payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / superio / fintek / f71808a / superio.c
blob17fa379df43b3bd872f5b87e547c66ba4e04ac15
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <device/device.h>
4 #include <device/pnp.h>
5 #include <superio/conf_mode.h>
6 #include <pc80/keyboard.h>
8 #include "f71808a.h"
9 #include "fintek_internal.h"
11 static void f71808a_init(struct device *dev)
13 if (!dev->enabled)
14 return;
16 switch (dev->path.pnp.device) {
17 /* TODO: Might potentially need code for UART, GPIO... */
18 case F71808A_KBC:
19 pc_keyboard_init(NO_AUX_DEVICE);
20 break;
21 case F71808A_HWM:
22 f71808a_multifunc_init(dev);
23 f71808a_hwm_init(dev);
24 break;
28 static struct device_operations ops = {
29 .read_resources = pnp_read_resources,
30 .set_resources = pnp_set_resources,
31 .enable_resources = pnp_enable_resources,
32 .enable = pnp_alt_enable,
33 .init = f71808a_init,
34 .ops_pnp_mode = &pnp_conf_mode_8787_aa,
37 static struct pnp_info pnp_dev_info[] = {
38 /* TODO: Some of the 0x07f8 etc. values may not be correct. */
39 { NULL, F71808A_SP1, PNP_IO0 | PNP_IRQ0, 0x07f8, },
40 { NULL, F71808A_HWM, PNP_IO0 | PNP_IRQ0, 0x07f8, },
41 { NULL, F71808A_KBC, PNP_IO0 | PNP_IRQ0 | PNP_IRQ1, 0x07ff, },
42 { NULL, F71808A_GPIO, PNP_IRQ0, },
43 { NULL, F71808A_WDT, PNP_IO0, 0x07f8,},
44 { NULL, F71808A_CIR, PNP_IO0 | PNP_IRQ0, 0x07f8, },
45 { NULL, F71808A_PME, },
48 static void enable_dev(struct device *dev)
50 pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
53 struct chip_operations superio_fintek_f71808a_ops = {
54 CHIP_NAME("Fintek F71808A Super I/O")
55 .enable_dev = enable_dev