lantiq: use named pci resources
authorMathias Kresin <dev@kresin.me>
Sun, 23 Jun 2019 19:24:51 +0000 (21:24 +0200)
committerMathias Kresin <dev@kresin.me>
Mon, 12 Apr 2021 21:37:51 +0000 (23:37 +0200)
Use named resources instead of annotating the register with comments.

Signed-off-by: Mathias Kresin <dev@kresin.me>
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9.dtsi
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube.dtsi
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9.dtsi
target/linux/lantiq/patches-5.10/0204-MIPS-lantiq-pci-use-named-resources.patch [new file with mode: 0644]
target/linux/lantiq/patches-5.4/0204-MIPS-lantiq-pci-use-named-resources.patch [new file with mode: 0644]

index 455fcd21dd4d583da11631f4a00094608e768b42..1c79e811f6f78832986c9996845daf9b31776632 100644 (file)
                        bus-range = <0x0 0x0>;
                        ranges = <0x2000000 0 0x8000000 0x8000000 0 0x2000000   /* pci memory */
                                  0x1000000 0 0x00000000 0xae00000 0 0x200000>; /* io space */
-                       reg = <0x7000000 0x8000         /* config space */
-                               0xe105400 0x400>;       /* pci bridge */
+
+                       reg = <0x7000000 0x8000>, <0xe105400 0x400>;
+                       reg-names = "config", "ctrl";
+
                        lantiq,bus-clock = <33333333>;
                        interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                        interrupt-map = <0x7000 0 0 1 &icu0 30 1>;
index 2947b25146f29ec26308e961e2a7bde3feabc853..02a50a1cad2567921830d051dca71b885f077c57 100644 (file)
                        bus-range = <0x0 0x0>;
                        ranges = <0x2000000 0 0x8000000 0x8000000 0 0x2000000   /* pci memory */
                                  0x1000000 0 0x00000000 0xae00000 0 0x200000>; /* io space */
-                       reg = <0x7000000 0x8000         /* config space */
-                               0xe105400 0x400>;       /* pci bridge */
+
+                       reg = <0x7000000 0x8000>, <0xe105400 0x400>;
+                       reg-names = "config", "ctrl";
+
                        lantiq,bus-clock = <33333333>;
                        interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                        interrupt-map = <0x7000 0 0 1 &icu0 30 1>; /* slot 14, irq 30 */
index c037f3ac07acaaa18d115087cb417a19f1055c52..d39be6a127d793bf4e65006f375abcb68dc95d13 100644 (file)
                        bus-range = <0x0 0x0>;
                        ranges = <0x2000000 0 0x8000000 0x8000000 0 0x2000000   /* pci memory */
                                0x1000000 0 0x00000000 0xae00000 0 0x200000>; /* io space */
-                       reg = <0x7000000 0x8000         /* config space */
-                               0xe105400 0x400>;       /* pci bridge */
+
+                       reg = <0x7000000 0x8000>, <0xe105400 0x400>;
+                       reg-names = "config", "ctrl";
+
                        lantiq,bus-clock = <33333333>;
                        interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                        interrupt-map = <0x7000 0 0 1 &icu0 30 1>; /* slot 14, irq 30 */
diff --git a/target/linux/lantiq/patches-5.10/0204-MIPS-lantiq-pci-use-named-resources.patch b/target/linux/lantiq/patches-5.10/0204-MIPS-lantiq-pci-use-named-resources.patch
new file mode 100644 (file)
index 0000000..586fd64
--- /dev/null
@@ -0,0 +1,35 @@
+From 605bb59aa560c48d7845aa9cc4ff976a4339560b Mon Sep 17 00:00:00 2001
+From: Mathias Kresin <dev@kresin.me>
+Date: Sun, 27 Jan 2019 11:32:35 +0100
+Subject: [PATCH 5/6] MIPS: lantiq: pci: use named resources
+
+Use named resources instead of annotating the register with comments.
+
+Signed-off-by: Mathias Kresin <dev@kresin.me>
+---
+ arch/mips/boot/dts/lantiq/danube.dtsi | 5 +++--
+ arch/mips/pci/pci-lantiq.c            | 4 ++--
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c
+index 187ef82c4154..7061662c3f17 100644
+--- a/arch/mips/pci/pci-lantiq.c
++++ b/arch/mips/pci/pci-lantiq.c
+@@ -215,12 +215,12 @@ static int ltq_pci_probe(struct platform_device *pdev)
+       pci_clear_flags(PCI_PROBE_ONLY);
+-      res_bridge = platform_get_resource(pdev, IORESOURCE_MEM, 1);
++      res_bridge = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl");
+       ltq_pci_membase = devm_ioremap_resource(&pdev->dev, res_bridge);
+       if (IS_ERR(ltq_pci_membase))
+               return PTR_ERR(ltq_pci_membase);
+-      res_cfg = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++      res_cfg = platform_get_resource_byname(pdev, IORESOURCE_MEM, "config");
+       ltq_pci_mapped_cfg = devm_ioremap_resource(&pdev->dev, res_cfg);
+       if (IS_ERR(ltq_pci_mapped_cfg))
+               return PTR_ERR(ltq_pci_mapped_cfg);
+-- 
+2.17.1
+
diff --git a/target/linux/lantiq/patches-5.4/0204-MIPS-lantiq-pci-use-named-resources.patch b/target/linux/lantiq/patches-5.4/0204-MIPS-lantiq-pci-use-named-resources.patch
new file mode 100644 (file)
index 0000000..586fd64
--- /dev/null
@@ -0,0 +1,35 @@
+From 605bb59aa560c48d7845aa9cc4ff976a4339560b Mon Sep 17 00:00:00 2001
+From: Mathias Kresin <dev@kresin.me>
+Date: Sun, 27 Jan 2019 11:32:35 +0100
+Subject: [PATCH 5/6] MIPS: lantiq: pci: use named resources
+
+Use named resources instead of annotating the register with comments.
+
+Signed-off-by: Mathias Kresin <dev@kresin.me>
+---
+ arch/mips/boot/dts/lantiq/danube.dtsi | 5 +++--
+ arch/mips/pci/pci-lantiq.c            | 4 ++--
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c
+index 187ef82c4154..7061662c3f17 100644
+--- a/arch/mips/pci/pci-lantiq.c
++++ b/arch/mips/pci/pci-lantiq.c
+@@ -215,12 +215,12 @@ static int ltq_pci_probe(struct platform_device *pdev)
+       pci_clear_flags(PCI_PROBE_ONLY);
+-      res_bridge = platform_get_resource(pdev, IORESOURCE_MEM, 1);
++      res_bridge = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl");
+       ltq_pci_membase = devm_ioremap_resource(&pdev->dev, res_bridge);
+       if (IS_ERR(ltq_pci_membase))
+               return PTR_ERR(ltq_pci_membase);
+-      res_cfg = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++      res_cfg = platform_get_resource_byname(pdev, IORESOURCE_MEM, "config");
+       ltq_pci_mapped_cfg = devm_ioremap_resource(&pdev->dev, res_cfg);
+       if (IS_ERR(ltq_pci_mapped_cfg))
+               return PTR_ERR(ltq_pci_mapped_cfg);
+-- 
+2.17.1
+