Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 1 | /* |
| 2 | * PCIe host controller driver for Marvell Armada-8K SoCs |
| 3 | * |
| 4 | * Armada-8K PCIe Glue Layer Source Code |
| 5 | * |
| 6 | * Copyright (C) 2016 Marvell Technology Group Ltd. |
| 7 | * |
Paul Gortmaker | 0e6f98c | 2016-07-02 19:13:21 -0400 | [diff] [blame] | 8 | * Author: Yehuda Yitshak <yehuday@marvell.com> |
| 9 | * Author: Shadi Ammouri <shadi@marvell.com> |
| 10 | * |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 11 | * This file is licensed under the terms of the GNU General Public |
| 12 | * License version 2. This program is licensed "as is" without any |
| 13 | * warranty of any kind, whether express or implied. |
| 14 | */ |
| 15 | |
| 16 | #include <linux/clk.h> |
| 17 | #include <linux/delay.h> |
| 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/kernel.h> |
Paul Gortmaker | 0e6f98c | 2016-07-02 19:13:21 -0400 | [diff] [blame] | 20 | #include <linux/init.h> |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 21 | #include <linux/of.h> |
| 22 | #include <linux/pci.h> |
| 23 | #include <linux/phy/phy.h> |
| 24 | #include <linux/platform_device.h> |
| 25 | #include <linux/resource.h> |
| 26 | #include <linux/of_pci.h> |
| 27 | #include <linux/of_irq.h> |
| 28 | |
| 29 | #include "pcie-designware.h" |
| 30 | |
| 31 | struct armada8k_pcie { |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 32 | struct dw_pcie *pci; |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 33 | struct clk *clk; |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | #define PCIE_VENDOR_REGS_OFFSET 0x8000 |
| 37 | |
Bjorn Helgaas | 74e6907 | 2016-10-06 13:29:59 -0500 | [diff] [blame] | 38 | #define PCIE_GLOBAL_CONTROL_REG (PCIE_VENDOR_REGS_OFFSET + 0x0) |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 39 | #define PCIE_APP_LTSSM_EN BIT(2) |
| 40 | #define PCIE_DEVICE_TYPE_SHIFT 4 |
| 41 | #define PCIE_DEVICE_TYPE_MASK 0xF |
| 42 | #define PCIE_DEVICE_TYPE_RC 0x4 /* Root complex */ |
| 43 | |
Bjorn Helgaas | 74e6907 | 2016-10-06 13:29:59 -0500 | [diff] [blame] | 44 | #define PCIE_GLOBAL_STATUS_REG (PCIE_VENDOR_REGS_OFFSET + 0x8) |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 45 | #define PCIE_GLB_STS_RDLH_LINK_UP BIT(1) |
| 46 | #define PCIE_GLB_STS_PHY_LINK_UP BIT(9) |
| 47 | |
Bjorn Helgaas | 74e6907 | 2016-10-06 13:29:59 -0500 | [diff] [blame] | 48 | #define PCIE_GLOBAL_INT_CAUSE1_REG (PCIE_VENDOR_REGS_OFFSET + 0x1C) |
| 49 | #define PCIE_GLOBAL_INT_MASK1_REG (PCIE_VENDOR_REGS_OFFSET + 0x20) |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 50 | #define PCIE_INT_A_ASSERT_MASK BIT(9) |
| 51 | #define PCIE_INT_B_ASSERT_MASK BIT(10) |
| 52 | #define PCIE_INT_C_ASSERT_MASK BIT(11) |
| 53 | #define PCIE_INT_D_ASSERT_MASK BIT(12) |
| 54 | |
Bjorn Helgaas | 74e6907 | 2016-10-06 13:29:59 -0500 | [diff] [blame] | 55 | #define PCIE_ARCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET + 0x50) |
| 56 | #define PCIE_AWCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET + 0x54) |
| 57 | #define PCIE_ARUSER_REG (PCIE_VENDOR_REGS_OFFSET + 0x5C) |
| 58 | #define PCIE_AWUSER_REG (PCIE_VENDOR_REGS_OFFSET + 0x60) |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 59 | /* |
| 60 | * AR/AW Cache defauls: Normal memory, Write-Back, Read / Write |
| 61 | * allocate |
| 62 | */ |
| 63 | #define ARCACHE_DEFAULT_VALUE 0x3511 |
| 64 | #define AWCACHE_DEFAULT_VALUE 0x5311 |
| 65 | |
| 66 | #define DOMAIN_OUTER_SHAREABLE 0x2 |
| 67 | #define AX_USER_DOMAIN_MASK 0x3 |
| 68 | #define AX_USER_DOMAIN_SHIFT 4 |
| 69 | |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 70 | #define to_armada8k_pcie(x) dev_get_drvdata((x)->dev) |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 71 | |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 72 | static int armada8k_pcie_link_up(struct dw_pcie *pci) |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 73 | { |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 74 | u32 reg; |
| 75 | u32 mask = PCIE_GLB_STS_RDLH_LINK_UP | PCIE_GLB_STS_PHY_LINK_UP; |
| 76 | |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 77 | reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_STATUS_REG); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 78 | |
| 79 | if ((reg & mask) == mask) |
| 80 | return 1; |
| 81 | |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 82 | dev_dbg(pci->dev, "No link detected (Global-Status: 0x%08x).\n", reg); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 83 | return 0; |
| 84 | } |
| 85 | |
Bjorn Helgaas | b2d6fd7 | 2016-10-06 13:30:00 -0500 | [diff] [blame] | 86 | static void armada8k_pcie_establish_link(struct armada8k_pcie *pcie) |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 87 | { |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 88 | struct dw_pcie *pci = pcie->pci; |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 89 | u32 reg; |
| 90 | |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 91 | if (!dw_pcie_link_up(pci)) { |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 92 | /* Disable LTSSM state machine to enable configuration */ |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 93 | reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_CONTROL_REG); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 94 | reg &= ~(PCIE_APP_LTSSM_EN); |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 95 | dw_pcie_writel_dbi(pci, PCIE_GLOBAL_CONTROL_REG, reg); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | /* Set the device to root complex mode */ |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 99 | reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_CONTROL_REG); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 100 | reg &= ~(PCIE_DEVICE_TYPE_MASK << PCIE_DEVICE_TYPE_SHIFT); |
| 101 | reg |= PCIE_DEVICE_TYPE_RC << PCIE_DEVICE_TYPE_SHIFT; |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 102 | dw_pcie_writel_dbi(pci, PCIE_GLOBAL_CONTROL_REG, reg); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 103 | |
| 104 | /* Set the PCIe master AxCache attributes */ |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 105 | dw_pcie_writel_dbi(pci, PCIE_ARCACHE_TRC_REG, ARCACHE_DEFAULT_VALUE); |
| 106 | dw_pcie_writel_dbi(pci, PCIE_AWCACHE_TRC_REG, AWCACHE_DEFAULT_VALUE); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 107 | |
| 108 | /* Set the PCIe master AxDomain attributes */ |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 109 | reg = dw_pcie_readl_dbi(pci, PCIE_ARUSER_REG); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 110 | reg &= ~(AX_USER_DOMAIN_MASK << AX_USER_DOMAIN_SHIFT); |
| 111 | reg |= DOMAIN_OUTER_SHAREABLE << AX_USER_DOMAIN_SHIFT; |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 112 | dw_pcie_writel_dbi(pci, PCIE_ARUSER_REG, reg); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 113 | |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 114 | reg = dw_pcie_readl_dbi(pci, PCIE_AWUSER_REG); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 115 | reg &= ~(AX_USER_DOMAIN_MASK << AX_USER_DOMAIN_SHIFT); |
| 116 | reg |= DOMAIN_OUTER_SHAREABLE << AX_USER_DOMAIN_SHIFT; |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 117 | dw_pcie_writel_dbi(pci, PCIE_AWUSER_REG, reg); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 118 | |
| 119 | /* Enable INT A-D interrupts */ |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 120 | reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_INT_MASK1_REG); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 121 | reg |= PCIE_INT_A_ASSERT_MASK | PCIE_INT_B_ASSERT_MASK | |
| 122 | PCIE_INT_C_ASSERT_MASK | PCIE_INT_D_ASSERT_MASK; |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 123 | dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_MASK1_REG, reg); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 124 | |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 125 | if (!dw_pcie_link_up(pci)) { |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 126 | /* Configuration done. Start LTSSM */ |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 127 | reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_CONTROL_REG); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 128 | reg |= PCIE_APP_LTSSM_EN; |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 129 | dw_pcie_writel_dbi(pci, PCIE_GLOBAL_CONTROL_REG, reg); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | /* Wait until the link becomes active again */ |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 133 | if (dw_pcie_wait_for_link(pci)) |
| 134 | dev_err(pci->dev, "Link not up after reconfiguration\n"); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 135 | } |
| 136 | |
| 137 | static void armada8k_pcie_host_init(struct pcie_port *pp) |
| 138 | { |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 139 | struct dw_pcie *pci = to_dw_pcie_from_pp(pp); |
| 140 | struct armada8k_pcie *pcie = to_armada8k_pcie(pci); |
Bjorn Helgaas | b2d6fd7 | 2016-10-06 13:30:00 -0500 | [diff] [blame] | 141 | |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 142 | dw_pcie_setup_rc(pp); |
Bjorn Helgaas | b2d6fd7 | 2016-10-06 13:30:00 -0500 | [diff] [blame] | 143 | armada8k_pcie_establish_link(pcie); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg) |
| 147 | { |
Bjorn Helgaas | b2d6fd7 | 2016-10-06 13:30:00 -0500 | [diff] [blame] | 148 | struct armada8k_pcie *pcie = arg; |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 149 | struct dw_pcie *pci = pcie->pci; |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 150 | u32 val; |
| 151 | |
| 152 | /* |
| 153 | * Interrupts are directly handled by the device driver of the |
| 154 | * PCI device. However, they are also latched into the PCIe |
| 155 | * controller, so we simply discard them. |
| 156 | */ |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 157 | val = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_INT_CAUSE1_REG); |
| 158 | dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_CAUSE1_REG, val); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 159 | |
| 160 | return IRQ_HANDLED; |
| 161 | } |
| 162 | |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 163 | static struct dw_pcie_host_ops armada8k_pcie_host_ops = { |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 164 | .host_init = armada8k_pcie_host_init, |
| 165 | }; |
| 166 | |
Bjorn Helgaas | b2d6fd7 | 2016-10-06 13:30:00 -0500 | [diff] [blame] | 167 | static int armada8k_add_pcie_port(struct armada8k_pcie *pcie, |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 168 | struct platform_device *pdev) |
| 169 | { |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 170 | struct dw_pcie *pci = pcie->pci; |
| 171 | struct pcie_port *pp = &pci->pp; |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 172 | struct device *dev = &pdev->dev; |
| 173 | int ret; |
| 174 | |
| 175 | pp->root_bus_nr = -1; |
| 176 | pp->ops = &armada8k_pcie_host_ops; |
| 177 | |
| 178 | pp->irq = platform_get_irq(pdev, 0); |
| 179 | if (!pp->irq) { |
| 180 | dev_err(dev, "failed to get irq for port\n"); |
| 181 | return -ENODEV; |
| 182 | } |
| 183 | |
| 184 | ret = devm_request_irq(dev, pp->irq, armada8k_pcie_irq_handler, |
Bjorn Helgaas | b2d6fd7 | 2016-10-06 13:30:00 -0500 | [diff] [blame] | 185 | IRQF_SHARED, "armada8k-pcie", pcie); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 186 | if (ret) { |
| 187 | dev_err(dev, "failed to request irq %d\n", pp->irq); |
| 188 | return ret; |
| 189 | } |
| 190 | |
| 191 | ret = dw_pcie_host_init(pp); |
| 192 | if (ret) { |
| 193 | dev_err(dev, "failed to initialize host: %d\n", ret); |
| 194 | return ret; |
| 195 | } |
| 196 | |
| 197 | return 0; |
| 198 | } |
| 199 | |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 200 | static const struct dw_pcie_ops dw_pcie_ops = { |
| 201 | .link_up = armada8k_pcie_link_up, |
| 202 | }; |
| 203 | |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 204 | static int armada8k_pcie_probe(struct platform_device *pdev) |
| 205 | { |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 206 | struct dw_pcie *pci; |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 207 | struct armada8k_pcie *pcie; |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 208 | struct device *dev = &pdev->dev; |
| 209 | struct resource *base; |
| 210 | int ret; |
| 211 | |
| 212 | pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL); |
| 213 | if (!pcie) |
| 214 | return -ENOMEM; |
| 215 | |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 216 | pci = devm_kzalloc(dev, sizeof(*pci), GFP_KERNEL); |
| 217 | if (!pci) |
| 218 | return -ENOMEM; |
| 219 | |
| 220 | pci->dev = dev; |
| 221 | pci->ops = &dw_pcie_ops; |
| 222 | |
Guenter Roeck | c046406 | 2017-02-25 02:08:12 -0800 | [diff] [blame] | 223 | pcie->pci = pci; |
| 224 | |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 225 | pcie->clk = devm_clk_get(dev, NULL); |
| 226 | if (IS_ERR(pcie->clk)) |
| 227 | return PTR_ERR(pcie->clk); |
| 228 | |
| 229 | clk_prepare_enable(pcie->clk); |
| 230 | |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 231 | /* Get the dw-pcie unit configuration/control registers base. */ |
| 232 | base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl"); |
Lorenzo Pieralisi | 53dfa17 | 2017-04-19 17:49:04 +0100 | [diff] [blame^] | 233 | pci->dbi_base = devm_pci_remap_cfg_resource(dev, base); |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 234 | if (IS_ERR(pci->dbi_base)) { |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 235 | dev_err(dev, "couldn't remap regs base %p\n", base); |
Kishon Vijay Abraham I | 442ec4c | 2017-02-15 18:48:14 +0530 | [diff] [blame] | 236 | ret = PTR_ERR(pci->dbi_base); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 237 | goto fail; |
| 238 | } |
| 239 | |
Kishon Vijay Abraham I | 9bcf0a6 | 2017-02-15 18:48:11 +0530 | [diff] [blame] | 240 | platform_set_drvdata(pdev, pcie); |
| 241 | |
Bjorn Helgaas | b2d6fd7 | 2016-10-06 13:30:00 -0500 | [diff] [blame] | 242 | ret = armada8k_add_pcie_port(pcie, pdev); |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 243 | if (ret) |
| 244 | goto fail; |
| 245 | |
| 246 | return 0; |
| 247 | |
| 248 | fail: |
| 249 | if (!IS_ERR(pcie->clk)) |
| 250 | clk_disable_unprepare(pcie->clk); |
| 251 | |
| 252 | return ret; |
| 253 | } |
| 254 | |
| 255 | static const struct of_device_id armada8k_pcie_of_match[] = { |
| 256 | { .compatible = "marvell,armada8k-pcie", }, |
| 257 | {}, |
| 258 | }; |
Thomas Petazzoni | 1c52a51 | 2016-04-26 10:31:46 +0200 | [diff] [blame] | 259 | |
| 260 | static struct platform_driver armada8k_pcie_driver = { |
| 261 | .probe = armada8k_pcie_probe, |
| 262 | .driver = { |
| 263 | .name = "armada8k-pcie", |
| 264 | .of_match_table = of_match_ptr(armada8k_pcie_of_match), |
| 265 | }, |
| 266 | }; |
Paul Gortmaker | 0e6f98c | 2016-07-02 19:13:21 -0400 | [diff] [blame] | 267 | builtin_platform_driver(armada8k_pcie_driver); |