Skip to contentSkip to conversation

arm: dts: kirkwood: Enable upstream DT on Kirkwood boards

PATCH Superseded Tony Dinh 3 participants 5 messages Mar 22, 2024 – Mar 27, 2024

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Tony Dinh

author
#0 lore raw

PATCH 1/1 arm: dts: kirkwood: Enable upstream DT on Kirkwood boards

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:

Hi Stefan,
Hi Michael,

I did a survey and we currently have 28 Kirkwood boards. Using some commands and filters, here are the finding.

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: dts/upstream/src/arm/marvell/kirkwood-atl-sbx81lifkw.dts: No such file or directory
diff: dts/upstream/src/arm/marvell/kirkwood-atl-sbx81lifxcat.dts: No such file or directory

Files arch/arm/dts/kirkwood-dockstar.dts and dts/upstream/src/arm/marvell/kirkwood-dockstar.dts differ Files arch/arm/dts/kirkwood-dreamplug.dts and dts/upstream/src/arm/marvell/kirkwood-dreamplug.dts differ Files arch/arm/dts/kirkwood-goflexnet.dts and dts/upstream/src/arm/marvell/kirkwood-goflexnet.dts differ Files arch/arm/dts/kirkwood-guruplug-server-plus.dts and dts/upstream/src/arm/marvell/kirkwood-guruplug-server-plus.dts differ Files arch/arm/dts/kirkwood-iconnect.dts and dts/upstream/src/arm/marvell/kirkwood-iconnect.dts differ Files arch/arm/dts/kirkwood-net2big.dts and dts/upstream/src/arm/marvell/kirkwood-net2big.dts differ Files arch/arm/dts/kirkwood-ns2max.dts and dts/upstream/src/arm/marvell/kirkwood-ns2max.dts differ
Files arch/arm/dts/kirkwood-ns2mini.dts and dts/upstream/src/arm/marvell/kirkwood-ns2mini.dts differ Files arch/arm/dts/kirkwood-nsa310s.dts and dts/upstream/src/arm/marvell/kirkwood-nsa310s.dts differ Files arch/arm/dts/kirkwood-nsa325.dts and dts/upstream/src/arm/marvell/kirkwood-nsa325.dts differ
Files arch/arm/dts/kirkwood-openrd-client.dts and dts/upstream/src/arm/marvell/kirkwood-openrd-client.dts differ

diff -qrbu arch/arm/dts/ dts/upstream/src/arm/marvell/ | grep kirkwood | grep ".dtsi "

Files arch/arm/dts/kirkwood-6192.dtsi and dts/upstream/src/arm/marvell/kirkwood-6192.dtsi differ Files arch/arm/dts/kirkwood-6281.dtsi and dts/upstream/src/arm/marvell/kirkwood-6281.dtsi differ Files arch/arm/dts/kirkwood-98dx4122.dtsi and dts/upstream/src/arm/marvell/kirkwood-98dx4122.dtsi differ Files arch/arm/dts/kirkwood-dnskw.dtsi and dts/upstream/src/arm/marvell/kirkwood-dnskw.dtsi differ Files arch/arm/dts/kirkwood.dtsi and dts/upstream/src/arm/marvell/kirkwood.dtsi differ
Files arch/arm/dts/kirkwood-lsxl.dtsi and dts/upstream/src/arm/marvell/kirkwood-lsxl.dtsi differ Files arch/arm/dts/kirkwood-nsa3x0-common.dtsi and dts/upstream/src/arm/marvell/kirkwood-nsa3x0-common.dtsi differ Files arch/arm/dts/kirkwood-synology.dtsi and dts/upstream/src/arm/marvell/kirkwood-synology.dtsi differ

And after reviewing these differences, the following are my observation.

OF_LIST is not used in these Kirkwood boards.

1. Boards that have only u-boot DTS that should be opt-out for now with "#CONFIG_OF_UPSTREAM is not set"

diff: dts/upstream/src/arm/marvell/kirkwood-atl-sbx81lifkw.dts: No such file or directory
diff: dts/upstream/src/arm/marvell/kirkwood-atl-sbx81lifxcat.dts: No such file or directory

2. DTS and DTSI files that have only cosmetic, style, or binding changes (safe to take)

Files arch/arm/dts/kirkwood-dockstar.dts and dts/upstream/src/arm/marvell/kirkwood-dockstar.dts differ Files arch/arm/dts/kirkwood-goflexnet.dts and dts/upstream/src/arm/marvell/kirkwood-goflexnet.dts differ Files arch/arm/dts/kirkwood-guruplug-server-plus.dts and dts/upstream/src/arm/marvell/kirkwood-guruplug-server-plus.dts differ Files arch/arm/dts/kirkwood-iconnect.dts and dts/upstream/src/arm/marvell/kirkwood-iconnect.dts differ Files arch/arm/dts/kirkwood-net2big.dts and dts/upstream/src/arm/marvell/kirkwood-net2big.dts differ Files arch/arm/dts/kirkwood-ns2max.dts and dts/upstream/src/arm/marvell/kirkwood-ns2max.dts differ
Files arch/arm/dts/kirkwood-ns2mini.dts and dts/upstream/src/arm/marvell/kirkwood-ns2mini.dts differ Files arch/arm/dts/kirkwood-nsa325.dts and dts/upstream/src/arm/marvell/kirkwood-nsa325.dts differ
Files arch/arm/dts/kirkwood-openrd-client.dts and dts/upstream/src/arm/marvell/kirkwood-openrd-client.dts differ

Files arch/arm/dts/kirkwood-dnskw.dtsi and dts/upstream/src/arm/marvell/kirkwood-dnskw.dtsi differ Files arch/arm/dts/kirkwood.dtsi and dts/upstream/src/arm/marvell/kirkwood.dtsi differ Files arch/arm/dts/kirkwood-synology.dtsi and dts/upstream/src/arm/marvell/kirkwood-synology.dtsi differ

3. DTS files that are newer in upstream (safe to take with regression test)

Files arch/arm/dts/kirkwood-nsa310s.dts and dts/upstream/src/arm/marvell/kirkwood-nsa310s.dts differ

4. DTSI files that have additional PCI-related bindings in upstream (safe to take with regression test)

Files arch/arm/dts/kirkwood-6192.dtsi and dts/upstream/src/arm/marvell/kirkwood-6192.dtsi differ Files arch/arm/dts/kirkwood-6281.dtsi and dts/upstream/src/arm/marvell/kirkwood-6281.dtsi differ Files arch/arm/dts/kirkwood-98dx4122.dtsi and dts/upstream/src/arm/marvell/kirkwood-98dx4122.dtsi differ

5. DTSI files that will need new or modified -u-boot.dtsi

Files arch/arm/dts/kirkwood-dreamplug.dts and dts/upstream/src/arm/marvell/kirkwood-dreamplug.dts differ Files arch/arm/dts/kirkwood-lsxl.dtsi and dts/upstream/src/arm/marvell/kirkwood-lsxl.dtsi differ Files arch/arm/dts/kirkwood-nsa3x0-common.dtsi and dts/upstream/src/arm/marvell/kirkwood-nsa3x0-common.dtsi differ

So these u-boot.dtsi files need to be created/modified so we can use upstream DTS/DTSI:

modified: arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi
modified: arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi

new file: arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi
new file: arch/arm/dts/kirkwood-nsa325-u-boot.dtsi

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.

---

 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              | 4 ++++
 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, 54 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
arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..59f19a211f
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/ {
+	aliases {
+		spi0 = &spi0;
+	};
+};
arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi +4 -2
index 7fc2d7d3b4..cf33ff822e 100644
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0+
 
-&eth0 {
-	status = "disabled";
+/ {
+	aliases {
+		spi0 = &spi0;
+	};
 };
 
 &hdd_power {
arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi +4 -2
index 7fc2d7d3b4..cf33ff822e 100644
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0+
 
-&eth0 {
-	status = "disabled";
+/ {
+	aliases {
+		spi0 = &spi0;
+	};
 };
 
 &hdd_power {
arch/arm/dts/kirkwood-nsa325-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..dec27b2a87
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+&nand {
+	partition@0 {
+		/delete-property/ read-only;
+	};
+};
arch/arm/mach-kirkwood/Kconfig +4 -0
index c2fff84a68..39593c83d0 100644
@@ -28,6 +28,10 @@ config CUSTOM_SYS_INIT_SP_ADDR
         depends on HAS_CUSTOM_SYS_INIT_SP_ADDR
         default 0x5ff000
 
+config OF_UPSTREAM
+	bool "Use upstream DTS for Kirkwood boards"
+	default y
+
 choice
 	prompt "Marvell Kirkwood board select"
 	optional
configs/SBx81LIFKW_defconfig +1 -0
index cc17a8b114..977daf9f09 100644
@@ -6,6 +6,7 @@ CONFIG_ARCH_KIRKWOOD=y
 CONFIG_SYS_KWD_CONFIG="board/alliedtelesis/SBx81LIFKW/kwbimage.cfg"
 CONFIG_TEXT_BASE=0x00600000
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc8012000
+# CONFIG_OF_UPSTREAM is not set
 CONFIG_TARGET_SBx81LIFKW=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_OFFSET=0xC0000
configs/SBx81LIFXCAT_defconfig +1 -0
index 0612723298..9bc8614030 100644
@@ -6,6 +6,7 @@ CONFIG_ARCH_KIRKWOOD=y
 CONFIG_SYS_KWD_CONFIG="board/alliedtelesis/SBx81LIFXCAT/kwbimage.cfg"
 CONFIG_TEXT_BASE=0x00600000
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc8012000
+# CONFIG_OF_UPSTREAM is not set
 CONFIG_TARGET_SBx81LIFXCAT=y
 CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_OFFSET=0xC0000
configs/d2net_v2_defconfig +1 -1
index bb1bcb0aa3..69658a2ba7 100644
@@ -11,7 +11,7 @@ CONFIG_TARGET_NET2BIG_V2=y
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x70000
 CONFIG_ENV_SECT_SIZE=0x10000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-d2net"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-d2net"
 CONFIG_IDENT_STRING=" D2 v2"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_ENV_ADDR=0x70000
configs/dns325_defconfig +1 -1
index edfe92c5f3..b85f7cac8e 100644
@@ -10,7 +10,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc8012000
 CONFIG_TARGET_DNS325=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0xE0000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-dns325"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-dns325"
 CONFIG_IDENT_STRING="\nD-Link DNS-325"
 CONFIG_SYS_LOAD_ADDR=0x800000
 # CONFIG_SYS_MALLOC_F is not set
configs/dockstar_defconfig +1 -1
index 719fa3979e..7b5f19433a 100644
@@ -13,7 +13,7 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_TARGET_DOCKSTAR=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0x80000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-dockstar"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-dockstar"
 CONFIG_IDENT_STRING="\nSeagate FreeAgent DockStar"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_BOOTDELAY=3
configs/dreamplug_defconfig +1 -1
index 02a2635af8..8518eabcb2 100644
@@ -13,7 +13,7 @@ CONFIG_TARGET_DREAMPLUG=y
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x100000
 CONFIG_ENV_SECT_SIZE=0x10000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-dreamplug"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-dreamplug"
 CONFIG_IDENT_STRING="\nMarvell-DreamPlug"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_ENV_ADDR=0x100000
configs/ds109_defconfig +1 -1
index 304c098c99..ef805eca56 100644
@@ -14,7 +14,7 @@ CONFIG_TARGET_DS109=y
 CONFIG_ENV_SIZE=0x10000
 CONFIG_ENV_OFFSET=0x3D0000
 CONFIG_ENV_SECT_SIZE=0x10000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-ds109"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-ds109"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_ENV_ADDR=0x3D0000
 # CONFIG_SYS_MALLOC_F is not set
configs/goflexhome_defconfig +1 -1
index d577d5807b..53b2ce97e8 100644
@@ -13,7 +13,7 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_TARGET_GOFLEXHOME=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0xC0000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-goflexnet"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-goflexnet"
 CONFIG_IDENT_STRING="\nSeagate GoFlex Home"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_BOOTDELAY=3
configs/guruplug_defconfig +1 -1
index 7cb649e29c..5371ee403b 100644
@@ -10,7 +10,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc8012000
 CONFIG_TARGET_GURUPLUG=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0xE0000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-guruplug-server-plus"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-guruplug-server-plus"
 CONFIG_IDENT_STRING="\nMarvell-GuruPlug"
 CONFIG_SYS_LOAD_ADDR=0x800000
 # CONFIG_SYS_MALLOC_F is not set
configs/ib62x0_defconfig +1 -1
index 074384e387..32b0e1c395 100644
@@ -10,7 +10,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc8012000
 CONFIG_TARGET_IB62X0=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0xE0000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-ib62x0"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-ib62x0"
 CONFIG_IDENT_STRING=" RaidSonic ICY BOX IB-NAS62x0"
 CONFIG_SYS_LOAD_ADDR=0x800000
 # CONFIG_SYS_MALLOC_F is not set
configs/iconnect_defconfig +1 -1
index f7b74c4662..45ffbd92db 100644
@@ -13,7 +13,7 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_TARGET_ICONNECT=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0x80000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-iconnect"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-iconnect"
 CONFIG_IDENT_STRING=" Iomega iConnect"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_PCI=y
configs/inetspace_v2_defconfig +1 -1
index 2e8e3f3928..3fa7790d77 100644
@@ -11,7 +11,7 @@ CONFIG_TARGET_NETSPACE_V2=y
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x70000
 CONFIG_ENV_SECT_SIZE=0x10000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-is2"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-is2"
 CONFIG_IDENT_STRING=" IS v2"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_ENV_ADDR=0x70000
configs/lschlv2_defconfig +1 -1
index 99bdbc1483..ad060079a7 100644
@@ -15,7 +15,7 @@ CONFIG_ENV_SIZE=0x10000
 CONFIG_ENV_OFFSET=0x70000
 CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_DM_GPIO=y
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-lschlv2"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-lschlv2"
 CONFIG_IDENT_STRING=" LS-CHLv2"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_HAS_BOARD_SIZE_LIMIT=y
configs/lsxhl_defconfig +1 -1
index bb0a5ddf50..b2d9f0c9d8 100644
@@ -16,7 +16,7 @@ CONFIG_ENV_SIZE=0x10000
 CONFIG_ENV_OFFSET=0x70000
 CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_DM_GPIO=y
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-lsxhl"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-lsxhl"
 CONFIG_IDENT_STRING=" LS-XHL"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_HAS_BOARD_SIZE_LIMIT=y
configs/nas220_defconfig +1 -1
index f01b26f2df..4ea342a043 100644
@@ -10,7 +10,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc8012000
 CONFIG_TARGET_NAS220=y
 CONFIG_ENV_SIZE=0x10000
 CONFIG_ENV_OFFSET=0xA0000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-blackarmor-nas220"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-blackarmor-nas220"
 CONFIG_IDENT_STRING="\nNAS 220"
 CONFIG_SYS_LOAD_ADDR=0x800000
 # CONFIG_SYS_MALLOC_F is not set
configs/net2big_v2_defconfig +1 -1
index dda627aac6..39cbc3384f 100644
@@ -12,7 +12,7 @@ CONFIG_NET2BIG_V2=y
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x70000
 CONFIG_ENV_SECT_SIZE=0x10000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-net2big"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-net2big"
 CONFIG_IDENT_STRING=" 2Big v2"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_ENV_ADDR=0x70000
configs/netspace_lite_v2_defconfig +1 -1
index 742e6205d8..cd416cb150 100644
@@ -12,7 +12,7 @@ CONFIG_NETSPACE_LITE_V2=y
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x70000
 CONFIG_ENV_SECT_SIZE=0x10000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-ns2lite"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-ns2lite"
 CONFIG_IDENT_STRING=" NS v2 Lite"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_ENV_ADDR=0x70000
configs/netspace_max_v2_defconfig +1 -1
index 7779e6815e..6a3d9296ac 100644
@@ -12,7 +12,7 @@ CONFIG_NETSPACE_MAX_V2=y
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x70000
 CONFIG_ENV_SECT_SIZE=0x10000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-ns2max"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-ns2max"
 CONFIG_IDENT_STRING=" NS Max v2"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_ENV_ADDR=0x70000
configs/netspace_mini_v2_defconfig +1 -1
index 9e3614bb44..e25631b09f 100644
@@ -12,7 +12,7 @@ CONFIG_NETSPACE_MINI_V2=y
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x70000
 CONFIG_ENV_SECT_SIZE=0x10000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-ns2mini"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-ns2mini"
 CONFIG_IDENT_STRING=" NS v2 Mini"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_ENV_ADDR=0x70000
configs/netspace_v2_defconfig +1 -1
index 1583a0adb3..b6ac2a8b19 100644
@@ -12,7 +12,7 @@ CONFIG_NETSPACE_V2=y
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x70000
 CONFIG_ENV_SECT_SIZE=0x10000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-ns2"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-ns2"
 CONFIG_IDENT_STRING=" NS v2"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_ENV_ADDR=0x70000
configs/nsa310s_defconfig +1 -1
index 89d8b18b16..e859a43ffa 100644
@@ -13,7 +13,7 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_TARGET_NSA310S=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0xE0000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-nsa310s"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-nsa310s"
 CONFIG_DEBUG_UART_BASE=0xf1012000
 CONFIG_DEBUG_UART_CLOCK=166666667
 CONFIG_IDENT_STRING="\nZyXEL NSA310S/320S 1/2-Bay Power Media Server"
configs/nsa325_defconfig +1 -1
index 5da4a002b4..88a890002e 100644
@@ -13,7 +13,7 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_TARGET_NSA325=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0xC0000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-nsa325"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-nsa325"
 CONFIG_IDENT_STRING="\nZyXEL NSA325 2-Bay Power Media Server"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_PCI=y
configs/openrd_base_defconfig +1 -1
index 29a14e0927..057dd28dff 100644
@@ -11,7 +11,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc8012000
 CONFIG_TARGET_OPENRD=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0x80000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-openrd-base"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-openrd-base"
 CONFIG_IDENT_STRING="\nOpenRD-Base"
 CONFIG_SYS_LOAD_ADDR=0x800000
 # CONFIG_SYS_MALLOC_F is not set
configs/openrd_client_defconfig +1 -1
index a95a435bdf..05e4292764 100644
@@ -12,7 +12,7 @@ CONFIG_TARGET_OPENRD=y
 CONFIG_BOARD_IS_OPENRD_CLIENT=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0x80000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-openrd-client"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-openrd-client"
 CONFIG_IDENT_STRING="\nOpenRD-Client"
 CONFIG_SYS_LOAD_ADDR=0x800000
 # CONFIG_SYS_MALLOC_F is not set
configs/openrd_ultimate_defconfig +1 -1
index e3f5294ff1..6e13c6eabd 100644
@@ -12,7 +12,7 @@ CONFIG_TARGET_OPENRD=y
 CONFIG_BOARD_IS_OPENRD_ULTIMATE=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0x80000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-openrd-ultimate"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-openrd-ultimate"
 CONFIG_IDENT_STRING="\nOpenRD-Ultimate"
 CONFIG_SYS_LOAD_ADDR=0x800000
 # CONFIG_SYS_MALLOC_F is not set
configs/pogo_e02_defconfig +1 -1
index e53ccf34c7..880cb20b22 100644
@@ -13,7 +13,7 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_TARGET_POGO_E02=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0xC0000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-pogo_e02"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-pogo_e02"
 CONFIG_IDENT_STRING="\nPogo E02"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_BOOTDELAY=3
configs/pogo_v4_defconfig +1 -1
index 95e22b3fef..50046e83b7 100644
@@ -12,7 +12,7 @@ CONFIG_TEXT_BASE=0x600000
 CONFIG_TARGET_POGO_V4=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0xC0000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-pogoplug-series-4"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-pogoplug-series-4"
 CONFIG_IDENT_STRING="\nPogoplug V4"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_PCI=y
configs/sheevaplug_defconfig +1 -1
index 0af87dc4fb..b673b3f6da 100644
@@ -13,7 +13,7 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_TARGET_SHEEVAPLUG=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0x80000
-CONFIG_DEFAULT_DEVICE_TREE="kirkwood-sheevaplug"
+CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-sheevaplug"
 CONFIG_IDENT_STRING="\nMarvell-Sheevaplug"
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_HAS_BOARD_SIZE_LIMIT=y
Signature · 1 line
2.39.2
Tested-by on v1 1/1
#1 lore raw

Hi Tony,

Quoted 4 lines · 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.

Thanks for taking care.

Quoted 1 line

lsxl should work too as it is just different in memory and cpu frequency settings.

Quoted 4 lines

---

 arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi   | 6 ++++--
 arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi     | 6 ++++--

arch/arm/dts/kirkwood-lschlv2.dts
arch/arm/dts/kirkwood-lsxhl.dts

Should be then be removed.

-michael

author
#2 lore raw

Hi Michael,

Quoted 20 lines · Michael Walle

Hi Tony,

Quoted 4 lines · 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.

Thanks for taking care.

Quoted 1 line

lsxl should work too as it is just different in memory and cpu frequency settings.

Quoted 2 lines

---

Quoted 7 lines
Quoted 2 lines
 arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi   | 6 ++++--
 arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi     | 6 ++++--

arch/arm/dts/kirkwood-lschlv2.dts
arch/arm/dts/kirkwood-lsxhl.dts

Should be then be removed.

Thanks for the lschlv2 review/test! I plan to send a follow-up patch to remove the corresponding DTS and DTSI files.

All the best,
Tony

Quoted 2 lines

-michael

#3 lore raw
In reply to Tony Dinh

Hi Tony,

Quoted 199 lines · 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:

Hi Stefan,
Hi Michael,

I did a survey and we currently have 28 Kirkwood boards. Using some commands and filters, here are the finding.

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: dts/upstream/src/arm/marvell/kirkwood-atl-sbx81lifkw.dts: No such file or directory
diff: dts/upstream/src/arm/marvell/kirkwood-atl-sbx81lifxcat.dts: No such file or directory

Files arch/arm/dts/kirkwood-dockstar.dts and dts/upstream/src/arm/marvell/kirkwood-dockstar.dts differ Files arch/arm/dts/kirkwood-dreamplug.dts and dts/upstream/src/arm/marvell/kirkwood-dreamplug.dts differ Files arch/arm/dts/kirkwood-goflexnet.dts and dts/upstream/src/arm/marvell/kirkwood-goflexnet.dts differ Files arch/arm/dts/kirkwood-guruplug-server-plus.dts and dts/upstream/src/arm/marvell/kirkwood-guruplug-server-plus.dts differ Files arch/arm/dts/kirkwood-iconnect.dts and dts/upstream/src/arm/marvell/kirkwood-iconnect.dts differ Files arch/arm/dts/kirkwood-net2big.dts and dts/upstream/src/arm/marvell/kirkwood-net2big.dts differ Files arch/arm/dts/kirkwood-ns2max.dts and dts/upstream/src/arm/marvell/kirkwood-ns2max.dts differ
Files arch/arm/dts/kirkwood-ns2mini.dts and dts/upstream/src/arm/marvell/kirkwood-ns2mini.dts differ Files arch/arm/dts/kirkwood-nsa310s.dts and dts/upstream/src/arm/marvell/kirkwood-nsa310s.dts differ Files arch/arm/dts/kirkwood-nsa325.dts and dts/upstream/src/arm/marvell/kirkwood-nsa325.dts differ
Files arch/arm/dts/kirkwood-openrd-client.dts and dts/upstream/src/arm/marvell/kirkwood-openrd-client.dts differ

diff -qrbu arch/arm/dts/ dts/upstream/src/arm/marvell/ | grep kirkwood | grep ".dtsi "

Files arch/arm/dts/kirkwood-6192.dtsi and dts/upstream/src/arm/marvell/kirkwood-6192.dtsi differ Files arch/arm/dts/kirkwood-6281.dtsi and dts/upstream/src/arm/marvell/kirkwood-6281.dtsi differ Files arch/arm/dts/kirkwood-98dx4122.dtsi and dts/upstream/src/arm/marvell/kirkwood-98dx4122.dtsi differ Files arch/arm/dts/kirkwood-dnskw.dtsi and dts/upstream/src/arm/marvell/kirkwood-dnskw.dtsi differ Files arch/arm/dts/kirkwood.dtsi and dts/upstream/src/arm/marvell/kirkwood.dtsi differ
Files arch/arm/dts/kirkwood-lsxl.dtsi and dts/upstream/src/arm/marvell/kirkwood-lsxl.dtsi differ Files arch/arm/dts/kirkwood-nsa3x0-common.dtsi and dts/upstream/src/arm/marvell/kirkwood-nsa3x0-common.dtsi differ Files arch/arm/dts/kirkwood-synology.dtsi and dts/upstream/src/arm/marvell/kirkwood-synology.dtsi differ

And after reviewing these differences, the following are my observation.

OF_LIST is not used in these Kirkwood boards.

1. Boards that have only u-boot DTS that should be opt-out for now with "#CONFIG_OF_UPSTREAM is not set"

diff: dts/upstream/src/arm/marvell/kirkwood-atl-sbx81lifkw.dts: No such file or directory
diff: dts/upstream/src/arm/marvell/kirkwood-atl-sbx81lifxcat.dts: No such file or directory

2. DTS and DTSI files that have only cosmetic, style, or binding changes (safe to take)

Files arch/arm/dts/kirkwood-dockstar.dts and dts/upstream/src/arm/marvell/kirkwood-dockstar.dts differ Files arch/arm/dts/kirkwood-goflexnet.dts and dts/upstream/src/arm/marvell/kirkwood-goflexnet.dts differ Files arch/arm/dts/kirkwood-guruplug-server-plus.dts and dts/upstream/src/arm/marvell/kirkwood-guruplug-server-plus.dts differ Files arch/arm/dts/kirkwood-iconnect.dts and dts/upstream/src/arm/marvell/kirkwood-iconnect.dts differ Files arch/arm/dts/kirkwood-net2big.dts and dts/upstream/src/arm/marvell/kirkwood-net2big.dts differ Files arch/arm/dts/kirkwood-ns2max.dts and dts/upstream/src/arm/marvell/kirkwood-ns2max.dts differ
Files arch/arm/dts/kirkwood-ns2mini.dts and dts/upstream/src/arm/marvell/kirkwood-ns2mini.dts differ Files arch/arm/dts/kirkwood-nsa325.dts and dts/upstream/src/arm/marvell/kirkwood-nsa325.dts differ
Files arch/arm/dts/kirkwood-openrd-client.dts and dts/upstream/src/arm/marvell/kirkwood-openrd-client.dts differ

Files arch/arm/dts/kirkwood-dnskw.dtsi and dts/upstream/src/arm/marvell/kirkwood-dnskw.dtsi differ Files arch/arm/dts/kirkwood.dtsi and dts/upstream/src/arm/marvell/kirkwood.dtsi differ Files arch/arm/dts/kirkwood-synology.dtsi and dts/upstream/src/arm/marvell/kirkwood-synology.dtsi differ

3. DTS files that are newer in upstream (safe to take with regression test)

Files arch/arm/dts/kirkwood-nsa310s.dts and dts/upstream/src/arm/marvell/kirkwood-nsa310s.dts differ

4. DTSI files that have additional PCI-related bindings in upstream (safe to take with regression test)

Files arch/arm/dts/kirkwood-6192.dtsi and dts/upstream/src/arm/marvell/kirkwood-6192.dtsi differ Files arch/arm/dts/kirkwood-6281.dtsi and dts/upstream/src/arm/marvell/kirkwood-6281.dtsi differ Files arch/arm/dts/kirkwood-98dx4122.dtsi and dts/upstream/src/arm/marvell/kirkwood-98dx4122.dtsi differ

5. DTSI files that will need new or modified -u-boot.dtsi

Files arch/arm/dts/kirkwood-dreamplug.dts and dts/upstream/src/arm/marvell/kirkwood-dreamplug.dts differ Files arch/arm/dts/kirkwood-lsxl.dtsi and dts/upstream/src/arm/marvell/kirkwood-lsxl.dtsi differ Files arch/arm/dts/kirkwood-nsa3x0-common.dtsi and dts/upstream/src/arm/marvell/kirkwood-nsa3x0-common.dtsi differ

So these u-boot.dtsi files need to be created/modified so we can use upstream DTS/DTSI:

modified: arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi
modified: arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi

new file: arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi
new file: arch/arm/dts/kirkwood-nsa325-u-boot.dtsi

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.

---

 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              | 4 ++++
 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, 54 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
arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..59f19a211f
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/ {
+       aliases {
+               spi0 = &spi0;
+       };
+};
arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi +4 -2
index 7fc2d7d3b4..cf33ff822e 100644
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0+
 
-&eth0 {
-       status = "disabled";
+/ {
+       aliases {
+               spi0 = &spi0;
+       };
 };
 
 &hdd_power {
arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi +4 -2
index 7fc2d7d3b4..cf33ff822e 100644
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0+
 
-&eth0 {
-       status = "disabled";
+/ {
+       aliases {
+               spi0 = &spi0;
+       };
 };
 
 &hdd_power {
arch/arm/dts/kirkwood-nsa325-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..dec27b2a87
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+&nand {
+       partition@0 {
+               /delete-property/ read-only;
+       };
+};
arch/arm/mach-kirkwood/Kconfig +0 -0
index c2fff84a68..39593c83d0 100644

arch/arm/mach-kirkwood/Kconfig config CUSTOM_SYS_INIT_SP_ADDR · line 33

Quoted 6 lines
arch/arm/mach-kirkwood/Kconfig +3 -0
@@ -28,6 +28,10 @@ config CUSTOM_SYS_INIT_SP_ADDR
         depends on HAS_CUSTOM_SYS_INIT_SP_ADDR
         default 0x5ff000
 
+config OF_UPSTREAM
+       bool "Use upstream DTS for Kirkwood boards"
+       default y

You don't have to create a new config option here, just add "imply OF_UPSTREAM" for the SoC which you want to switch, something like:

arch/arm/mach-kirkwood/Kconfig +2 -0
index c2fff84a686..031d4e5ecd3 100644
@@ -6,10 +6,12 @@ config FEROCEON_88FR131
 config KW88F6192
        bool
        select ARCH_VERY_EARLY_INIT
+       imply OF_UPSTREAM
 
 config KW88F6281
        bool
        select ARCH_VERY_EARLY_INIT
+       imply OF_UPSTREAM
 
 config SHEEVA_88SV131
        bool

-Sumit

author
#4 lore raw

Hi Sumit,

Quoted 220 lines · Sumit Garg

Hi Tony,

Quoted 199 lines · 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:

Hi Stefan,
Hi Michael,

I did a survey and we currently have 28 Kirkwood boards. Using some commands and filters, here are the finding.

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: dts/upstream/src/arm/marvell/kirkwood-atl-sbx81lifkw.dts: No such file or directory
diff: dts/upstream/src/arm/marvell/kirkwood-atl-sbx81lifxcat.dts: No such file or directory

Files arch/arm/dts/kirkwood-dockstar.dts and dts/upstream/src/arm/marvell/kirkwood-dockstar.dts differ Files arch/arm/dts/kirkwood-dreamplug.dts and dts/upstream/src/arm/marvell/kirkwood-dreamplug.dts differ Files arch/arm/dts/kirkwood-goflexnet.dts and dts/upstream/src/arm/marvell/kirkwood-goflexnet.dts differ Files arch/arm/dts/kirkwood-guruplug-server-plus.dts and dts/upstream/src/arm/marvell/kirkwood-guruplug-server-plus.dts differ Files arch/arm/dts/kirkwood-iconnect.dts and dts/upstream/src/arm/marvell/kirkwood-iconnect.dts differ Files arch/arm/dts/kirkwood-net2big.dts and dts/upstream/src/arm/marvell/kirkwood-net2big.dts differ Files arch/arm/dts/kirkwood-ns2max.dts and dts/upstream/src/arm/marvell/kirkwood-ns2max.dts differ
Files arch/arm/dts/kirkwood-ns2mini.dts and dts/upstream/src/arm/marvell/kirkwood-ns2mini.dts differ Files arch/arm/dts/kirkwood-nsa310s.dts and dts/upstream/src/arm/marvell/kirkwood-nsa310s.dts differ Files arch/arm/dts/kirkwood-nsa325.dts and dts/upstream/src/arm/marvell/kirkwood-nsa325.dts differ
Files arch/arm/dts/kirkwood-openrd-client.dts and dts/upstream/src/arm/marvell/kirkwood-openrd-client.dts differ

diff -qrbu arch/arm/dts/ dts/upstream/src/arm/marvell/ | grep kirkwood | grep ".dtsi "

Files arch/arm/dts/kirkwood-6192.dtsi and dts/upstream/src/arm/marvell/kirkwood-6192.dtsi differ Files arch/arm/dts/kirkwood-6281.dtsi and dts/upstream/src/arm/marvell/kirkwood-6281.dtsi differ Files arch/arm/dts/kirkwood-98dx4122.dtsi and dts/upstream/src/arm/marvell/kirkwood-98dx4122.dtsi differ Files arch/arm/dts/kirkwood-dnskw.dtsi and dts/upstream/src/arm/marvell/kirkwood-dnskw.dtsi differ Files arch/arm/dts/kirkwood.dtsi and dts/upstream/src/arm/marvell/kirkwood.dtsi differ
Files arch/arm/dts/kirkwood-lsxl.dtsi and dts/upstream/src/arm/marvell/kirkwood-lsxl.dtsi differ Files arch/arm/dts/kirkwood-nsa3x0-common.dtsi and dts/upstream/src/arm/marvell/kirkwood-nsa3x0-common.dtsi differ Files arch/arm/dts/kirkwood-synology.dtsi and dts/upstream/src/arm/marvell/kirkwood-synology.dtsi differ

And after reviewing these differences, the following are my observation.

OF_LIST is not used in these Kirkwood boards.

1. Boards that have only u-boot DTS that should be opt-out for now with "#CONFIG_OF_UPSTREAM is not set"

diff: dts/upstream/src/arm/marvell/kirkwood-atl-sbx81lifkw.dts: No such file or directory
diff: dts/upstream/src/arm/marvell/kirkwood-atl-sbx81lifxcat.dts: No such file or directory

2. DTS and DTSI files that have only cosmetic, style, or binding changes (safe to take)

Files arch/arm/dts/kirkwood-dockstar.dts and dts/upstream/src/arm/marvell/kirkwood-dockstar.dts differ Files arch/arm/dts/kirkwood-goflexnet.dts and dts/upstream/src/arm/marvell/kirkwood-goflexnet.dts differ Files arch/arm/dts/kirkwood-guruplug-server-plus.dts and dts/upstream/src/arm/marvell/kirkwood-guruplug-server-plus.dts differ Files arch/arm/dts/kirkwood-iconnect.dts and dts/upstream/src/arm/marvell/kirkwood-iconnect.dts differ Files arch/arm/dts/kirkwood-net2big.dts and dts/upstream/src/arm/marvell/kirkwood-net2big.dts differ Files arch/arm/dts/kirkwood-ns2max.dts and dts/upstream/src/arm/marvell/kirkwood-ns2max.dts differ
Files arch/arm/dts/kirkwood-ns2mini.dts and dts/upstream/src/arm/marvell/kirkwood-ns2mini.dts differ Files arch/arm/dts/kirkwood-nsa325.dts and dts/upstream/src/arm/marvell/kirkwood-nsa325.dts differ
Files arch/arm/dts/kirkwood-openrd-client.dts and dts/upstream/src/arm/marvell/kirkwood-openrd-client.dts differ

Files arch/arm/dts/kirkwood-dnskw.dtsi and dts/upstream/src/arm/marvell/kirkwood-dnskw.dtsi differ Files arch/arm/dts/kirkwood.dtsi and dts/upstream/src/arm/marvell/kirkwood.dtsi differ Files arch/arm/dts/kirkwood-synology.dtsi and dts/upstream/src/arm/marvell/kirkwood-synology.dtsi differ

3. DTS files that are newer in upstream (safe to take with regression test)

Files arch/arm/dts/kirkwood-nsa310s.dts and dts/upstream/src/arm/marvell/kirkwood-nsa310s.dts differ

4. DTSI files that have additional PCI-related bindings in upstream (safe to take with regression test)

Files arch/arm/dts/kirkwood-6192.dtsi and dts/upstream/src/arm/marvell/kirkwood-6192.dtsi differ Files arch/arm/dts/kirkwood-6281.dtsi and dts/upstream/src/arm/marvell/kirkwood-6281.dtsi differ Files arch/arm/dts/kirkwood-98dx4122.dtsi and dts/upstream/src/arm/marvell/kirkwood-98dx4122.dtsi differ

5. DTSI files that will need new or modified -u-boot.dtsi

Files arch/arm/dts/kirkwood-dreamplug.dts and dts/upstream/src/arm/marvell/kirkwood-dreamplug.dts differ Files arch/arm/dts/kirkwood-lsxl.dtsi and dts/upstream/src/arm/marvell/kirkwood-lsxl.dtsi differ Files arch/arm/dts/kirkwood-nsa3x0-common.dtsi and dts/upstream/src/arm/marvell/kirkwood-nsa3x0-common.dtsi differ

So these u-boot.dtsi files need to be created/modified so we can use upstream DTS/DTSI:

modified: arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi
modified: arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi

new file: arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi
new file: arch/arm/dts/kirkwood-nsa325-u-boot.dtsi

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.

---

 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              | 4 ++++
 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, 54 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
arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..59f19a211f
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/ {
+       aliases {
+               spi0 = &spi0;
+       };
+};
arch/arm/dts/kirkwood-lschlv2-u-boot.dtsi +4 -2
index 7fc2d7d3b4..cf33ff822e 100644
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0+
 
-&eth0 {
-       status = "disabled";
+/ {
+       aliases {
+               spi0 = &spi0;
+       };
 };
 
 &hdd_power {
arch/arm/dts/kirkwood-lsxhl-u-boot.dtsi +4 -2
index 7fc2d7d3b4..cf33ff822e 100644
@@ -1,7 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0+
 
-&eth0 {
-       status = "disabled";
+/ {
+       aliases {
+               spi0 = &spi0;
+       };
 };
 
 &hdd_power {
arch/arm/dts/kirkwood-nsa325-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..dec27b2a87
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+&nand {
+       partition@0 {
+               /delete-property/ read-only;
+       };
+};
arch/arm/mach-kirkwood/Kconfig +0 -0
index c2fff84a68..39593c83d0 100644

arch/arm/mach-kirkwood/Kconfig config CUSTOM_SYS_INIT_SP_ADDR · line 33

Quoted 6 lines
arch/arm/mach-kirkwood/Kconfig +3 -0
@@ -28,6 +28,10 @@ config CUSTOM_SYS_INIT_SP_ADDR
         depends on HAS_CUSTOM_SYS_INIT_SP_ADDR
         default 0x5ff000
 
+config OF_UPSTREAM
+       bool "Use upstream DTS for Kirkwood boards"
+       default y

You don't have to create a new config option here, just add "imply OF_UPSTREAM" for the SoC which you want to switch, something like:

arch/arm/mach-kirkwood/Kconfig +0 -0
index c2fff84a686..031d4e5ecd3 100644
@@ -6,10 +6,12 @@ config FEROCEON_88FR131
 config KW88F6192
        bool

arch/arm/mach-kirkwood/Kconfig config FEROCEON_88FR131 · line 17

Quoted 10 lines
arch/arm/mach-kirkwood/Kconfig +2 -0
        select ARCH_VERY_EARLY_INIT
+       imply OF_UPSTREAM
 
 config KW88F6281
        bool
        select ARCH_VERY_EARLY_INIT
+       imply OF_UPSTREAM
 
 config SHEEVA_88SV131
        bool

Thanks! That's a better way indeed. I'll send v2.

All the best,
Tony

Quoted 2 lines

-Sumit