blob: 1a35fae5c3a8baaa4812070ca5e884bf21df1dba [file] [log] [blame]
Shawn Linc0649da2021-01-15 18:01:22 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Rockchip DesignWare based PCIe host controller driver
4 *
5 * Copyright (c) 2021 Rockchip, Inc.
6 */
7
8#include <common.h>
9#include <clk.h>
10#include <dm.h>
11#include <generic-phy.h>
12#include <pci.h>
13#include <power-domain.h>
14#include <reset.h>
15#include <syscon.h>
16#include <asm/arch-rockchip/clock.h>
Simon Glass3ba929a2020-10-30 21:38:53 -060017#include <asm/global_data.h>
Shawn Linc0649da2021-01-15 18:01:22 +080018#include <asm/io.h>
19#include <asm-generic/gpio.h>
20#include <dm/device_compat.h>
21#include <linux/iopoll.h>
22#include <linux/delay.h>
23#include <power/regulator.h>
24
Neil Armstrongcf214c62021-03-25 15:49:20 +010025#include "pcie_dw_common.h"
26
Shawn Linc0649da2021-01-15 18:01:22 +080027DECLARE_GLOBAL_DATA_PTR;
28
29/**
30 * struct rk_pcie - RK DW PCIe controller state
31 *
32 * @vpcie3v3: The 3.3v power supply for slot
Shawn Linc0649da2021-01-15 18:01:22 +080033 * @apb_base: The base address of vendor regs
Shawn Linc0649da2021-01-15 18:01:22 +080034 * @rst_gpio: The #PERST signal for slot
Shawn Linc0649da2021-01-15 18:01:22 +080035 */
36struct rk_pcie {
Neil Armstrongcf214c62021-03-25 15:49:20 +010037 /* Must be first member of the struct */
38 struct pcie_dw dw;
Shawn Linc0649da2021-01-15 18:01:22 +080039 struct udevice *vpcie3v3;
Shawn Linc0649da2021-01-15 18:01:22 +080040 void *apb_base;
Shawn Linc0649da2021-01-15 18:01:22 +080041 struct phy phy;
42 struct clk_bulk clks;
Shawn Linc0649da2021-01-15 18:01:22 +080043 struct reset_ctl_bulk rsts;
44 struct gpio_desc rst_gpio;
Jon Lin793de192023-04-27 10:35:33 +030045 u32 gen;
Shawn Linc0649da2021-01-15 18:01:22 +080046};
47
48/* Parameters for the waiting for iATU enabled routine */
49#define PCIE_CLIENT_GENERAL_DEBUG 0x104
50#define PCIE_CLIENT_HOT_RESET_CTRL 0x180
51#define PCIE_LTSSM_ENABLE_ENHANCE BIT(4)
52#define PCIE_CLIENT_LTSSM_STATUS 0x300
53#define SMLH_LINKUP BIT(16)
54#define RDLH_LINKUP BIT(17)
55#define PCIE_CLIENT_DBG_FIFO_MODE_CON 0x310
56#define PCIE_CLIENT_DBG_FIFO_PTN_HIT_D0 0x320
57#define PCIE_CLIENT_DBG_FIFO_PTN_HIT_D1 0x324
58#define PCIE_CLIENT_DBG_FIFO_TRN_HIT_D0 0x328
59#define PCIE_CLIENT_DBG_FIFO_TRN_HIT_D1 0x32c
60#define PCIE_CLIENT_DBG_FIFO_STATUS 0x350
61#define PCIE_CLIENT_DBG_TRANSITION_DATA 0xffff0000
62#define PCIE_CLIENT_DBF_EN 0xffff0003
63
Jon Lin97be1652023-07-22 13:30:20 +000064#define PCIE_TYPE0_HDR_DBI2_OFFSET 0x100000
65
Shawn Linc0649da2021-01-15 18:01:22 +080066static int rk_pcie_read(void __iomem *addr, int size, u32 *val)
67{
68 if ((uintptr_t)addr & (size - 1)) {
69 *val = 0;
Anand Moone4e87452021-06-05 14:38:41 +000070 return -EOPNOTSUPP;
Shawn Linc0649da2021-01-15 18:01:22 +080071 }
72
73 if (size == 4) {
74 *val = readl(addr);
75 } else if (size == 2) {
76 *val = readw(addr);
77 } else if (size == 1) {
78 *val = readb(addr);
79 } else {
80 *val = 0;
81 return -ENODEV;
82 }
83
84 return 0;
85}
86
87static int rk_pcie_write(void __iomem *addr, int size, u32 val)
88{
89 if ((uintptr_t)addr & (size - 1))
Anand Moone4e87452021-06-05 14:38:41 +000090 return -EOPNOTSUPP;
Shawn Linc0649da2021-01-15 18:01:22 +080091
92 if (size == 4)
93 writel(val, addr);
94 else if (size == 2)
95 writew(val, addr);
96 else if (size == 1)
97 writeb(val, addr);
98 else
99 return -ENODEV;
100
101 return 0;
102}
103
104static u32 __rk_pcie_read_apb(struct rk_pcie *rk_pcie, void __iomem *base,
105 u32 reg, size_t size)
106{
107 int ret;
108 u32 val;
109
110 ret = rk_pcie_read(base + reg, size, &val);
111 if (ret)
Neil Armstrongcf214c62021-03-25 15:49:20 +0100112 dev_err(rk_pcie->dw.dev, "Read APB address failed\n");
Shawn Linc0649da2021-01-15 18:01:22 +0800113
114 return val;
115}
116
117static void __rk_pcie_write_apb(struct rk_pcie *rk_pcie, void __iomem *base,
118 u32 reg, size_t size, u32 val)
119{
120 int ret;
121
122 ret = rk_pcie_write(base + reg, size, val);
123 if (ret)
Neil Armstrongcf214c62021-03-25 15:49:20 +0100124 dev_err(rk_pcie->dw.dev, "Write APB address failed\n");
Shawn Linc0649da2021-01-15 18:01:22 +0800125}
126
127/**
128 * rk_pcie_readl_apb() - Read vendor regs
129 *
130 * @rk_pcie: Pointer to the PCI controller state
131 * @reg: Offset of regs
132 */
133static inline u32 rk_pcie_readl_apb(struct rk_pcie *rk_pcie, u32 reg)
134{
135 return __rk_pcie_read_apb(rk_pcie, rk_pcie->apb_base, reg, 0x4);
136}
137
138/**
139 * rk_pcie_writel_apb() - Write vendor regs
140 *
141 * @rk_pcie: Pointer to the PCI controller state
142 * @reg: Offset of regs
143 * @val: Value to be writen
144 */
145static inline void rk_pcie_writel_apb(struct rk_pcie *rk_pcie, u32 reg,
146 u32 val)
147{
148 __rk_pcie_write_apb(rk_pcie, rk_pcie->apb_base, reg, 0x4, val);
149}
150
Shawn Linc0649da2021-01-15 18:01:22 +0800151/**
152 * rk_pcie_configure() - Configure link capabilities and speed
153 *
154 * @rk_pcie: Pointer to the PCI controller state
155 * @cap_speed: The capabilities and speed to configure
156 *
157 * Configure the link capabilities and speed in the PCIe root complex.
158 */
159static void rk_pcie_configure(struct rk_pcie *pci, u32 cap_speed)
160{
Neil Armstrongcf214c62021-03-25 15:49:20 +0100161 dw_pcie_dbi_write_enable(&pci->dw, true);
Shawn Linc0649da2021-01-15 18:01:22 +0800162
Jon Lin97be1652023-07-22 13:30:20 +0000163 /* Disable BAR 0 and BAR 1 */
164 writel(0, pci->dw.dbi_base + PCIE_TYPE0_HDR_DBI2_OFFSET +
165 PCI_BASE_ADDRESS_0);
166 writel(0, pci->dw.dbi_base + PCIE_TYPE0_HDR_DBI2_OFFSET +
167 PCI_BASE_ADDRESS_1);
168
Neil Armstrongcf214c62021-03-25 15:49:20 +0100169 clrsetbits_le32(pci->dw.dbi_base + PCIE_LINK_CAPABILITY,
Shawn Linc0649da2021-01-15 18:01:22 +0800170 TARGET_LINK_SPEED_MASK, cap_speed);
171
Neil Armstrongcf214c62021-03-25 15:49:20 +0100172 clrsetbits_le32(pci->dw.dbi_base + PCIE_LINK_CTL_2,
Shawn Linc0649da2021-01-15 18:01:22 +0800173 TARGET_LINK_SPEED_MASK, cap_speed);
174
Neil Armstrongcf214c62021-03-25 15:49:20 +0100175 dw_pcie_dbi_write_enable(&pci->dw, false);
Shawn Linc0649da2021-01-15 18:01:22 +0800176}
177
Shawn Linc0649da2021-01-15 18:01:22 +0800178static void rk_pcie_enable_debug(struct rk_pcie *rk_pcie)
179{
180 rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_DBG_FIFO_PTN_HIT_D0,
181 PCIE_CLIENT_DBG_TRANSITION_DATA);
182 rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_DBG_FIFO_PTN_HIT_D1,
183 PCIE_CLIENT_DBG_TRANSITION_DATA);
184 rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_DBG_FIFO_TRN_HIT_D0,
185 PCIE_CLIENT_DBG_TRANSITION_DATA);
186 rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_DBG_FIFO_TRN_HIT_D1,
187 PCIE_CLIENT_DBG_TRANSITION_DATA);
188 rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_DBG_FIFO_MODE_CON,
189 PCIE_CLIENT_DBF_EN);
190}
191
192static void rk_pcie_debug_dump(struct rk_pcie *rk_pcie)
193{
194 u32 loop;
195
196 debug("ltssm = 0x%x\n",
197 rk_pcie_readl_apb(rk_pcie, PCIE_CLIENT_LTSSM_STATUS));
198 for (loop = 0; loop < 64; loop++)
199 debug("fifo_status = 0x%x\n",
200 rk_pcie_readl_apb(rk_pcie, PCIE_CLIENT_DBG_FIFO_STATUS));
201}
202
203static inline void rk_pcie_link_status_clear(struct rk_pcie *rk_pcie)
204{
205 rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_GENERAL_DEBUG, 0x0);
206}
207
208static inline void rk_pcie_disable_ltssm(struct rk_pcie *rk_pcie)
209{
210 rk_pcie_writel_apb(rk_pcie, 0x0, 0xc0008);
211}
212
213static inline void rk_pcie_enable_ltssm(struct rk_pcie *rk_pcie)
214{
215 rk_pcie_writel_apb(rk_pcie, 0x0, 0xc000c);
216}
217
218static int is_link_up(struct rk_pcie *priv)
219{
220 u32 val;
221
222 val = rk_pcie_readl_apb(priv, PCIE_CLIENT_LTSSM_STATUS);
223 if ((val & (RDLH_LINKUP | SMLH_LINKUP)) == 0x30000 &&
224 (val & GENMASK(5, 0)) == 0x11)
225 return 1;
226
227 return 0;
228}
229
230/**
231 * rk_pcie_link_up() - Wait for the link to come up
232 *
233 * @rk_pcie: Pointer to the PCI controller state
234 * @cap_speed: Desired link speed
235 *
236 * Return: 1 (true) for active line and negetive (false) for no link (timeout)
237 */
238static int rk_pcie_link_up(struct rk_pcie *priv, u32 cap_speed)
239{
240 int retries;
241
242 if (is_link_up(priv)) {
243 printf("PCI Link already up before configuration!\n");
244 return 1;
245 }
246
247 /* DW pre link configurations */
248 rk_pcie_configure(priv, cap_speed);
249
Shawn Linc0649da2021-01-15 18:01:22 +0800250 rk_pcie_disable_ltssm(priv);
251 rk_pcie_link_status_clear(priv);
252 rk_pcie_enable_debug(priv);
253
Jonas Karlman64942b72023-07-22 13:30:19 +0000254 /* Reset the device */
255 if (dm_gpio_is_valid(&priv->rst_gpio))
256 dm_gpio_set_value(&priv->rst_gpio, 0);
257
Shawn Linc0649da2021-01-15 18:01:22 +0800258 /* Enable LTSSM */
259 rk_pcie_enable_ltssm(priv);
260
Jonas Karlman64942b72023-07-22 13:30:19 +0000261 /*
262 * PCIe requires the refclk to be stable for 100ms prior to releasing
263 * PERST. See table 2-4 in section 2.6.2 AC Specifications of the PCI
264 * Express Card Electromechanical Specification, 1.1. However, we don't
265 * know if the refclk is coming from RC's PHY or external OSC. If it's
266 * from RC, so enabling LTSSM is the just right place to release #PERST.
267 */
268 mdelay(100);
269 if (dm_gpio_is_valid(&priv->rst_gpio))
270 dm_gpio_set_value(&priv->rst_gpio, 1);
271
272 /* Check if the link is up or not */
273 for (retries = 0; retries < 10; retries++) {
274 if (is_link_up(priv))
275 break;
276
277 mdelay(100);
278 }
Shawn Linc0649da2021-01-15 18:01:22 +0800279
Jonas Karlman64942b72023-07-22 13:30:19 +0000280 if (retries >= 10) {
281 dev_err(priv->dw.dev, "PCIe-%d Link Fail\n",
282 dev_seq(priv->dw.dev));
283 return -EIO;
Shawn Linc0649da2021-01-15 18:01:22 +0800284 }
285
Jonas Karlman64942b72023-07-22 13:30:19 +0000286 dev_info(priv->dw.dev, "PCIe Link up, LTSSM is 0x%x\n",
287 rk_pcie_readl_apb(priv, PCIE_CLIENT_LTSSM_STATUS));
288 rk_pcie_debug_dump(priv);
289 return 0;
Shawn Linc0649da2021-01-15 18:01:22 +0800290}
291
292static int rockchip_pcie_init_port(struct udevice *dev)
293{
294 int ret;
295 u32 val;
296 struct rk_pcie *priv = dev_get_priv(dev);
297
Jonas Karlman64942b72023-07-22 13:30:19 +0000298 ret = reset_assert_bulk(&priv->rsts);
299 if (ret) {
300 dev_err(dev, "failed to assert resets (ret=%d)\n", ret);
301 return ret;
302 }
303
Shawn Linc0649da2021-01-15 18:01:22 +0800304 /* Set power and maybe external ref clk input */
Jonas Karlman39993bc2023-07-22 13:30:18 +0000305 ret = regulator_set_enable_if_allowed(priv->vpcie3v3, true);
306 if (ret && ret != -ENOSYS) {
307 dev_err(dev, "failed to enable vpcie3v3 (ret=%d)\n", ret);
308 return ret;
Shawn Linc0649da2021-01-15 18:01:22 +0800309 }
310
Shawn Linc0649da2021-01-15 18:01:22 +0800311 ret = generic_phy_init(&priv->phy);
312 if (ret) {
313 dev_err(dev, "failed to init phy (ret=%d)\n", ret);
Jonas Karlman39993bc2023-07-22 13:30:18 +0000314 goto err_disable_regulator;
Shawn Linc0649da2021-01-15 18:01:22 +0800315 }
316
317 ret = generic_phy_power_on(&priv->phy);
318 if (ret) {
319 dev_err(dev, "failed to power on phy (ret=%d)\n", ret);
320 goto err_exit_phy;
321 }
322
323 ret = reset_deassert_bulk(&priv->rsts);
324 if (ret) {
325 dev_err(dev, "failed to deassert resets (ret=%d)\n", ret);
326 goto err_power_off_phy;
327 }
328
329 ret = clk_enable_bulk(&priv->clks);
330 if (ret) {
331 dev_err(dev, "failed to enable clks (ret=%d)\n", ret);
332 goto err_deassert_bulk;
333 }
334
335 /* LTSSM EN ctrl mode */
336 val = rk_pcie_readl_apb(priv, PCIE_CLIENT_HOT_RESET_CTRL);
337 val |= PCIE_LTSSM_ENABLE_ENHANCE | (PCIE_LTSSM_ENABLE_ENHANCE << 16);
338 rk_pcie_writel_apb(priv, PCIE_CLIENT_HOT_RESET_CTRL, val);
339
340 /* Set RC mode */
341 rk_pcie_writel_apb(priv, 0x0, 0xf00040);
Neil Armstrongcf214c62021-03-25 15:49:20 +0100342 pcie_dw_setup_host(&priv->dw);
Shawn Linc0649da2021-01-15 18:01:22 +0800343
Jon Lin793de192023-04-27 10:35:33 +0300344 ret = rk_pcie_link_up(priv, priv->gen);
Shawn Linc0649da2021-01-15 18:01:22 +0800345 if (ret < 0)
346 goto err_link_up;
347
348 return 0;
349err_link_up:
350 clk_disable_bulk(&priv->clks);
351err_deassert_bulk:
352 reset_assert_bulk(&priv->rsts);
353err_power_off_phy:
354 generic_phy_power_off(&priv->phy);
355err_exit_phy:
356 generic_phy_exit(&priv->phy);
Jonas Karlman39993bc2023-07-22 13:30:18 +0000357err_disable_regulator:
358 regulator_set_enable_if_allowed(priv->vpcie3v3, false);
Shawn Linc0649da2021-01-15 18:01:22 +0800359
360 return ret;
361}
362
363static int rockchip_pcie_parse_dt(struct udevice *dev)
364{
365 struct rk_pcie *priv = dev_get_priv(dev);
366 int ret;
367
Johan Jonker5ff88122023-03-13 01:31:49 +0100368 priv->dw.dbi_base = dev_read_addr_index_ptr(dev, 0);
Neil Armstrongcf214c62021-03-25 15:49:20 +0100369 if (!priv->dw.dbi_base)
Johan Jonker5ff88122023-03-13 01:31:49 +0100370 return -EINVAL;
Shawn Linc0649da2021-01-15 18:01:22 +0800371
Neil Armstrongcf214c62021-03-25 15:49:20 +0100372 dev_dbg(dev, "DBI address is 0x%p\n", priv->dw.dbi_base);
Shawn Linc0649da2021-01-15 18:01:22 +0800373
Johan Jonker5ff88122023-03-13 01:31:49 +0100374 priv->apb_base = dev_read_addr_index_ptr(dev, 1);
Shawn Linc0649da2021-01-15 18:01:22 +0800375 if (!priv->apb_base)
Johan Jonker5ff88122023-03-13 01:31:49 +0100376 return -EINVAL;
Shawn Linc0649da2021-01-15 18:01:22 +0800377
378 dev_dbg(dev, "APB address is 0x%p\n", priv->apb_base);
379
Jonas Karlman8746d9c2023-07-22 13:30:16 +0000380 priv->dw.cfg_base = dev_read_addr_size_index_ptr(dev, 2,
381 &priv->dw.cfg_size);
382 if (!priv->dw.cfg_base)
383 return -EINVAL;
384
385 dev_dbg(dev, "CFG address is 0x%p\n", priv->dw.cfg_base);
386
Shawn Linc0649da2021-01-15 18:01:22 +0800387 ret = gpio_request_by_name(dev, "reset-gpios", 0,
388 &priv->rst_gpio, GPIOD_IS_OUT);
389 if (ret) {
390 dev_err(dev, "failed to find reset-gpios property\n");
391 return ret;
392 }
393
394 ret = reset_get_bulk(dev, &priv->rsts);
395 if (ret) {
396 dev_err(dev, "Can't get reset: %d\n", ret);
Eugen Hristev32a51032023-04-13 17:11:03 +0300397 goto rockchip_pcie_parse_dt_err_reset_get_bulk;
Shawn Linc0649da2021-01-15 18:01:22 +0800398 }
399
400 ret = clk_get_bulk(dev, &priv->clks);
401 if (ret) {
402 dev_err(dev, "Can't get clock: %d\n", ret);
Eugen Hristev32a51032023-04-13 17:11:03 +0300403 goto rockchip_pcie_parse_dt_err_clk_get_bulk;
Shawn Linc0649da2021-01-15 18:01:22 +0800404 }
405
406 ret = device_get_supply_regulator(dev, "vpcie3v3-supply",
407 &priv->vpcie3v3);
408 if (ret && ret != -ENOENT) {
409 dev_err(dev, "failed to get vpcie3v3 supply (ret=%d)\n", ret);
Eugen Hristev32a51032023-04-13 17:11:03 +0300410 goto rockchip_pcie_parse_dt_err_supply_regulator;
Shawn Linc0649da2021-01-15 18:01:22 +0800411 }
412
413 ret = generic_phy_get_by_index(dev, 0, &priv->phy);
414 if (ret) {
415 dev_err(dev, "failed to get pcie phy (ret=%d)\n", ret);
Eugen Hristev32a51032023-04-13 17:11:03 +0300416 goto rockchip_pcie_parse_dt_err_phy_get_by_index;
Shawn Linc0649da2021-01-15 18:01:22 +0800417 }
418
Jon Lin793de192023-04-27 10:35:33 +0300419 priv->gen = dev_read_u32_default(dev, "max-link-speed",
420 LINK_SPEED_GEN_3);
421
Shawn Linc0649da2021-01-15 18:01:22 +0800422 return 0;
Eugen Hristev32a51032023-04-13 17:11:03 +0300423
424rockchip_pcie_parse_dt_err_phy_get_by_index:
425 /* regulators don't need release */
426rockchip_pcie_parse_dt_err_supply_regulator:
427 clk_release_bulk(&priv->clks);
428rockchip_pcie_parse_dt_err_clk_get_bulk:
429 reset_release_bulk(&priv->rsts);
430rockchip_pcie_parse_dt_err_reset_get_bulk:
431 dm_gpio_free(dev, &priv->rst_gpio);
432 return ret;
Shawn Linc0649da2021-01-15 18:01:22 +0800433}
434
435/**
436 * rockchip_pcie_probe() - Probe the PCIe bus for active link
437 *
438 * @dev: A pointer to the device being operated on
439 *
440 * Probe for an active link on the PCIe bus and configure the controller
441 * to enable this port.
442 *
443 * Return: 0 on success, else -ENODEV
444 */
445static int rockchip_pcie_probe(struct udevice *dev)
446{
447 struct rk_pcie *priv = dev_get_priv(dev);
448 struct udevice *ctlr = pci_get_controller(dev);
449 struct pci_controller *hose = dev_get_uclass_priv(ctlr);
Neil Armstrongcf214c62021-03-25 15:49:20 +0100450 int ret = 0;
Shawn Linc0649da2021-01-15 18:01:22 +0800451
Neil Armstrongcf214c62021-03-25 15:49:20 +0100452 priv->dw.first_busno = dev_seq(dev);
453 priv->dw.dev = dev;
Shawn Linc0649da2021-01-15 18:01:22 +0800454
455 ret = rockchip_pcie_parse_dt(dev);
456 if (ret)
457 return ret;
458
459 ret = rockchip_pcie_init_port(dev);
460 if (ret)
Eugen Hristev32a51032023-04-13 17:11:03 +0300461 goto rockchip_pcie_probe_err_init_port;
Shawn Linc0649da2021-01-15 18:01:22 +0800462
463 dev_info(dev, "PCIE-%d: Link up (Gen%d-x%d, Bus%d)\n",
Neil Armstrongcf214c62021-03-25 15:49:20 +0100464 dev_seq(dev), pcie_dw_get_link_speed(&priv->dw),
465 pcie_dw_get_link_width(&priv->dw),
Shawn Linc0649da2021-01-15 18:01:22 +0800466 hose->first_busno);
467
Eugen Hristev32a51032023-04-13 17:11:03 +0300468
469 ret = pcie_dw_prog_outbound_atu_unroll(&priv->dw,
470 PCIE_ATU_REGION_INDEX0,
471 PCIE_ATU_TYPE_MEM,
472 priv->dw.mem.phys_start,
473 priv->dw.mem.bus_start,
474 priv->dw.mem.size);
475 if (!ret)
476 return ret;
477
478rockchip_pcie_probe_err_init_port:
479 clk_release_bulk(&priv->clks);
480 reset_release_bulk(&priv->rsts);
481 dm_gpio_free(dev, &priv->rst_gpio);
Shawn Linc0649da2021-01-15 18:01:22 +0800482
Eugen Hristev32a51032023-04-13 17:11:03 +0300483 return ret;
Shawn Linc0649da2021-01-15 18:01:22 +0800484}
485
486static const struct dm_pci_ops rockchip_pcie_ops = {
Neil Armstrongcf214c62021-03-25 15:49:20 +0100487 .read_config = pcie_dw_read_config,
488 .write_config = pcie_dw_write_config,
Shawn Linc0649da2021-01-15 18:01:22 +0800489};
490
491static const struct udevice_id rockchip_pcie_ids[] = {
492 { .compatible = "rockchip,rk3568-pcie" },
Jon Lin2bdea352023-04-27 10:35:32 +0300493 { .compatible = "rockchip,rk3588-pcie" },
Shawn Linc0649da2021-01-15 18:01:22 +0800494 { }
495};
496
497U_BOOT_DRIVER(rockchip_dw_pcie) = {
498 .name = "pcie_dw_rockchip",
499 .id = UCLASS_PCI,
500 .of_match = rockchip_pcie_ids,
501 .ops = &rockchip_pcie_ops,
502 .probe = rockchip_pcie_probe,
503 .priv_auto = sizeof(struct rk_pcie),
504};