Skip to content

Commit dfb77c8

Browse files
committed
Merge branch 'pci/controller/s32g'
- Add NXP S32G host controller DT binding and driver (Vincent Guittot) * pci/controller/s32g: MAINTAINERS: Add NXP S32G PCIe controller driver maintainer PCI: s32g: Add NXP S32G PCIe controller driver (RC) PCI: dwc: Add register and bitfield definitions dt-bindings: PCI: s32g: Add NXP S32G PCIe controller
2 parents c934541 + de45401 commit dfb77c8

6 files changed

Lines changed: 564 additions & 0 deletions

File tree

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pci/nxp,s32g-pcie.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NXP S32G2xxx/S32G3xxx PCIe Root Complex controller
8+
9+
maintainers:
10+
- Bogdan Hamciuc <bogdan.hamciuc@nxp.com>
11+
- Ionut Vicovan <ionut.vicovan@nxp.com>
12+
13+
description:
14+
This PCIe controller is based on the Synopsys DesignWare PCIe IP.
15+
The S32G SoC family has two PCIe controllers, which can be configured as
16+
either Root Complex or Endpoint.
17+
18+
properties:
19+
compatible:
20+
oneOf:
21+
- enum:
22+
- nxp,s32g2-pcie
23+
- items:
24+
- const: nxp,s32g3-pcie
25+
- const: nxp,s32g2-pcie
26+
27+
reg:
28+
maxItems: 6
29+
30+
reg-names:
31+
items:
32+
- const: dbi
33+
- const: dbi2
34+
- const: atu
35+
- const: dma
36+
- const: ctrl
37+
- const: config
38+
39+
interrupts:
40+
minItems: 1
41+
maxItems: 2
42+
43+
interrupt-names:
44+
items:
45+
- const: msi
46+
- const: dma
47+
minItems: 1
48+
49+
pcie@0:
50+
description:
51+
Describe the S32G Root Port.
52+
type: object
53+
$ref: /schemas/pci/pci-pci-bridge.yaml#
54+
55+
properties:
56+
reg:
57+
maxItems: 1
58+
59+
phys:
60+
maxItems: 1
61+
62+
required:
63+
- reg
64+
- phys
65+
66+
unevaluatedProperties: false
67+
68+
required:
69+
- compatible
70+
- reg
71+
- reg-names
72+
- interrupts
73+
- interrupt-names
74+
- ranges
75+
- pcie@0
76+
77+
allOf:
78+
- $ref: /schemas/pci/snps,dw-pcie.yaml#
79+
80+
unevaluatedProperties: false
81+
82+
examples:
83+
- |
84+
#include <dt-bindings/interrupt-controller/arm-gic.h>
85+
#include <dt-bindings/phy/phy.h>
86+
87+
bus {
88+
#address-cells = <2>;
89+
#size-cells = <2>;
90+
91+
pcie@40400000 {
92+
compatible = "nxp,s32g3-pcie", "nxp,s32g2-pcie";
93+
reg = <0x00 0x40400000 0x0 0x00001000>, /* dbi registers */
94+
<0x00 0x40420000 0x0 0x00001000>, /* dbi2 registers */
95+
<0x00 0x40460000 0x0 0x00001000>, /* atu registers */
96+
<0x00 0x40470000 0x0 0x00001000>, /* dma registers */
97+
<0x00 0x40481000 0x0 0x000000f8>, /* ctrl registers */
98+
<0x5f 0xffffe000 0x0 0x00002000>; /* config space */
99+
reg-names = "dbi", "dbi2", "atu", "dma", "ctrl", "config";
100+
dma-coherent;
101+
#address-cells = <3>;
102+
#size-cells = <2>;
103+
device_type = "pci";
104+
ranges =
105+
<0x01000000 0x0 0x00000000 0x5f 0xfffe0000 0x0 0x00010000>,
106+
<0x02000000 0x0 0x00000000 0x58 0x00000000 0x0 0x80000000>,
107+
<0x02000000 0x1 0x00000000 0x59 0x00000000 0x6 0xfffe0000>;
108+
109+
bus-range = <0x0 0xff>;
110+
interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
111+
<GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
112+
interrupt-names = "msi", "dma";
113+
#interrupt-cells = <1>;
114+
interrupt-map-mask = <0 0 0 0x7>;
115+
interrupt-map = <0 0 0 1 &gic 0 0 GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>,
116+
<0 0 0 2 &gic 0 0 GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>,
117+
<0 0 0 3 &gic 0 0 GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
118+
<0 0 0 4 &gic 0 0 GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
119+
120+
pcie@0 {
121+
reg = <0x0 0x0 0x0 0x0 0x0>;
122+
#address-cells = <3>;
123+
#size-cells = <2>;
124+
ranges;
125+
126+
device_type = "pci";
127+
phys = <&serdes0 PHY_TYPE_PCIE 0 0>;
128+
};
129+
};
130+
};

MAINTAINERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3132,6 +3132,15 @@ F: arch/arm64/boot/dts/freescale/s32g*.dts*
31323132
F: drivers/pinctrl/nxp/
31333133
F: drivers/rtc/rtc-s32g.c
31343134

3135+
ARM/NXP S32G PCIE CONTROLLER DRIVER
3136+
M: Ciprian Marian Costea <ciprianmarian.costea@oss.nxp.com>
3137+
R: NXP S32 Linux Team <s32@nxp.com>
3138+
L: imx@lists.linux.dev
3139+
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
3140+
S: Maintained
3141+
F: Documentation/devicetree/bindings/pci/nxp,s32g-pcie.yaml
3142+
F: drivers/pci/controller/dwc/pcie-nxp-s32g*
3143+
31353144
ARM/NXP S32G/S32R DWMAC ETHERNET DRIVER
31363145
M: Jan Petrous <jan.petrous@oss.nxp.com>
31373146
R: s32@nxp.com

drivers/pci/controller/dwc/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,16 @@ config PCIE_TEGRA194_EP
256256
in order to enable device-specific features PCIE_TEGRA194_EP must be
257257
selected. This uses the DesignWare core.
258258

259+
config PCIE_NXP_S32G
260+
bool "NXP S32G PCIe controller (host mode)"
261+
depends on ARCH_S32 || COMPILE_TEST
262+
select PCIE_DW_HOST
263+
help
264+
Enable support for the PCIe controller in NXP S32G based boards to
265+
work in Host mode. The controller is based on DesignWare IP and
266+
can work either as RC or EP. In order to enable host-specific
267+
features PCIE_NXP_S32G must be selected.
268+
259269
config PCIE_DW_PLAT
260270
bool
261271

drivers/pci/controller/dwc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ obj-$(CONFIG_PCI_DRA7XX) += pci-dra7xx.o
1010
obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o
1111
obj-$(CONFIG_PCIE_FU740) += pcie-fu740.o
1212
obj-$(CONFIG_PCI_IMX6) += pci-imx6.o
13+
obj-$(CONFIG_PCIE_NXP_S32G) += pcie-nxp-s32g.o
1314
obj-$(CONFIG_PCIE_SPEAR13XX) += pcie-spear13xx.o
1415
# ARM32 platforms use hook_fault_code() and cannot support loadable module.
1516
obj-$(CONFIG_PCI_KEYSTONE) += pci-keystone.o

drivers/pci/controller/dwc/pcie-designware.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121

122122
#define GEN3_RELATED_OFF 0x890
123123
#define GEN3_RELATED_OFF_GEN3_ZRXDC_NONCOMPL BIT(0)
124+
#define GEN3_RELATED_OFF_EQ_PHASE_2_3 BIT(9)
124125
#define GEN3_RELATED_OFF_RXEQ_RGRDLESS_RXTS BIT(13)
125126
#define GEN3_RELATED_OFF_GEN3_EQ_DISABLE BIT(16)
126127
#define GEN3_RELATED_OFF_RATE_SHADOW_SEL_SHIFT 24
@@ -138,6 +139,13 @@
138139
#define GEN3_EQ_FMDC_MAX_PRE_CURSOR_DELTA GENMASK(13, 10)
139140
#define GEN3_EQ_FMDC_MAX_POST_CURSOR_DELTA GENMASK(17, 14)
140141

142+
#define COHERENCY_CONTROL_1_OFF 0x8E0
143+
#define CFG_MEMTYPE_BOUNDARY_LOW_ADDR_MASK GENMASK(31, 2)
144+
#define CFG_MEMTYPE_VALUE BIT(0)
145+
146+
#define COHERENCY_CONTROL_2_OFF 0x8E4
147+
#define COHERENCY_CONTROL_3_OFF 0x8E8
148+
141149
#define PCIE_PORT_MULTI_LANE_CTRL 0x8C0
142150
#define PORT_MLTI_UPCFG_SUPPORT BIT(7)
143151

0 commit comments

Comments
 (0)