David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 1 | /* |
| 2 | * This program is free software; you can redistribute it and/or modify |
| 3 | * it under the terms of the GNU General Public License version 2 as |
| 4 | * published by the Free Software Foundation. |
| 5 | * |
| 6 | * This program is distributed in the hope that it will be useful, |
| 7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 9 | * GNU General Public License for more details. |
| 10 | * |
| 11 | * You should have received a copy of the GNU General Public License |
| 12 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 13 | * |
| 14 | * Copyright (C) 2015 - 2016 Cavium, Inc. |
| 15 | */ |
| 16 | |
| 17 | #include <linux/kernel.h> |
Paul Gortmaker | 0b3cd16 | 2016-07-22 16:24:49 -0500 | [diff] [blame] | 18 | #include <linux/init.h> |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 19 | #include <linux/of_address.h> |
| 20 | #include <linux/of_pci.h> |
Tomasz Nowicki | 44f22bd | 2016-12-01 00:07:56 -0600 | [diff] [blame] | 21 | #include <linux/pci-acpi.h> |
Jayachandran C | 80955f9 | 2016-06-10 21:55:09 +0200 | [diff] [blame] | 22 | #include <linux/pci-ecam.h> |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 23 | #include <linux/platform_device.h> |
Tomasz Nowicki | 44f22bd | 2016-12-01 00:07:56 -0600 | [diff] [blame] | 24 | #include "../pci.h" |
| 25 | |
| 26 | #if defined(CONFIG_PCI_HOST_THUNDER_PEM) || (defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)) |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 27 | |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 28 | #define PEM_CFG_WR 0x28 |
| 29 | #define PEM_CFG_RD 0x30 |
| 30 | |
| 31 | struct thunder_pem_pci { |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 32 | u32 ea_entry[3]; |
| 33 | void __iomem *pem_reg_base; |
| 34 | }; |
| 35 | |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 36 | static int thunder_pem_bridge_read(struct pci_bus *bus, unsigned int devfn, |
| 37 | int where, int size, u32 *val) |
| 38 | { |
David Daney | c5c4d3a | 2017-01-11 11:22:11 -0800 | [diff] [blame] | 39 | u64 read_val, tmp_val; |
Jayachandran C | 1958e71 | 2016-05-11 17:34:46 -0500 | [diff] [blame] | 40 | struct pci_config_window *cfg = bus->sysdata; |
| 41 | struct thunder_pem_pci *pem_pci = (struct thunder_pem_pci *)cfg->priv; |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 42 | |
| 43 | if (devfn != 0 || where >= 2048) { |
| 44 | *val = ~0; |
| 45 | return PCIBIOS_DEVICE_NOT_FOUND; |
| 46 | } |
| 47 | |
| 48 | /* |
| 49 | * 32-bit accesses only. Write the address to the low order |
| 50 | * bits of PEM_CFG_RD, then trigger the read by reading back. |
| 51 | * The config data lands in the upper 32-bits of PEM_CFG_RD. |
| 52 | */ |
| 53 | read_val = where & ~3ull; |
| 54 | writeq(read_val, pem_pci->pem_reg_base + PEM_CFG_RD); |
| 55 | read_val = readq(pem_pci->pem_reg_base + PEM_CFG_RD); |
| 56 | read_val >>= 32; |
| 57 | |
| 58 | /* |
| 59 | * The config space contains some garbage, fix it up. Also |
| 60 | * synthesize an EA capability for the BAR used by MSI-X. |
| 61 | */ |
| 62 | switch (where & ~3) { |
| 63 | case 0x40: |
| 64 | read_val &= 0xffff00ff; |
| 65 | read_val |= 0x00007000; /* Skip MSI CAP */ |
| 66 | break; |
| 67 | case 0x70: /* Express Cap */ |
David Daney | c5c4d3a | 2017-01-11 11:22:11 -0800 | [diff] [blame] | 68 | /* |
| 69 | * Change PME interrupt to vector 2 on T88 where it |
| 70 | * reads as 0, else leave it alone. |
| 71 | */ |
| 72 | if (!(read_val & (0x1f << 25))) |
| 73 | read_val |= (2u << 25); |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 74 | break; |
| 75 | case 0xb0: /* MSI-X Cap */ |
David Daney | c5c4d3a | 2017-01-11 11:22:11 -0800 | [diff] [blame] | 76 | /* TableSize=2 or 4, Next Cap is EA */ |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 77 | read_val &= 0xc00000ff; |
David Daney | c5c4d3a | 2017-01-11 11:22:11 -0800 | [diff] [blame] | 78 | /* |
| 79 | * If Express Cap(0x70) raw PME vector reads as 0 we are on |
| 80 | * T88 and TableSize is reported as 4, else TableSize |
| 81 | * is 2. |
| 82 | */ |
| 83 | writeq(0x70, pem_pci->pem_reg_base + PEM_CFG_RD); |
| 84 | tmp_val = readq(pem_pci->pem_reg_base + PEM_CFG_RD); |
| 85 | tmp_val >>= 32; |
| 86 | if (!(tmp_val & (0x1f << 25))) |
| 87 | read_val |= 0x0003bc00; |
| 88 | else |
| 89 | read_val |= 0x0001bc00; |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 90 | break; |
| 91 | case 0xb4: |
| 92 | /* Table offset=0, BIR=0 */ |
| 93 | read_val = 0x00000000; |
| 94 | break; |
| 95 | case 0xb8: |
| 96 | /* BPA offset=0xf0000, BIR=0 */ |
| 97 | read_val = 0x000f0000; |
| 98 | break; |
| 99 | case 0xbc: |
| 100 | /* EA, 1 entry, no next Cap */ |
| 101 | read_val = 0x00010014; |
| 102 | break; |
| 103 | case 0xc0: |
| 104 | /* DW2 for type-1 */ |
| 105 | read_val = 0x00000000; |
| 106 | break; |
| 107 | case 0xc4: |
| 108 | /* Entry BEI=0, PP=0x00, SP=0xff, ES=3 */ |
| 109 | read_val = 0x80ff0003; |
| 110 | break; |
| 111 | case 0xc8: |
| 112 | read_val = pem_pci->ea_entry[0]; |
| 113 | break; |
| 114 | case 0xcc: |
| 115 | read_val = pem_pci->ea_entry[1]; |
| 116 | break; |
| 117 | case 0xd0: |
| 118 | read_val = pem_pci->ea_entry[2]; |
| 119 | break; |
| 120 | default: |
| 121 | break; |
| 122 | } |
| 123 | read_val >>= (8 * (where & 3)); |
| 124 | switch (size) { |
| 125 | case 1: |
| 126 | read_val &= 0xff; |
| 127 | break; |
| 128 | case 2: |
| 129 | read_val &= 0xffff; |
| 130 | break; |
| 131 | default: |
| 132 | break; |
| 133 | } |
| 134 | *val = read_val; |
| 135 | return PCIBIOS_SUCCESSFUL; |
| 136 | } |
| 137 | |
| 138 | static int thunder_pem_config_read(struct pci_bus *bus, unsigned int devfn, |
| 139 | int where, int size, u32 *val) |
| 140 | { |
Jayachandran C | 1958e71 | 2016-05-11 17:34:46 -0500 | [diff] [blame] | 141 | struct pci_config_window *cfg = bus->sysdata; |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 142 | |
Jayachandran C | 1958e71 | 2016-05-11 17:34:46 -0500 | [diff] [blame] | 143 | if (bus->number < cfg->busr.start || |
| 144 | bus->number > cfg->busr.end) |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 145 | return PCIBIOS_DEVICE_NOT_FOUND; |
| 146 | |
| 147 | /* |
| 148 | * The first device on the bus is the PEM PCIe bridge. |
| 149 | * Special case its config access. |
| 150 | */ |
Jayachandran C | 1958e71 | 2016-05-11 17:34:46 -0500 | [diff] [blame] | 151 | if (bus->number == cfg->busr.start) |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 152 | return thunder_pem_bridge_read(bus, devfn, where, size, val); |
| 153 | |
| 154 | return pci_generic_config_read(bus, devfn, where, size, val); |
| 155 | } |
| 156 | |
| 157 | /* |
| 158 | * Some of the w1c_bits below also include read-only or non-writable |
| 159 | * reserved bits, this makes the code simpler and is OK as the bits |
| 160 | * are not affected by writing zeros to them. |
| 161 | */ |
David Daney | 93bf907 | 2016-04-11 16:29:32 -0700 | [diff] [blame] | 162 | static u32 thunder_pem_bridge_w1c_bits(u64 where_aligned) |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 163 | { |
| 164 | u32 w1c_bits = 0; |
| 165 | |
David Daney | 93bf907 | 2016-04-11 16:29:32 -0700 | [diff] [blame] | 166 | switch (where_aligned) { |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 167 | case 0x04: /* Command/Status */ |
| 168 | case 0x1c: /* Base and I/O Limit/Secondary Status */ |
| 169 | w1c_bits = 0xff000000; |
| 170 | break; |
| 171 | case 0x44: /* Power Management Control and Status */ |
| 172 | w1c_bits = 0xfffffe00; |
| 173 | break; |
| 174 | case 0x78: /* Device Control/Device Status */ |
| 175 | case 0x80: /* Link Control/Link Status */ |
| 176 | case 0x88: /* Slot Control/Slot Status */ |
| 177 | case 0x90: /* Root Status */ |
| 178 | case 0xa0: /* Link Control 2 Registers/Link Status 2 */ |
| 179 | w1c_bits = 0xffff0000; |
| 180 | break; |
| 181 | case 0x104: /* Uncorrectable Error Status */ |
| 182 | case 0x110: /* Correctable Error Status */ |
| 183 | case 0x130: /* Error Status */ |
| 184 | case 0x160: /* Link Control 4 */ |
| 185 | w1c_bits = 0xffffffff; |
| 186 | break; |
| 187 | default: |
| 188 | break; |
| 189 | } |
| 190 | return w1c_bits; |
| 191 | } |
| 192 | |
David Daney | 93bf907 | 2016-04-11 16:29:32 -0700 | [diff] [blame] | 193 | /* Some bits must be written to one so they appear to be read-only. */ |
| 194 | static u32 thunder_pem_bridge_w1_bits(u64 where_aligned) |
| 195 | { |
| 196 | u32 w1_bits; |
| 197 | |
| 198 | switch (where_aligned) { |
| 199 | case 0x1c: /* I/O Base / I/O Limit, Secondary Status */ |
| 200 | /* Force 32-bit I/O addressing. */ |
| 201 | w1_bits = 0x0101; |
| 202 | break; |
| 203 | case 0x24: /* Prefetchable Memory Base / Prefetchable Memory Limit */ |
| 204 | /* Force 64-bit addressing */ |
| 205 | w1_bits = 0x00010001; |
| 206 | break; |
| 207 | default: |
| 208 | w1_bits = 0; |
| 209 | break; |
| 210 | } |
| 211 | return w1_bits; |
| 212 | } |
| 213 | |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 214 | static int thunder_pem_bridge_write(struct pci_bus *bus, unsigned int devfn, |
| 215 | int where, int size, u32 val) |
| 216 | { |
Jayachandran C | 1958e71 | 2016-05-11 17:34:46 -0500 | [diff] [blame] | 217 | struct pci_config_window *cfg = bus->sysdata; |
| 218 | struct thunder_pem_pci *pem_pci = (struct thunder_pem_pci *)cfg->priv; |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 219 | u64 write_val, read_val; |
David Daney | 93bf907 | 2016-04-11 16:29:32 -0700 | [diff] [blame] | 220 | u64 where_aligned = where & ~3ull; |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 221 | u32 mask = 0; |
| 222 | |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 223 | |
| 224 | if (devfn != 0 || where >= 2048) |
| 225 | return PCIBIOS_DEVICE_NOT_FOUND; |
| 226 | |
| 227 | /* |
| 228 | * 32-bit accesses only. If the write is for a size smaller |
| 229 | * than 32-bits, we must first read the 32-bit value and merge |
| 230 | * in the desired bits and then write the whole 32-bits back |
| 231 | * out. |
| 232 | */ |
| 233 | switch (size) { |
| 234 | case 1: |
David Daney | 93bf907 | 2016-04-11 16:29:32 -0700 | [diff] [blame] | 235 | writeq(where_aligned, pem_pci->pem_reg_base + PEM_CFG_RD); |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 236 | read_val = readq(pem_pci->pem_reg_base + PEM_CFG_RD); |
| 237 | read_val >>= 32; |
| 238 | mask = ~(0xff << (8 * (where & 3))); |
| 239 | read_val &= mask; |
| 240 | val = (val & 0xff) << (8 * (where & 3)); |
| 241 | val |= (u32)read_val; |
| 242 | break; |
| 243 | case 2: |
David Daney | 93bf907 | 2016-04-11 16:29:32 -0700 | [diff] [blame] | 244 | writeq(where_aligned, pem_pci->pem_reg_base + PEM_CFG_RD); |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 245 | read_val = readq(pem_pci->pem_reg_base + PEM_CFG_RD); |
| 246 | read_val >>= 32; |
| 247 | mask = ~(0xffff << (8 * (where & 3))); |
| 248 | read_val &= mask; |
| 249 | val = (val & 0xffff) << (8 * (where & 3)); |
| 250 | val |= (u32)read_val; |
| 251 | break; |
| 252 | default: |
| 253 | break; |
| 254 | } |
| 255 | |
| 256 | /* |
| 257 | * By expanding the write width to 32 bits, we may |
| 258 | * inadvertently hit some W1C bits that were not intended to |
| 259 | * be written. Calculate the mask that must be applied to the |
| 260 | * data to be written to avoid these cases. |
| 261 | */ |
| 262 | if (mask) { |
| 263 | u32 w1c_bits = thunder_pem_bridge_w1c_bits(where); |
| 264 | |
| 265 | if (w1c_bits) { |
| 266 | mask &= w1c_bits; |
| 267 | val &= ~mask; |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | /* |
David Daney | 93bf907 | 2016-04-11 16:29:32 -0700 | [diff] [blame] | 272 | * Some bits must be read-only with value of one. Since the |
| 273 | * access method allows these to be cleared if a zero is |
| 274 | * written, force them to one before writing. |
| 275 | */ |
| 276 | val |= thunder_pem_bridge_w1_bits(where_aligned); |
| 277 | |
| 278 | /* |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 279 | * Low order bits are the config address, the high order 32 |
| 280 | * bits are the data to be written. |
| 281 | */ |
David Daney | 93bf907 | 2016-04-11 16:29:32 -0700 | [diff] [blame] | 282 | write_val = (((u64)val) << 32) | where_aligned; |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 283 | writeq(write_val, pem_pci->pem_reg_base + PEM_CFG_WR); |
| 284 | return PCIBIOS_SUCCESSFUL; |
| 285 | } |
| 286 | |
| 287 | static int thunder_pem_config_write(struct pci_bus *bus, unsigned int devfn, |
| 288 | int where, int size, u32 val) |
| 289 | { |
Jayachandran C | 1958e71 | 2016-05-11 17:34:46 -0500 | [diff] [blame] | 290 | struct pci_config_window *cfg = bus->sysdata; |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 291 | |
Jayachandran C | 1958e71 | 2016-05-11 17:34:46 -0500 | [diff] [blame] | 292 | if (bus->number < cfg->busr.start || |
| 293 | bus->number > cfg->busr.end) |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 294 | return PCIBIOS_DEVICE_NOT_FOUND; |
| 295 | /* |
| 296 | * The first device on the bus is the PEM PCIe bridge. |
| 297 | * Special case its config access. |
| 298 | */ |
Jayachandran C | 1958e71 | 2016-05-11 17:34:46 -0500 | [diff] [blame] | 299 | if (bus->number == cfg->busr.start) |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 300 | return thunder_pem_bridge_write(bus, devfn, where, size, val); |
| 301 | |
| 302 | |
| 303 | return pci_generic_config_write(bus, devfn, where, size, val); |
| 304 | } |
| 305 | |
Bjorn Helgaas | 0d41426 | 2016-11-30 23:57:56 -0600 | [diff] [blame] | 306 | static int thunder_pem_init(struct device *dev, struct pci_config_window *cfg, |
| 307 | struct resource *res_pem) |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 308 | { |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 309 | struct thunder_pem_pci *pem_pci; |
Bjorn Helgaas | 0d41426 | 2016-11-30 23:57:56 -0600 | [diff] [blame] | 310 | resource_size_t bar4_start; |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 311 | |
| 312 | pem_pci = devm_kzalloc(dev, sizeof(*pem_pci), GFP_KERNEL); |
| 313 | if (!pem_pci) |
| 314 | return -ENOMEM; |
| 315 | |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 316 | pem_pci->pem_reg_base = devm_ioremap(dev, res_pem->start, 0x10000); |
| 317 | if (!pem_pci->pem_reg_base) |
| 318 | return -ENOMEM; |
| 319 | |
| 320 | /* |
| 321 | * The MSI-X BAR for the PEM and AER interrupts is located at |
| 322 | * a fixed offset from the PEM register base. Generate a |
| 323 | * fragment of the synthesized Enhanced Allocation capability |
| 324 | * structure here for the BAR. |
| 325 | */ |
| 326 | bar4_start = res_pem->start + 0xf00000; |
| 327 | pem_pci->ea_entry[0] = (u32)bar4_start | 2; |
| 328 | pem_pci->ea_entry[1] = (u32)(res_pem->end - bar4_start) & ~3u; |
| 329 | pem_pci->ea_entry[2] = (u32)(bar4_start >> 32); |
| 330 | |
Jayachandran C | 1958e71 | 2016-05-11 17:34:46 -0500 | [diff] [blame] | 331 | cfg->priv = pem_pci; |
| 332 | return 0; |
| 333 | } |
| 334 | |
Tomasz Nowicki | 44f22bd | 2016-12-01 00:07:56 -0600 | [diff] [blame] | 335 | #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS) |
| 336 | |
| 337 | static int thunder_pem_acpi_init(struct pci_config_window *cfg) |
| 338 | { |
| 339 | struct device *dev = cfg->parent; |
| 340 | struct acpi_device *adev = to_acpi_device(dev); |
| 341 | struct acpi_pci_root *root = acpi_driver_data(adev); |
| 342 | struct resource *res_pem; |
| 343 | int ret; |
| 344 | |
| 345 | res_pem = devm_kzalloc(&adev->dev, sizeof(*res_pem), GFP_KERNEL); |
| 346 | if (!res_pem) |
| 347 | return -ENOMEM; |
| 348 | |
Tomasz Nowicki | 81caa91 | 2017-03-23 17:10:10 -0500 | [diff] [blame^] | 349 | ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem); |
Tomasz Nowicki | 44f22bd | 2016-12-01 00:07:56 -0600 | [diff] [blame] | 350 | if (ret) { |
| 351 | dev_err(dev, "can't get rc base address\n"); |
| 352 | return ret; |
| 353 | } |
| 354 | |
| 355 | return thunder_pem_init(dev, cfg, res_pem); |
| 356 | } |
| 357 | |
| 358 | struct pci_ecam_ops thunder_pem_ecam_ops = { |
| 359 | .bus_shift = 24, |
| 360 | .init = thunder_pem_acpi_init, |
| 361 | .pci_ops = { |
| 362 | .map_bus = pci_ecam_map_bus, |
| 363 | .read = thunder_pem_config_read, |
| 364 | .write = thunder_pem_config_write, |
| 365 | } |
| 366 | }; |
| 367 | |
| 368 | #endif |
| 369 | |
| 370 | #ifdef CONFIG_PCI_HOST_THUNDER_PEM |
| 371 | |
Bjorn Helgaas | 0d41426 | 2016-11-30 23:57:56 -0600 | [diff] [blame] | 372 | static int thunder_pem_platform_init(struct pci_config_window *cfg) |
| 373 | { |
| 374 | struct device *dev = cfg->parent; |
| 375 | struct platform_device *pdev = to_platform_device(dev); |
| 376 | struct resource *res_pem; |
| 377 | |
| 378 | if (!dev->of_node) |
| 379 | return -EINVAL; |
| 380 | |
| 381 | /* |
| 382 | * The second register range is the PEM bridge to the PCIe |
| 383 | * bus. It has a different config access method than those |
| 384 | * devices behind the bridge. |
| 385 | */ |
| 386 | res_pem = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
| 387 | if (!res_pem) { |
| 388 | dev_err(dev, "missing \"reg[1]\"property\n"); |
| 389 | return -EINVAL; |
| 390 | } |
| 391 | |
| 392 | return thunder_pem_init(dev, cfg, res_pem); |
| 393 | } |
| 394 | |
Jayachandran C | 1958e71 | 2016-05-11 17:34:46 -0500 | [diff] [blame] | 395 | static struct pci_ecam_ops pci_thunder_pem_ops = { |
| 396 | .bus_shift = 24, |
Bjorn Helgaas | 0d41426 | 2016-11-30 23:57:56 -0600 | [diff] [blame] | 397 | .init = thunder_pem_platform_init, |
Jayachandran C | 1958e71 | 2016-05-11 17:34:46 -0500 | [diff] [blame] | 398 | .pci_ops = { |
| 399 | .map_bus = pci_ecam_map_bus, |
| 400 | .read = thunder_pem_config_read, |
| 401 | .write = thunder_pem_config_write, |
| 402 | } |
| 403 | }; |
| 404 | |
| 405 | static const struct of_device_id thunder_pem_of_match[] = { |
| 406 | { .compatible = "cavium,pci-host-thunder-pem" }, |
| 407 | { }, |
| 408 | }; |
Jayachandran C | 1958e71 | 2016-05-11 17:34:46 -0500 | [diff] [blame] | 409 | |
| 410 | static int thunder_pem_probe(struct platform_device *pdev) |
| 411 | { |
| 412 | return pci_host_common_probe(pdev, &pci_thunder_pem_ops); |
David Daney | f12b76e | 2016-03-04 14:31:47 -0800 | [diff] [blame] | 413 | } |
| 414 | |
| 415 | static struct platform_driver thunder_pem_driver = { |
| 416 | .driver = { |
| 417 | .name = KBUILD_MODNAME, |
| 418 | .of_match_table = thunder_pem_of_match, |
| 419 | }, |
| 420 | .probe = thunder_pem_probe, |
| 421 | }; |
Paul Gortmaker | 0b3cd16 | 2016-07-22 16:24:49 -0500 | [diff] [blame] | 422 | builtin_platform_driver(thunder_pem_driver); |
Tomasz Nowicki | 44f22bd | 2016-12-01 00:07:56 -0600 | [diff] [blame] | 423 | |
| 424 | #endif |
| 425 | #endif |