* [PATCH v2 1/4] dt-bindings: PCI: uniphier: Add iATU register description
2020-09-28 1:05 [PATCH v2 0/4] PCI: dwc: Move iATU register mapping to common framework Kunihiko Hayashi
@ 2020-09-28 1:05 ` Kunihiko Hayashi
2020-09-28 1:05 ` [PATCH v2 2/4] dt-bindings: PCI: uniphier-ep: " Kunihiko Hayashi
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Kunihiko Hayashi @ 2020-09-28 1:05 UTC (permalink / raw)
To: Rob Herring, Bjorn Helgaas, Lorenzo Pieralisi, Jingoo Han,
Gustavo Pimentel, Murali Karicheri
Cc: linux-pci, devicetree, linux-arm-kernel, linux-kernel,
Masami Hiramatsu, Jassi Brar, Kunihiko Hayashi
In the dt-bindings, "atu" reg-names is required to get the register space
for iATU in Synopsys DWC version 4.80 or later.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/pci/uniphier-pcie.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/pci/uniphier-pcie.txt b/Documentation/devicetree/bindings/pci/uniphier-pcie.txt
index 1fa2c59..c4b7381 100644
--- a/Documentation/devicetree/bindings/pci/uniphier-pcie.txt
+++ b/Documentation/devicetree/bindings/pci/uniphier-pcie.txt
@@ -16,6 +16,7 @@ Required properties:
"dbi" - controller configuration registers
"link" - SoC-specific glue layer registers
"config" - PCIe configuration space
+ "atu" - iATU registers for DWC version 4.80 or later
- clocks: A phandle to the clock gate for PCIe glue layer including
the host controller.
- resets: A phandle to the reset line for PCIe glue layer including
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/4] dt-bindings: PCI: uniphier-ep: Add iATU register description
2020-09-28 1:05 [PATCH v2 0/4] PCI: dwc: Move iATU register mapping to common framework Kunihiko Hayashi
2020-09-28 1:05 ` [PATCH v2 1/4] dt-bindings: PCI: uniphier: Add iATU register description Kunihiko Hayashi
@ 2020-09-28 1:05 ` Kunihiko Hayashi
2020-09-28 18:09 ` Rob Herring
2020-09-28 1:05 ` [PATCH v2 3/4] PCI: dwc: Add common iATU register support Kunihiko Hayashi
2020-09-28 1:05 ` [PATCH v2 4/4] PCI: keystone: Remove iATU register mapping Kunihiko Hayashi
3 siblings, 1 reply; 8+ messages in thread
From: Kunihiko Hayashi @ 2020-09-28 1:05 UTC (permalink / raw)
To: Rob Herring, Bjorn Helgaas, Lorenzo Pieralisi, Jingoo Han,
Gustavo Pimentel, Murali Karicheri
Cc: linux-pci, devicetree, linux-arm-kernel, linux-kernel,
Masami Hiramatsu, Jassi Brar, Kunihiko Hayashi
In the dt-bindings, "atu" reg-names is required to get the register space
for iATU in Synopsis DWC version 4.80 or later.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.yaml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.yaml b/Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.yaml
index f0558b9..98d7d3b 100644
--- a/Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.yaml
+++ b/Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.yaml
@@ -23,7 +23,7 @@ properties:
const: socionext,uniphier-pro5-pcie-ep
reg:
- maxItems: 4
+ maxItems: 5
reg-names:
items:
@@ -31,6 +31,7 @@ properties:
- const: dbi2
- const: link
- const: addr_space
+ - const: atu
clocks:
maxItems: 2
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/4] dt-bindings: PCI: uniphier-ep: Add iATU register description
2020-09-28 1:05 ` [PATCH v2 2/4] dt-bindings: PCI: uniphier-ep: " Kunihiko Hayashi
@ 2020-09-28 18:09 ` Rob Herring
2020-09-30 5:16 ` Kunihiko Hayashi
0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2020-09-28 18:09 UTC (permalink / raw)
To: Kunihiko Hayashi
Cc: Jassi Brar, devicetree, linux-kernel, Jingoo Han, Rob Herring,
Lorenzo Pieralisi, Masami Hiramatsu, Murali Karicheri,
Bjorn Helgaas, Gustavo Pimentel, linux-arm-kernel, linux-pci
On Mon, 28 Sep 2020 10:05:31 +0900, Kunihiko Hayashi wrote:
> In the dt-bindings, "atu" reg-names is required to get the register space
> for iATU in Synopsis DWC version 4.80 or later.
>
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
> Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.yaml | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
My bot found errors running 'make dt_binding_check' on your patch:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.example.dt.yaml: pcie-ep@66000000: reg: [[1711276032, 4096], [1711280128, 4096], [1711341568, 65536], [1728053248, 4194304]] is too short
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.example.dt.yaml: pcie-ep@66000000: reg-names: ['dbi', 'dbi2', 'link', 'addr_space'] is too short
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.yaml
See https://patchwork.ozlabs.org/patch/1372225
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:
pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
Please check and re-submit.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/4] dt-bindings: PCI: uniphier-ep: Add iATU register description
2020-09-28 18:09 ` Rob Herring
@ 2020-09-30 5:16 ` Kunihiko Hayashi
0 siblings, 0 replies; 8+ messages in thread
From: Kunihiko Hayashi @ 2020-09-30 5:16 UTC (permalink / raw)
To: Rob Herring
Cc: Jassi Brar, devicetree, linux-kernel, Jingoo Han, Rob Herring,
Lorenzo Pieralisi, Masami Hiramatsu, Murali Karicheri,
Bjorn Helgaas, Gustavo Pimentel, linux-arm-kernel, linux-pci
On 2020/09/29 3:09, Rob Herring wrote:
> On Mon, 28 Sep 2020 10:05:31 +0900, Kunihiko Hayashi wrote:
>> In the dt-bindings, "atu" reg-names is required to get the register space
>> for iATU in Synopsis DWC version 4.80 or later.
>>
>> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
>> ---
>> Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.yaml | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>
>
> My bot found errors running 'make dt_binding_check' on your patch:
>
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.example.dt.yaml: pcie-ep@66000000: reg: [[1711276032, 4096], [1711280128, 4096], [1711341568, 65536], [1728053248, 4194304]] is too short
> From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.yaml
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.example.dt.yaml: pcie-ep@66000000: reg-names: ['dbi', 'dbi2', 'link', 'addr_space'] is too short
> From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.yaml
I found this binding update was wrong.
I'll fix and resend it.
>
>
> See https://patchwork.ozlabs.org/patch/1372225
>
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure dt-schema is up to date:
>
> pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
>
> Please check and re-submit.
Thank you,
---
Best Regards
Kunihiko Hayashi
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/4] PCI: dwc: Add common iATU register support
2020-09-28 1:05 [PATCH v2 0/4] PCI: dwc: Move iATU register mapping to common framework Kunihiko Hayashi
2020-09-28 1:05 ` [PATCH v2 1/4] dt-bindings: PCI: uniphier: Add iATU register description Kunihiko Hayashi
2020-09-28 1:05 ` [PATCH v2 2/4] dt-bindings: PCI: uniphier-ep: " Kunihiko Hayashi
@ 2020-09-28 1:05 ` Kunihiko Hayashi
2020-09-29 0:15 ` Rob Herring
2020-09-28 1:05 ` [PATCH v2 4/4] PCI: keystone: Remove iATU register mapping Kunihiko Hayashi
3 siblings, 1 reply; 8+ messages in thread
From: Kunihiko Hayashi @ 2020-09-28 1:05 UTC (permalink / raw)
To: Rob Herring, Bjorn Helgaas, Lorenzo Pieralisi, Jingoo Han,
Gustavo Pimentel, Murali Karicheri
Cc: linux-pci, devicetree, linux-arm-kernel, linux-kernel,
Masami Hiramatsu, Jassi Brar, Kunihiko Hayashi
This gets iATU register area from reg property that has reg-names "atu".
In Synopsys DWC version 4.80 or later, since iATU register area is
separated from core register area, this area is necessary to get from
DT independently.
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pci/controller/dwc/pcie-designware.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index 3fe859f..b6b39af 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -10,6 +10,7 @@
#include <linux/delay.h>
#include <linux/of.h>
+#include <linux/of_platform.h>
#include <linux/types.h>
#include "../../pci.h"
@@ -548,11 +549,15 @@ void dw_pcie_setup(struct dw_pcie *pci)
u32 val;
struct device *dev = pci->dev;
struct device_node *np = dev->of_node;
+ struct platform_device *pdev = to_platform_device(dev);
if (pci->version >= 0x480A || (!pci->version &&
dw_pcie_iatu_unroll_enabled(pci))) {
pci->iatu_unroll_enabled = true;
if (!pci->atu_base)
+ pci->atu_base =
+ devm_platform_ioremap_resource_byname(pdev, "atu");
+ if (IS_ERR(pci->atu_base))
pci->atu_base = pci->dbi_base + DEFAULT_DBI_ATU_OFFSET;
}
dev_dbg(pci->dev, "iATU unroll: %s\n", pci->iatu_unroll_enabled ?
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 3/4] PCI: dwc: Add common iATU register support
2020-09-28 1:05 ` [PATCH v2 3/4] PCI: dwc: Add common iATU register support Kunihiko Hayashi
@ 2020-09-29 0:15 ` Rob Herring
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2020-09-29 0:15 UTC (permalink / raw)
To: Kunihiko Hayashi
Cc: Bjorn Helgaas, Lorenzo Pieralisi, Jingoo Han, Gustavo Pimentel,
Murali Karicheri, PCI, devicetree, linux-arm-kernel,
linux-kernel, Masami Hiramatsu, Jassi Brar
On Sun, Sep 27, 2020 at 8:05 PM Kunihiko Hayashi
<hayashi.kunihiko@socionext.com> wrote:
>
> This gets iATU register area from reg property that has reg-names "atu".
> In Synopsys DWC version 4.80 or later, since iATU register area is
> separated from core register area, this area is necessary to get from
> DT independently.
>
> Cc: Murali Karicheri <m-karicheri2@ti.com>
> Cc: Jingoo Han <jingoohan1@gmail.com>
> Cc: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
> Suggested-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
> drivers/pci/controller/dwc/pcie-designware.c | 5 +++++
> 1 file changed, 5 insertions(+)
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 4/4] PCI: keystone: Remove iATU register mapping
2020-09-28 1:05 [PATCH v2 0/4] PCI: dwc: Move iATU register mapping to common framework Kunihiko Hayashi
` (2 preceding siblings ...)
2020-09-28 1:05 ` [PATCH v2 3/4] PCI: dwc: Add common iATU register support Kunihiko Hayashi
@ 2020-09-28 1:05 ` Kunihiko Hayashi
3 siblings, 0 replies; 8+ messages in thread
From: Kunihiko Hayashi @ 2020-09-28 1:05 UTC (permalink / raw)
To: Rob Herring, Bjorn Helgaas, Lorenzo Pieralisi, Jingoo Han,
Gustavo Pimentel, Murali Karicheri
Cc: linux-pci, devicetree, linux-arm-kernel, linux-kernel,
Masami Hiramatsu, Jassi Brar, Kunihiko Hayashi
After applying "PCI: dwc: Add common iATU register support",
there is no need to set own iATU in the Keystone driver itself.
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
drivers/pci/controller/dwc/pci-keystone.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
index b554812..a222728 100644
--- a/drivers/pci/controller/dwc/pci-keystone.c
+++ b/drivers/pci/controller/dwc/pci-keystone.c
@@ -1154,7 +1154,6 @@ static int __init ks_pcie_probe(struct platform_device *pdev)
struct keystone_pcie *ks_pcie;
struct device_link **link;
struct gpio_desc *gpiod;
- void __iomem *atu_base;
struct resource *res;
unsigned int version;
void __iomem *base;
@@ -1275,23 +1274,12 @@ static int __init ks_pcie_probe(struct platform_device *pdev)
goto err_get_sync;
}
- if (pci->version >= 0x480A) {
- atu_base = devm_platform_ioremap_resource_byname(pdev, "atu");
- if (IS_ERR(atu_base)) {
- ret = PTR_ERR(atu_base);
- goto err_get_sync;
- }
-
- pci->atu_base = atu_base;
-
+ if (pci->version >= 0x480A)
ret = ks_pcie_am654_set_mode(dev, mode);
- if (ret < 0)
- goto err_get_sync;
- } else {
+ else
ret = ks_pcie_set_mode(dev);
- if (ret < 0)
- goto err_get_sync;
- }
+ if (ret < 0)
+ goto err_get_sync;
switch (mode) {
case DW_PCIE_RC_TYPE:
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread