Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 1 | /* |
| 2 | * PCIe host controller driver for Freescale i.MX6 SoCs |
| 3 | * |
| 4 | * Copyright (C) 2013 Kosagi |
| 5 | * http://www.kosagi.com |
| 6 | * |
| 7 | * Author: Sean Cross <xobs@kosagi.com> |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License version 2 as |
| 11 | * published by the Free Software Foundation. |
| 12 | */ |
| 13 | |
| 14 | #include <linux/clk.h> |
| 15 | #include <linux/delay.h> |
| 16 | #include <linux/gpio.h> |
| 17 | #include <linux/kernel.h> |
| 18 | #include <linux/mfd/syscon.h> |
| 19 | #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> |
| 20 | #include <linux/module.h> |
| 21 | #include <linux/of_gpio.h> |
| 22 | #include <linux/pci.h> |
| 23 | #include <linux/platform_device.h> |
| 24 | #include <linux/regmap.h> |
| 25 | #include <linux/resource.h> |
| 26 | #include <linux/signal.h> |
| 27 | #include <linux/types.h> |
Lucas Stach | d1dc974 | 2014-03-28 17:52:59 +0100 | [diff] [blame] | 28 | #include <linux/interrupt.h> |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 29 | |
| 30 | #include "pcie-designware.h" |
| 31 | |
| 32 | #define to_imx6_pcie(x) container_of(x, struct imx6_pcie, pp) |
| 33 | |
| 34 | struct imx6_pcie { |
Fabio Estevam | b2d7a9c | 2016-03-28 18:45:36 -0300 | [diff] [blame] | 35 | int reset_gpio; |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 36 | struct clk *pcie_bus; |
| 37 | struct clk *pcie_phy; |
| 38 | struct clk *pcie; |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 39 | struct pcie_port pp; |
| 40 | struct regmap *iomuxc_gpr; |
| 41 | void __iomem *mem_base; |
Justin Waters | 28e3abe | 2016-01-15 10:24:35 -0500 | [diff] [blame] | 42 | u32 tx_deemph_gen1; |
| 43 | u32 tx_deemph_gen2_3p5db; |
| 44 | u32 tx_deemph_gen2_6db; |
| 45 | u32 tx_swing_full; |
| 46 | u32 tx_swing_low; |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 47 | }; |
| 48 | |
Marek Vasut | fa33a6d | 2013-12-12 22:50:02 +0100 | [diff] [blame] | 49 | /* PCIe Root Complex registers (memory-mapped) */ |
| 50 | #define PCIE_RC_LCR 0x7c |
| 51 | #define PCIE_RC_LCR_MAX_LINK_SPEEDS_GEN1 0x1 |
| 52 | #define PCIE_RC_LCR_MAX_LINK_SPEEDS_GEN2 0x2 |
| 53 | #define PCIE_RC_LCR_MAX_LINK_SPEEDS_MASK 0xf |
| 54 | |
Bjorn Helgaas | 2393f79 | 2015-06-12 17:27:43 -0500 | [diff] [blame] | 55 | #define PCIE_RC_LCSR 0x80 |
| 56 | |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 57 | /* PCIe Port Logic registers (memory-mapped) */ |
| 58 | #define PL_OFFSET 0x700 |
Lucas Stach | 3e3e406 | 2014-07-31 20:16:05 +0200 | [diff] [blame] | 59 | #define PCIE_PL_PFLR (PL_OFFSET + 0x08) |
| 60 | #define PCIE_PL_PFLR_LINK_STATE_MASK (0x3f << 16) |
| 61 | #define PCIE_PL_PFLR_FORCE_LINK (1 << 15) |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 62 | #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28) |
| 63 | #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c) |
Marek Vasut | 7f9f40c | 2013-12-12 22:49:59 +0100 | [diff] [blame] | 64 | #define PCIE_PHY_DEBUG_R1_XMLH_LINK_IN_TRAINING (1 << 29) |
| 65 | #define PCIE_PHY_DEBUG_R1_XMLH_LINK_UP (1 << 4) |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 66 | |
| 67 | #define PCIE_PHY_CTRL (PL_OFFSET + 0x114) |
| 68 | #define PCIE_PHY_CTRL_DATA_LOC 0 |
| 69 | #define PCIE_PHY_CTRL_CAP_ADR_LOC 16 |
| 70 | #define PCIE_PHY_CTRL_CAP_DAT_LOC 17 |
| 71 | #define PCIE_PHY_CTRL_WR_LOC 18 |
| 72 | #define PCIE_PHY_CTRL_RD_LOC 19 |
| 73 | |
| 74 | #define PCIE_PHY_STAT (PL_OFFSET + 0x110) |
| 75 | #define PCIE_PHY_STAT_ACK_LOC 16 |
| 76 | |
Marek Vasut | fa33a6d | 2013-12-12 22:50:02 +0100 | [diff] [blame] | 77 | #define PCIE_LINK_WIDTH_SPEED_CONTROL 0x80C |
| 78 | #define PORT_LOGIC_SPEED_CHANGE (0x1 << 17) |
| 79 | |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 80 | /* PHY registers (not memory-mapped) */ |
| 81 | #define PCIE_PHY_RX_ASIC_OUT 0x100D |
Fabio Estevam | 111feb7 | 2015-09-11 09:08:53 -0300 | [diff] [blame] | 82 | #define PCIE_PHY_RX_ASIC_OUT_VALID (1 << 0) |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 83 | |
| 84 | #define PHY_RX_OVRD_IN_LO 0x1005 |
| 85 | #define PHY_RX_OVRD_IN_LO_RX_DATA_EN (1 << 5) |
| 86 | #define PHY_RX_OVRD_IN_LO_RX_PLL_EN (1 << 3) |
| 87 | |
| 88 | static int pcie_phy_poll_ack(void __iomem *dbi_base, int exp_val) |
| 89 | { |
| 90 | u32 val; |
| 91 | u32 max_iterations = 10; |
| 92 | u32 wait_counter = 0; |
| 93 | |
| 94 | do { |
| 95 | val = readl(dbi_base + PCIE_PHY_STAT); |
| 96 | val = (val >> PCIE_PHY_STAT_ACK_LOC) & 0x1; |
| 97 | wait_counter++; |
| 98 | |
| 99 | if (val == exp_val) |
| 100 | return 0; |
| 101 | |
| 102 | udelay(1); |
| 103 | } while (wait_counter < max_iterations); |
| 104 | |
| 105 | return -ETIMEDOUT; |
| 106 | } |
| 107 | |
| 108 | static int pcie_phy_wait_ack(void __iomem *dbi_base, int addr) |
| 109 | { |
| 110 | u32 val; |
| 111 | int ret; |
| 112 | |
| 113 | val = addr << PCIE_PHY_CTRL_DATA_LOC; |
| 114 | writel(val, dbi_base + PCIE_PHY_CTRL); |
| 115 | |
| 116 | val |= (0x1 << PCIE_PHY_CTRL_CAP_ADR_LOC); |
| 117 | writel(val, dbi_base + PCIE_PHY_CTRL); |
| 118 | |
| 119 | ret = pcie_phy_poll_ack(dbi_base, 1); |
| 120 | if (ret) |
| 121 | return ret; |
| 122 | |
| 123 | val = addr << PCIE_PHY_CTRL_DATA_LOC; |
| 124 | writel(val, dbi_base + PCIE_PHY_CTRL); |
| 125 | |
Fabio Estevam | 8d1ceb5 | 2015-08-20 01:31:58 -0500 | [diff] [blame] | 126 | return pcie_phy_poll_ack(dbi_base, 0); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 127 | } |
| 128 | |
| 129 | /* Read from the 16-bit PCIe PHY control registers (not memory-mapped) */ |
Bogicevic Sasa | ff3ce48 | 2015-12-27 13:21:11 -0800 | [diff] [blame] | 130 | static int pcie_phy_read(void __iomem *dbi_base, int addr, int *data) |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 131 | { |
| 132 | u32 val, phy_ctl; |
| 133 | int ret; |
| 134 | |
| 135 | ret = pcie_phy_wait_ack(dbi_base, addr); |
| 136 | if (ret) |
| 137 | return ret; |
| 138 | |
| 139 | /* assert Read signal */ |
| 140 | phy_ctl = 0x1 << PCIE_PHY_CTRL_RD_LOC; |
| 141 | writel(phy_ctl, dbi_base + PCIE_PHY_CTRL); |
| 142 | |
| 143 | ret = pcie_phy_poll_ack(dbi_base, 1); |
| 144 | if (ret) |
| 145 | return ret; |
| 146 | |
| 147 | val = readl(dbi_base + PCIE_PHY_STAT); |
| 148 | *data = val & 0xffff; |
| 149 | |
| 150 | /* deassert Read signal */ |
| 151 | writel(0x00, dbi_base + PCIE_PHY_CTRL); |
| 152 | |
Fabio Estevam | 8d1ceb5 | 2015-08-20 01:31:58 -0500 | [diff] [blame] | 153 | return pcie_phy_poll_ack(dbi_base, 0); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 154 | } |
| 155 | |
| 156 | static int pcie_phy_write(void __iomem *dbi_base, int addr, int data) |
| 157 | { |
| 158 | u32 var; |
| 159 | int ret; |
| 160 | |
| 161 | /* write addr */ |
| 162 | /* cap addr */ |
| 163 | ret = pcie_phy_wait_ack(dbi_base, addr); |
| 164 | if (ret) |
| 165 | return ret; |
| 166 | |
| 167 | var = data << PCIE_PHY_CTRL_DATA_LOC; |
| 168 | writel(var, dbi_base + PCIE_PHY_CTRL); |
| 169 | |
| 170 | /* capture data */ |
| 171 | var |= (0x1 << PCIE_PHY_CTRL_CAP_DAT_LOC); |
| 172 | writel(var, dbi_base + PCIE_PHY_CTRL); |
| 173 | |
| 174 | ret = pcie_phy_poll_ack(dbi_base, 1); |
| 175 | if (ret) |
| 176 | return ret; |
| 177 | |
| 178 | /* deassert cap data */ |
| 179 | var = data << PCIE_PHY_CTRL_DATA_LOC; |
| 180 | writel(var, dbi_base + PCIE_PHY_CTRL); |
| 181 | |
| 182 | /* wait for ack de-assertion */ |
| 183 | ret = pcie_phy_poll_ack(dbi_base, 0); |
| 184 | if (ret) |
| 185 | return ret; |
| 186 | |
| 187 | /* assert wr signal */ |
| 188 | var = 0x1 << PCIE_PHY_CTRL_WR_LOC; |
| 189 | writel(var, dbi_base + PCIE_PHY_CTRL); |
| 190 | |
| 191 | /* wait for ack */ |
| 192 | ret = pcie_phy_poll_ack(dbi_base, 1); |
| 193 | if (ret) |
| 194 | return ret; |
| 195 | |
| 196 | /* deassert wr signal */ |
| 197 | var = data << PCIE_PHY_CTRL_DATA_LOC; |
| 198 | writel(var, dbi_base + PCIE_PHY_CTRL); |
| 199 | |
| 200 | /* wait for ack de-assertion */ |
| 201 | ret = pcie_phy_poll_ack(dbi_base, 0); |
| 202 | if (ret) |
| 203 | return ret; |
| 204 | |
| 205 | writel(0x0, dbi_base + PCIE_PHY_CTRL); |
| 206 | |
| 207 | return 0; |
| 208 | } |
| 209 | |
Lucas Stach | 53eeb48 | 2016-01-15 19:56:47 +0100 | [diff] [blame] | 210 | static void imx6_pcie_reset_phy(struct pcie_port *pp) |
| 211 | { |
| 212 | u32 tmp; |
| 213 | |
| 214 | pcie_phy_read(pp->dbi_base, PHY_RX_OVRD_IN_LO, &tmp); |
| 215 | tmp |= (PHY_RX_OVRD_IN_LO_RX_DATA_EN | |
| 216 | PHY_RX_OVRD_IN_LO_RX_PLL_EN); |
| 217 | pcie_phy_write(pp->dbi_base, PHY_RX_OVRD_IN_LO, tmp); |
| 218 | |
| 219 | usleep_range(2000, 3000); |
| 220 | |
| 221 | pcie_phy_read(pp->dbi_base, PHY_RX_OVRD_IN_LO, &tmp); |
| 222 | tmp &= ~(PHY_RX_OVRD_IN_LO_RX_DATA_EN | |
| 223 | PHY_RX_OVRD_IN_LO_RX_PLL_EN); |
| 224 | pcie_phy_write(pp->dbi_base, PHY_RX_OVRD_IN_LO, tmp); |
| 225 | } |
| 226 | |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 227 | /* Added for PCI abort handling */ |
| 228 | static int imx6q_pcie_abort_handler(unsigned long addr, |
| 229 | unsigned int fsr, struct pt_regs *regs) |
| 230 | { |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 231 | return 0; |
| 232 | } |
| 233 | |
| 234 | static int imx6_pcie_assert_core_reset(struct pcie_port *pp) |
| 235 | { |
| 236 | struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); |
Lucas Stach | 3e3e406 | 2014-07-31 20:16:05 +0200 | [diff] [blame] | 237 | u32 val, gpr1, gpr12; |
| 238 | |
| 239 | /* |
| 240 | * If the bootloader already enabled the link we need some special |
| 241 | * handling to get the core back into a state where it is safe to |
| 242 | * touch it for configuration. As there is no dedicated reset signal |
| 243 | * wired up for MX6QDL, we need to manually force LTSSM into "detect" |
| 244 | * state before completely disabling LTSSM, which is a prerequisite |
| 245 | * for core configuration. |
| 246 | * |
| 247 | * If both LTSSM_ENABLE and REF_SSP_ENABLE are active we have a strong |
| 248 | * indication that the bootloader activated the link. |
| 249 | */ |
| 250 | regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, &gpr1); |
| 251 | regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, &gpr12); |
| 252 | |
| 253 | if ((gpr1 & IMX6Q_GPR1_PCIE_REF_CLK_EN) && |
| 254 | (gpr12 & IMX6Q_GPR12_PCIE_CTL_2)) { |
| 255 | val = readl(pp->dbi_base + PCIE_PL_PFLR); |
| 256 | val &= ~PCIE_PL_PFLR_LINK_STATE_MASK; |
| 257 | val |= PCIE_PL_PFLR_FORCE_LINK; |
| 258 | writel(val, pp->dbi_base + PCIE_PL_PFLR); |
| 259 | |
| 260 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, |
| 261 | IMX6Q_GPR12_PCIE_CTL_2, 0 << 10); |
| 262 | } |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 263 | |
| 264 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, |
| 265 | IMX6Q_GPR1_PCIE_TEST_PD, 1 << 18); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 266 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, |
| 267 | IMX6Q_GPR1_PCIE_REF_CLK_EN, 0 << 16); |
| 268 | |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 269 | return 0; |
| 270 | } |
| 271 | |
Bjorn Helgaas | 4d1821e | 2016-03-14 00:30:55 +0100 | [diff] [blame^] | 272 | static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie) |
| 273 | { |
| 274 | /* power up core phy and enable ref clock */ |
| 275 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, |
| 276 | IMX6Q_GPR1_PCIE_TEST_PD, 0 << 18); |
| 277 | /* |
| 278 | * the async reset input need ref clock to sync internally, |
| 279 | * when the ref clock comes after reset, internal synced |
| 280 | * reset time is too short, cannot meet the requirement. |
| 281 | * add one ~10us delay here. |
| 282 | */ |
| 283 | udelay(10); |
| 284 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, |
| 285 | IMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16); |
| 286 | return 0; |
| 287 | } |
| 288 | |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 289 | static int imx6_pcie_deassert_core_reset(struct pcie_port *pp) |
| 290 | { |
| 291 | struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); |
| 292 | int ret; |
| 293 | |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 294 | ret = clk_prepare_enable(imx6_pcie->pcie_phy); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 295 | if (ret) { |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 296 | dev_err(pp->dev, "unable to enable pcie_phy clock\n"); |
| 297 | goto err_pcie_phy; |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 298 | } |
| 299 | |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 300 | ret = clk_prepare_enable(imx6_pcie->pcie_bus); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 301 | if (ret) { |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 302 | dev_err(pp->dev, "unable to enable pcie_bus clock\n"); |
| 303 | goto err_pcie_bus; |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 304 | } |
| 305 | |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 306 | ret = clk_prepare_enable(imx6_pcie->pcie); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 307 | if (ret) { |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 308 | dev_err(pp->dev, "unable to enable pcie clock\n"); |
| 309 | goto err_pcie; |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 310 | } |
| 311 | |
Bjorn Helgaas | 4d1821e | 2016-03-14 00:30:55 +0100 | [diff] [blame^] | 312 | ret = imx6_pcie_enable_ref_clk(imx6_pcie); |
| 313 | if (ret) { |
| 314 | dev_err(pp->dev, "unable to enable pcie ref clock\n"); |
| 315 | goto err_ref_clk; |
| 316 | } |
Tim Harvey | 3fce0e8 | 2014-08-07 23:36:40 -0700 | [diff] [blame] | 317 | |
Richard Zhu | a2fa6f6 | 2014-10-27 13:17:32 +0800 | [diff] [blame] | 318 | /* allow the clocks to stabilize */ |
| 319 | usleep_range(200, 500); |
| 320 | |
Richard Zhu | bc9ef77 | 2013-12-12 22:50:03 +0100 | [diff] [blame] | 321 | /* Some boards don't have PCIe reset GPIO. */ |
Fabio Estevam | b2d7a9c | 2016-03-28 18:45:36 -0300 | [diff] [blame] | 322 | if (gpio_is_valid(imx6_pcie->reset_gpio)) { |
| 323 | gpio_set_value_cansleep(imx6_pcie->reset_gpio, 0); |
Richard Zhu | bc9ef77 | 2013-12-12 22:50:03 +0100 | [diff] [blame] | 324 | msleep(100); |
Fabio Estevam | b2d7a9c | 2016-03-28 18:45:36 -0300 | [diff] [blame] | 325 | gpio_set_value_cansleep(imx6_pcie->reset_gpio, 1); |
Richard Zhu | bc9ef77 | 2013-12-12 22:50:03 +0100 | [diff] [blame] | 326 | } |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 327 | return 0; |
| 328 | |
Bjorn Helgaas | 4d1821e | 2016-03-14 00:30:55 +0100 | [diff] [blame^] | 329 | err_ref_clk: |
| 330 | clk_disable_unprepare(imx6_pcie->pcie); |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 331 | err_pcie: |
| 332 | clk_disable_unprepare(imx6_pcie->pcie_bus); |
| 333 | err_pcie_bus: |
| 334 | clk_disable_unprepare(imx6_pcie->pcie_phy); |
| 335 | err_pcie_phy: |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 336 | return ret; |
| 337 | |
| 338 | } |
| 339 | |
| 340 | static void imx6_pcie_init_phy(struct pcie_port *pp) |
| 341 | { |
| 342 | struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); |
| 343 | |
| 344 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, |
| 345 | IMX6Q_GPR12_PCIE_CTL_2, 0 << 10); |
| 346 | |
| 347 | /* configure constant input signal to the pcie ctrl and phy */ |
| 348 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, |
| 349 | IMX6Q_GPR12_DEVICE_TYPE, PCI_EXP_TYPE_ROOT_PORT << 12); |
| 350 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, |
| 351 | IMX6Q_GPR12_LOS_LEVEL, 9 << 4); |
| 352 | |
| 353 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR8, |
Justin Waters | 28e3abe | 2016-01-15 10:24:35 -0500 | [diff] [blame] | 354 | IMX6Q_GPR8_TX_DEEMPH_GEN1, |
| 355 | imx6_pcie->tx_deemph_gen1 << 0); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 356 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR8, |
Justin Waters | 28e3abe | 2016-01-15 10:24:35 -0500 | [diff] [blame] | 357 | IMX6Q_GPR8_TX_DEEMPH_GEN2_3P5DB, |
| 358 | imx6_pcie->tx_deemph_gen2_3p5db << 6); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 359 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR8, |
Justin Waters | 28e3abe | 2016-01-15 10:24:35 -0500 | [diff] [blame] | 360 | IMX6Q_GPR8_TX_DEEMPH_GEN2_6DB, |
| 361 | imx6_pcie->tx_deemph_gen2_6db << 12); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 362 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR8, |
Justin Waters | 28e3abe | 2016-01-15 10:24:35 -0500 | [diff] [blame] | 363 | IMX6Q_GPR8_TX_SWING_FULL, |
| 364 | imx6_pcie->tx_swing_full << 18); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 365 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR8, |
Justin Waters | 28e3abe | 2016-01-15 10:24:35 -0500 | [diff] [blame] | 366 | IMX6Q_GPR8_TX_SWING_LOW, |
| 367 | imx6_pcie->tx_swing_low << 25); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 368 | } |
| 369 | |
Marek Vasut | 66a60f9 | 2013-12-12 22:50:01 +0100 | [diff] [blame] | 370 | static int imx6_pcie_wait_for_link(struct pcie_port *pp) |
| 371 | { |
Joao Pinto | 886bc5c | 2016-03-10 14:44:35 -0600 | [diff] [blame] | 372 | /* check if the link is up or not */ |
| 373 | if (!dw_pcie_wait_for_link(pp)) |
| 374 | return 0; |
Marek Vasut | 66a60f9 | 2013-12-12 22:50:01 +0100 | [diff] [blame] | 375 | |
Bjorn Helgaas | 6cbb247 | 2015-06-02 16:47:17 -0500 | [diff] [blame] | 376 | dev_dbg(pp->dev, "DEBUG_R0: 0x%08x, DEBUG_R1: 0x%08x\n", |
| 377 | readl(pp->dbi_base + PCIE_PHY_DEBUG_R0), |
| 378 | readl(pp->dbi_base + PCIE_PHY_DEBUG_R1)); |
Joao Pinto | 886bc5c | 2016-03-10 14:44:35 -0600 | [diff] [blame] | 379 | return -ETIMEDOUT; |
Marek Vasut | 66a60f9 | 2013-12-12 22:50:01 +0100 | [diff] [blame] | 380 | } |
| 381 | |
Troy Kisky | a042746 | 2015-06-12 14:30:16 -0500 | [diff] [blame] | 382 | static int imx6_pcie_wait_for_speed_change(struct pcie_port *pp) |
| 383 | { |
Bjorn Helgaas | 1c7fae1 | 2015-06-12 15:02:49 -0500 | [diff] [blame] | 384 | u32 tmp; |
Troy Kisky | a042746 | 2015-06-12 14:30:16 -0500 | [diff] [blame] | 385 | unsigned int retries; |
| 386 | |
| 387 | for (retries = 0; retries < 200; retries++) { |
| 388 | tmp = readl(pp->dbi_base + PCIE_LINK_WIDTH_SPEED_CONTROL); |
| 389 | /* Test if the speed change finished. */ |
| 390 | if (!(tmp & PORT_LOGIC_SPEED_CHANGE)) |
| 391 | return 0; |
| 392 | usleep_range(100, 1000); |
| 393 | } |
| 394 | |
| 395 | dev_err(pp->dev, "Speed change timeout\n"); |
| 396 | return -EINVAL; |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 397 | } |
| 398 | |
Lucas Stach | d1dc974 | 2014-03-28 17:52:59 +0100 | [diff] [blame] | 399 | static irqreturn_t imx6_pcie_msi_handler(int irq, void *arg) |
| 400 | { |
| 401 | struct pcie_port *pp = arg; |
| 402 | |
| 403 | return dw_handle_msi_irq(pp); |
| 404 | } |
| 405 | |
Bjorn Helgaas | fd5da20 | 2015-06-02 16:16:44 -0500 | [diff] [blame] | 406 | static int imx6_pcie_establish_link(struct pcie_port *pp) |
Marek Vasut | fa33a6d | 2013-12-12 22:50:02 +0100 | [diff] [blame] | 407 | { |
| 408 | struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); |
Bjorn Helgaas | 1c7fae1 | 2015-06-12 15:02:49 -0500 | [diff] [blame] | 409 | u32 tmp; |
Troy Kisky | a042746 | 2015-06-12 14:30:16 -0500 | [diff] [blame] | 410 | int ret; |
Marek Vasut | fa33a6d | 2013-12-12 22:50:02 +0100 | [diff] [blame] | 411 | |
| 412 | /* |
| 413 | * Force Gen1 operation when starting the link. In case the link is |
| 414 | * started in Gen2 mode, there is a possibility the devices on the |
| 415 | * bus will not be detected at all. This happens with PCIe switches. |
| 416 | */ |
| 417 | tmp = readl(pp->dbi_base + PCIE_RC_LCR); |
| 418 | tmp &= ~PCIE_RC_LCR_MAX_LINK_SPEEDS_MASK; |
| 419 | tmp |= PCIE_RC_LCR_MAX_LINK_SPEEDS_GEN1; |
| 420 | writel(tmp, pp->dbi_base + PCIE_RC_LCR); |
| 421 | |
| 422 | /* Start LTSSM. */ |
| 423 | regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, |
| 424 | IMX6Q_GPR12_PCIE_CTL_2, 1 << 10); |
| 425 | |
| 426 | ret = imx6_pcie_wait_for_link(pp); |
Lucas Stach | 54a47a8 | 2016-01-25 16:49:53 -0600 | [diff] [blame] | 427 | if (ret) { |
| 428 | dev_info(pp->dev, "Link never came up\n"); |
| 429 | goto err_reset_phy; |
| 430 | } |
Marek Vasut | fa33a6d | 2013-12-12 22:50:02 +0100 | [diff] [blame] | 431 | |
| 432 | /* Allow Gen2 mode after the link is up. */ |
| 433 | tmp = readl(pp->dbi_base + PCIE_RC_LCR); |
| 434 | tmp &= ~PCIE_RC_LCR_MAX_LINK_SPEEDS_MASK; |
| 435 | tmp |= PCIE_RC_LCR_MAX_LINK_SPEEDS_GEN2; |
| 436 | writel(tmp, pp->dbi_base + PCIE_RC_LCR); |
| 437 | |
| 438 | /* |
| 439 | * Start Directed Speed Change so the best possible speed both link |
| 440 | * partners support can be negotiated. |
| 441 | */ |
| 442 | tmp = readl(pp->dbi_base + PCIE_LINK_WIDTH_SPEED_CONTROL); |
| 443 | tmp |= PORT_LOGIC_SPEED_CHANGE; |
| 444 | writel(tmp, pp->dbi_base + PCIE_LINK_WIDTH_SPEED_CONTROL); |
| 445 | |
Troy Kisky | a042746 | 2015-06-12 14:30:16 -0500 | [diff] [blame] | 446 | ret = imx6_pcie_wait_for_speed_change(pp); |
| 447 | if (ret) { |
| 448 | dev_err(pp->dev, "Failed to bring link up!\n"); |
Lucas Stach | 54a47a8 | 2016-01-25 16:49:53 -0600 | [diff] [blame] | 449 | goto err_reset_phy; |
Marek Vasut | fa33a6d | 2013-12-12 22:50:02 +0100 | [diff] [blame] | 450 | } |
| 451 | |
| 452 | /* Make sure link training is finished as well! */ |
Troy Kisky | a042746 | 2015-06-12 14:30:16 -0500 | [diff] [blame] | 453 | ret = imx6_pcie_wait_for_link(pp); |
Marek Vasut | fa33a6d | 2013-12-12 22:50:02 +0100 | [diff] [blame] | 454 | if (ret) { |
| 455 | dev_err(pp->dev, "Failed to bring link up!\n"); |
Lucas Stach | 54a47a8 | 2016-01-25 16:49:53 -0600 | [diff] [blame] | 456 | goto err_reset_phy; |
Marek Vasut | fa33a6d | 2013-12-12 22:50:02 +0100 | [diff] [blame] | 457 | } |
| 458 | |
Bjorn Helgaas | 2393f79 | 2015-06-12 17:27:43 -0500 | [diff] [blame] | 459 | tmp = readl(pp->dbi_base + PCIE_RC_LCSR); |
Troy Kisky | a042746 | 2015-06-12 14:30:16 -0500 | [diff] [blame] | 460 | dev_dbg(pp->dev, "Link up, Gen=%i\n", (tmp >> 16) & 0xf); |
Lucas Stach | 54a47a8 | 2016-01-25 16:49:53 -0600 | [diff] [blame] | 461 | |
Troy Kisky | a042746 | 2015-06-12 14:30:16 -0500 | [diff] [blame] | 462 | return 0; |
Lucas Stach | 54a47a8 | 2016-01-25 16:49:53 -0600 | [diff] [blame] | 463 | |
| 464 | err_reset_phy: |
| 465 | dev_dbg(pp->dev, "PHY DEBUG_R0=0x%08x DEBUG_R1=0x%08x\n", |
| 466 | readl(pp->dbi_base + PCIE_PHY_DEBUG_R0), |
| 467 | readl(pp->dbi_base + PCIE_PHY_DEBUG_R1)); |
| 468 | imx6_pcie_reset_phy(pp); |
| 469 | |
| 470 | return ret; |
Marek Vasut | fa33a6d | 2013-12-12 22:50:02 +0100 | [diff] [blame] | 471 | } |
| 472 | |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 473 | static void imx6_pcie_host_init(struct pcie_port *pp) |
| 474 | { |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 475 | imx6_pcie_assert_core_reset(pp); |
| 476 | |
| 477 | imx6_pcie_init_phy(pp); |
| 478 | |
| 479 | imx6_pcie_deassert_core_reset(pp); |
| 480 | |
| 481 | dw_pcie_setup_rc(pp); |
| 482 | |
Bjorn Helgaas | fd5da20 | 2015-06-02 16:16:44 -0500 | [diff] [blame] | 483 | imx6_pcie_establish_link(pp); |
Lucas Stach | d1dc974 | 2014-03-28 17:52:59 +0100 | [diff] [blame] | 484 | |
| 485 | if (IS_ENABLED(CONFIG_PCI_MSI)) |
| 486 | dw_pcie_msi_init(pp); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 487 | } |
| 488 | |
| 489 | static int imx6_pcie_link_up(struct pcie_port *pp) |
| 490 | { |
Lucas Stach | 4d107d3 | 2016-01-25 16:50:02 -0600 | [diff] [blame] | 491 | return readl(pp->dbi_base + PCIE_PHY_DEBUG_R1) & |
| 492 | PCIE_PHY_DEBUG_R1_XMLH_LINK_UP; |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 493 | } |
| 494 | |
| 495 | static struct pcie_host_ops imx6_pcie_host_ops = { |
| 496 | .link_up = imx6_pcie_link_up, |
| 497 | .host_init = imx6_pcie_host_init, |
| 498 | }; |
| 499 | |
Sachin Kamat | 44cb5e9 | 2014-05-30 12:08:48 +0530 | [diff] [blame] | 500 | static int __init imx6_add_pcie_port(struct pcie_port *pp, |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 501 | struct platform_device *pdev) |
| 502 | { |
| 503 | int ret; |
| 504 | |
Lucas Stach | d1dc974 | 2014-03-28 17:52:59 +0100 | [diff] [blame] | 505 | if (IS_ENABLED(CONFIG_PCI_MSI)) { |
| 506 | pp->msi_irq = platform_get_irq_byname(pdev, "msi"); |
| 507 | if (pp->msi_irq <= 0) { |
| 508 | dev_err(&pdev->dev, "failed to get MSI irq\n"); |
| 509 | return -ENODEV; |
| 510 | } |
| 511 | |
| 512 | ret = devm_request_irq(&pdev->dev, pp->msi_irq, |
Jingoo Han | d88a7ef | 2014-11-12 12:25:09 +0900 | [diff] [blame] | 513 | imx6_pcie_msi_handler, |
Grygorii Strashko | 8ff0ef9 | 2015-12-10 21:18:20 +0200 | [diff] [blame] | 514 | IRQF_SHARED | IRQF_NO_THREAD, |
| 515 | "mx6-pcie-msi", pp); |
Lucas Stach | d1dc974 | 2014-03-28 17:52:59 +0100 | [diff] [blame] | 516 | if (ret) { |
| 517 | dev_err(&pdev->dev, "failed to request MSI irq\n"); |
Fabio Estevam | 89b2d4f | 2015-09-11 09:08:52 -0300 | [diff] [blame] | 518 | return ret; |
Lucas Stach | d1dc974 | 2014-03-28 17:52:59 +0100 | [diff] [blame] | 519 | } |
| 520 | } |
| 521 | |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 522 | pp->root_bus_nr = -1; |
| 523 | pp->ops = &imx6_pcie_host_ops; |
| 524 | |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 525 | ret = dw_pcie_host_init(pp); |
| 526 | if (ret) { |
| 527 | dev_err(&pdev->dev, "failed to initialize host\n"); |
| 528 | return ret; |
| 529 | } |
| 530 | |
| 531 | return 0; |
| 532 | } |
| 533 | |
| 534 | static int __init imx6_pcie_probe(struct platform_device *pdev) |
| 535 | { |
| 536 | struct imx6_pcie *imx6_pcie; |
| 537 | struct pcie_port *pp; |
Fabio Estevam | b2d7a9c | 2016-03-28 18:45:36 -0300 | [diff] [blame] | 538 | struct device_node *np = pdev->dev.of_node; |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 539 | struct resource *dbi_base; |
Justin Waters | 28e3abe | 2016-01-15 10:24:35 -0500 | [diff] [blame] | 540 | struct device_node *node = pdev->dev.of_node; |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 541 | int ret; |
| 542 | |
| 543 | imx6_pcie = devm_kzalloc(&pdev->dev, sizeof(*imx6_pcie), GFP_KERNEL); |
| 544 | if (!imx6_pcie) |
| 545 | return -ENOMEM; |
| 546 | |
| 547 | pp = &imx6_pcie->pp; |
| 548 | pp->dev = &pdev->dev; |
| 549 | |
| 550 | /* Added for PCI abort handling */ |
| 551 | hook_fault_code(16 + 6, imx6q_pcie_abort_handler, SIGBUS, 0, |
| 552 | "imprecise external abort"); |
| 553 | |
| 554 | dbi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 555 | pp->dbi_base = devm_ioremap_resource(&pdev->dev, dbi_base); |
Fabio Estevam | b391bf3 | 2013-12-02 01:39:35 -0200 | [diff] [blame] | 556 | if (IS_ERR(pp->dbi_base)) |
| 557 | return PTR_ERR(pp->dbi_base); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 558 | |
| 559 | /* Fetch GPIOs */ |
Fabio Estevam | b2d7a9c | 2016-03-28 18:45:36 -0300 | [diff] [blame] | 560 | imx6_pcie->reset_gpio = of_get_named_gpio(np, "reset-gpio", 0); |
| 561 | if (gpio_is_valid(imx6_pcie->reset_gpio)) { |
| 562 | ret = devm_gpio_request_one(&pdev->dev, imx6_pcie->reset_gpio, |
| 563 | GPIOF_OUT_INIT_LOW, "PCIe reset"); |
| 564 | if (ret) { |
| 565 | dev_err(&pdev->dev, "unable to get reset gpio\n"); |
| 566 | return ret; |
| 567 | } |
| 568 | } |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 569 | |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 570 | /* Fetch clocks */ |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 571 | imx6_pcie->pcie_phy = devm_clk_get(&pdev->dev, "pcie_phy"); |
| 572 | if (IS_ERR(imx6_pcie->pcie_phy)) { |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 573 | dev_err(&pdev->dev, |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 574 | "pcie_phy clock source missing or invalid\n"); |
| 575 | return PTR_ERR(imx6_pcie->pcie_phy); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 576 | } |
| 577 | |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 578 | imx6_pcie->pcie_bus = devm_clk_get(&pdev->dev, "pcie_bus"); |
| 579 | if (IS_ERR(imx6_pcie->pcie_bus)) { |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 580 | dev_err(&pdev->dev, |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 581 | "pcie_bus clock source missing or invalid\n"); |
| 582 | return PTR_ERR(imx6_pcie->pcie_bus); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 583 | } |
| 584 | |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 585 | imx6_pcie->pcie = devm_clk_get(&pdev->dev, "pcie"); |
| 586 | if (IS_ERR(imx6_pcie->pcie)) { |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 587 | dev_err(&pdev->dev, |
Lucas Stach | 5752613 | 2014-03-28 17:52:55 +0100 | [diff] [blame] | 588 | "pcie clock source missing or invalid\n"); |
| 589 | return PTR_ERR(imx6_pcie->pcie); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 590 | } |
| 591 | |
| 592 | /* Grab GPR config register range */ |
| 593 | imx6_pcie->iomuxc_gpr = |
| 594 | syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); |
| 595 | if (IS_ERR(imx6_pcie->iomuxc_gpr)) { |
| 596 | dev_err(&pdev->dev, "unable to find iomuxc registers\n"); |
Fabio Estevam | b391bf3 | 2013-12-02 01:39:35 -0200 | [diff] [blame] | 597 | return PTR_ERR(imx6_pcie->iomuxc_gpr); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 598 | } |
| 599 | |
Justin Waters | 28e3abe | 2016-01-15 10:24:35 -0500 | [diff] [blame] | 600 | /* Grab PCIe PHY Tx Settings */ |
| 601 | if (of_property_read_u32(node, "fsl,tx-deemph-gen1", |
| 602 | &imx6_pcie->tx_deemph_gen1)) |
| 603 | imx6_pcie->tx_deemph_gen1 = 0; |
| 604 | |
| 605 | if (of_property_read_u32(node, "fsl,tx-deemph-gen2-3p5db", |
| 606 | &imx6_pcie->tx_deemph_gen2_3p5db)) |
| 607 | imx6_pcie->tx_deemph_gen2_3p5db = 0; |
| 608 | |
| 609 | if (of_property_read_u32(node, "fsl,tx-deemph-gen2-6db", |
| 610 | &imx6_pcie->tx_deemph_gen2_6db)) |
| 611 | imx6_pcie->tx_deemph_gen2_6db = 20; |
| 612 | |
| 613 | if (of_property_read_u32(node, "fsl,tx-swing-full", |
| 614 | &imx6_pcie->tx_swing_full)) |
| 615 | imx6_pcie->tx_swing_full = 127; |
| 616 | |
| 617 | if (of_property_read_u32(node, "fsl,tx-swing-low", |
| 618 | &imx6_pcie->tx_swing_low)) |
| 619 | imx6_pcie->tx_swing_low = 127; |
| 620 | |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 621 | ret = imx6_add_pcie_port(pp, pdev); |
| 622 | if (ret < 0) |
Fabio Estevam | b391bf3 | 2013-12-02 01:39:35 -0200 | [diff] [blame] | 623 | return ret; |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 624 | |
| 625 | platform_set_drvdata(pdev, imx6_pcie); |
| 626 | return 0; |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 627 | } |
| 628 | |
Lucas Stach | 3e3e406 | 2014-07-31 20:16:05 +0200 | [diff] [blame] | 629 | static void imx6_pcie_shutdown(struct platform_device *pdev) |
| 630 | { |
| 631 | struct imx6_pcie *imx6_pcie = platform_get_drvdata(pdev); |
| 632 | |
| 633 | /* bring down link, so bootloader gets clean state in case of reboot */ |
| 634 | imx6_pcie_assert_core_reset(&imx6_pcie->pp); |
| 635 | } |
| 636 | |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 637 | static const struct of_device_id imx6_pcie_of_match[] = { |
| 638 | { .compatible = "fsl,imx6q-pcie", }, |
| 639 | {}, |
| 640 | }; |
| 641 | MODULE_DEVICE_TABLE(of, imx6_pcie_of_match); |
| 642 | |
| 643 | static struct platform_driver imx6_pcie_driver = { |
| 644 | .driver = { |
| 645 | .name = "imx6q-pcie", |
Sachin Kamat | 8bcadbe | 2013-10-21 14:36:41 +0530 | [diff] [blame] | 646 | .of_match_table = imx6_pcie_of_match, |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 647 | }, |
Lucas Stach | 3e3e406 | 2014-07-31 20:16:05 +0200 | [diff] [blame] | 648 | .shutdown = imx6_pcie_shutdown, |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 649 | }; |
| 650 | |
| 651 | /* Freescale PCIe driver does not allow module unload */ |
| 652 | |
| 653 | static int __init imx6_pcie_init(void) |
| 654 | { |
| 655 | return platform_driver_probe(&imx6_pcie_driver, imx6_pcie_probe); |
| 656 | } |
Lucas Stach | 61da50d | 2014-09-05 09:36:48 -0600 | [diff] [blame] | 657 | module_init(imx6_pcie_init); |
Sean Cross | bb38919 | 2013-09-26 11:24:47 +0800 | [diff] [blame] | 658 | |
| 659 | MODULE_AUTHOR("Sean Cross <xobs@kosagi.com>"); |
| 660 | MODULE_DESCRIPTION("Freescale i.MX6 PCIe host controller driver"); |
| 661 | MODULE_LICENSE("GPL v2"); |