Re: [PATCH v3] arm: dts: kirkwood: Enable upstream DT on Kirkwood boards

2024-04-04 Thread Stefan Roese

On 4/2/24 00:08, Tony Dinh wrote:

Enable OF_UPSTREAM to use upstream DT and add marvell/ prefix to the
DEFAULT_DEVICE_TREE for Kirkwood boards. And so we can directly build
DTBs from dts/upstream/src/arm/marvell, and including *-u-boot.dtsi
files from arch/arm/dts/ directory.

Background:

The following 2 commands and filters were used in the analysis to determine
which upstream DTS and DTSI files can be used as they are, or need to have
modified/created *-u-boot.dtsi for u-boot specific implementation, and
which board should be opt-out from OF_UPSTREAM.

"git grep -li arch_kirkwood configs | xargs grep DEVICE_TREE | cut -d '"' -f2 | 
xargs -n1 sh -c 'diff -qs  arch/arm/dts/$1.dts dts/upstream/src/arm/marvell/$1.dts' sh | grep 
differ"
"diff -qrbu arch/arm/dts/ dts/upstream/src/arm/marvell/ | grep kirkwood | grep ".dtsi 
""

More detailed information can be found at:
https://lore.kernel.org/u-boot/20240328021825.17935-1-mibo...@gmail.com/T/#u

I've regression tested this patch with the Zyxel NSA325 (Kirkwood 88F6282)
and Zyxel NSA310S (Kirkwood 88F6281). The Zyxel NSA325 board has a
USB 3.0 controller attached to the PCIe bus. And the Zyxel NSA310S
has an extensive overhaul in bindings and styles in upstream DTS version.

Tested-by: Michael Walle  # on lschv2
Acked-by: Sumit Garg 
Reviewed-by: Stefan Roese 

Signed-off-by: Tony Dinh 


Applied to u-boot-marvell/master

Thanks,
Stefan


---

Changes in v3:
- Collect Reviewed/Tested/Acked-by tags.
- Trim the commit description and point to lore.kernel.org for detailed 
information.
- No change from the V2 patch.

Changes in v2:
Remove unnecessary redefined OF_UPSTREAM and use "imply OF_UPSTREAM" for
KW88F6281 and KW88F6192 SoCs.

  arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi | 7 +++
  arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi   | 6 --
  arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi | 6 --
  arch/arm/dts/kirkwood-nsa325-u-boot.dtsi| 7 +++
  arch/arm/mach-kirkwood/Kconfig  | 2 ++
  configs/SBx81LIFKW_defconfig| 1 +
  configs/SBx81LIFXCAT_defconfig  | 1 +
  configs/d2net_v2_defconfig  | 2 +-
  configs/dns325_defconfig| 2 +-
  configs/dockstar_defconfig  | 2 +-
  configs/dreamplug_defconfig | 2 +-
  configs/ds109_defconfig | 2 +-
  configs/goflexhome_defconfig| 2 +-
  configs/guruplug_defconfig  | 2 +-
  configs/ib62x0_defconfig| 2 +-
  configs/iconnect_defconfig  | 2 +-
  configs/inetspace_v2_defconfig  | 2 +-
  configs/lschlv2_defconfig   | 2 +-
  configs/lsxhl_defconfig | 2 +-
  configs/nas220_defconfig| 2 +-
  configs/net2big_v2_defconfig| 2 +-
  configs/netspace_lite_v2_defconfig  | 2 +-
  configs/netspace_max_v2_defconfig   | 2 +-
  configs/netspace_mini_v2_defconfig  | 2 +-
  configs/netspace_v2_defconfig   | 2 +-
  configs/nsa310s_defconfig   | 2 +-
  configs/nsa325_defconfig| 2 +-
  configs/openrd_base_defconfig   | 2 +-
  configs/openrd_client_defconfig | 2 +-
  configs/openrd_ultimate_defconfig   | 2 +-
  configs/pogo_e02_defconfig  | 2 +-
  configs/pogo_v4_defconfig   | 2 +-
  configs/sheevaplug_defconfig| 2 +-
  33 files changed, 52 insertions(+), 30 deletions(-)
  create mode 100644 arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi
  create mode 100644 arch/arm/dts/kirkwood-nsa325-u-boot.dtsi

diff --git a/arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi 
b/arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi
new file mode 100644
index 00..59f19a211f
--- /dev/null
+++ b/arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/ {
+   aliases {
+   spi0 = 
+   };
+};
diff --git a/arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi 
b/arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi
index 7fc2d7d3b4..cf33ff822e 100644
--- a/arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi
+++ b/arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi
@@ -1,7 +1,9 @@
  // SPDX-License-Identifier: GPL-2.0+
  
- {

-   status = "disabled";
+/ {
+   aliases {
+   spi0 = 
+   };
  };
  
  _power {

diff --git a/arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi 
b/arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi
index 7fc2d7d3b4..cf33ff822e 100644
--- a/arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi
+++ b/arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi
@@ -1,7 +1,9 @@
  // SPDX-License-Identifier: GPL-2.0+
  
- {

-   status = "disabled";
+/ {
+   aliases {
+   spi0 = 
+   };
  };
  
  _power {

diff --git a/arch/arm/dts/kirkwood-nsa325-u-boot.dtsi 
b/arch/arm/dts/kirkwood-nsa325-u-boot.dtsi
new file mode 100644
index 00..dec27b2a87
--- /dev/null
+++ b/arch/arm/dts/kirkwood-nsa325-u-boot.dtsi

[PATCH v3] arm: dts: kirkwood: Enable upstream DT on Kirkwood boards

2024-04-01 Thread Tony Dinh
Enable OF_UPSTREAM to use upstream DT and add marvell/ prefix to the
DEFAULT_DEVICE_TREE for Kirkwood boards. And so we can directly build
DTBs from dts/upstream/src/arm/marvell, and including *-u-boot.dtsi
files from arch/arm/dts/ directory.

Background:

The following 2 commands and filters were used in the analysis to determine
which upstream DTS and DTSI files can be used as they are, or need to have
modified/created *-u-boot.dtsi for u-boot specific implementation, and
which board should be opt-out from OF_UPSTREAM.

"git grep -li arch_kirkwood configs | xargs grep DEVICE_TREE | cut -d '"' -f2 | 
xargs -n1 sh -c 'diff -qs  arch/arm/dts/$1.dts 
dts/upstream/src/arm/marvell/$1.dts' sh | grep differ"
"diff -qrbu arch/arm/dts/ dts/upstream/src/arm/marvell/ | grep kirkwood | grep 
".dtsi ""

More detailed information can be found at:
https://lore.kernel.org/u-boot/20240328021825.17935-1-mibo...@gmail.com/T/#u

I've regression tested this patch with the Zyxel NSA325 (Kirkwood 88F6282)
and Zyxel NSA310S (Kirkwood 88F6281). The Zyxel NSA325 board has a
USB 3.0 controller attached to the PCIe bus. And the Zyxel NSA310S
has an extensive overhaul in bindings and styles in upstream DTS version.

Tested-by: Michael Walle  # on lschv2
Acked-by: Sumit Garg 
Reviewed-by: Stefan Roese 

Signed-off-by: Tony Dinh 
---

Changes in v3:
- Collect Reviewed/Tested/Acked-by tags.
- Trim the commit description and point to lore.kernel.org for detailed 
information.
- No change from the V2 patch.

Changes in v2:
Remove unnecessary redefined OF_UPSTREAM and use "imply OF_UPSTREAM" for
KW88F6281 and KW88F6192 SoCs.

 arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi | 7 +++
 arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi   | 6 --
 arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi | 6 --
 arch/arm/dts/kirkwood-nsa325-u-boot.dtsi| 7 +++
 arch/arm/mach-kirkwood/Kconfig  | 2 ++
 configs/SBx81LIFKW_defconfig| 1 +
 configs/SBx81LIFXCAT_defconfig  | 1 +
 configs/d2net_v2_defconfig  | 2 +-
 configs/dns325_defconfig| 2 +-
 configs/dockstar_defconfig  | 2 +-
 configs/dreamplug_defconfig | 2 +-
 configs/ds109_defconfig | 2 +-
 configs/goflexhome_defconfig| 2 +-
 configs/guruplug_defconfig  | 2 +-
 configs/ib62x0_defconfig| 2 +-
 configs/iconnect_defconfig  | 2 +-
 configs/inetspace_v2_defconfig  | 2 +-
 configs/lschlv2_defconfig   | 2 +-
 configs/lsxhl_defconfig | 2 +-
 configs/nas220_defconfig| 2 +-
 configs/net2big_v2_defconfig| 2 +-
 configs/netspace_lite_v2_defconfig  | 2 +-
 configs/netspace_max_v2_defconfig   | 2 +-
 configs/netspace_mini_v2_defconfig  | 2 +-
 configs/netspace_v2_defconfig   | 2 +-
 configs/nsa310s_defconfig   | 2 +-
 configs/nsa325_defconfig| 2 +-
 configs/openrd_base_defconfig   | 2 +-
 configs/openrd_client_defconfig | 2 +-
 configs/openrd_ultimate_defconfig   | 2 +-
 configs/pogo_e02_defconfig  | 2 +-
 configs/pogo_v4_defconfig   | 2 +-
 configs/sheevaplug_defconfig| 2 +-
 33 files changed, 52 insertions(+), 30 deletions(-)
 create mode 100644 arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi
 create mode 100644 arch/arm/dts/kirkwood-nsa325-u-boot.dtsi

diff --git a/arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi 
b/arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi
new file mode 100644
index 00..59f19a211f
--- /dev/null
+++ b/arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/ {
+   aliases {
+   spi0 = 
+   };
+};
diff --git a/arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi 
b/arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi
index 7fc2d7d3b4..cf33ff822e 100644
--- a/arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi
+++ b/arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0+
 
- {
-   status = "disabled";
+/ {
+   aliases {
+   spi0 = 
+   };
 };
 
 _power {
diff --git a/arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi 
b/arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi
index 7fc2d7d3b4..cf33ff822e 100644
--- a/arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi
+++ b/arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0+
 
- {
-   status = "disabled";
+/ {
+   aliases {
+   spi0 = 
+   };
 };
 
 _power {
diff --git a/arch/arm/dts/kirkwood-nsa325-u-boot.dtsi 
b/arch/arm/dts/kirkwood-nsa325-u-boot.dtsi
new file mode 100644
index 00..dec27b2a87
--- /dev/null
+++ b/arch/arm/dts/kirkwood-nsa325-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+ {
+   partition@0 {
+   /delete-property/ read-only;
+   };