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

Tony Dinh mibodhi at gmail.com
Wed Mar 27 07:02:37 CET 2024


Hi Sumit,

On Tue, Mar 26, 2024 at 9:21 PM Sumit Garg <sumit.garg at linaro.org> wrote:
>
> Hi Tony,
>
> On Fri, 22 Mar 2024 at 07:48, Tony Dinh <mibodhi at gmail.com> 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:
> >
> > 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.
> >
> > Signed-off-by: Tony Dinh <mibodhi at gmail.com>
> > ---
> >
> >  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
> >
> > 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 0000000000..59f19a211f
> > --- /dev/null
> > +++ b/arch/arm/dts/kirkwood-dreamplug-u-boot.dtsi
> > @@ -0,0 +1,7 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +
> > +/ {
> > +       aliases {
> > +               spi0 = &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+
> >
> > -&eth0 {
> > -       status = "disabled";
> > +/ {
> > +       aliases {
> > +               spi0 = &spi0;
> > +       };
> >  };
> >
> >  &hdd_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+
> >
> > -&eth0 {
> > -       status = "disabled";
> > +/ {
> > +       aliases {
> > +               spi0 = &spi0;
> > +       };
> >  };
> >
> >  &hdd_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 0000000000..dec27b2a87
> > --- /dev/null
> > +++ b/arch/arm/dts/kirkwood-nsa325-u-boot.dtsi
> > @@ -0,0 +1,7 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +
> > +&nand {
> > +       partition at 0 {
> > +               /delete-property/ read-only;
> > +       };
> > +};
> > diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> > index c2fff84a68..39593c83d0 100644
> > --- a/arch/arm/mach-kirkwood/Kconfig
> > +++ b/arch/arm/mach-kirkwood/Kconfig
> > @@ -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:
>
> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> index c2fff84a686..031d4e5ecd3 100644
> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -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

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

All the best,
Tony

>
> -Sumit


More information about the U-Boot mailing list