Linux Audio

Check our new training course

Loading...
v5.4
  1// SPDX-License-Identifier: GPL-2.0
  2/*
  3 * PCIe host controller driver for Axis ARTPEC-6 SoC
  4 *
  5 * Author: Niklas Cassel <niklas.cassel@axis.com>
  6 *
  7 * Based on work done by Phil Edworthy <phil@edworthys.org>
  8 */
  9
 10#include <linux/delay.h>
 11#include <linux/kernel.h>
 12#include <linux/init.h>
 13#include <linux/of_device.h>
 14#include <linux/pci.h>
 15#include <linux/platform_device.h>
 16#include <linux/resource.h>
 17#include <linux/signal.h>
 18#include <linux/types.h>
 19#include <linux/interrupt.h>
 20#include <linux/mfd/syscon.h>
 21#include <linux/regmap.h>
 22
 23#include "pcie-designware.h"
 24
 25#define to_artpec6_pcie(x)	dev_get_drvdata((x)->dev)
 26
 27enum artpec_pcie_variants {
 28	ARTPEC6,
 29	ARTPEC7,
 30};
 31
 32struct artpec6_pcie {
 33	struct dw_pcie		*pci;
 34	struct regmap		*regmap;	/* DT axis,syscon-pcie */
 35	void __iomem		*phy_base;	/* DT phy */
 36	enum artpec_pcie_variants variant;
 37	enum dw_pcie_device_mode mode;
 38};
 39
 40struct artpec_pcie_of_data {
 41	enum artpec_pcie_variants variant;
 42	enum dw_pcie_device_mode mode;
 43};
 44
 45static const struct of_device_id artpec6_pcie_of_match[];
 46
 47/* PCIe Port Logic registers (memory-mapped) */
 48#define PL_OFFSET			0x700
 49
 50#define ACK_F_ASPM_CTRL_OFF		(PL_OFFSET + 0xc)
 51#define ACK_N_FTS_MASK			GENMASK(15, 8)
 52#define ACK_N_FTS(x)			(((x) << 8) & ACK_N_FTS_MASK)
 53
 54#define FAST_TRAINING_SEQ_MASK		GENMASK(7, 0)
 55#define FAST_TRAINING_SEQ(x)		(((x) << 0) & FAST_TRAINING_SEQ_MASK)
 56
 57/* ARTPEC-6 specific registers */
 58#define PCIECFG				0x18
 59#define  PCIECFG_DBG_OEN		BIT(24)
 60#define  PCIECFG_CORE_RESET_REQ		BIT(21)
 61#define  PCIECFG_LTSSM_ENABLE		BIT(20)
 62#define  PCIECFG_DEVICE_TYPE_MASK	GENMASK(19, 16)
 63#define  PCIECFG_CLKREQ_B		BIT(11)
 64#define  PCIECFG_REFCLK_ENABLE		BIT(10)
 65#define  PCIECFG_PLL_ENABLE		BIT(9)
 66#define  PCIECFG_PCLK_ENABLE		BIT(8)
 67#define  PCIECFG_RISRCREN		BIT(4)
 68#define  PCIECFG_MODE_TX_DRV_EN		BIT(3)
 69#define  PCIECFG_CISRREN		BIT(2)
 70#define  PCIECFG_MACRO_ENABLE		BIT(0)
 71/* ARTPEC-7 specific fields */
 72#define  PCIECFG_REFCLKSEL		BIT(23)
 73#define  PCIECFG_NOC_RESET		BIT(3)
 74
 75#define PCIESTAT			0x1c
 76/* ARTPEC-7 specific fields */
 77#define  PCIESTAT_EXTREFCLK		BIT(3)
 78
 79#define NOCCFG				0x40
 80#define  NOCCFG_ENABLE_CLK_PCIE		BIT(4)
 81#define  NOCCFG_POWER_PCIE_IDLEACK	BIT(3)
 82#define  NOCCFG_POWER_PCIE_IDLE		BIT(2)
 83#define  NOCCFG_POWER_PCIE_IDLEREQ	BIT(1)
 84
 85#define PHY_STATUS			0x118
 86#define  PHY_COSPLLLOCK			BIT(0)
 87
 88#define PHY_TX_ASIC_OUT			0x4040
 89#define  PHY_TX_ASIC_OUT_TX_ACK		BIT(0)
 90
 91#define PHY_RX_ASIC_OUT			0x405c
 92#define  PHY_RX_ASIC_OUT_ACK		BIT(0)
 93
 94static u32 artpec6_pcie_readl(struct artpec6_pcie *artpec6_pcie, u32 offset)
 95{
 96	u32 val;
 97
 98	regmap_read(artpec6_pcie->regmap, offset, &val);
 99	return val;
100}
101
102static void artpec6_pcie_writel(struct artpec6_pcie *artpec6_pcie, u32 offset, u32 val)
103{
104	regmap_write(artpec6_pcie->regmap, offset, val);
105}
106
107static u64 artpec6_pcie_cpu_addr_fixup(struct dw_pcie *pci, u64 pci_addr)
108{
109	struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pci);
110	struct pcie_port *pp = &pci->pp;
111	struct dw_pcie_ep *ep = &pci->ep;
112
113	switch (artpec6_pcie->mode) {
114	case DW_PCIE_RC_TYPE:
115		return pci_addr - pp->cfg0_base;
116	case DW_PCIE_EP_TYPE:
117		return pci_addr - ep->phys_base;
118	default:
119		dev_err(pci->dev, "UNKNOWN device type\n");
120	}
121	return pci_addr;
122}
123
124static int artpec6_pcie_establish_link(struct dw_pcie *pci)
125{
126	struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pci);
127	u32 val;
128
129	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
130	val |= PCIECFG_LTSSM_ENABLE;
131	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
132
133	return 0;
134}
135
136static void artpec6_pcie_stop_link(struct dw_pcie *pci)
137{
138	struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pci);
139	u32 val;
140
141	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
142	val &= ~PCIECFG_LTSSM_ENABLE;
143	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
144}
145
146static const struct dw_pcie_ops dw_pcie_ops = {
147	.cpu_addr_fixup = artpec6_pcie_cpu_addr_fixup,
148	.start_link = artpec6_pcie_establish_link,
149	.stop_link = artpec6_pcie_stop_link,
150};
151
152static void artpec6_pcie_wait_for_phy_a6(struct artpec6_pcie *artpec6_pcie)
153{
154	struct dw_pcie *pci = artpec6_pcie->pci;
155	struct device *dev = pci->dev;
156	u32 val;
157	unsigned int retries;
158
159	retries = 50;
160	do {
161		usleep_range(1000, 2000);
162		val = artpec6_pcie_readl(artpec6_pcie, NOCCFG);
163		retries--;
164	} while (retries &&
165		(val & (NOCCFG_POWER_PCIE_IDLEACK | NOCCFG_POWER_PCIE_IDLE)));
166	if (!retries)
167		dev_err(dev, "PCIe clock manager did not leave idle state\n");
168
169	retries = 50;
170	do {
171		usleep_range(1000, 2000);
172		val = readl(artpec6_pcie->phy_base + PHY_STATUS);
173		retries--;
174	} while (retries && !(val & PHY_COSPLLLOCK));
175	if (!retries)
176		dev_err(dev, "PHY PLL did not lock\n");
177}
178
179static void artpec6_pcie_wait_for_phy_a7(struct artpec6_pcie *artpec6_pcie)
180{
181	struct dw_pcie *pci = artpec6_pcie->pci;
182	struct device *dev = pci->dev;
183	u32 val;
184	u16 phy_status_tx, phy_status_rx;
185	unsigned int retries;
186
187	retries = 50;
188	do {
189		usleep_range(1000, 2000);
190		val = artpec6_pcie_readl(artpec6_pcie, NOCCFG);
191		retries--;
192	} while (retries &&
193		(val & (NOCCFG_POWER_PCIE_IDLEACK | NOCCFG_POWER_PCIE_IDLE)));
194	if (!retries)
195		dev_err(dev, "PCIe clock manager did not leave idle state\n");
196
197	retries = 50;
198	do {
199		usleep_range(1000, 2000);
200		phy_status_tx = readw(artpec6_pcie->phy_base + PHY_TX_ASIC_OUT);
201		phy_status_rx = readw(artpec6_pcie->phy_base + PHY_RX_ASIC_OUT);
202		retries--;
203	} while (retries && ((phy_status_tx & PHY_TX_ASIC_OUT_TX_ACK) ||
204				(phy_status_rx & PHY_RX_ASIC_OUT_ACK)));
205	if (!retries)
206		dev_err(dev, "PHY did not enter Pn state\n");
207}
208
209static void artpec6_pcie_wait_for_phy(struct artpec6_pcie *artpec6_pcie)
210{
211	switch (artpec6_pcie->variant) {
212	case ARTPEC6:
213		artpec6_pcie_wait_for_phy_a6(artpec6_pcie);
214		break;
215	case ARTPEC7:
216		artpec6_pcie_wait_for_phy_a7(artpec6_pcie);
217		break;
218	}
219}
220
221static void artpec6_pcie_init_phy_a6(struct artpec6_pcie *artpec6_pcie)
222{
223	u32 val;
224
225	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
226	val |=  PCIECFG_RISRCREN |	/* Receiver term. 50 Ohm */
227		PCIECFG_MODE_TX_DRV_EN |
228		PCIECFG_CISRREN |	/* Reference clock term. 100 Ohm */
229		PCIECFG_MACRO_ENABLE;
230	val |= PCIECFG_REFCLK_ENABLE;
231	val &= ~PCIECFG_DBG_OEN;
232	val &= ~PCIECFG_CLKREQ_B;
233	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
234	usleep_range(5000, 6000);
235
236	val = artpec6_pcie_readl(artpec6_pcie, NOCCFG);
237	val |= NOCCFG_ENABLE_CLK_PCIE;
238	artpec6_pcie_writel(artpec6_pcie, NOCCFG, val);
239	usleep_range(20, 30);
240
241	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
242	val |= PCIECFG_PCLK_ENABLE | PCIECFG_PLL_ENABLE;
243	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
244	usleep_range(6000, 7000);
245
246	val = artpec6_pcie_readl(artpec6_pcie, NOCCFG);
247	val &= ~NOCCFG_POWER_PCIE_IDLEREQ;
248	artpec6_pcie_writel(artpec6_pcie, NOCCFG, val);
249}
250
251static void artpec6_pcie_init_phy_a7(struct artpec6_pcie *artpec6_pcie)
252{
253	struct dw_pcie *pci = artpec6_pcie->pci;
254	u32 val;
255	bool extrefclk;
256
257	/* Check if external reference clock is connected */
258	val = artpec6_pcie_readl(artpec6_pcie, PCIESTAT);
259	extrefclk = !!(val & PCIESTAT_EXTREFCLK);
260	dev_dbg(pci->dev, "Using reference clock: %s\n",
261		extrefclk ? "external" : "internal");
262
263	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
264	val |=  PCIECFG_RISRCREN |	/* Receiver term. 50 Ohm */
265		PCIECFG_PCLK_ENABLE;
266	if (extrefclk)
267		val |= PCIECFG_REFCLKSEL;
268	else
269		val &= ~PCIECFG_REFCLKSEL;
270	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
271	usleep_range(10, 20);
272
273	val = artpec6_pcie_readl(artpec6_pcie, NOCCFG);
274	val |= NOCCFG_ENABLE_CLK_PCIE;
275	artpec6_pcie_writel(artpec6_pcie, NOCCFG, val);
276	usleep_range(20, 30);
277
278	val = artpec6_pcie_readl(artpec6_pcie, NOCCFG);
279	val &= ~NOCCFG_POWER_PCIE_IDLEREQ;
280	artpec6_pcie_writel(artpec6_pcie, NOCCFG, val);
281}
282
283static void artpec6_pcie_init_phy(struct artpec6_pcie *artpec6_pcie)
284{
285	switch (artpec6_pcie->variant) {
286	case ARTPEC6:
287		artpec6_pcie_init_phy_a6(artpec6_pcie);
288		break;
289	case ARTPEC7:
290		artpec6_pcie_init_phy_a7(artpec6_pcie);
291		break;
292	}
293}
294
295static void artpec6_pcie_set_nfts(struct artpec6_pcie *artpec6_pcie)
296{
297	struct dw_pcie *pci = artpec6_pcie->pci;
298	u32 val;
299
300	if (artpec6_pcie->variant != ARTPEC7)
301		return;
302
303	/*
304	 * Increase the N_FTS (Number of Fast Training Sequences)
305	 * to be transmitted when transitioning from L0s to L0.
306	 */
307	val = dw_pcie_readl_dbi(pci, ACK_F_ASPM_CTRL_OFF);
308	val &= ~ACK_N_FTS_MASK;
309	val |= ACK_N_FTS(180);
310	dw_pcie_writel_dbi(pci, ACK_F_ASPM_CTRL_OFF, val);
311
312	/*
313	 * Set the Number of Fast Training Sequences that the core
314	 * advertises as its N_FTS during Gen2 or Gen3 link training.
315	 */
316	val = dw_pcie_readl_dbi(pci, PCIE_LINK_WIDTH_SPEED_CONTROL);
317	val &= ~FAST_TRAINING_SEQ_MASK;
318	val |= FAST_TRAINING_SEQ(180);
319	dw_pcie_writel_dbi(pci, PCIE_LINK_WIDTH_SPEED_CONTROL, val);
320}
321
322static void artpec6_pcie_assert_core_reset(struct artpec6_pcie *artpec6_pcie)
323{
324	u32 val;
325
326	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
327	switch (artpec6_pcie->variant) {
328	case ARTPEC6:
329		val |= PCIECFG_CORE_RESET_REQ;
330		break;
331	case ARTPEC7:
332		val &= ~PCIECFG_NOC_RESET;
333		break;
334	}
335	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
336}
337
338static void artpec6_pcie_deassert_core_reset(struct artpec6_pcie *artpec6_pcie)
339{
340	u32 val;
341
342	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
343	switch (artpec6_pcie->variant) {
344	case ARTPEC6:
345		val &= ~PCIECFG_CORE_RESET_REQ;
346		break;
347	case ARTPEC7:
348		val |= PCIECFG_NOC_RESET;
349		break;
350	}
351	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
352	usleep_range(100, 200);
353}
354
355static void artpec6_pcie_enable_interrupts(struct artpec6_pcie *artpec6_pcie)
356{
357	struct dw_pcie *pci = artpec6_pcie->pci;
358	struct pcie_port *pp = &pci->pp;
359
360	if (IS_ENABLED(CONFIG_PCI_MSI))
361		dw_pcie_msi_init(pp);
362}
363
364static int artpec6_pcie_host_init(struct pcie_port *pp)
365{
366	struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
367	struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pci);
368
369	artpec6_pcie_assert_core_reset(artpec6_pcie);
370	artpec6_pcie_init_phy(artpec6_pcie);
371	artpec6_pcie_deassert_core_reset(artpec6_pcie);
372	artpec6_pcie_wait_for_phy(artpec6_pcie);
373	artpec6_pcie_set_nfts(artpec6_pcie);
374	dw_pcie_setup_rc(pp);
375	artpec6_pcie_establish_link(pci);
376	dw_pcie_wait_for_link(pci);
377	artpec6_pcie_enable_interrupts(artpec6_pcie);
378
379	return 0;
380}
381
382static const struct dw_pcie_host_ops artpec6_pcie_host_ops = {
383	.host_init = artpec6_pcie_host_init,
384};
385
386static int artpec6_add_pcie_port(struct artpec6_pcie *artpec6_pcie,
387				 struct platform_device *pdev)
388{
389	struct dw_pcie *pci = artpec6_pcie->pci;
390	struct pcie_port *pp = &pci->pp;
391	struct device *dev = pci->dev;
392	int ret;
393
394	if (IS_ENABLED(CONFIG_PCI_MSI)) {
395		pp->msi_irq = platform_get_irq_byname(pdev, "msi");
396		if (pp->msi_irq < 0) {
397			dev_err(dev, "failed to get MSI irq\n");
398			return pp->msi_irq;
399		}
400	}
401
402	pp->ops = &artpec6_pcie_host_ops;
403
404	ret = dw_pcie_host_init(pp);
405	if (ret) {
406		dev_err(dev, "failed to initialize host\n");
407		return ret;
408	}
409
410	return 0;
411}
412
413static void artpec6_pcie_ep_init(struct dw_pcie_ep *ep)
414{
415	struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
416	struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pci);
417	enum pci_barno bar;
418
419	artpec6_pcie_assert_core_reset(artpec6_pcie);
420	artpec6_pcie_init_phy(artpec6_pcie);
421	artpec6_pcie_deassert_core_reset(artpec6_pcie);
422	artpec6_pcie_wait_for_phy(artpec6_pcie);
423	artpec6_pcie_set_nfts(artpec6_pcie);
424
425	for (bar = BAR_0; bar <= BAR_5; bar++)
426		dw_pcie_ep_reset_bar(pci, bar);
427}
428
429static int artpec6_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
430				  enum pci_epc_irq_type type, u16 interrupt_num)
431{
432	struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
433
434	switch (type) {
435	case PCI_EPC_IRQ_LEGACY:
436		dev_err(pci->dev, "EP cannot trigger legacy IRQs\n");
437		return -EINVAL;
438	case PCI_EPC_IRQ_MSI:
439		return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
440	default:
441		dev_err(pci->dev, "UNKNOWN IRQ type\n");
442	}
443
444	return 0;
445}
446
447static const struct dw_pcie_ep_ops pcie_ep_ops = {
448	.ep_init = artpec6_pcie_ep_init,
449	.raise_irq = artpec6_pcie_raise_irq,
450};
451
452static int artpec6_add_pcie_ep(struct artpec6_pcie *artpec6_pcie,
453			       struct platform_device *pdev)
454{
455	int ret;
456	struct dw_pcie_ep *ep;
457	struct resource *res;
458	struct device *dev = &pdev->dev;
459	struct dw_pcie *pci = artpec6_pcie->pci;
460
461	ep = &pci->ep;
462	ep->ops = &pcie_ep_ops;
463
464	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dbi2");
465	pci->dbi_base2 = devm_ioremap_resource(dev, res);
466	if (IS_ERR(pci->dbi_base2))
467		return PTR_ERR(pci->dbi_base2);
468
469	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space");
470	if (!res)
471		return -EINVAL;
472
473	ep->phys_base = res->start;
474	ep->addr_size = resource_size(res);
475
476	ret = dw_pcie_ep_init(ep);
477	if (ret) {
478		dev_err(dev, "failed to initialize endpoint\n");
479		return ret;
480	}
481
482	return 0;
483}
484
485static int artpec6_pcie_probe(struct platform_device *pdev)
486{
487	struct device *dev = &pdev->dev;
488	struct dw_pcie *pci;
489	struct artpec6_pcie *artpec6_pcie;
490	struct resource *dbi_base;
491	struct resource *phy_base;
492	int ret;
493	const struct of_device_id *match;
494	const struct artpec_pcie_of_data *data;
495	enum artpec_pcie_variants variant;
496	enum dw_pcie_device_mode mode;
497
498	match = of_match_device(artpec6_pcie_of_match, dev);
499	if (!match)
500		return -EINVAL;
501
502	data = (struct artpec_pcie_of_data *)match->data;
503	variant = (enum artpec_pcie_variants)data->variant;
504	mode = (enum dw_pcie_device_mode)data->mode;
505
506	artpec6_pcie = devm_kzalloc(dev, sizeof(*artpec6_pcie), GFP_KERNEL);
507	if (!artpec6_pcie)
508		return -ENOMEM;
509
510	pci = devm_kzalloc(dev, sizeof(*pci), GFP_KERNEL);
511	if (!pci)
512		return -ENOMEM;
513
514	pci->dev = dev;
515	pci->ops = &dw_pcie_ops;
516
517	artpec6_pcie->pci = pci;
518	artpec6_pcie->variant = variant;
519	artpec6_pcie->mode = mode;
520
521	dbi_base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dbi");
522	pci->dbi_base = devm_ioremap_resource(dev, dbi_base);
523	if (IS_ERR(pci->dbi_base))
524		return PTR_ERR(pci->dbi_base);
525
526	phy_base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy");
527	artpec6_pcie->phy_base = devm_ioremap_resource(dev, phy_base);
528	if (IS_ERR(artpec6_pcie->phy_base))
529		return PTR_ERR(artpec6_pcie->phy_base);
530
531	artpec6_pcie->regmap =
532		syscon_regmap_lookup_by_phandle(dev->of_node,
533						"axis,syscon-pcie");
534	if (IS_ERR(artpec6_pcie->regmap))
535		return PTR_ERR(artpec6_pcie->regmap);
536
537	platform_set_drvdata(pdev, artpec6_pcie);
538
539	switch (artpec6_pcie->mode) {
540	case DW_PCIE_RC_TYPE:
541		if (!IS_ENABLED(CONFIG_PCIE_ARTPEC6_HOST))
542			return -ENODEV;
543
544		ret = artpec6_add_pcie_port(artpec6_pcie, pdev);
545		if (ret < 0)
546			return ret;
547		break;
548	case DW_PCIE_EP_TYPE: {
549		u32 val;
550
551		if (!IS_ENABLED(CONFIG_PCIE_ARTPEC6_EP))
552			return -ENODEV;
553
554		val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
555		val &= ~PCIECFG_DEVICE_TYPE_MASK;
556		artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
557		ret = artpec6_add_pcie_ep(artpec6_pcie, pdev);
558		if (ret < 0)
559			return ret;
560		break;
561	}
562	default:
563		dev_err(dev, "INVALID device type %d\n", artpec6_pcie->mode);
564	}
565
566	return 0;
567}
568
569static const struct artpec_pcie_of_data artpec6_pcie_rc_of_data = {
570	.variant = ARTPEC6,
571	.mode = DW_PCIE_RC_TYPE,
572};
573
574static const struct artpec_pcie_of_data artpec6_pcie_ep_of_data = {
575	.variant = ARTPEC6,
576	.mode = DW_PCIE_EP_TYPE,
577};
578
579static const struct artpec_pcie_of_data artpec7_pcie_rc_of_data = {
580	.variant = ARTPEC7,
581	.mode = DW_PCIE_RC_TYPE,
582};
583
584static const struct artpec_pcie_of_data artpec7_pcie_ep_of_data = {
585	.variant = ARTPEC7,
586	.mode = DW_PCIE_EP_TYPE,
587};
588
589static const struct of_device_id artpec6_pcie_of_match[] = {
590	{
591		.compatible = "axis,artpec6-pcie",
592		.data = &artpec6_pcie_rc_of_data,
593	},
594	{
595		.compatible = "axis,artpec6-pcie-ep",
596		.data = &artpec6_pcie_ep_of_data,
597	},
598	{
599		.compatible = "axis,artpec7-pcie",
600		.data = &artpec7_pcie_rc_of_data,
601	},
602	{
603		.compatible = "axis,artpec7-pcie-ep",
604		.data = &artpec7_pcie_ep_of_data,
605	},
606	{},
607};
608
609static struct platform_driver artpec6_pcie_driver = {
610	.probe = artpec6_pcie_probe,
611	.driver = {
612		.name	= "artpec6-pcie",
613		.of_match_table = artpec6_pcie_of_match,
614		.suppress_bind_attrs = true,
615	},
616};
617builtin_platform_driver(artpec6_pcie_driver);
v5.9
  1// SPDX-License-Identifier: GPL-2.0
  2/*
  3 * PCIe host controller driver for Axis ARTPEC-6 SoC
  4 *
  5 * Author: Niklas Cassel <niklas.cassel@axis.com>
  6 *
  7 * Based on work done by Phil Edworthy <phil@edworthys.org>
  8 */
  9
 10#include <linux/delay.h>
 11#include <linux/kernel.h>
 12#include <linux/init.h>
 13#include <linux/of_device.h>
 14#include <linux/pci.h>
 15#include <linux/platform_device.h>
 16#include <linux/resource.h>
 17#include <linux/signal.h>
 18#include <linux/types.h>
 19#include <linux/interrupt.h>
 20#include <linux/mfd/syscon.h>
 21#include <linux/regmap.h>
 22
 23#include "pcie-designware.h"
 24
 25#define to_artpec6_pcie(x)	dev_get_drvdata((x)->dev)
 26
 27enum artpec_pcie_variants {
 28	ARTPEC6,
 29	ARTPEC7,
 30};
 31
 32struct artpec6_pcie {
 33	struct dw_pcie		*pci;
 34	struct regmap		*regmap;	/* DT axis,syscon-pcie */
 35	void __iomem		*phy_base;	/* DT phy */
 36	enum artpec_pcie_variants variant;
 37	enum dw_pcie_device_mode mode;
 38};
 39
 40struct artpec_pcie_of_data {
 41	enum artpec_pcie_variants variant;
 42	enum dw_pcie_device_mode mode;
 43};
 44
 45static const struct of_device_id artpec6_pcie_of_match[];
 46
 47/* PCIe Port Logic registers (memory-mapped) */
 48#define PL_OFFSET			0x700
 49
 50#define ACK_F_ASPM_CTRL_OFF		(PL_OFFSET + 0xc)
 51#define ACK_N_FTS_MASK			GENMASK(15, 8)
 52#define ACK_N_FTS(x)			(((x) << 8) & ACK_N_FTS_MASK)
 53
 
 
 
 54/* ARTPEC-6 specific registers */
 55#define PCIECFG				0x18
 56#define  PCIECFG_DBG_OEN		BIT(24)
 57#define  PCIECFG_CORE_RESET_REQ		BIT(21)
 58#define  PCIECFG_LTSSM_ENABLE		BIT(20)
 59#define  PCIECFG_DEVICE_TYPE_MASK	GENMASK(19, 16)
 60#define  PCIECFG_CLKREQ_B		BIT(11)
 61#define  PCIECFG_REFCLK_ENABLE		BIT(10)
 62#define  PCIECFG_PLL_ENABLE		BIT(9)
 63#define  PCIECFG_PCLK_ENABLE		BIT(8)
 64#define  PCIECFG_RISRCREN		BIT(4)
 65#define  PCIECFG_MODE_TX_DRV_EN		BIT(3)
 66#define  PCIECFG_CISRREN		BIT(2)
 67#define  PCIECFG_MACRO_ENABLE		BIT(0)
 68/* ARTPEC-7 specific fields */
 69#define  PCIECFG_REFCLKSEL		BIT(23)
 70#define  PCIECFG_NOC_RESET		BIT(3)
 71
 72#define PCIESTAT			0x1c
 73/* ARTPEC-7 specific fields */
 74#define  PCIESTAT_EXTREFCLK		BIT(3)
 75
 76#define NOCCFG				0x40
 77#define  NOCCFG_ENABLE_CLK_PCIE		BIT(4)
 78#define  NOCCFG_POWER_PCIE_IDLEACK	BIT(3)
 79#define  NOCCFG_POWER_PCIE_IDLE		BIT(2)
 80#define  NOCCFG_POWER_PCIE_IDLEREQ	BIT(1)
 81
 82#define PHY_STATUS			0x118
 83#define  PHY_COSPLLLOCK			BIT(0)
 84
 85#define PHY_TX_ASIC_OUT			0x4040
 86#define  PHY_TX_ASIC_OUT_TX_ACK		BIT(0)
 87
 88#define PHY_RX_ASIC_OUT			0x405c
 89#define  PHY_RX_ASIC_OUT_ACK		BIT(0)
 90
 91static u32 artpec6_pcie_readl(struct artpec6_pcie *artpec6_pcie, u32 offset)
 92{
 93	u32 val;
 94
 95	regmap_read(artpec6_pcie->regmap, offset, &val);
 96	return val;
 97}
 98
 99static void artpec6_pcie_writel(struct artpec6_pcie *artpec6_pcie, u32 offset, u32 val)
100{
101	regmap_write(artpec6_pcie->regmap, offset, val);
102}
103
104static u64 artpec6_pcie_cpu_addr_fixup(struct dw_pcie *pci, u64 pci_addr)
105{
106	struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pci);
107	struct pcie_port *pp = &pci->pp;
108	struct dw_pcie_ep *ep = &pci->ep;
109
110	switch (artpec6_pcie->mode) {
111	case DW_PCIE_RC_TYPE:
112		return pci_addr - pp->cfg0_base;
113	case DW_PCIE_EP_TYPE:
114		return pci_addr - ep->phys_base;
115	default:
116		dev_err(pci->dev, "UNKNOWN device type\n");
117	}
118	return pci_addr;
119}
120
121static int artpec6_pcie_establish_link(struct dw_pcie *pci)
122{
123	struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pci);
124	u32 val;
125
126	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
127	val |= PCIECFG_LTSSM_ENABLE;
128	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
129
130	return 0;
131}
132
133static void artpec6_pcie_stop_link(struct dw_pcie *pci)
134{
135	struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pci);
136	u32 val;
137
138	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
139	val &= ~PCIECFG_LTSSM_ENABLE;
140	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
141}
142
143static const struct dw_pcie_ops dw_pcie_ops = {
144	.cpu_addr_fixup = artpec6_pcie_cpu_addr_fixup,
145	.start_link = artpec6_pcie_establish_link,
146	.stop_link = artpec6_pcie_stop_link,
147};
148
149static void artpec6_pcie_wait_for_phy_a6(struct artpec6_pcie *artpec6_pcie)
150{
151	struct dw_pcie *pci = artpec6_pcie->pci;
152	struct device *dev = pci->dev;
153	u32 val;
154	unsigned int retries;
155
156	retries = 50;
157	do {
158		usleep_range(1000, 2000);
159		val = artpec6_pcie_readl(artpec6_pcie, NOCCFG);
160		retries--;
161	} while (retries &&
162		(val & (NOCCFG_POWER_PCIE_IDLEACK | NOCCFG_POWER_PCIE_IDLE)));
163	if (!retries)
164		dev_err(dev, "PCIe clock manager did not leave idle state\n");
165
166	retries = 50;
167	do {
168		usleep_range(1000, 2000);
169		val = readl(artpec6_pcie->phy_base + PHY_STATUS);
170		retries--;
171	} while (retries && !(val & PHY_COSPLLLOCK));
172	if (!retries)
173		dev_err(dev, "PHY PLL did not lock\n");
174}
175
176static void artpec6_pcie_wait_for_phy_a7(struct artpec6_pcie *artpec6_pcie)
177{
178	struct dw_pcie *pci = artpec6_pcie->pci;
179	struct device *dev = pci->dev;
180	u32 val;
181	u16 phy_status_tx, phy_status_rx;
182	unsigned int retries;
183
184	retries = 50;
185	do {
186		usleep_range(1000, 2000);
187		val = artpec6_pcie_readl(artpec6_pcie, NOCCFG);
188		retries--;
189	} while (retries &&
190		(val & (NOCCFG_POWER_PCIE_IDLEACK | NOCCFG_POWER_PCIE_IDLE)));
191	if (!retries)
192		dev_err(dev, "PCIe clock manager did not leave idle state\n");
193
194	retries = 50;
195	do {
196		usleep_range(1000, 2000);
197		phy_status_tx = readw(artpec6_pcie->phy_base + PHY_TX_ASIC_OUT);
198		phy_status_rx = readw(artpec6_pcie->phy_base + PHY_RX_ASIC_OUT);
199		retries--;
200	} while (retries && ((phy_status_tx & PHY_TX_ASIC_OUT_TX_ACK) ||
201				(phy_status_rx & PHY_RX_ASIC_OUT_ACK)));
202	if (!retries)
203		dev_err(dev, "PHY did not enter Pn state\n");
204}
205
206static void artpec6_pcie_wait_for_phy(struct artpec6_pcie *artpec6_pcie)
207{
208	switch (artpec6_pcie->variant) {
209	case ARTPEC6:
210		artpec6_pcie_wait_for_phy_a6(artpec6_pcie);
211		break;
212	case ARTPEC7:
213		artpec6_pcie_wait_for_phy_a7(artpec6_pcie);
214		break;
215	}
216}
217
218static void artpec6_pcie_init_phy_a6(struct artpec6_pcie *artpec6_pcie)
219{
220	u32 val;
221
222	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
223	val |=  PCIECFG_RISRCREN |	/* Receiver term. 50 Ohm */
224		PCIECFG_MODE_TX_DRV_EN |
225		PCIECFG_CISRREN |	/* Reference clock term. 100 Ohm */
226		PCIECFG_MACRO_ENABLE;
227	val |= PCIECFG_REFCLK_ENABLE;
228	val &= ~PCIECFG_DBG_OEN;
229	val &= ~PCIECFG_CLKREQ_B;
230	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
231	usleep_range(5000, 6000);
232
233	val = artpec6_pcie_readl(artpec6_pcie, NOCCFG);
234	val |= NOCCFG_ENABLE_CLK_PCIE;
235	artpec6_pcie_writel(artpec6_pcie, NOCCFG, val);
236	usleep_range(20, 30);
237
238	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
239	val |= PCIECFG_PCLK_ENABLE | PCIECFG_PLL_ENABLE;
240	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
241	usleep_range(6000, 7000);
242
243	val = artpec6_pcie_readl(artpec6_pcie, NOCCFG);
244	val &= ~NOCCFG_POWER_PCIE_IDLEREQ;
245	artpec6_pcie_writel(artpec6_pcie, NOCCFG, val);
246}
247
248static void artpec6_pcie_init_phy_a7(struct artpec6_pcie *artpec6_pcie)
249{
250	struct dw_pcie *pci = artpec6_pcie->pci;
251	u32 val;
252	bool extrefclk;
253
254	/* Check if external reference clock is connected */
255	val = artpec6_pcie_readl(artpec6_pcie, PCIESTAT);
256	extrefclk = !!(val & PCIESTAT_EXTREFCLK);
257	dev_dbg(pci->dev, "Using reference clock: %s\n",
258		extrefclk ? "external" : "internal");
259
260	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
261	val |=  PCIECFG_RISRCREN |	/* Receiver term. 50 Ohm */
262		PCIECFG_PCLK_ENABLE;
263	if (extrefclk)
264		val |= PCIECFG_REFCLKSEL;
265	else
266		val &= ~PCIECFG_REFCLKSEL;
267	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
268	usleep_range(10, 20);
269
270	val = artpec6_pcie_readl(artpec6_pcie, NOCCFG);
271	val |= NOCCFG_ENABLE_CLK_PCIE;
272	artpec6_pcie_writel(artpec6_pcie, NOCCFG, val);
273	usleep_range(20, 30);
274
275	val = artpec6_pcie_readl(artpec6_pcie, NOCCFG);
276	val &= ~NOCCFG_POWER_PCIE_IDLEREQ;
277	artpec6_pcie_writel(artpec6_pcie, NOCCFG, val);
278}
279
280static void artpec6_pcie_init_phy(struct artpec6_pcie *artpec6_pcie)
281{
282	switch (artpec6_pcie->variant) {
283	case ARTPEC6:
284		artpec6_pcie_init_phy_a6(artpec6_pcie);
285		break;
286	case ARTPEC7:
287		artpec6_pcie_init_phy_a7(artpec6_pcie);
288		break;
289	}
290}
291
292static void artpec6_pcie_set_nfts(struct artpec6_pcie *artpec6_pcie)
293{
294	struct dw_pcie *pci = artpec6_pcie->pci;
295	u32 val;
296
297	if (artpec6_pcie->variant != ARTPEC7)
298		return;
299
300	/*
301	 * Increase the N_FTS (Number of Fast Training Sequences)
302	 * to be transmitted when transitioning from L0s to L0.
303	 */
304	val = dw_pcie_readl_dbi(pci, ACK_F_ASPM_CTRL_OFF);
305	val &= ~ACK_N_FTS_MASK;
306	val |= ACK_N_FTS(180);
307	dw_pcie_writel_dbi(pci, ACK_F_ASPM_CTRL_OFF, val);
308
309	/*
310	 * Set the Number of Fast Training Sequences that the core
311	 * advertises as its N_FTS during Gen2 or Gen3 link training.
312	 */
313	dw_pcie_link_set_n_fts(pci, 180);
 
 
 
314}
315
316static void artpec6_pcie_assert_core_reset(struct artpec6_pcie *artpec6_pcie)
317{
318	u32 val;
319
320	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
321	switch (artpec6_pcie->variant) {
322	case ARTPEC6:
323		val |= PCIECFG_CORE_RESET_REQ;
324		break;
325	case ARTPEC7:
326		val &= ~PCIECFG_NOC_RESET;
327		break;
328	}
329	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
330}
331
332static void artpec6_pcie_deassert_core_reset(struct artpec6_pcie *artpec6_pcie)
333{
334	u32 val;
335
336	val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
337	switch (artpec6_pcie->variant) {
338	case ARTPEC6:
339		val &= ~PCIECFG_CORE_RESET_REQ;
340		break;
341	case ARTPEC7:
342		val |= PCIECFG_NOC_RESET;
343		break;
344	}
345	artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
346	usleep_range(100, 200);
347}
348
349static void artpec6_pcie_enable_interrupts(struct artpec6_pcie *artpec6_pcie)
350{
351	struct dw_pcie *pci = artpec6_pcie->pci;
352	struct pcie_port *pp = &pci->pp;
353
354	if (IS_ENABLED(CONFIG_PCI_MSI))
355		dw_pcie_msi_init(pp);
356}
357
358static int artpec6_pcie_host_init(struct pcie_port *pp)
359{
360	struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
361	struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pci);
362
363	artpec6_pcie_assert_core_reset(artpec6_pcie);
364	artpec6_pcie_init_phy(artpec6_pcie);
365	artpec6_pcie_deassert_core_reset(artpec6_pcie);
366	artpec6_pcie_wait_for_phy(artpec6_pcie);
367	artpec6_pcie_set_nfts(artpec6_pcie);
368	dw_pcie_setup_rc(pp);
369	artpec6_pcie_establish_link(pci);
370	dw_pcie_wait_for_link(pci);
371	artpec6_pcie_enable_interrupts(artpec6_pcie);
372
373	return 0;
374}
375
376static const struct dw_pcie_host_ops artpec6_pcie_host_ops = {
377	.host_init = artpec6_pcie_host_init,
378};
379
380static int artpec6_add_pcie_port(struct artpec6_pcie *artpec6_pcie,
381				 struct platform_device *pdev)
382{
383	struct dw_pcie *pci = artpec6_pcie->pci;
384	struct pcie_port *pp = &pci->pp;
385	struct device *dev = pci->dev;
386	int ret;
387
388	if (IS_ENABLED(CONFIG_PCI_MSI)) {
389		pp->msi_irq = platform_get_irq_byname(pdev, "msi");
390		if (pp->msi_irq < 0)
 
391			return pp->msi_irq;
 
392	}
393
394	pp->ops = &artpec6_pcie_host_ops;
395
396	ret = dw_pcie_host_init(pp);
397	if (ret) {
398		dev_err(dev, "failed to initialize host\n");
399		return ret;
400	}
401
402	return 0;
403}
404
405static void artpec6_pcie_ep_init(struct dw_pcie_ep *ep)
406{
407	struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
408	struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pci);
409	enum pci_barno bar;
410
411	artpec6_pcie_assert_core_reset(artpec6_pcie);
412	artpec6_pcie_init_phy(artpec6_pcie);
413	artpec6_pcie_deassert_core_reset(artpec6_pcie);
414	artpec6_pcie_wait_for_phy(artpec6_pcie);
415	artpec6_pcie_set_nfts(artpec6_pcie);
416
417	for (bar = 0; bar < PCI_STD_NUM_BARS; bar++)
418		dw_pcie_ep_reset_bar(pci, bar);
419}
420
421static int artpec6_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
422				  enum pci_epc_irq_type type, u16 interrupt_num)
423{
424	struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
425
426	switch (type) {
427	case PCI_EPC_IRQ_LEGACY:
428		dev_err(pci->dev, "EP cannot trigger legacy IRQs\n");
429		return -EINVAL;
430	case PCI_EPC_IRQ_MSI:
431		return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
432	default:
433		dev_err(pci->dev, "UNKNOWN IRQ type\n");
434	}
435
436	return 0;
437}
438
439static const struct dw_pcie_ep_ops pcie_ep_ops = {
440	.ep_init = artpec6_pcie_ep_init,
441	.raise_irq = artpec6_pcie_raise_irq,
442};
443
444static int artpec6_add_pcie_ep(struct artpec6_pcie *artpec6_pcie,
445			       struct platform_device *pdev)
446{
447	int ret;
448	struct dw_pcie_ep *ep;
449	struct resource *res;
450	struct device *dev = &pdev->dev;
451	struct dw_pcie *pci = artpec6_pcie->pci;
452
453	ep = &pci->ep;
454	ep->ops = &pcie_ep_ops;
455
456	pci->dbi_base2 = devm_platform_ioremap_resource_byname(pdev, "dbi2");
 
457	if (IS_ERR(pci->dbi_base2))
458		return PTR_ERR(pci->dbi_base2);
459
460	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space");
461	if (!res)
462		return -EINVAL;
463
464	ep->phys_base = res->start;
465	ep->addr_size = resource_size(res);
466
467	ret = dw_pcie_ep_init(ep);
468	if (ret) {
469		dev_err(dev, "failed to initialize endpoint\n");
470		return ret;
471	}
472
473	return 0;
474}
475
476static int artpec6_pcie_probe(struct platform_device *pdev)
477{
478	struct device *dev = &pdev->dev;
479	struct dw_pcie *pci;
480	struct artpec6_pcie *artpec6_pcie;
 
 
481	int ret;
482	const struct of_device_id *match;
483	const struct artpec_pcie_of_data *data;
484	enum artpec_pcie_variants variant;
485	enum dw_pcie_device_mode mode;
486
487	match = of_match_device(artpec6_pcie_of_match, dev);
488	if (!match)
489		return -EINVAL;
490
491	data = (struct artpec_pcie_of_data *)match->data;
492	variant = (enum artpec_pcie_variants)data->variant;
493	mode = (enum dw_pcie_device_mode)data->mode;
494
495	artpec6_pcie = devm_kzalloc(dev, sizeof(*artpec6_pcie), GFP_KERNEL);
496	if (!artpec6_pcie)
497		return -ENOMEM;
498
499	pci = devm_kzalloc(dev, sizeof(*pci), GFP_KERNEL);
500	if (!pci)
501		return -ENOMEM;
502
503	pci->dev = dev;
504	pci->ops = &dw_pcie_ops;
505
506	artpec6_pcie->pci = pci;
507	artpec6_pcie->variant = variant;
508	artpec6_pcie->mode = mode;
509
510	pci->dbi_base = devm_platform_ioremap_resource_byname(pdev, "dbi");
 
511	if (IS_ERR(pci->dbi_base))
512		return PTR_ERR(pci->dbi_base);
513
514	artpec6_pcie->phy_base =
515		devm_platform_ioremap_resource_byname(pdev, "phy");
516	if (IS_ERR(artpec6_pcie->phy_base))
517		return PTR_ERR(artpec6_pcie->phy_base);
518
519	artpec6_pcie->regmap =
520		syscon_regmap_lookup_by_phandle(dev->of_node,
521						"axis,syscon-pcie");
522	if (IS_ERR(artpec6_pcie->regmap))
523		return PTR_ERR(artpec6_pcie->regmap);
524
525	platform_set_drvdata(pdev, artpec6_pcie);
526
527	switch (artpec6_pcie->mode) {
528	case DW_PCIE_RC_TYPE:
529		if (!IS_ENABLED(CONFIG_PCIE_ARTPEC6_HOST))
530			return -ENODEV;
531
532		ret = artpec6_add_pcie_port(artpec6_pcie, pdev);
533		if (ret < 0)
534			return ret;
535		break;
536	case DW_PCIE_EP_TYPE: {
537		u32 val;
538
539		if (!IS_ENABLED(CONFIG_PCIE_ARTPEC6_EP))
540			return -ENODEV;
541
542		val = artpec6_pcie_readl(artpec6_pcie, PCIECFG);
543		val &= ~PCIECFG_DEVICE_TYPE_MASK;
544		artpec6_pcie_writel(artpec6_pcie, PCIECFG, val);
545		ret = artpec6_add_pcie_ep(artpec6_pcie, pdev);
546		if (ret < 0)
547			return ret;
548		break;
549	}
550	default:
551		dev_err(dev, "INVALID device type %d\n", artpec6_pcie->mode);
552	}
553
554	return 0;
555}
556
557static const struct artpec_pcie_of_data artpec6_pcie_rc_of_data = {
558	.variant = ARTPEC6,
559	.mode = DW_PCIE_RC_TYPE,
560};
561
562static const struct artpec_pcie_of_data artpec6_pcie_ep_of_data = {
563	.variant = ARTPEC6,
564	.mode = DW_PCIE_EP_TYPE,
565};
566
567static const struct artpec_pcie_of_data artpec7_pcie_rc_of_data = {
568	.variant = ARTPEC7,
569	.mode = DW_PCIE_RC_TYPE,
570};
571
572static const struct artpec_pcie_of_data artpec7_pcie_ep_of_data = {
573	.variant = ARTPEC7,
574	.mode = DW_PCIE_EP_TYPE,
575};
576
577static const struct of_device_id artpec6_pcie_of_match[] = {
578	{
579		.compatible = "axis,artpec6-pcie",
580		.data = &artpec6_pcie_rc_of_data,
581	},
582	{
583		.compatible = "axis,artpec6-pcie-ep",
584		.data = &artpec6_pcie_ep_of_data,
585	},
586	{
587		.compatible = "axis,artpec7-pcie",
588		.data = &artpec7_pcie_rc_of_data,
589	},
590	{
591		.compatible = "axis,artpec7-pcie-ep",
592		.data = &artpec7_pcie_ep_of_data,
593	},
594	{},
595};
596
597static struct platform_driver artpec6_pcie_driver = {
598	.probe = artpec6_pcie_probe,
599	.driver = {
600		.name	= "artpec6-pcie",
601		.of_match_table = artpec6_pcie_of_match,
602		.suppress_bind_attrs = true,
603	},
604};
605builtin_platform_driver(artpec6_pcie_driver);