2018-05-23 09:59:28

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v6 1/4] ARM: dts: tegra: Remove usage of deprecated skeleton.dtsi

Remove the usage of skeleton.dtsi because it was deprecated since commit
9c0da3cc61f1 ("ARM: dts: explicitly mark skeleton.dtsi as deprecated").
It also allows later to fix DTC warnings for missing unit name in
/memory nodes.

The /chosen and /aliases nodes are added only when dependent DTSes do
not define them. Compiled DTB is the same as before this commit.

Signed-off-by: Krzysztof Kozlowski <[email protected]>

---

Changes since v5:
1. New patch, split with skeleton.dtsi removal (suggested by Stefan).
---
arch/arm/boot/dts/tegra114.dtsi | 8 ++++++--
arch/arm/boot/dts/tegra124.dtsi | 6 ++++--
arch/arm/boot/dts/tegra20.dtsi | 11 +++++++++--
arch/arm/boot/dts/tegra30-apalis.dtsi | 4 ++++
arch/arm/boot/dts/tegra30.dtsi | 11 +++++++++--
5 files changed, 32 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
index 0e4a13295d8a..27ef515e5640 100644
--- a/arch/arm/boot/dts/tegra114.dtsi
+++ b/arch/arm/boot/dts/tegra114.dtsi
@@ -5,11 +5,15 @@
#include <dt-bindings/pinctrl/pinctrl-tegra.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>

-#include "skeleton.dtsi"
-
/ {
compatible = "nvidia,tegra114";
interrupt-parent = <&lic>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ memory {
+ device_type = "memory";
+ };

host1x@50000000 {
compatible = "nvidia,tegra114-host1x", "simple-bus";
diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
index 174092bfac90..951feea784af 100644
--- a/arch/arm/boot/dts/tegra124.dtsi
+++ b/arch/arm/boot/dts/tegra124.dtsi
@@ -7,14 +7,16 @@
#include <dt-bindings/reset/tegra124-car.h>
#include <dt-bindings/thermal/tegra124-soctherm.h>

-#include "skeleton.dtsi"
-
/ {
compatible = "nvidia,tegra124";
interrupt-parent = <&lic>;
#address-cells = <2>;
#size-cells = <2>;

+ memory {
+ device_type = "memory";
+ };
+
pcie@1003000 {
compatible = "nvidia,tegra124-pcie";
device_type = "pci";
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 0a7136462a1a..88dd1afb5877 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -4,11 +4,18 @@
#include <dt-bindings/pinctrl/pinctrl-tegra.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>

-#include "skeleton.dtsi"
-
/ {
compatible = "nvidia,tegra20";
interrupt-parent = <&lic>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ chosen { };
+ aliases { };
+
+ memory {
+ device_type = "memory";
+ };

iram@40000000 {
compatible = "mmio-sram";
diff --git a/arch/arm/boot/dts/tegra30-apalis.dtsi b/arch/arm/boot/dts/tegra30-apalis.dtsi
index d1d21ec2a844..6f29cbad6e8a 100644
--- a/arch/arm/boot/dts/tegra30-apalis.dtsi
+++ b/arch/arm/boot/dts/tegra30-apalis.dtsi
@@ -10,6 +10,10 @@
model = "Toradex Apalis T30";
compatible = "toradex,apalis_t30", "nvidia,tegra30";

+ memory {
+ reg = <0 0>;
+ };
+
pcie@3000 {
avdd-pexa-supply = <&vdd2_reg>;
vdd-pexa-supply = <&vdd2_reg>;
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index a110cf84d85f..19237c08c166 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -5,11 +5,18 @@
#include <dt-bindings/pinctrl/pinctrl-tegra.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>

-#include "skeleton.dtsi"
-
/ {
compatible = "nvidia,tegra30";
interrupt-parent = <&lic>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ chosen { };
+ aliases { };
+
+ memory {
+ device_type = "memory";
+ };

pcie@3000 {
compatible = "nvidia,tegra30-pcie";
--
2.7.4



2018-05-23 09:57:55

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v6 4/4] ARM: dts: tegra: Work safely with 256 MB Colibri-T20 modules

Colibri-T20 can come in 256 MB RAM (with 512 MB NAND) or 512 MB RAM
(with 1024 MB NAND) flavors. Both of them will use the same DTSI
expecting the bootloader to do the fixup of /memory node. However in
case it does not happen, let's stay on safe side by limiting the memory
to 256 MB for both versions of Colibri-T20.

Signed-off-by: Krzysztof Kozlowski <[email protected]>

---

RFT:
Not tested on 512 MB module as I have only the 256 MB one.

Changes since v5:
1. Add "colibri" suffix to iris DTS (suggested by Stefan).

Changes since v4:
1. Drop the 512 suffix from file names (suggested by Stefan).

Changes since v3:
1. Reduce the memory in existing DTSI instead of creating a new one
(suggested by Marcel).

Changes since v2:
1. Do not add new compatible but use everywhere existing
"toradex,colibri_t20-512" (suggested by Rob).

Changes since v1:
1. Fix memory size in tegra20-colibri-256.dtsi (was working fine because
my bootloader uses mem= argument).
---
arch/arm/boot/dts/Makefile | 2 +-
.../boot/dts/{tegra20-iris-512.dts => tegra20-colibri-iris.dts} | 4 ++--
.../boot/dts/{tegra20-colibri-512.dtsi => tegra20-colibri.dtsi} | 9 +++++++--
3 files changed, 10 insertions(+), 5 deletions(-)
rename arch/arm/boot/dts/{tegra20-iris-512.dts => tegra20-colibri-iris.dts} (95%)
rename arch/arm/boot/dts/{tegra20-colibri-512.dtsi => tegra20-colibri.dtsi} (98%)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index ec2024ea8b1e..1c8bb55c0948 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1030,7 +1030,7 @@ dtb-$(CONFIG_ARCH_TANGO) += \
tango4-vantage-1172.dtb
dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += \
tegra20-harmony.dtb \
- tegra20-iris-512.dtb \
+ tegra20-colibri-iris.dtb \
tegra20-medcom-wide.dtb \
tegra20-paz00.dtb \
tegra20-plutux.dtb \
diff --git a/arch/arm/boot/dts/tegra20-iris-512.dts b/arch/arm/boot/dts/tegra20-colibri-iris.dts
similarity index 95%
rename from arch/arm/boot/dts/tegra20-iris-512.dts
rename to arch/arm/boot/dts/tegra20-colibri-iris.dts
index 40126388946d..57f16c0e9917 100644
--- a/arch/arm/boot/dts/tegra20-iris-512.dts
+++ b/arch/arm/boot/dts/tegra20-colibri-iris.dts
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

-#include "tegra20-colibri-512.dtsi"
+#include "tegra20-colibri.dtsi"

/ {
- model = "Toradex Colibri T20 512MB on Iris";
+ model = "Toradex Colibri T20 256/512 MB on Iris";
compatible = "toradex,iris", "toradex,colibri_t20-512", "nvidia,tegra20";

aliases {
diff --git a/arch/arm/boot/dts/tegra20-colibri-512.dtsi b/arch/arm/boot/dts/tegra20-colibri.dtsi
similarity index 98%
rename from arch/arm/boot/dts/tegra20-colibri-512.dtsi
rename to arch/arm/boot/dts/tegra20-colibri.dtsi
index 5623ff8d128c..dc06b23183e1 100644
--- a/arch/arm/boot/dts/tegra20-colibri-512.dtsi
+++ b/arch/arm/boot/dts/tegra20-colibri.dtsi
@@ -2,7 +2,7 @@
#include "tegra20.dtsi"

/ {
- model = "Toradex Colibri T20 512MB";
+ model = "Toradex Colibri T20 256/512 MB";
compatible = "toradex,colibri_t20-512", "nvidia,tegra20";

aliases {
@@ -11,7 +11,12 @@
};

memory@0 {
- reg = <0x00000000 0x20000000>;
+ /*
+ * Set memory to 256 MB to be safe as this could be used on
+ * 256 or 512 MB module. It is expected from bootloader
+ * to fix this up for 512 MB version.
+ */
+ reg = <0x00000000 0x10000000>;
};

host1x@50000000 {
--
2.7.4


2018-05-23 09:58:14

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v6 2/4] ARM: dts: tegra: Fix unit_address_vs_reg DTC warnings for /memory

Add a generic /memory node in each Tegra DTSI (with empty reg property,
to be overidden by each DTS) and set proper unit address for /memory
nodes to fix the DTC warnings:

arch/arm/boot/dts/tegra20-harmony.dtb: Warning (unit_address_vs_reg):
/memory: node has a reg or ranges property, but no unit name

The DTB after the change is the same as before except adding
unit-address to /memory node.

Signed-off-by: Krzysztof Kozlowski <[email protected]>

---

Changes since v5:
1. Split with skeleton.dtsi removal (suggested by Stefan).

Changes since v4:
1. None
---
arch/arm/boot/dts/tegra114-dalmore.dts | 2 +-
arch/arm/boot/dts/tegra114-roth.dts | 2 +-
arch/arm/boot/dts/tegra114-tn7.dts | 2 +-
arch/arm/boot/dts/tegra114.dtsi | 3 ++-
arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi | 2 +-
arch/arm/boot/dts/tegra124-apalis.dtsi | 2 +-
arch/arm/boot/dts/tegra124-jetson-tk1.dts | 2 +-
arch/arm/boot/dts/tegra124-nyan.dtsi | 2 +-
arch/arm/boot/dts/tegra124-venice2.dts | 2 +-
arch/arm/boot/dts/tegra124.dtsi | 3 ++-
arch/arm/boot/dts/tegra20-colibri-512.dtsi | 2 +-
arch/arm/boot/dts/tegra20-harmony.dts | 2 +-
arch/arm/boot/dts/tegra20-paz00.dts | 2 +-
arch/arm/boot/dts/tegra20-seaboard.dts | 2 +-
arch/arm/boot/dts/tegra20-tamonten.dtsi | 2 +-
arch/arm/boot/dts/tegra20-trimslice.dts | 2 +-
arch/arm/boot/dts/tegra20-ventana.dts | 2 +-
arch/arm/boot/dts/tegra20.dtsi | 3 ++-
arch/arm/boot/dts/tegra30-apalis.dtsi | 4 ++--
arch/arm/boot/dts/tegra30-beaver.dts | 2 +-
arch/arm/boot/dts/tegra30-cardhu.dtsi | 2 +-
arch/arm/boot/dts/tegra30-colibri.dtsi | 2 +-
arch/arm/boot/dts/tegra30.dtsi | 3 ++-
23 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/arch/arm/boot/dts/tegra114-dalmore.dts b/arch/arm/boot/dts/tegra114-dalmore.dts
index eafff16765b4..1788556b4977 100644
--- a/arch/arm/boot/dts/tegra114-dalmore.dts
+++ b/arch/arm/boot/dts/tegra114-dalmore.dts
@@ -23,7 +23,7 @@
stdout-path = "serial0:115200n8";
};

- memory {
+ memory@80000000 {
reg = <0x80000000 0x40000000>;
};

diff --git a/arch/arm/boot/dts/tegra114-roth.dts b/arch/arm/boot/dts/tegra114-roth.dts
index 7ed7370ee67a..3d3835591cd2 100644
--- a/arch/arm/boot/dts/tegra114-roth.dts
+++ b/arch/arm/boot/dts/tegra114-roth.dts
@@ -28,7 +28,7 @@
};
};

- memory {
+ memory@80000000 {
/* memory >= 0x79600000 is reserved for firmware usage */
reg = <0x80000000 0x79600000>;
};
diff --git a/arch/arm/boot/dts/tegra114-tn7.dts b/arch/arm/boot/dts/tegra114-tn7.dts
index 7fc4a8b31e45..bfdd1bf61816 100644
--- a/arch/arm/boot/dts/tegra114-tn7.dts
+++ b/arch/arm/boot/dts/tegra114-tn7.dts
@@ -28,7 +28,7 @@
};
};

- memory {
+ memory@80000000 {
/* memory >= 0x37e00000 is reserved for firmware usage */
reg = <0x80000000 0x37e00000>;
};
diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
index 27ef515e5640..aff4b8e115bc 100644
--- a/arch/arm/boot/dts/tegra114.dtsi
+++ b/arch/arm/boot/dts/tegra114.dtsi
@@ -11,8 +11,9 @@
#address-cells = <1>;
#size-cells = <1>;

- memory {
+ memory@80000000 {
device_type = "memory";
+ reg = <0x80000000 0>;
};

host1x@50000000 {
diff --git a/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi b/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
index bb67edb016c5..6a7f45651d38 100644
--- a/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
+++ b/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
@@ -15,7 +15,7 @@
compatible = "toradex,apalis-tk1-v1.2", "toradex,apalis-tk1",
"nvidia,tegra124";

- memory {
+ memory@0 {
reg = <0x0 0x80000000 0x0 0x80000000>;
};

diff --git a/arch/arm/boot/dts/tegra124-apalis.dtsi b/arch/arm/boot/dts/tegra124-apalis.dtsi
index 65a2161b9b8e..e4625abd0a8a 100644
--- a/arch/arm/boot/dts/tegra124-apalis.dtsi
+++ b/arch/arm/boot/dts/tegra124-apalis.dtsi
@@ -50,7 +50,7 @@
model = "Toradex Apalis TK1";
compatible = "toradex,apalis-tk1", "nvidia,tegra124";

- memory {
+ memory@0 {
reg = <0x0 0x80000000 0x0 0x80000000>;
};

diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
index 6dbcf84dafbc..e23b1159e8fd 100644
--- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
+++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
@@ -24,7 +24,7 @@
stdout-path = "serial0:115200n8";
};

- memory {
+ memory@0 {
reg = <0x0 0x80000000 0x0 0x80000000>;
};

diff --git a/arch/arm/boot/dts/tegra124-nyan.dtsi b/arch/arm/boot/dts/tegra124-nyan.dtsi
index 3609367037a6..f45ac668d88c 100644
--- a/arch/arm/boot/dts/tegra124-nyan.dtsi
+++ b/arch/arm/boot/dts/tegra124-nyan.dtsi
@@ -13,7 +13,7 @@
stdout-path = "serial0:115200n8";
};

- memory {
+ memory@0 {
reg = <0x0 0x80000000 0x0 0x80000000>;
};

diff --git a/arch/arm/boot/dts/tegra124-venice2.dts b/arch/arm/boot/dts/tegra124-venice2.dts
index 89bcc178994d..44492b48e165 100644
--- a/arch/arm/boot/dts/tegra124-venice2.dts
+++ b/arch/arm/boot/dts/tegra124-venice2.dts
@@ -18,7 +18,7 @@
stdout-path = "serial0:115200n8";
};

- memory {
+ memory@0 {
reg = <0x0 0x80000000 0x0 0x80000000>;
};

diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
index 951feea784af..ad9c9cd6fa8a 100644
--- a/arch/arm/boot/dts/tegra124.dtsi
+++ b/arch/arm/boot/dts/tegra124.dtsi
@@ -13,8 +13,9 @@
#address-cells = <2>;
#size-cells = <2>;

- memory {
+ memory@0 {
device_type = "memory";
+ reg = <0 0>;
};

pcie@1003000 {
diff --git a/arch/arm/boot/dts/tegra20-colibri-512.dtsi b/arch/arm/boot/dts/tegra20-colibri-512.dtsi
index 5c202b3e3bb1..5623ff8d128c 100644
--- a/arch/arm/boot/dts/tegra20-colibri-512.dtsi
+++ b/arch/arm/boot/dts/tegra20-colibri-512.dtsi
@@ -10,7 +10,7 @@
rtc1 = "/rtc@7000e000";
};

- memory {
+ memory@0 {
reg = <0x00000000 0x20000000>;
};

diff --git a/arch/arm/boot/dts/tegra20-harmony.dts b/arch/arm/boot/dts/tegra20-harmony.dts
index 628a55a9318b..1d96d92b72a7 100644
--- a/arch/arm/boot/dts/tegra20-harmony.dts
+++ b/arch/arm/boot/dts/tegra20-harmony.dts
@@ -18,7 +18,7 @@
stdout-path = "serial0:115200n8";
};

- memory {
+ memory@0 {
reg = <0x00000000 0x40000000>;
};

diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts
index 30436969adc0..ef245291924f 100644
--- a/arch/arm/boot/dts/tegra20-paz00.dts
+++ b/arch/arm/boot/dts/tegra20-paz00.dts
@@ -19,7 +19,7 @@
stdout-path = "serial0:115200n8";
};

- memory {
+ memory@0 {
reg = <0x00000000 0x20000000>;
};

diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts b/arch/arm/boot/dts/tegra20-seaboard.dts
index 284aae351ff2..f91441683aad 100644
--- a/arch/arm/boot/dts/tegra20-seaboard.dts
+++ b/arch/arm/boot/dts/tegra20-seaboard.dts
@@ -18,7 +18,7 @@
stdout-path = "serial0:115200n8";
};

- memory {
+ memory@0 {
reg = <0x00000000 0x40000000>;
};

diff --git a/arch/arm/boot/dts/tegra20-tamonten.dtsi b/arch/arm/boot/dts/tegra20-tamonten.dtsi
index 872046d48709..20137fc578b1 100644
--- a/arch/arm/boot/dts/tegra20-tamonten.dtsi
+++ b/arch/arm/boot/dts/tegra20-tamonten.dtsi
@@ -15,7 +15,7 @@
stdout-path = "serial0:115200n8";
};

- memory {
+ memory@0 {
reg = <0x00000000 0x20000000>;
};

diff --git a/arch/arm/boot/dts/tegra20-trimslice.dts b/arch/arm/boot/dts/tegra20-trimslice.dts
index d55c6b240a30..9eb26dc15f6b 100644
--- a/arch/arm/boot/dts/tegra20-trimslice.dts
+++ b/arch/arm/boot/dts/tegra20-trimslice.dts
@@ -18,7 +18,7 @@
stdout-path = "serial0:115200n8";
};

- memory {
+ memory@0 {
reg = <0x00000000 0x40000000>;
};

diff --git a/arch/arm/boot/dts/tegra20-ventana.dts b/arch/arm/boot/dts/tegra20-ventana.dts
index ee3fbf941e79..f44551e2d9d0 100644
--- a/arch/arm/boot/dts/tegra20-ventana.dts
+++ b/arch/arm/boot/dts/tegra20-ventana.dts
@@ -18,7 +18,7 @@
stdout-path = "serial0:115200n8";
};

- memory {
+ memory@0 {
reg = <0x00000000 0x40000000>;
};

diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 88dd1afb5877..55581c0e5105 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -13,8 +13,9 @@
chosen { };
aliases { };

- memory {
+ memory@0 {
device_type = "memory";
+ reg = <0 0>;
};

iram@40000000 {
diff --git a/arch/arm/boot/dts/tegra30-apalis.dtsi b/arch/arm/boot/dts/tegra30-apalis.dtsi
index 6f29cbad6e8a..9465fc592b7b 100644
--- a/arch/arm/boot/dts/tegra30-apalis.dtsi
+++ b/arch/arm/boot/dts/tegra30-apalis.dtsi
@@ -10,8 +10,8 @@
model = "Toradex Apalis T30";
compatible = "toradex,apalis_t30", "nvidia,tegra30";

- memory {
- reg = <0 0>;
+ memory@80000000 {
+ reg = <0x80000000 0x40000000>;
};

pcie@3000 {
diff --git a/arch/arm/boot/dts/tegra30-beaver.dts b/arch/arm/boot/dts/tegra30-beaver.dts
index ae52a5039506..1434d50438f9 100644
--- a/arch/arm/boot/dts/tegra30-beaver.dts
+++ b/arch/arm/boot/dts/tegra30-beaver.dts
@@ -17,7 +17,7 @@
stdout-path = "serial0:115200n8";
};

- memory {
+ memory@80000000 {
reg = <0x80000000 0x7ff00000>;
};

diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi b/arch/arm/boot/dts/tegra30-cardhu.dtsi
index 92a9740c533f..33b73dca16a3 100644
--- a/arch/arm/boot/dts/tegra30-cardhu.dtsi
+++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi
@@ -40,7 +40,7 @@
stdout-path = "serial0:115200n8";
};

- memory {
+ memory@80000000 {
reg = <0x80000000 0x40000000>;
};

diff --git a/arch/arm/boot/dts/tegra30-colibri.dtsi b/arch/arm/boot/dts/tegra30-colibri.dtsi
index c44d8c40c410..9bf3327665d3 100644
--- a/arch/arm/boot/dts/tegra30-colibri.dtsi
+++ b/arch/arm/boot/dts/tegra30-colibri.dtsi
@@ -10,7 +10,7 @@
model = "Toradex Colibri T30";
compatible = "toradex,colibri_t30", "nvidia,tegra30";

- memory {
+ memory@80000000 {
reg = <0x80000000 0x40000000>;
};

diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index 19237c08c166..2b6243b0c6d6 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -14,8 +14,9 @@
chosen { };
aliases { };

- memory {
+ memory@80000000 {
device_type = "memory";
+ reg = <0x80000000 0>;
};

pcie@3000 {
--
2.7.4


2018-05-23 09:59:51

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v6 3/4] ARM: dts: tegra: Fix unit_address_vs_reg and avoid_unnecessary_addr_size DTC warnings

Remove unneeded address/size cells properties and unit addresses to fix
DTC warnings like:

arch/arm/boot/dts/tegra30-apalis-eval.dtb: Warning (unit_address_vs_reg):
/i2c@7000d000/stmpe811@41/stmpe_touchscreen@0: node has a unit name, but no reg property
arch/arm/boot/dts/tegra30-apalis-eval.dtb: Warning (avoid_unnecessary_addr_size):
/i2c@7000d000/stmpe811@41: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Stefan Agner <[email protected]>

---

Changes since v5:
1. Add Stefan's reviewed-by tag.

Changes since v4:
1. None
---
arch/arm/boot/dts/tegra30-apalis.dtsi | 4 +---
arch/arm/boot/dts/tegra30-beaver.dts | 3 ---
arch/arm/boot/dts/tegra30-colibri.dtsi | 2 --
3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/tegra30-apalis.dtsi b/arch/arm/boot/dts/tegra30-apalis.dtsi
index 9465fc592b7b..d1a2c0a253c8 100644
--- a/arch/arm/boot/dts/tegra30-apalis.dtsi
+++ b/arch/arm/boot/dts/tegra30-apalis.dtsi
@@ -589,8 +589,6 @@
/* STMPE811 touch screen controller */
stmpe811@41 {
compatible = "st,stmpe811";
- #address-cells = <1>;
- #size-cells = <0>;
reg = <0x41>;
interrupts = <TEGRA_GPIO(V, 0) IRQ_TYPE_LEVEL_LOW>;
interrupt-parent = <&gpio>;
@@ -599,7 +597,7 @@
blocks = <0x5>;
irq-trigger = <0x1>;

- stmpe_touchscreen@0 {
+ stmpe_touchscreen {
compatible = "st,stmpe-ts";
/* 3.25 MHz ADC clock speed */
st,adc-freq = <1>;
diff --git a/arch/arm/boot/dts/tegra30-beaver.dts b/arch/arm/boot/dts/tegra30-beaver.dts
index 1434d50438f9..b0d40ac8ac6e 100644
--- a/arch/arm/boot/dts/tegra30-beaver.dts
+++ b/arch/arm/boot/dts/tegra30-beaver.dts
@@ -1790,9 +1790,6 @@
vccio-supply = <&vdd_5v_in_reg>;

regulators {
- #address-cells = <1>;
- #size-cells = <0>;
-
vdd1_reg: vdd1 {
regulator-name = "vddio_ddr_1v2";
regulator-min-microvolt = <1200000>;
diff --git a/arch/arm/boot/dts/tegra30-colibri.dtsi b/arch/arm/boot/dts/tegra30-colibri.dtsi
index 9bf3327665d3..526ed71cf7a3 100644
--- a/arch/arm/boot/dts/tegra30-colibri.dtsi
+++ b/arch/arm/boot/dts/tegra30-colibri.dtsi
@@ -351,8 +351,6 @@
/* STMPE811 touch screen controller */
stmpe811@41 {
compatible = "st,stmpe811";
- #address-cells = <1>;
- #size-cells = <0>;
reg = <0x41>;
interrupts = <TEGRA_GPIO(V, 0) IRQ_TYPE_LEVEL_LOW>;
interrupt-parent = <&gpio>;
--
2.7.4


2018-05-23 10:46:48

by Stefan Agner

[permalink] [raw]
Subject: Re: [PATCH v6 1/4] ARM: dts: tegra: Remove usage of deprecated skeleton.dtsi

On 23.05.2018 11:56, Krzysztof Kozlowski wrote:
> Remove the usage of skeleton.dtsi because it was deprecated since commit
> 9c0da3cc61f1 ("ARM: dts: explicitly mark skeleton.dtsi as deprecated").
> It also allows later to fix DTC warnings for missing unit name in
> /memory nodes.
>
> The /chosen and /aliases nodes are added only when dependent DTSes do
> not define them. Compiled DTB is the same as before this commit.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Hm I see, you cannot add unit address here because the board level
device tree do not have it yet... That makes the split indeed a bit less
appealing.

Anyway, now we have it, and I think it is still nice to have a separate
change.

Reviewed-by: Stefan Agner <[email protected]>

--
Stefan



>
> ---
>
> Changes since v5:
> 1. New patch, split with skeleton.dtsi removal (suggested by Stefan).
> ---
> arch/arm/boot/dts/tegra114.dtsi | 8 ++++++--
> arch/arm/boot/dts/tegra124.dtsi | 6 ++++--
> arch/arm/boot/dts/tegra20.dtsi | 11 +++++++++--
> arch/arm/boot/dts/tegra30-apalis.dtsi | 4 ++++
> arch/arm/boot/dts/tegra30.dtsi | 11 +++++++++--
> 5 files changed, 32 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
> index 0e4a13295d8a..27ef515e5640 100644
> --- a/arch/arm/boot/dts/tegra114.dtsi
> +++ b/arch/arm/boot/dts/tegra114.dtsi
> @@ -5,11 +5,15 @@
> #include <dt-bindings/pinctrl/pinctrl-tegra.h>
> #include <dt-bindings/interrupt-controller/arm-gic.h>
>
> -#include "skeleton.dtsi"
> -
> / {
> compatible = "nvidia,tegra114";
> interrupt-parent = <&lic>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + memory {
> + device_type = "memory";
> + };
>
> host1x@50000000 {
> compatible = "nvidia,tegra114-host1x", "simple-bus";
> diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
> index 174092bfac90..951feea784af 100644
> --- a/arch/arm/boot/dts/tegra124.dtsi
> +++ b/arch/arm/boot/dts/tegra124.dtsi
> @@ -7,14 +7,16 @@
> #include <dt-bindings/reset/tegra124-car.h>
> #include <dt-bindings/thermal/tegra124-soctherm.h>
>
> -#include "skeleton.dtsi"
> -
> / {
> compatible = "nvidia,tegra124";
> interrupt-parent = <&lic>;
> #address-cells = <2>;
> #size-cells = <2>;
>
> + memory {
> + device_type = "memory";
> + };
> +
> pcie@1003000 {
> compatible = "nvidia,tegra124-pcie";
> device_type = "pci";
> diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
> index 0a7136462a1a..88dd1afb5877 100644
> --- a/arch/arm/boot/dts/tegra20.dtsi
> +++ b/arch/arm/boot/dts/tegra20.dtsi
> @@ -4,11 +4,18 @@
> #include <dt-bindings/pinctrl/pinctrl-tegra.h>
> #include <dt-bindings/interrupt-controller/arm-gic.h>
>
> -#include "skeleton.dtsi"
> -
> / {
> compatible = "nvidia,tegra20";
> interrupt-parent = <&lic>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + chosen { };
> + aliases { };
> +
> + memory {
> + device_type = "memory";
> + };
>
> iram@40000000 {
> compatible = "mmio-sram";
> diff --git a/arch/arm/boot/dts/tegra30-apalis.dtsi
> b/arch/arm/boot/dts/tegra30-apalis.dtsi
> index d1d21ec2a844..6f29cbad6e8a 100644
> --- a/arch/arm/boot/dts/tegra30-apalis.dtsi
> +++ b/arch/arm/boot/dts/tegra30-apalis.dtsi
> @@ -10,6 +10,10 @@
> model = "Toradex Apalis T30";
> compatible = "toradex,apalis_t30", "nvidia,tegra30";
>
> + memory {
> + reg = <0 0>;
> + };
> +
> pcie@3000 {
> avdd-pexa-supply = <&vdd2_reg>;
> vdd-pexa-supply = <&vdd2_reg>;
> diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
> index a110cf84d85f..19237c08c166 100644
> --- a/arch/arm/boot/dts/tegra30.dtsi
> +++ b/arch/arm/boot/dts/tegra30.dtsi
> @@ -5,11 +5,18 @@
> #include <dt-bindings/pinctrl/pinctrl-tegra.h>
> #include <dt-bindings/interrupt-controller/arm-gic.h>
>
> -#include "skeleton.dtsi"
> -
> / {
> compatible = "nvidia,tegra30";
> interrupt-parent = <&lic>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + chosen { };
> + aliases { };
> +
> + memory {
> + device_type = "memory";
> + };
>
> pcie@3000 {
> compatible = "nvidia,tegra30-pcie";

2018-05-23 11:00:51

by Stefan Agner

[permalink] [raw]
Subject: Re: [PATCH v6 2/4] ARM: dts: tegra: Fix unit_address_vs_reg DTC warnings for /memory

On 23.05.2018 11:56, Krzysztof Kozlowski wrote:
> Add a generic /memory node in each Tegra DTSI (with empty reg property,
> to be overidden by each DTS) and set proper unit address for /memory
> nodes to fix the DTC warnings:
>
> arch/arm/boot/dts/tegra20-harmony.dtb: Warning (unit_address_vs_reg):
> /memory: node has a reg or ranges property, but no unit name
>
> The DTB after the change is the same as before except adding
> unit-address to /memory node.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>
> ---
>
> Changes since v5:
> 1. Split with skeleton.dtsi removal (suggested by Stefan).
>
> Changes since v4:
> 1. None
> ---
> arch/arm/boot/dts/tegra114-dalmore.dts | 2 +-
> arch/arm/boot/dts/tegra114-roth.dts | 2 +-
> arch/arm/boot/dts/tegra114-tn7.dts | 2 +-
> arch/arm/boot/dts/tegra114.dtsi | 3 ++-
> arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi | 2 +-
> arch/arm/boot/dts/tegra124-apalis.dtsi | 2 +-
> arch/arm/boot/dts/tegra124-jetson-tk1.dts | 2 +-
> arch/arm/boot/dts/tegra124-nyan.dtsi | 2 +-
> arch/arm/boot/dts/tegra124-venice2.dts | 2 +-
> arch/arm/boot/dts/tegra124.dtsi | 3 ++-
> arch/arm/boot/dts/tegra20-colibri-512.dtsi | 2 +-
> arch/arm/boot/dts/tegra20-harmony.dts | 2 +-
> arch/arm/boot/dts/tegra20-paz00.dts | 2 +-
> arch/arm/boot/dts/tegra20-seaboard.dts | 2 +-
> arch/arm/boot/dts/tegra20-tamonten.dtsi | 2 +-
> arch/arm/boot/dts/tegra20-trimslice.dts | 2 +-
> arch/arm/boot/dts/tegra20-ventana.dts | 2 +-
> arch/arm/boot/dts/tegra20.dtsi | 3 ++-
> arch/arm/boot/dts/tegra30-apalis.dtsi | 4 ++--
> arch/arm/boot/dts/tegra30-beaver.dts | 2 +-
> arch/arm/boot/dts/tegra30-cardhu.dtsi | 2 +-
> arch/arm/boot/dts/tegra30-colibri.dtsi | 2 +-
> arch/arm/boot/dts/tegra30.dtsi | 3 ++-
> 23 files changed, 28 insertions(+), 24 deletions(-)
>
> diff --git a/arch/arm/boot/dts/tegra114-dalmore.dts
> b/arch/arm/boot/dts/tegra114-dalmore.dts
> index eafff16765b4..1788556b4977 100644
> --- a/arch/arm/boot/dts/tegra114-dalmore.dts
> +++ b/arch/arm/boot/dts/tegra114-dalmore.dts
> @@ -23,7 +23,7 @@
> stdout-path = "serial0:115200n8";
> };
>
> - memory {
> + memory@80000000 {
> reg = <0x80000000 0x40000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra114-roth.dts
> b/arch/arm/boot/dts/tegra114-roth.dts
> index 7ed7370ee67a..3d3835591cd2 100644
> --- a/arch/arm/boot/dts/tegra114-roth.dts
> +++ b/arch/arm/boot/dts/tegra114-roth.dts
> @@ -28,7 +28,7 @@
> };
> };
>
> - memory {
> + memory@80000000 {
> /* memory >= 0x79600000 is reserved for firmware usage */
> reg = <0x80000000 0x79600000>;
> };
> diff --git a/arch/arm/boot/dts/tegra114-tn7.dts
> b/arch/arm/boot/dts/tegra114-tn7.dts
> index 7fc4a8b31e45..bfdd1bf61816 100644
> --- a/arch/arm/boot/dts/tegra114-tn7.dts
> +++ b/arch/arm/boot/dts/tegra114-tn7.dts
> @@ -28,7 +28,7 @@
> };
> };
>
> - memory {
> + memory@80000000 {
> /* memory >= 0x37e00000 is reserved for firmware usage */
> reg = <0x80000000 0x37e00000>;
> };
> diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
> index 27ef515e5640..aff4b8e115bc 100644
> --- a/arch/arm/boot/dts/tegra114.dtsi
> +++ b/arch/arm/boot/dts/tegra114.dtsi
> @@ -11,8 +11,9 @@
> #address-cells = <1>;
> #size-cells = <1>;
>
> - memory {
> + memory@80000000 {
> device_type = "memory";
> + reg = <0x80000000 0>;

Nit: I'd rather prefer

reg = <0x80000000 0x0>;


> };
>
> host1x@50000000 {
> diff --git a/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
> b/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
> index bb67edb016c5..6a7f45651d38 100644
> --- a/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
> +++ b/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
> @@ -15,7 +15,7 @@
> compatible = "toradex,apalis-tk1-v1.2", "toradex,apalis-tk1",
> "nvidia,tegra124";
>
> - memory {
> + memory@0 {
> reg = <0x0 0x80000000 0x0 0x80000000>;
> };

Unit address combines all address cells, so this should be 80000000
here. See also the device tree spec (v0.2) which has an example in
chapter 3.4 /memory node.

So this should be:

memory@80000000 {
...

Same with all the board files below.

>
> diff --git a/arch/arm/boot/dts/tegra124-apalis.dtsi
> b/arch/arm/boot/dts/tegra124-apalis.dtsi
> index 65a2161b9b8e..e4625abd0a8a 100644
> --- a/arch/arm/boot/dts/tegra124-apalis.dtsi
> +++ b/arch/arm/boot/dts/tegra124-apalis.dtsi
> @@ -50,7 +50,7 @@
> model = "Toradex Apalis TK1";
> compatible = "toradex,apalis-tk1", "nvidia,tegra124";
>
> - memory {
> + memory@0 {
> reg = <0x0 0x80000000 0x0 0x80000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
> b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
> index 6dbcf84dafbc..e23b1159e8fd 100644
> --- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
> +++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
> @@ -24,7 +24,7 @@
> stdout-path = "serial0:115200n8";
> };
>
> - memory {
> + memory@0 {
> reg = <0x0 0x80000000 0x0 0x80000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra124-nyan.dtsi
> b/arch/arm/boot/dts/tegra124-nyan.dtsi
> index 3609367037a6..f45ac668d88c 100644
> --- a/arch/arm/boot/dts/tegra124-nyan.dtsi
> +++ b/arch/arm/boot/dts/tegra124-nyan.dtsi
> @@ -13,7 +13,7 @@
> stdout-path = "serial0:115200n8";
> };
>
> - memory {
> + memory@0 {
> reg = <0x0 0x80000000 0x0 0x80000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra124-venice2.dts
> b/arch/arm/boot/dts/tegra124-venice2.dts
> index 89bcc178994d..44492b48e165 100644
> --- a/arch/arm/boot/dts/tegra124-venice2.dts
> +++ b/arch/arm/boot/dts/tegra124-venice2.dts
> @@ -18,7 +18,7 @@
> stdout-path = "serial0:115200n8";
> };
>
> - memory {
> + memory@0 {
> reg = <0x0 0x80000000 0x0 0x80000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
> index 951feea784af..ad9c9cd6fa8a 100644
> --- a/arch/arm/boot/dts/tegra124.dtsi
> +++ b/arch/arm/boot/dts/tegra124.dtsi
> @@ -13,8 +13,9 @@
> #address-cells = <2>;
> #size-cells = <2>;
>
> - memory {
> + memory@0 {
> device_type = "memory";
> + reg = <0 0>;
> };

This should have two address and two size cells I guess. And DDR for all
TK1 start at 0x0 0x80000000...

So here with a default length of 0:

memory@80000000 {
reg = <0x0 0x80000000 0x0 0x0>;
};

>
> pcie@1003000 {
> diff --git a/arch/arm/boot/dts/tegra20-colibri-512.dtsi
> b/arch/arm/boot/dts/tegra20-colibri-512.dtsi
> index 5c202b3e3bb1..5623ff8d128c 100644
> --- a/arch/arm/boot/dts/tegra20-colibri-512.dtsi
> +++ b/arch/arm/boot/dts/tegra20-colibri-512.dtsi
> @@ -10,7 +10,7 @@
> rtc1 = "/rtc@7000e000";
> };
>
> - memory {
> + memory@0 {
> reg = <0x00000000 0x20000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra20-harmony.dts
> b/arch/arm/boot/dts/tegra20-harmony.dts
> index 628a55a9318b..1d96d92b72a7 100644
> --- a/arch/arm/boot/dts/tegra20-harmony.dts
> +++ b/arch/arm/boot/dts/tegra20-harmony.dts
> @@ -18,7 +18,7 @@
> stdout-path = "serial0:115200n8";
> };
>
> - memory {
> + memory@0 {
> reg = <0x00000000 0x40000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra20-paz00.dts
> b/arch/arm/boot/dts/tegra20-paz00.dts
> index 30436969adc0..ef245291924f 100644
> --- a/arch/arm/boot/dts/tegra20-paz00.dts
> +++ b/arch/arm/boot/dts/tegra20-paz00.dts
> @@ -19,7 +19,7 @@
> stdout-path = "serial0:115200n8";
> };
>
> - memory {
> + memory@0 {
> reg = <0x00000000 0x20000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts
> b/arch/arm/boot/dts/tegra20-seaboard.dts
> index 284aae351ff2..f91441683aad 100644
> --- a/arch/arm/boot/dts/tegra20-seaboard.dts
> +++ b/arch/arm/boot/dts/tegra20-seaboard.dts
> @@ -18,7 +18,7 @@
> stdout-path = "serial0:115200n8";
> };
>
> - memory {
> + memory@0 {
> reg = <0x00000000 0x40000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra20-tamonten.dtsi
> b/arch/arm/boot/dts/tegra20-tamonten.dtsi
> index 872046d48709..20137fc578b1 100644
> --- a/arch/arm/boot/dts/tegra20-tamonten.dtsi
> +++ b/arch/arm/boot/dts/tegra20-tamonten.dtsi
> @@ -15,7 +15,7 @@
> stdout-path = "serial0:115200n8";
> };
>
> - memory {
> + memory@0 {
> reg = <0x00000000 0x20000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra20-trimslice.dts
> b/arch/arm/boot/dts/tegra20-trimslice.dts
> index d55c6b240a30..9eb26dc15f6b 100644
> --- a/arch/arm/boot/dts/tegra20-trimslice.dts
> +++ b/arch/arm/boot/dts/tegra20-trimslice.dts
> @@ -18,7 +18,7 @@
> stdout-path = "serial0:115200n8";
> };
>
> - memory {
> + memory@0 {
> reg = <0x00000000 0x40000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra20-ventana.dts
> b/arch/arm/boot/dts/tegra20-ventana.dts
> index ee3fbf941e79..f44551e2d9d0 100644
> --- a/arch/arm/boot/dts/tegra20-ventana.dts
> +++ b/arch/arm/boot/dts/tegra20-ventana.dts
> @@ -18,7 +18,7 @@
> stdout-path = "serial0:115200n8";
> };
>
> - memory {
> + memory@0 {
> reg = <0x00000000 0x40000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
> index 88dd1afb5877..55581c0e5105 100644
> --- a/arch/arm/boot/dts/tegra20.dtsi
> +++ b/arch/arm/boot/dts/tegra20.dtsi
> @@ -13,8 +13,9 @@
> chosen { };
> aliases { };
>
> - memory {
> + memory@0 {
> device_type = "memory";
> + reg = <0 0>;
> };
>
> iram@40000000 {
> diff --git a/arch/arm/boot/dts/tegra30-apalis.dtsi
> b/arch/arm/boot/dts/tegra30-apalis.dtsi
> index 6f29cbad6e8a..9465fc592b7b 100644
> --- a/arch/arm/boot/dts/tegra30-apalis.dtsi
> +++ b/arch/arm/boot/dts/tegra30-apalis.dtsi
> @@ -10,8 +10,8 @@
> model = "Toradex Apalis T30";
> compatible = "toradex,apalis_t30", "nvidia,tegra30";
>
> - memory {
> - reg = <0 0>;
> + memory@80000000 {
> + reg = <0x80000000 0x40000000>;
> };
>
> pcie@3000 {
> diff --git a/arch/arm/boot/dts/tegra30-beaver.dts
> b/arch/arm/boot/dts/tegra30-beaver.dts
> index ae52a5039506..1434d50438f9 100644
> --- a/arch/arm/boot/dts/tegra30-beaver.dts
> +++ b/arch/arm/boot/dts/tegra30-beaver.dts
> @@ -17,7 +17,7 @@
> stdout-path = "serial0:115200n8";
> };
>
> - memory {
> + memory@80000000 {
> reg = <0x80000000 0x7ff00000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi
> b/arch/arm/boot/dts/tegra30-cardhu.dtsi
> index 92a9740c533f..33b73dca16a3 100644
> --- a/arch/arm/boot/dts/tegra30-cardhu.dtsi
> +++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi
> @@ -40,7 +40,7 @@
> stdout-path = "serial0:115200n8";
> };
>
> - memory {
> + memory@80000000 {
> reg = <0x80000000 0x40000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra30-colibri.dtsi
> b/arch/arm/boot/dts/tegra30-colibri.dtsi
> index c44d8c40c410..9bf3327665d3 100644
> --- a/arch/arm/boot/dts/tegra30-colibri.dtsi
> +++ b/arch/arm/boot/dts/tegra30-colibri.dtsi
> @@ -10,7 +10,7 @@
> model = "Toradex Colibri T30";
> compatible = "toradex,colibri_t30", "nvidia,tegra30";
>
> - memory {
> + memory@80000000 {
> reg = <0x80000000 0x40000000>;
> };
>
> diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
> index 19237c08c166..2b6243b0c6d6 100644
> --- a/arch/arm/boot/dts/tegra30.dtsi
> +++ b/arch/arm/boot/dts/tegra30.dtsi
> @@ -14,8 +14,9 @@
> chosen { };
> aliases { };
>
> - memory {
> + memory@80000000 {
> device_type = "memory";
> + reg = <0x80000000 0>;

Nit: for consistency sake, 0x0 :-)

--
Stefan

> };
>
> pcie@3000 {

2018-05-23 11:28:04

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v6 2/4] ARM: dts: tegra: Fix unit_address_vs_reg DTC warnings for /memory

On Wed, May 23, 2018 at 1:00 PM, Stefan Agner <[email protected]> wrote:
> On 23.05.2018 11:56, Krzysztof Kozlowski wrote:
>> Add a generic /memory node in each Tegra DTSI (with empty reg property,
>> to be overidden by each DTS) and set proper unit address for /memory
>> nodes to fix the DTC warnings:
>>
>> arch/arm/boot/dts/tegra20-harmony.dtb: Warning (unit_address_vs_reg):
>> /memory: node has a reg or ranges property, but no unit name
>>
>> The DTB after the change is the same as before except adding
>> unit-address to /memory node.
>>
>> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>>
>> ---
>>
>> Changes since v5:
>> 1. Split with skeleton.dtsi removal (suggested by Stefan).
>>
>> Changes since v4:
>> 1. None
>> ---
>> arch/arm/boot/dts/tegra114-dalmore.dts | 2 +-
>> arch/arm/boot/dts/tegra114-roth.dts | 2 +-
>> arch/arm/boot/dts/tegra114-tn7.dts | 2 +-
>> arch/arm/boot/dts/tegra114.dtsi | 3 ++-
>> arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi | 2 +-
>> arch/arm/boot/dts/tegra124-apalis.dtsi | 2 +-
>> arch/arm/boot/dts/tegra124-jetson-tk1.dts | 2 +-
>> arch/arm/boot/dts/tegra124-nyan.dtsi | 2 +-
>> arch/arm/boot/dts/tegra124-venice2.dts | 2 +-
>> arch/arm/boot/dts/tegra124.dtsi | 3 ++-
>> arch/arm/boot/dts/tegra20-colibri-512.dtsi | 2 +-
>> arch/arm/boot/dts/tegra20-harmony.dts | 2 +-
>> arch/arm/boot/dts/tegra20-paz00.dts | 2 +-
>> arch/arm/boot/dts/tegra20-seaboard.dts | 2 +-
>> arch/arm/boot/dts/tegra20-tamonten.dtsi | 2 +-
>> arch/arm/boot/dts/tegra20-trimslice.dts | 2 +-
>> arch/arm/boot/dts/tegra20-ventana.dts | 2 +-
>> arch/arm/boot/dts/tegra20.dtsi | 3 ++-
>> arch/arm/boot/dts/tegra30-apalis.dtsi | 4 ++--
>> arch/arm/boot/dts/tegra30-beaver.dts | 2 +-
>> arch/arm/boot/dts/tegra30-cardhu.dtsi | 2 +-
>> arch/arm/boot/dts/tegra30-colibri.dtsi | 2 +-
>> arch/arm/boot/dts/tegra30.dtsi | 3 ++-
>> 23 files changed, 28 insertions(+), 24 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/tegra114-dalmore.dts
>> b/arch/arm/boot/dts/tegra114-dalmore.dts
>> index eafff16765b4..1788556b4977 100644
>> --- a/arch/arm/boot/dts/tegra114-dalmore.dts
>> +++ b/arch/arm/boot/dts/tegra114-dalmore.dts
>> @@ -23,7 +23,7 @@
>> stdout-path = "serial0:115200n8";
>> };
>>
>> - memory {
>> + memory@80000000 {
>> reg = <0x80000000 0x40000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra114-roth.dts
>> b/arch/arm/boot/dts/tegra114-roth.dts
>> index 7ed7370ee67a..3d3835591cd2 100644
>> --- a/arch/arm/boot/dts/tegra114-roth.dts
>> +++ b/arch/arm/boot/dts/tegra114-roth.dts
>> @@ -28,7 +28,7 @@
>> };
>> };
>>
>> - memory {
>> + memory@80000000 {
>> /* memory >= 0x79600000 is reserved for firmware usage */
>> reg = <0x80000000 0x79600000>;
>> };
>> diff --git a/arch/arm/boot/dts/tegra114-tn7.dts
>> b/arch/arm/boot/dts/tegra114-tn7.dts
>> index 7fc4a8b31e45..bfdd1bf61816 100644
>> --- a/arch/arm/boot/dts/tegra114-tn7.dts
>> +++ b/arch/arm/boot/dts/tegra114-tn7.dts
>> @@ -28,7 +28,7 @@
>> };
>> };
>>
>> - memory {
>> + memory@80000000 {
>> /* memory >= 0x37e00000 is reserved for firmware usage */
>> reg = <0x80000000 0x37e00000>;
>> };
>> diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
>> index 27ef515e5640..aff4b8e115bc 100644
>> --- a/arch/arm/boot/dts/tegra114.dtsi
>> +++ b/arch/arm/boot/dts/tegra114.dtsi
>> @@ -11,8 +11,9 @@
>> #address-cells = <1>;
>> #size-cells = <1>;
>>
>> - memory {
>> + memory@80000000 {
>> device_type = "memory";
>> + reg = <0x80000000 0>;
>
> Nit: I'd rather prefer
>
> reg = <0x80000000 0x0>;

Sure.


>> };
>>
>> host1x@50000000 {
>> diff --git a/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
>> b/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
>> index bb67edb016c5..6a7f45651d38 100644
>> --- a/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
>> +++ b/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
>> @@ -15,7 +15,7 @@
>> compatible = "toradex,apalis-tk1-v1.2", "toradex,apalis-tk1",
>> "nvidia,tegra124";
>>
>> - memory {
>> + memory@0 {
>> reg = <0x0 0x80000000 0x0 0x80000000>;
>> };
>
> Unit address combines all address cells, so this should be 80000000
> here. See also the device tree spec (v0.2) which has an example in
> chapter 3.4 /memory node.
>
> So this should be:
>
> memory@80000000 {
> ...
>
> Same with all the board files below.

Ah, yes.

>>
>> diff --git a/arch/arm/boot/dts/tegra124-apalis.dtsi
>> b/arch/arm/boot/dts/tegra124-apalis.dtsi
>> index 65a2161b9b8e..e4625abd0a8a 100644
>> --- a/arch/arm/boot/dts/tegra124-apalis.dtsi
>> +++ b/arch/arm/boot/dts/tegra124-apalis.dtsi
>> @@ -50,7 +50,7 @@
>> model = "Toradex Apalis TK1";
>> compatible = "toradex,apalis-tk1", "nvidia,tegra124";
>>
>> - memory {
>> + memory@0 {
>> reg = <0x0 0x80000000 0x0 0x80000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
>> b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
>> index 6dbcf84dafbc..e23b1159e8fd 100644
>> --- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
>> +++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
>> @@ -24,7 +24,7 @@
>> stdout-path = "serial0:115200n8";
>> };
>>
>> - memory {
>> + memory@0 {
>> reg = <0x0 0x80000000 0x0 0x80000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra124-nyan.dtsi
>> b/arch/arm/boot/dts/tegra124-nyan.dtsi
>> index 3609367037a6..f45ac668d88c 100644
>> --- a/arch/arm/boot/dts/tegra124-nyan.dtsi
>> +++ b/arch/arm/boot/dts/tegra124-nyan.dtsi
>> @@ -13,7 +13,7 @@
>> stdout-path = "serial0:115200n8";
>> };
>>
>> - memory {
>> + memory@0 {
>> reg = <0x0 0x80000000 0x0 0x80000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra124-venice2.dts
>> b/arch/arm/boot/dts/tegra124-venice2.dts
>> index 89bcc178994d..44492b48e165 100644
>> --- a/arch/arm/boot/dts/tegra124-venice2.dts
>> +++ b/arch/arm/boot/dts/tegra124-venice2.dts
>> @@ -18,7 +18,7 @@
>> stdout-path = "serial0:115200n8";
>> };
>>
>> - memory {
>> + memory@0 {
>> reg = <0x0 0x80000000 0x0 0x80000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
>> index 951feea784af..ad9c9cd6fa8a 100644
>> --- a/arch/arm/boot/dts/tegra124.dtsi
>> +++ b/arch/arm/boot/dts/tegra124.dtsi
>> @@ -13,8 +13,9 @@
>> #address-cells = <2>;
>> #size-cells = <2>;
>>
>> - memory {
>> + memory@0 {
>> device_type = "memory";
>> + reg = <0 0>;
>> };
>
> This should have two address and two size cells I guess. And DDR for all
> TK1 start at 0x0 0x80000000...
>
> So here with a default length of 0:
>
> memory@80000000 {
> reg = <0x0 0x80000000 0x0 0x0>;
> };

Yes, right.

>>
>> pcie@1003000 {
>> diff --git a/arch/arm/boot/dts/tegra20-colibri-512.dtsi
>> b/arch/arm/boot/dts/tegra20-colibri-512.dtsi
>> index 5c202b3e3bb1..5623ff8d128c 100644
>> --- a/arch/arm/boot/dts/tegra20-colibri-512.dtsi
>> +++ b/arch/arm/boot/dts/tegra20-colibri-512.dtsi
>> @@ -10,7 +10,7 @@
>> rtc1 = "/rtc@7000e000";
>> };
>>
>> - memory {
>> + memory@0 {
>> reg = <0x00000000 0x20000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra20-harmony.dts
>> b/arch/arm/boot/dts/tegra20-harmony.dts
>> index 628a55a9318b..1d96d92b72a7 100644
>> --- a/arch/arm/boot/dts/tegra20-harmony.dts
>> +++ b/arch/arm/boot/dts/tegra20-harmony.dts
>> @@ -18,7 +18,7 @@
>> stdout-path = "serial0:115200n8";
>> };
>>
>> - memory {
>> + memory@0 {
>> reg = <0x00000000 0x40000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra20-paz00.dts
>> b/arch/arm/boot/dts/tegra20-paz00.dts
>> index 30436969adc0..ef245291924f 100644
>> --- a/arch/arm/boot/dts/tegra20-paz00.dts
>> +++ b/arch/arm/boot/dts/tegra20-paz00.dts
>> @@ -19,7 +19,7 @@
>> stdout-path = "serial0:115200n8";
>> };
>>
>> - memory {
>> + memory@0 {
>> reg = <0x00000000 0x20000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts
>> b/arch/arm/boot/dts/tegra20-seaboard.dts
>> index 284aae351ff2..f91441683aad 100644
>> --- a/arch/arm/boot/dts/tegra20-seaboard.dts
>> +++ b/arch/arm/boot/dts/tegra20-seaboard.dts
>> @@ -18,7 +18,7 @@
>> stdout-path = "serial0:115200n8";
>> };
>>
>> - memory {
>> + memory@0 {
>> reg = <0x00000000 0x40000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra20-tamonten.dtsi
>> b/arch/arm/boot/dts/tegra20-tamonten.dtsi
>> index 872046d48709..20137fc578b1 100644
>> --- a/arch/arm/boot/dts/tegra20-tamonten.dtsi
>> +++ b/arch/arm/boot/dts/tegra20-tamonten.dtsi
>> @@ -15,7 +15,7 @@
>> stdout-path = "serial0:115200n8";
>> };
>>
>> - memory {
>> + memory@0 {
>> reg = <0x00000000 0x20000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra20-trimslice.dts
>> b/arch/arm/boot/dts/tegra20-trimslice.dts
>> index d55c6b240a30..9eb26dc15f6b 100644
>> --- a/arch/arm/boot/dts/tegra20-trimslice.dts
>> +++ b/arch/arm/boot/dts/tegra20-trimslice.dts
>> @@ -18,7 +18,7 @@
>> stdout-path = "serial0:115200n8";
>> };
>>
>> - memory {
>> + memory@0 {
>> reg = <0x00000000 0x40000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra20-ventana.dts
>> b/arch/arm/boot/dts/tegra20-ventana.dts
>> index ee3fbf941e79..f44551e2d9d0 100644
>> --- a/arch/arm/boot/dts/tegra20-ventana.dts
>> +++ b/arch/arm/boot/dts/tegra20-ventana.dts
>> @@ -18,7 +18,7 @@
>> stdout-path = "serial0:115200n8";
>> };
>>
>> - memory {
>> + memory@0 {
>> reg = <0x00000000 0x40000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
>> index 88dd1afb5877..55581c0e5105 100644
>> --- a/arch/arm/boot/dts/tegra20.dtsi
>> +++ b/arch/arm/boot/dts/tegra20.dtsi
>> @@ -13,8 +13,9 @@
>> chosen { };
>> aliases { };
>>
>> - memory {
>> + memory@0 {
>> device_type = "memory";
>> + reg = <0 0>;
>> };
>>
>> iram@40000000 {
>> diff --git a/arch/arm/boot/dts/tegra30-apalis.dtsi
>> b/arch/arm/boot/dts/tegra30-apalis.dtsi
>> index 6f29cbad6e8a..9465fc592b7b 100644
>> --- a/arch/arm/boot/dts/tegra30-apalis.dtsi
>> +++ b/arch/arm/boot/dts/tegra30-apalis.dtsi
>> @@ -10,8 +10,8 @@
>> model = "Toradex Apalis T30";
>> compatible = "toradex,apalis_t30", "nvidia,tegra30";
>>
>> - memory {
>> - reg = <0 0>;
>> + memory@80000000 {
>> + reg = <0x80000000 0x40000000>;
>> };
>>
>> pcie@3000 {
>> diff --git a/arch/arm/boot/dts/tegra30-beaver.dts
>> b/arch/arm/boot/dts/tegra30-beaver.dts
>> index ae52a5039506..1434d50438f9 100644
>> --- a/arch/arm/boot/dts/tegra30-beaver.dts
>> +++ b/arch/arm/boot/dts/tegra30-beaver.dts
>> @@ -17,7 +17,7 @@
>> stdout-path = "serial0:115200n8";
>> };
>>
>> - memory {
>> + memory@80000000 {
>> reg = <0x80000000 0x7ff00000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi
>> b/arch/arm/boot/dts/tegra30-cardhu.dtsi
>> index 92a9740c533f..33b73dca16a3 100644
>> --- a/arch/arm/boot/dts/tegra30-cardhu.dtsi
>> +++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi
>> @@ -40,7 +40,7 @@
>> stdout-path = "serial0:115200n8";
>> };
>>
>> - memory {
>> + memory@80000000 {
>> reg = <0x80000000 0x40000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra30-colibri.dtsi
>> b/arch/arm/boot/dts/tegra30-colibri.dtsi
>> index c44d8c40c410..9bf3327665d3 100644
>> --- a/arch/arm/boot/dts/tegra30-colibri.dtsi
>> +++ b/arch/arm/boot/dts/tegra30-colibri.dtsi
>> @@ -10,7 +10,7 @@
>> model = "Toradex Colibri T30";
>> compatible = "toradex,colibri_t30", "nvidia,tegra30";
>>
>> - memory {
>> + memory@80000000 {
>> reg = <0x80000000 0x40000000>;
>> };
>>
>> diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
>> index 19237c08c166..2b6243b0c6d6 100644
>> --- a/arch/arm/boot/dts/tegra30.dtsi
>> +++ b/arch/arm/boot/dts/tegra30.dtsi
>> @@ -14,8 +14,9 @@
>> chosen { };
>> aliases { };
>>
>> - memory {
>> + memory@80000000 {
>> device_type = "memory";
>> + reg = <0x80000000 0>;
>
> Nit: for consistency sake, 0x0 :-)


Sure, thanks for review!

Best regards,
Krzysztof

2018-05-23 11:36:54

by Stefan Agner

[permalink] [raw]
Subject: Re: [PATCH v6 4/4] ARM: dts: tegra: Work safely with 256 MB Colibri-T20 modules

On 23.05.2018 11:56, Krzysztof Kozlowski wrote:
> Colibri-T20 can come in 256 MB RAM (with 512 MB NAND) or 512 MB RAM
> (with 1024 MB NAND) flavors. Both of them will use the same DTSI
> expecting the bootloader to do the fixup of /memory node. However in
> case it does not happen, let's stay on safe side by limiting the memory
> to 256 MB for both versions of Colibri-T20.
>

Maybe also mention the renaming stuff:

"Rename to remove the unnecessary memory size from the device tree file
name. While at it, also follow the typical Toradex SoC, module, carrier
board hierarchy."

--
Stefan

> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>
> ---
>
> RFT:
> Not tested on 512 MB module as I have only the 256 MB one.
>
> Changes since v5:
> 1. Add "colibri" suffix to iris DTS (suggested by Stefan).
>
> Changes since v4:
> 1. Drop the 512 suffix from file names (suggested by Stefan).
>
> Changes since v3:
> 1. Reduce the memory in existing DTSI instead of creating a new one
> (suggested by Marcel).
>
> Changes since v2:
> 1. Do not add new compatible but use everywhere existing
> "toradex,colibri_t20-512" (suggested by Rob).
>
> Changes since v1:
> 1. Fix memory size in tegra20-colibri-256.dtsi (was working fine because
> my bootloader uses mem= argument).
> ---
> arch/arm/boot/dts/Makefile | 2 +-
> .../boot/dts/{tegra20-iris-512.dts => tegra20-colibri-iris.dts} | 4 ++--
> .../boot/dts/{tegra20-colibri-512.dtsi => tegra20-colibri.dtsi} | 9 +++++++--
> 3 files changed, 10 insertions(+), 5 deletions(-)
> rename arch/arm/boot/dts/{tegra20-iris-512.dts =>
> tegra20-colibri-iris.dts} (95%)
> rename arch/arm/boot/dts/{tegra20-colibri-512.dtsi =>
> tegra20-colibri.dtsi} (98%)
>
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index ec2024ea8b1e..1c8bb55c0948 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -1030,7 +1030,7 @@ dtb-$(CONFIG_ARCH_TANGO) += \
> tango4-vantage-1172.dtb
> dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += \
> tegra20-harmony.dtb \
> - tegra20-iris-512.dtb \
> + tegra20-colibri-iris.dtb \
> tegra20-medcom-wide.dtb \
> tegra20-paz00.dtb \
> tegra20-plutux.dtb \
> diff --git a/arch/arm/boot/dts/tegra20-iris-512.dts
> b/arch/arm/boot/dts/tegra20-colibri-iris.dts
> similarity index 95%
> rename from arch/arm/boot/dts/tegra20-iris-512.dts
> rename to arch/arm/boot/dts/tegra20-colibri-iris.dts
> index 40126388946d..57f16c0e9917 100644
> --- a/arch/arm/boot/dts/tegra20-iris-512.dts
> +++ b/arch/arm/boot/dts/tegra20-colibri-iris.dts
> @@ -1,10 +1,10 @@
> // SPDX-License-Identifier: GPL-2.0
> /dts-v1/;
>
> -#include "tegra20-colibri-512.dtsi"
> +#include "tegra20-colibri.dtsi"
>
> / {
> - model = "Toradex Colibri T20 512MB on Iris";
> + model = "Toradex Colibri T20 256/512 MB on Iris";
> compatible = "toradex,iris", "toradex,colibri_t20-512", "nvidia,tegra20";
>
> aliases {
> diff --git a/arch/arm/boot/dts/tegra20-colibri-512.dtsi
> b/arch/arm/boot/dts/tegra20-colibri.dtsi
> similarity index 98%
> rename from arch/arm/boot/dts/tegra20-colibri-512.dtsi
> rename to arch/arm/boot/dts/tegra20-colibri.dtsi
> index 5623ff8d128c..dc06b23183e1 100644
> --- a/arch/arm/boot/dts/tegra20-colibri-512.dtsi
> +++ b/arch/arm/boot/dts/tegra20-colibri.dtsi
> @@ -2,7 +2,7 @@
> #include "tegra20.dtsi"
>
> / {
> - model = "Toradex Colibri T20 512MB";
> + model = "Toradex Colibri T20 256/512 MB";
> compatible = "toradex,colibri_t20-512", "nvidia,tegra20";
>
> aliases {
> @@ -11,7 +11,12 @@
> };
>
> memory@0 {
> - reg = <0x00000000 0x20000000>;
> + /*
> + * Set memory to 256 MB to be safe as this could be used on
> + * 256 or 512 MB module. It is expected from bootloader
> + * to fix this up for 512 MB version.
> + */
> + reg = <0x00000000 0x10000000>;
> };
>
> host1x@50000000 {

2018-05-23 11:39:24

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v6 4/4] ARM: dts: tegra: Work safely with 256 MB Colibri-T20 modules

On Wed, May 23, 2018 at 1:35 PM, Stefan Agner <[email protected]> wrote:
> On 23.05.2018 11:56, Krzysztof Kozlowski wrote:
>> Colibri-T20 can come in 256 MB RAM (with 512 MB NAND) or 512 MB RAM
>> (with 1024 MB NAND) flavors. Both of them will use the same DTSI
>> expecting the bootloader to do the fixup of /memory node. However in
>> case it does not happen, let's stay on safe side by limiting the memory
>> to 256 MB for both versions of Colibri-T20.
>>
>
> Maybe also mention the renaming stuff:
>
> "Rename to remove the unnecessary memory size from the device tree file
> name. While at it, also follow the typical Toradex SoC, module, carrier
> board hierarchy."

Since I am going to resend it for v7... no problem.

Best regards,
Krzysztof