cpu/x86/smm/pci_resource_store: Store DEV/VEN ID
[coreboot2.git] / src / superio / smsc / mec1308 / superio.c
blob39e100ece9e781fd2ccb1b49ee11a5b9fd0b6735
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* RAM driver for the SMSC MEC1308 Super I/O chip */
5 #include <device/device.h>
6 #include <device/pnp.h>
7 #include <superio/conf_mode.h>
8 #include <pc80/keyboard.h>
10 #include "mec1308.h"
12 static void mec1308_init(struct device *dev)
15 if (!dev->enabled)
16 return;
18 switch (dev->path.pnp.device) {
19 case MEC1308_KBC:
20 pc_keyboard_init(NO_AUX_DEVICE);
21 break;
25 static struct device_operations ops = {
26 .read_resources = pnp_read_resources,
27 .set_resources = pnp_set_resources,
28 .enable_resources = pnp_enable_resources,
29 .enable = pnp_alt_enable,
30 .init = mec1308_init,
31 .ops_pnp_mode = &pnp_conf_mode_55_aa,
34 static struct pnp_info pnp_dev_info[] = {
35 { NULL, MEC1308_PM1, PNP_IO0, 0x7ff },
36 { NULL, MEC1308_EC1, PNP_IO0, 0x7ff },
37 { NULL, MEC1308_EC2, PNP_IO0, 0x7ff },
38 { NULL, MEC1308_UART, PNP_IO0 | PNP_IRQ0, 0x0ff8, },
39 { NULL, MEC1308_KBC, PNP_IRQ0, 0 /* IO Fixed at 0x60/0x64 */ },
40 { NULL, MEC1308_EC0, PNP_IO0, 0x7ff },
41 { NULL, MEC1308_MBX, PNP_IO0, 0x7ff },
44 static void enable_dev(struct device *dev)
46 pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
49 struct chip_operations superio_smsc_mec1308_ops = {
50 .name = "SMSC MEC1308 EC SuperIO Interface",
51 .enable_dev = enable_dev