Skip to content

Commit db20113

Browse files
committed
Merge branch 'pci/controller/rcar'
- Add generic T_PVPERL macro for the required interval between power being stable and PERST# being inactive (Yoshihiro Shimoda) - Factor out dw_pcie_link_set_max_link_width() (Yoshihiro Shimoda) - Update PCI_EXP_LNKCAP_MLW so Link Capabilities shows the correct max link width (Yoshihiro Shimoda) - Drop tegra194 PCI_EXP_LNKCAP_MLW setting since dw_pcie_setup() already does it (Yoshihiro Shimoda) - Add dwc support for different dbi and dbi2 register offsets, to be used for R-Car Gen4 controllers (Yoshihiro Shimoda) - Add EDMA_UNROLL capability flag for R-Car Gen4 controllers that don't correctly advertise unrolled mapping via their eDMA CTRL register (Yoshihiro Shimoda) - Export dw_pcie_ep_exit() for use by the modular R-Car Gen4 driver (Yoshihiro Shimoda) - Add .pre_init() and .deinit() hooks for use by R-Car Gen4 controllers (Yoshihiro Shimoda) - Increase snps,dw-pcie DT reg and reg-names maxItems for R-Car Gen4 controllers (Yoshihiro Shimoda) - Add rcar-gen4-pci host and endpoint DT bindings and drivers (Yoshihiro Shimoda) - Add Renesas R8A779F0 Device ID to pci_endpoint_test to allow testing on R-Car S4-8 (Yoshihiro Shimoda) * pci/controller/rcar: misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller MAINTAINERS: Update PCI DRIVER FOR RENESAS R-CAR for R-Car Gen4 PCI: rcar-gen4: Add endpoint mode support PCI: rcar-gen4: Add R-Car Gen4 PCIe controller support for host mode dt-bindings: PCI: renesas: Add R-Car Gen4 PCIe Endpoint dt-bindings: PCI: renesas: Add R-Car Gen4 PCIe Host dt-bindings: PCI: dwc: Update maxItems of reg and reg-names PCI: dwc: endpoint: Introduce .pre_init() and .deinit() PCI: dwc: Expose dw_pcie_write_dbi2() to module PCI: dwc: Expose dw_pcie_ep_exit() to module PCI: dwc: Add EDMA_UNROLL capability flag PCI: dwc: endpoint: Add multiple PFs support for dbi2 PCI: tegra194: Drop PCI_EXP_LNKSTA_NLW setting PCI: dwc: Add missing PCI_EXP_LNKCAP_MLW handling PCI: dwc: Add dw_pcie_link_set_max_link_width() PCI: Add T_PVPERL macro
2 parents eecffeb + 6c4b399 commit db20113

15 files changed

+907
-69
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) 2022-2023 Renesas Electronics Corp.
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/pci/rcar-gen4-pci-ep.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Renesas R-Car Gen4 PCIe Endpoint
9+
10+
maintainers:
11+
- Yoshihiro Shimoda <[email protected]>
12+
13+
allOf:
14+
- $ref: snps,dw-pcie-ep.yaml#
15+
16+
properties:
17+
compatible:
18+
items:
19+
- const: renesas,r8a779f0-pcie-ep # R-Car S4-8
20+
- const: renesas,rcar-gen4-pcie-ep # R-Car Gen4
21+
22+
reg:
23+
maxItems: 7
24+
25+
reg-names:
26+
items:
27+
- const: dbi
28+
- const: dbi2
29+
- const: atu
30+
- const: dma
31+
- const: app
32+
- const: phy
33+
- const: addr_space
34+
35+
interrupts:
36+
maxItems: 3
37+
38+
interrupt-names:
39+
items:
40+
- const: dma
41+
- const: sft_ce
42+
- const: app
43+
44+
clocks:
45+
maxItems: 2
46+
47+
clock-names:
48+
items:
49+
- const: core
50+
- const: ref
51+
52+
power-domains:
53+
maxItems: 1
54+
55+
resets:
56+
maxItems: 1
57+
58+
reset-names:
59+
items:
60+
- const: pwr
61+
62+
max-link-speed:
63+
maximum: 4
64+
65+
num-lanes:
66+
maximum: 4
67+
68+
max-functions:
69+
maximum: 2
70+
71+
required:
72+
- compatible
73+
- reg
74+
- reg-names
75+
- interrupts
76+
- interrupt-names
77+
- clocks
78+
- clock-names
79+
- power-domains
80+
- resets
81+
- reset-names
82+
83+
unevaluatedProperties: false
84+
85+
examples:
86+
- |
87+
#include <dt-bindings/clock/r8a779f0-cpg-mssr.h>
88+
#include <dt-bindings/interrupt-controller/arm-gic.h>
89+
#include <dt-bindings/power/r8a779f0-sysc.h>
90+
91+
soc {
92+
#address-cells = <2>;
93+
#size-cells = <2>;
94+
95+
pcie0_ep: pcie-ep@e65d0000 {
96+
compatible = "renesas,r8a779f0-pcie-ep", "renesas,rcar-gen4-pcie-ep";
97+
reg = <0 0xe65d0000 0 0x2000>, <0 0xe65d2000 0 0x1000>,
98+
<0 0xe65d3000 0 0x2000>, <0 0xe65d5000 0 0x1200>,
99+
<0 0xe65d6200 0 0x0e00>, <0 0xe65d7000 0 0x0400>,
100+
<0 0xfe000000 0 0x400000>;
101+
reg-names = "dbi", "dbi2", "atu", "dma", "app", "phy", "addr_space";
102+
interrupts = <GIC_SPI 417 IRQ_TYPE_LEVEL_HIGH>,
103+
<GIC_SPI 418 IRQ_TYPE_LEVEL_HIGH>,
104+
<GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH>;
105+
interrupt-names = "dma", "sft_ce", "app";
106+
clocks = <&cpg CPG_MOD 624>, <&pcie0_clkref>;
107+
clock-names = "core", "ref";
108+
power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
109+
resets = <&cpg 624>;
110+
reset-names = "pwr";
111+
max-link-speed = <4>;
112+
num-lanes = <2>;
113+
max-functions = /bits/ 8 <2>;
114+
};
115+
};
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) 2022-2023 Renesas Electronics Corp.
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/pci/rcar-gen4-pci-host.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Renesas R-Car Gen4 PCIe Host
9+
10+
maintainers:
11+
- Yoshihiro Shimoda <[email protected]>
12+
13+
allOf:
14+
- $ref: snps,dw-pcie.yaml#
15+
16+
properties:
17+
compatible:
18+
items:
19+
- const: renesas,r8a779f0-pcie # R-Car S4-8
20+
- const: renesas,rcar-gen4-pcie # R-Car Gen4
21+
22+
reg:
23+
maxItems: 7
24+
25+
reg-names:
26+
items:
27+
- const: dbi
28+
- const: dbi2
29+
- const: atu
30+
- const: dma
31+
- const: app
32+
- const: phy
33+
- const: config
34+
35+
interrupts:
36+
maxItems: 4
37+
38+
interrupt-names:
39+
items:
40+
- const: msi
41+
- const: dma
42+
- const: sft_ce
43+
- const: app
44+
45+
clocks:
46+
maxItems: 2
47+
48+
clock-names:
49+
items:
50+
- const: core
51+
- const: ref
52+
53+
power-domains:
54+
maxItems: 1
55+
56+
resets:
57+
maxItems: 1
58+
59+
reset-names:
60+
items:
61+
- const: pwr
62+
63+
max-link-speed:
64+
maximum: 4
65+
66+
num-lanes:
67+
maximum: 4
68+
69+
required:
70+
- compatible
71+
- reg
72+
- reg-names
73+
- interrupts
74+
- interrupt-names
75+
- clocks
76+
- clock-names
77+
- power-domains
78+
- resets
79+
- reset-names
80+
81+
unevaluatedProperties: false
82+
83+
examples:
84+
- |
85+
#include <dt-bindings/clock/r8a779f0-cpg-mssr.h>
86+
#include <dt-bindings/interrupt-controller/arm-gic.h>
87+
#include <dt-bindings/power/r8a779f0-sysc.h>
88+
89+
soc {
90+
#address-cells = <2>;
91+
#size-cells = <2>;
92+
93+
pcie: pcie@e65d0000 {
94+
compatible = "renesas,r8a779f0-pcie", "renesas,rcar-gen4-pcie";
95+
reg = <0 0xe65d0000 0 0x1000>, <0 0xe65d2000 0 0x0800>,
96+
<0 0xe65d3000 0 0x2000>, <0 0xe65d5000 0 0x1200>,
97+
<0 0xe65d6200 0 0x0e00>, <0 0xe65d7000 0 0x0400>,
98+
<0 0xfe000000 0 0x400000>;
99+
reg-names = "dbi", "dbi2", "atu", "dma", "app", "phy", "config";
100+
interrupts = <GIC_SPI 416 IRQ_TYPE_LEVEL_HIGH>,
101+
<GIC_SPI 417 IRQ_TYPE_LEVEL_HIGH>,
102+
<GIC_SPI 418 IRQ_TYPE_LEVEL_HIGH>,
103+
<GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH>;
104+
interrupt-names = "msi", "dma", "sft_ce", "app";
105+
clocks = <&cpg CPG_MOD 624>, <&pcie0_clkref>;
106+
clock-names = "core", "ref";
107+
power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
108+
resets = <&cpg 624>;
109+
reset-names = "pwr";
110+
max-link-speed = <4>;
111+
num-lanes = <2>;
112+
#address-cells = <3>;
113+
#size-cells = <2>;
114+
bus-range = <0x00 0xff>;
115+
device_type = "pci";
116+
ranges = <0x01000000 0 0x00000000 0 0xfe000000 0 0x00400000>,
117+
<0x02000000 0 0x30000000 0 0x30000000 0 0x10000000>;
118+
dma-ranges = <0x42000000 0 0x00000000 0 0x00000000 1 0x00000000>;
119+
#interrupt-cells = <1>;
120+
interrupt-map-mask = <0 0 0 7>;
121+
interrupt-map = <0 0 0 1 &gic GIC_SPI 416 IRQ_TYPE_LEVEL_HIGH>,
122+
<0 0 0 2 &gic GIC_SPI 416 IRQ_TYPE_LEVEL_HIGH>,
123+
<0 0 0 3 &gic GIC_SPI 416 IRQ_TYPE_LEVEL_HIGH>,
124+
<0 0 0 4 &gic GIC_SPI 416 IRQ_TYPE_LEVEL_HIGH>;
125+
snps,enable-cdm-check;
126+
};
127+
};

Documentation/devicetree/bindings/pci/snps,dw-pcie-common.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ properties:
3333
specific for each activated function, while the rest of the sub-spaces
3434
are common for all of them (if there are more than one).
3535
minItems: 2
36-
maxItems: 6
36+
maxItems: 7
3737

3838
reg-names:
3939
minItems: 2
40-
maxItems: 6
40+
maxItems: 7
4141

4242
interrupts:
4343
description:

Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ properties:
3333
normal controller functioning. iATU memory IO region is also required
3434
if the space is unrolled (IP-core version >= 4.80a).
3535
minItems: 2
36-
maxItems: 5
36+
maxItems: 7
3737

3838
reg-names:
3939
minItems: 2
40-
maxItems: 5
40+
maxItems: 7
4141
items:
4242
oneOf:
4343
- description:

Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ properties:
4242
are required for the normal controller work. iATU memory IO region is
4343
also required if the space is unrolled (IP-core version >= 4.80a).
4444
minItems: 2
45-
maxItems: 5
45+
maxItems: 7
4646

4747
reg-names:
4848
minItems: 2
49-
maxItems: 5
49+
maxItems: 7
5050
items:
5151
oneOf:
5252
- description:

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16424,6 +16424,7 @@ L: [email protected]
1642416424
S: Maintained
1642516425
F: Documentation/devicetree/bindings/pci/*rcar*
1642616426
F: drivers/pci/controller/*rcar*
16427+
F: drivers/pci/controller/dwc/*rcar*
1642716428

1642816429
PCI DRIVER FOR SAMSUNG EXYNOS
1642916430
M: Jingoo Han <[email protected]>

drivers/misc/pci_endpoint_test.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
#define PCI_DEVICE_ID_RENESAS_R8A774B1 0x002b
8282
#define PCI_DEVICE_ID_RENESAS_R8A774C0 0x002d
8383
#define PCI_DEVICE_ID_RENESAS_R8A774E1 0x0025
84+
#define PCI_DEVICE_ID_RENESAS_R8A779F0 0x0031
8485

8586
static DEFINE_IDA(pci_endpoint_test_ida);
8687

@@ -990,6 +991,9 @@ static const struct pci_device_id pci_endpoint_test_tbl[] = {
990991
{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774B1),},
991992
{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774C0),},
992993
{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A774E1),},
994+
{ PCI_DEVICE(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_R8A779F0),
995+
.driver_data = (kernel_ulong_t)&default_data,
996+
},
993997
{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_J721E),
994998
.driver_data = (kernel_ulong_t)&j721e_data,
995999
},

drivers/pci/controller/dwc/Kconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,31 @@ config PCIE_QCOM_EP
286286
to work in endpoint mode. The PCIe controller uses the DesignWare core
287287
plus Qualcomm-specific hardware wrappers.
288288

289+
config PCIE_RCAR_GEN4
290+
tristate
291+
292+
config PCIE_RCAR_GEN4_HOST
293+
tristate "Renesas R-Car Gen4 PCIe controller (host mode)"
294+
depends on ARCH_RENESAS || COMPILE_TEST
295+
depends on PCI_MSI
296+
select PCIE_DW_HOST
297+
select PCIE_RCAR_GEN4
298+
help
299+
Say Y here if you want PCIe controller (host mode) on R-Car Gen4 SoCs.
300+
To compile this driver as a module, choose M here: the module will be
301+
called pcie-rcar-gen4.ko. This uses the DesignWare core.
302+
303+
config PCIE_RCAR_GEN4_EP
304+
tristate "Renesas R-Car Gen4 PCIe controller (endpoint mode)"
305+
depends on ARCH_RENESAS || COMPILE_TEST
306+
depends on PCI_ENDPOINT
307+
select PCIE_DW_EP
308+
select PCIE_RCAR_GEN4
309+
help
310+
Say Y here if you want PCIe controller (endpoint mode) on R-Car Gen4
311+
SoCs. To compile this driver as a module, choose M here: the module
312+
will be called pcie-rcar-gen4.ko. This uses the DesignWare core.
313+
289314
config PCIE_ROCKCHIP_DW_HOST
290315
bool "Rockchip DesignWare PCIe controller"
291316
select PCIE_DW

drivers/pci/controller/dwc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ obj-$(CONFIG_PCIE_TEGRA194) += pcie-tegra194.o
2626
obj-$(CONFIG_PCIE_UNIPHIER) += pcie-uniphier.o
2727
obj-$(CONFIG_PCIE_UNIPHIER_EP) += pcie-uniphier-ep.o
2828
obj-$(CONFIG_PCIE_VISCONTI_HOST) += pcie-visconti.o
29+
obj-$(CONFIG_PCIE_RCAR_GEN4) += pcie-rcar-gen4.o
2930

3031
# The following drivers are for devices that use the generic ACPI
3132
# pci_root.c driver but don't support standard ECAM config access.

0 commit comments

Comments
 (0)