| 1 |
|
| 2 |
|
| 3 |
#define __SIMPLE_DEVICE__ |
| 4 |
|
| 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> |
| 12 |
|
| 13 |
uint32_t p2sb2_sbi_read(uint8_t pid, uint16_t reg) |
| 14 |
{ |
| 15 |
return p2sb_dev_sbi_read(PCI_DEV_P2SB2, pid, reg); |
| 16 |
} |
| 17 |
|
| 18 |
void p2sb2_sbi_write(uint8_t pid, uint16_t reg, uint32_t val) |
| 19 |
{ |
| 20 |
p2sb_dev_sbi_write(PCI_DEV_P2SB2, pid, reg, val); |
| 21 |
} |
| 22 |
|
| 23 |
void p2sb2_enable_bar(void) |
| 24 |
{ |
| 25 |
p2sb_dev_enable_bar(PCI_DEV_P2SB2, P2SB2_BAR); |
| 26 |
} |
| 27 |
|
| 28 |
static void read_resources(struct device *dev) |
| 29 |
{ |
| 30 |
mmio_range(dev, PCI_BASE_ADDRESS_0, P2SB2_BAR, P2SB2_SIZE); |
| 31 |
} |
| 32 |
|
| 33 |
struct device_operations p2sb2_ops = { |
| 34 |
.read_resources = read_resources, |
| 35 |
.set_resources = noop_set_resources, |
| 36 |
.ops_pci = &pci_dev_ops_pci, |
| 37 |
}; |
| 38 |
|
| 39 |
static const unsigned short pci_device_ids[] = { |
| 40 |
PCI_DID_INTEL_WCL_P2SB2, |
| 41 |
PCI_DID_INTEL_PTL_H_P2SB2, |
| 42 |
PCI_DID_INTEL_PTL_U_H_P2SB2, |
| 43 |
0, |
| 44 |
}; |
| 45 |
|
| 46 |
static const struct pci_driver p2sb2 __pci_driver = { |
| 47 |
.ops = &p2sb2_ops, |
| 48 |
.vendor = PCI_VID_INTEL, |
| 49 |
.devices = pci_device_ids, |
| 50 |
}; |