2 * This file is part of the coreboot project.
4 * Copyright (C) 2010 Alec Ari <neotheuser@ymail.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
18 #include <device/device.h>
19 #include <device/pnp.h>
20 #include <superio/conf_mode.h>
21 #include <console/console.h>
23 #include <pc80/keyboard.h>
26 static void f71889_init(struct device
*dev
)
32 switch (dev
->path
.pnp
.device
) {
33 /* TODO: Might potentially need code for HWM or FDC etc. */
40 static struct device_operations ops
= {
41 .read_resources
= pnp_read_resources
,
42 .set_resources
= pnp_set_resources
,
43 .enable_resources
= pnp_enable_resources
,
44 .enable
= pnp_alt_enable
,
46 .ops_pnp_mode
= &pnp_conf_mode_8787_aa
,
49 static struct pnp_info pnp_dev_info
[] = {
50 /* TODO: Some of the 0x07f8 etc. values may not be correct. */
51 { &ops
, F71889_FDC
, PNP_IO0
| PNP_IRQ0
| PNP_DRQ0
, {0x07f8, 0}, },
52 { &ops
, F71889_SP1
, PNP_IO0
| PNP_IRQ0
, {0x07f8, 0}, },
53 { &ops
, F71889_SP2
, PNP_IO0
| PNP_IRQ0
, {0x07f8, 0}, },
54 { &ops
, F71889_PP
, PNP_IO0
| PNP_IRQ0
| PNP_DRQ0
, {0x07f8, 0}, },
55 { &ops
, F71889_HWM
, PNP_IO0
| PNP_IRQ0
, {0x0ff8, 0}, },
56 { &ops
, F71889_KBC
, PNP_IO0
| PNP_IRQ0
| PNP_IRQ1
, {0x07ff, 0}, },
57 { &ops
, F71889_GPIO
, },
58 { &ops
, F71889_VID
, PNP_IO0
| PNP_IRQ0
, {0x07f8, 0}, },
59 { &ops
, F71889_SPI
, },
60 { &ops
, F71889_PME
, },
61 { &ops
, F71889_VREF
, },
64 static void enable_dev(struct device
*dev
)
66 pnp_enable_devices(dev
, &ops
, ARRAY_SIZE(pnp_dev_info
), pnp_dev_info
);
69 struct chip_operations superio_fintek_f71889_ops
= {
70 CHIP_NAME("Fintek F71889 Super I/O")
71 .enable_dev
= enable_dev