1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #define __SIMPLE_DEVICE__
5 #include <device/pci.h>
6 #include <device/pci_ids.h>
7 #include <intelblocks/p2sb.h>
8 #include <intelblocks/p2sblib.h>
9 #include <intelblocks/pcr.h>
10 #include <soc/iomap.h>
11 #include <soc/pci_devs.h>
13 uint32_t ioe_p2sb_sbi_read(uint8_t pid
, uint16_t reg
)
15 return p2sb_dev_sbi_read(PCI_DEV_IOE_P2SB
, pid
, reg
);
18 void ioe_p2sb_sbi_write(uint8_t pid
, uint16_t reg
, uint32_t val
)
20 p2sb_dev_sbi_write(PCI_DEV_IOE_P2SB
, pid
, reg
, val
);
23 void ioe_p2sb_enable_bar(void)
25 p2sb_dev_enable_bar(PCI_DEV_IOE_P2SB
, IOE_P2SB_BAR
);
28 static void read_resources(struct device
*dev
)
30 mmio_range(dev
, 0, IOE_P2SB_BAR
, IOE_P2SB_SIZE
);
33 struct device_operations device_ops
= {
34 .read_resources
= read_resources
,
35 .set_resources
= noop_set_resources
,
36 .ops_pci
= &pci_dev_ops_pci
,
39 static const unsigned short pci_device_ids
[] = {
40 PCI_DID_INTEL_PTL_H_P2SB2
,
41 PCI_DID_INTEL_PTL_U_H_P2SB2
,
42 PCI_DID_INTEL_MTL_IOE_M_P2SB
,
43 PCI_DID_INTEL_MTL_IOE_P_P2SB
,
47 static const struct pci_driver ioe_p2sb __pci_driver
= {
49 .vendor
= PCI_VID_INTEL
,
50 .devices
= pci_device_ids
,