1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/pci.h>
4 #include <device/pci_ids.h>
6 #include <soc/pci_devs.h>
8 #include <soc/ramstage.h>
10 static void pmc_read_resources(struct device
*dev
)
12 unsigned int index
= 0;
15 /* Get the normal PCI resources of this device. */
16 pci_dev_read_resources(dev
);
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
;
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
;
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
= {
46 .vendor
= PCI_VENDOR_ID_INTEL
,
47 .device
= QUARK_V_LPC_DEVICE_ID_0
,