soc/intel/common/block/chip: Refactor chip_get_common_soc_structure()
[coreboot.git] / src / soc / intel / quark / lpc.c
blobad974565791d06d2ce169076db289be64c3e08c9
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/pci.h>
4 #include <device/pci_ids.h>
5 #include <soc/iomap.h>
6 #include <soc/pci_devs.h>
7 #include <soc/pm.h>
8 #include <soc/ramstage.h>
10 static void pmc_read_resources(struct device *dev)
12 unsigned int index = 0;
13 struct resource *res;
15 /* Get the normal PCI resources of this device. */
16 pci_dev_read_resources(dev);
18 /* GPE0 */
19 res = new_resource(dev, index++);
20 res->base = GPE0_BASE_ADDRESS;
21 res->size = GPE0_SIZE;
22 res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
24 /* PM1BLK */
25 res = new_resource(dev, index++);
26 res->base = PM1BLK_BASE_ADDRESS;
27 res->size = PM1BLK_SIZE;
28 res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
30 /* Legacy GPIO */
31 res = new_resource(dev, index++);
32 res->base = LEGACY_GPIO_BASE_ADDRESS;
33 res->size = LEGACY_GPIO_SIZE;
34 res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
37 static struct device_operations device_ops = {
38 .read_resources = pmc_read_resources,
39 .set_resources = pci_dev_set_resources,
40 .enable_resources = pci_dev_enable_resources,
41 .scan_bus = scan_static_bus,
44 static const struct pci_driver pmc __pci_driver = {
45 .ops = &device_ops,
46 .vendor = PCI_VENDOR_ID_INTEL,
47 .device = QUARK_V_LPC_DEVICE_ID_0,