1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef _SOC_SKYLAKE_PCI_DEVS_H_ 4 #define _SOC_SKYLAKE_PCI_DEVS_H_ 5 6 #include <device/pci_def.h> 7 8 #define _PCH_DEVFN(slot, func) PCI_DEVFN(PCH_DEV_SLOT_ ## slot, func) 9 10 #if !defined(__SIMPLE_DEVICE__) 11 #include <device/device.h> 12 #define _PCH_DEV(slot, func) pcidev_path_on_root_debug(_PCH_DEVFN(slot, func), __func__) 13 #else 14 #define _PCH_DEV(slot, func) PCI_DEV(0, PCH_DEV_SLOT_ ## slot, func) 15 #endif 16 17 /* System Agent Devices */ 18 19 #define SA_DEV_SLOT_ROOT 0x00 20 #define SA_DEVFN_ROOT PCI_DEVFN(SA_DEV_SLOT_ROOT, 0) 21 #if defined(__SIMPLE_DEVICE__) 22 #define SA_DEV_ROOT PCI_DEV(0, SA_DEV_SLOT_ROOT, 0) 23 #endif 24 25 #define SA_DEV_SLOT_PEG 0x01 26 #define SA_DEVFN_PEG0 PCI_DEVFN(SA_DEV_SLOT_PEG, 0) 27 #define SA_DEVFN_PEG1 PCI_DEVFN(SA_DEV_SLOT_PEG, 1) 28 #define SA_DEVFN_PEG2 PCI_DEVFN(SA_DEV_SLOT_PEG, 2) 29 #define SA_DEV_PEG0 PCI_DEV(0, SA_DEV_SLOT_PEG, 0) 30 #define SA_DEV_PEG1 PCI_DEV(0, SA_DEV_SLOT_PEG, 1) 31 #define SA_DEV_PEG2 PCI_DEV(0, SA_DEV_SLOT_PEG, 2) 32 33 #define SA_DEV_SLOT_IGD 0x02 34 #define SA_DEVFN_IGD PCI_DEVFN(SA_DEV_SLOT_IGD, 0) 35 #define SA_DEV_IGD PCI_DEV(0, SA_DEV_SLOT_IGD, 0) 36 37 #define SA_DEV_SLOT_TS 0x04 38 #define SA_DEVFN_TS PCI_DEVFN(SA_DEV_SLOT_TS, 0) 39 #define SA_DEV_TS PCI_DEV(0, SA_DEV_SLOT_TS, 0) 40 41 #define SA_DEV_SLOT_IMGU 0x05 42 #define SA_DEVFN_IMGU PCI_DEVFN(SA_DEV_SLOT_IMGU, 0) 43 #define SA_DEV_IMGU PCI_DEV(0, SA_DEV_SLOT_IMGU, 0) 44 45 #define SA_DEV_SLOT_CHAP 0x07 46 #define SA_DEVFN_CHAP PCI_DEVFN(SA_DEV_SLOT_CHAP, 0) 47 #define SA_DEV_CHAP PCI_DEV(0, SA_DEV_SLOT_CHAP, 0) 48 49 #define SA_DEV_SLOT_GMM 0x08 50 #define SA_DEVFN_GMM PCI_DEVFN(SA_DEV_SLOT_GMM, 0) 51 #define SA_DEV_GMM PCI_DEV(0, SA_DEV_SLOT_GMM, 0) 52 /* PCH Devices */ 53 54 #define PCH_DEV_SLOT_ISH 0x13 55 #define PCH_DEVFN_ISH _PCH_DEVFN(ISH, 0) 56 #define PCH_DEV_ISH _PCH_DEV(ISH, 0) 57 58 #define PCH_DEV_SLOT_XHCI 0x14 59 #define PCH_DEVFN_XHCI _PCH_DEVFN(XHCI, 0) 60 #define PCH_DEVFN_USBOTG _PCH_DEVFN(XHCI, 1) 61 #define PCH_DEVFN_THERMAL _PCH_DEVFN(XHCI, 2) 62 #define PCH_DEVFN_CIO _PCH_DEVFN(XHCI, 3) 63 #define PCH_DEV_XHCI _PCH_DEV(XHCI, 0) 64 #define PCH_DEV_USBOTG _PCH_DEV(XHCI, 1) 65 #define PCH_DEV_THERMAL _PCH_DEV(XHCI, 2) 66 #define PCH_DEV_CIO _PCH_DEV(XHCI, 3) 67 68 #define PCH_DEV_SLOT_SIO1 0x15 69 #define PCH_DEVFN_I2C0 _PCH_DEVFN(SIO1, 0) 70 #define PCH_DEVFN_I2C1 _PCH_DEVFN(SIO1, 1) 71 #define PCH_DEVFN_I2C2 _PCH_DEVFN(SIO1, 2) 72 #define PCH_DEVFN_I2C3 _PCH_DEVFN(SIO1, 3) 73 #define PCH_DEV_I2C0 _PCH_DEV(SIO1, 0) 74 #define PCH_DEV_I2C1 _PCH_DEV(SIO1, 1) 75 #define PCH_DEV_I2C2 _PCH_DEV(SIO1, 2) 76 #define PCH_DEV_I2C3 _PCH_DEV(SIO1, 3) 77 78 #define PCH_DEV_SLOT_CSE 0x16 79 #define PCH_DEVFN_CSE _PCH_DEVFN(CSE, 0) 80 #define PCH_DEVFN_CSE_2 _PCH_DEVFN(CSE, 1) 81 #define PCH_DEVFN_CSE_IDER _PCH_DEVFN(CSE, 2) 82 #define PCH_DEVFN_CSE_KT _PCH_DEVFN(CSE, 3) 83 #define PCH_DEVFN_CSE_3 _PCH_DEVFN(CSE, 4) 84 #define PCH_DEV_CSE _PCH_DEV(CSE, 0) 85 #define PCH_DEV_CSE_2 _PCH_DEV(CSE, 1) 86 #define PCH_DEV_CSE_IDER _PCH_DEV(CSE, 2) 87 #define PCH_DEV_CSE_KT _PCH_DEV(CSE, 3) 88 #define PCH_DEV_CSE_3 _PCH_DEV(CSE, 4) 89 90 #define PCH_DEV_SLOT_SATA 0x17 91 #define PCH_DEVFN_SATA _PCH_DEVFN(SATA, 0) 92 #define PCH_DEV_SATA _PCH_DEV(SATA, 0) 93 94 #define PCH_DEV_SLOT_SIO2 0x19 95 #define PCH_DEVFN_UART2 _PCH_DEVFN(SIO2, 0) 96 #define PCH_DEVFN_I2C5 _PCH_DEVFN(SIO2, 1) 97 #define PCH_DEVFN_I2C4 _PCH_DEVFN(SIO2, 2) 98 #define PCH_DEV_UART2 _PCH_DEV(SIO2, 0) 99 #define PCH_DEV_I2C5 _PCH_DEV(SIO2, 1) 100 #define PCH_DEV_I2C4 _PCH_DEV(SIO2, 2) 101 102 #define PCH_DEV_SLOT_PCIE_2 0x1b 103 #define PCH_DEVFN_PCIE17 _PCH_DEVFN(PCIE_2, 0) 104 #define PCH_DEVFN_PCIE18 _PCH_DEVFN(PCIE_2, 1) 105 #define PCH_DEVFN_PCIE19 _PCH_DEVFN(PCIE_2, 2) 106 #define PCH_DEVFN_PCIE20 _PCH_DEVFN(PCIE_2, 3) 107 #define PCH_DEVFN_PCIE21 _PCH_DEVFN(PCIE_2, 4) 108 #define PCH_DEVFN_PCIE22 _PCH_DEVFN(PCIE_2, 5) 109 #define PCH_DEVFN_PCIE23 _PCH_DEVFN(PCIE_2, 6) 110 #define PCH_DEVFN_PCIE24 _PCH_DEVFN(PCIE_2, 7) 111 #define PCH_DEV_PCIE17 _PCH_DEV(PCIE_2, 0) 112 #define PCH_DEV_PCIE18 _PCH_DEV(PCIE_2, 1) 113 #define PCH_DEV_PCIE19 _PCH_DEV(PCIE_2, 2) 114 #define PCH_DEV_PCIE20 _PCH_DEV(PCIE_2, 3) 115 #define PCH_DEV_PCIE21 _PCH_DEV(PCIE_2, 4) 116 #define PCH_DEV_PCIE22 _PCH_DEV(PCIE_2, 5) 117 #define PCH_DEV_PCIE23 _PCH_DEV(PCIE_2, 6) 118 #define PCH_DEV_PCIE24 _PCH_DEV(PCIE_2, 7) 119 120 #define PCH_DEV_SLOT_PCIE 0x1c 121 #define PCH_DEVFN_PCIE1 _PCH_DEVFN(PCIE, 0) 122 #define PCH_DEVFN_PCIE2 _PCH_DEVFN(PCIE, 1) 123 #define PCH_DEVFN_PCIE3 _PCH_DEVFN(PCIE, 2) 124 #define PCH_DEVFN_PCIE4 _PCH_DEVFN(PCIE, 3) 125 #define PCH_DEVFN_PCIE5 _PCH_DEVFN(PCIE, 4) 126 #define PCH_DEVFN_PCIE6 _PCH_DEVFN(PCIE, 5) 127 #define PCH_DEVFN_PCIE7 _PCH_DEVFN(PCIE, 6) 128 #define PCH_DEVFN_PCIE8 _PCH_DEVFN(PCIE, 7) 129 #define PCH_DEV_PCIE1 _PCH_DEV(PCIE, 0) 130 #define PCH_DEV_PCIE2 _PCH_DEV(PCIE, 1) 131 #define PCH_DEV_PCIE3 _PCH_DEV(PCIE, 2) 132 #define PCH_DEV_PCIE4 _PCH_DEV(PCIE, 3) 133 #define PCH_DEV_PCIE5 _PCH_DEV(PCIE, 4) 134 #define PCH_DEV_PCIE6 _PCH_DEV(PCIE, 5) 135 #define PCH_DEV_PCIE7 _PCH_DEV(PCIE, 6) 136 #define PCH_DEV_PCIE8 _PCH_DEV(PCIE, 7) 137 138 #define PCH_DEV_SLOT_PCIE_1 0x1d 139 #define PCH_DEVFN_PCIE9 _PCH_DEVFN(PCIE_1, 0) 140 #define PCH_DEVFN_PCIE10 _PCH_DEVFN(PCIE_1, 1) 141 #define PCH_DEVFN_PCIE11 _PCH_DEVFN(PCIE_1, 2) 142 #define PCH_DEVFN_PCIE12 _PCH_DEVFN(PCIE_1, 3) 143 #define PCH_DEVFN_PCIE13 _PCH_DEVFN(PCIE_1, 4) 144 #define PCH_DEVFN_PCIE14 _PCH_DEVFN(PCIE_1, 5) 145 #define PCH_DEVFN_PCIE15 _PCH_DEVFN(PCIE_1, 6) 146 #define PCH_DEVFN_PCIE16 _PCH_DEVFN(PCIE_1, 7) 147 #define PCH_DEV_PCIE9 _PCH_DEV(PCIE_1, 0) 148 #define PCH_DEV_PCIE10 _PCH_DEV(PCIE_1, 1) 149 #define PCH_DEV_PCIE11 _PCH_DEV(PCIE_1, 2) 150 #define PCH_DEV_PCIE12 _PCH_DEV(PCIE_1, 3) 151 #define PCH_DEV_PCIE13 _PCH_DEV(PCIE_1, 4) 152 #define PCH_DEV_PCIE14 _PCH_DEV(PCIE_1, 5) 153 #define PCH_DEV_PCIE15 _PCH_DEV(PCIE_1, 6) 154 #define PCH_DEV_PCIE16 _PCH_DEV(PCIE_1, 7) 155 156 #define PCH_DEV_SLOT_STORAGE 0x1e 157 #define PCH_DEVFN_UART0 _PCH_DEVFN(STORAGE, 0) 158 #define PCH_DEVFN_UART1 _PCH_DEVFN(STORAGE, 1) 159 #define PCH_DEVFN_GSPI0 _PCH_DEVFN(STORAGE, 2) 160 #define PCH_DEVFN_GSPI1 _PCH_DEVFN(STORAGE, 3) 161 #define PCH_DEVFN_EMMC _PCH_DEVFN(STORAGE, 4) 162 #define PCH_DEVFN_SDIO _PCH_DEVFN(STORAGE, 5) 163 #define PCH_DEVFN_SDCARD _PCH_DEVFN(STORAGE, 6) 164 #define PCH_DEV_UART0 _PCH_DEV(STORAGE, 0) 165 #define PCH_DEV_UART1 _PCH_DEV(STORAGE, 1) 166 #define PCH_DEV_GSPI0 _PCH_DEV(STORAGE, 2) 167 #define PCH_DEV_GSPI1 _PCH_DEV(STORAGE, 3) 168 #define PCH_DEV_EMMC _PCH_DEV(STORAGE, 4) 169 #define PCH_DEV_SDIO _PCH_DEV(STORAGE, 5) 170 #define PCH_DEV_SDCARD _PCH_DEV(STORAGE, 6) 171 172 #define PCH_DEV_SLOT_LPC 0x1f 173 #define PCH_DEVFN_LPC _PCH_DEVFN(LPC, 0) 174 #define PCH_DEVFN_P2SB _PCH_DEVFN(LPC, 1) 175 #define PCH_DEVFN_PMC _PCH_DEVFN(LPC, 2) 176 #define PCH_DEVFN_HDA _PCH_DEVFN(LPC, 3) 177 #define PCH_DEVFN_SMBUS _PCH_DEVFN(LPC, 4) 178 #define PCH_DEVFN_SPI _PCH_DEVFN(LPC, 5) 179 #define PCH_DEVFN_GBE _PCH_DEVFN(LPC, 6) 180 #define PCH_DEVFN_TRACEHUB _PCH_DEVFN(LPC, 7) 181 #define PCH_DEV_LPC _PCH_DEV(LPC, 0) 182 #define PCH_DEV_P2SB _PCH_DEV(LPC, 1) 183 #define PCH_DEV_PMC _PCH_DEV(LPC, 2) 184 #define PCH_DEV_HDA _PCH_DEV(LPC, 3) 185 #define PCH_DEV_SMBUS _PCH_DEV(LPC, 4) 186 #define PCH_DEV_SPI _PCH_DEV(LPC, 5) 187 #define PCH_DEV_GBE _PCH_DEV(LPC, 6) 188 #define PCH_DEV_TRACEHUB _PCH_DEV(LPC, 7) 189 190 #endif 191