diff mbox series

[v3,7/8] dts: meson-gxbb: Switch to using upstream DT

Message ID 20231228115804.3626579-8-sumit.garg@linaro.org
State Superseded
Headers show
Series An effort to bring DT bindings compliance within U-Boot | expand

Commit Message

Sumit Garg Dec. 28, 2023, 11:58 a.m. UTC
Although there were still some variations in board DTS files based on
meson-gxbb SoC but I think those were minor differences from upstream
and shouldn't impact boot on these devices.

So switch to upstream DT via mirroring amlogic/ directory from
devicetree-rebasing/src/arm64/amlogic/ directory. And thereby directly
building DTB from there including *-u-boot.dtsi files from
arch/$(ARCH)/dts/ directory.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
---

Changes in v3:
--------------
- Dropped Makefile portion and enabled OF_UPSTREAM for SoC instead.

Changes in v2:
--------------
- Picked up review tag

 arch/arm/mach-meson/Kconfig           | 1 +
 configs/nanopi-k2_defconfig           | 2 +-
 configs/odroid-c2_defconfig           | 2 +-
 configs/p200_defconfig                | 2 +-
 configs/p201_defconfig                | 2 +-
 configs/videostrong-kii-pro_defconfig | 2 +-
 configs/wetek-hub_defconfig           | 2 +-
 configs/wetek-play2_defconfig         | 2 +-
 dts/arch/arm64/amlogic                | 1 +
 9 files changed, 9 insertions(+), 7 deletions(-)
 create mode 120000 dts/arch/arm64/amlogic

Comments

Simon Glass Dec. 28, 2023, 1:37 p.m. UTC | #1
Hi Sumit,

On Thu, Dec 28, 2023 at 11:59 AM Sumit Garg <sumit.garg@linaro.org> wrote:
>
> Although there were still some variations in board DTS files based on
> meson-gxbb SoC but I think those were minor differences from upstream
> and shouldn't impact boot on these devices.
>
> So switch to upstream DT via mirroring amlogic/ directory from
> devicetree-rebasing/src/arm64/amlogic/ directory. And thereby directly
> building DTB from there including *-u-boot.dtsi files from
> arch/$(ARCH)/dts/ directory.
>
> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> ---
>
> Changes in v3:
> --------------
> - Dropped Makefile portion and enabled OF_UPSTREAM for SoC instead.
>
> Changes in v2:
> --------------
> - Picked up review tag
>
>  arch/arm/mach-meson/Kconfig           | 1 +
>  configs/nanopi-k2_defconfig           | 2 +-
>  configs/odroid-c2_defconfig           | 2 +-
>  configs/p200_defconfig                | 2 +-
>  configs/p201_defconfig                | 2 +-
>  configs/videostrong-kii-pro_defconfig | 2 +-
>  configs/wetek-hub_defconfig           | 2 +-
>  configs/wetek-play2_defconfig         | 2 +-
>  dts/arch/arm64/amlogic                | 1 +
>  9 files changed, 9 insertions(+), 7 deletions(-)
>  create mode 120000 dts/arch/arm64/amlogic
>

Reviewed-by: Simon Glass <sjg@chromium.org>

> diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
> index d6c89058061..8ddb59161a0 100644
> --- a/arch/arm/mach-meson/Kconfig
> +++ b/arch/arm/mach-meson/Kconfig
> @@ -25,6 +25,7 @@ choice
>  config MESON_GXBB
>         bool "GXBB"
>         select MESON_GX
> +       imply OF_UPSTREAM
>         help
>           Select this if your SoC is an S905
>
> diff --git a/configs/nanopi-k2_defconfig b/configs/nanopi-k2_defconfig
> index 41dbf7981f8..2e1c756bf7a 100644
> --- a/configs/nanopi-k2_defconfig
> +++ b/configs/nanopi-k2_defconfig
> @@ -6,7 +6,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
>  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
>  CONFIG_ENV_SIZE=0x2000
>  CONFIG_DM_GPIO=y
> -CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> +CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-nanopi-k2"
>  CONFIG_OF_LIBFDT_OVERLAY=y
>  CONFIG_DM_RESET=y
>  CONFIG_DEBUG_UART_BASE=0xc81004c0

So now I am wondering if we can (later) have the SoC be implied when
using OF_UPSTREAM so we can do:

CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"

and it will add the 'amlogic/' automatically?

Perhaps that might be a way to bridge the gap in terms of file layout?

[..]

Regards,
Simon
Tom Rini Dec. 28, 2023, 1:56 p.m. UTC | #2
On Thu, Dec 28, 2023 at 01:37:11PM +0000, Simon Glass wrote:
> Hi Sumit,
> 
> On Thu, Dec 28, 2023 at 11:59 AM Sumit Garg <sumit.garg@linaro.org> wrote:
> >
> > Although there were still some variations in board DTS files based on
> > meson-gxbb SoC but I think those were minor differences from upstream
> > and shouldn't impact boot on these devices.
> >
> > So switch to upstream DT via mirroring amlogic/ directory from
> > devicetree-rebasing/src/arm64/amlogic/ directory. And thereby directly
> > building DTB from there including *-u-boot.dtsi files from
> > arch/$(ARCH)/dts/ directory.
> >
> > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
> > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > ---
> >
> > Changes in v3:
> > --------------
> > - Dropped Makefile portion and enabled OF_UPSTREAM for SoC instead.
> >
> > Changes in v2:
> > --------------
> > - Picked up review tag
> >
> >  arch/arm/mach-meson/Kconfig           | 1 +
> >  configs/nanopi-k2_defconfig           | 2 +-
> >  configs/odroid-c2_defconfig           | 2 +-
> >  configs/p200_defconfig                | 2 +-
> >  configs/p201_defconfig                | 2 +-
> >  configs/videostrong-kii-pro_defconfig | 2 +-
> >  configs/wetek-hub_defconfig           | 2 +-
> >  configs/wetek-play2_defconfig         | 2 +-
> >  dts/arch/arm64/amlogic                | 1 +
> >  9 files changed, 9 insertions(+), 7 deletions(-)
> >  create mode 120000 dts/arch/arm64/amlogic
> >
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> > diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
> > index d6c89058061..8ddb59161a0 100644
> > --- a/arch/arm/mach-meson/Kconfig
> > +++ b/arch/arm/mach-meson/Kconfig
> > @@ -25,6 +25,7 @@ choice
> >  config MESON_GXBB
> >         bool "GXBB"
> >         select MESON_GX
> > +       imply OF_UPSTREAM
> >         help
> >           Select this if your SoC is an S905
> >
> > diff --git a/configs/nanopi-k2_defconfig b/configs/nanopi-k2_defconfig
> > index 41dbf7981f8..2e1c756bf7a 100644
> > --- a/configs/nanopi-k2_defconfig
> > +++ b/configs/nanopi-k2_defconfig
> > @@ -6,7 +6,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
> >  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
> >  CONFIG_ENV_SIZE=0x2000
> >  CONFIG_DM_GPIO=y
> > -CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> > +CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-nanopi-k2"
> >  CONFIG_OF_LIBFDT_OVERLAY=y
> >  CONFIG_DM_RESET=y
> >  CONFIG_DEBUG_UART_BASE=0xc81004c0
> 
> So now I am wondering if we can (later) have the SoC be implied when
> using OF_UPSTREAM so we can do:
> 
> CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> 
> and it will add the 'amlogic/' automatically?
> 
> Perhaps that might be a way to bridge the gap in terms of file layout?

That's going to start to look real ugly real quick I suspect and I'm not
sure what it really gets us? It seems to me that the convention of
"vendor/board" has already been well enough adapted outside of the
kernel, with the odd sticking point being getting everyone used to
whatever will be happening for 32bit boards long term. So I think hiding
the vendor part of the string here will be more, not less, confusing
long term.
Simon Glass Dec. 28, 2023, 3:09 p.m. UTC | #3
Hi Tom,

On Thu, Dec 28, 2023 at 1:56 PM Tom Rini <trini@konsulko.com> wrote:
>
> On Thu, Dec 28, 2023 at 01:37:11PM +0000, Simon Glass wrote:
> > Hi Sumit,
> >
> > On Thu, Dec 28, 2023 at 11:59 AM Sumit Garg <sumit.garg@linaro.org> wrote:
> > >
> > > Although there were still some variations in board DTS files based on
> > > meson-gxbb SoC but I think those were minor differences from upstream
> > > and shouldn't impact boot on these devices.
> > >
> > > So switch to upstream DT via mirroring amlogic/ directory from
> > > devicetree-rebasing/src/arm64/amlogic/ directory. And thereby directly
> > > building DTB from there including *-u-boot.dtsi files from
> > > arch/$(ARCH)/dts/ directory.
> > >
> > > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
> > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > ---
> > >
> > > Changes in v3:
> > > --------------
> > > - Dropped Makefile portion and enabled OF_UPSTREAM for SoC instead.
> > >
> > > Changes in v2:
> > > --------------
> > > - Picked up review tag
> > >
> > >  arch/arm/mach-meson/Kconfig           | 1 +
> > >  configs/nanopi-k2_defconfig           | 2 +-
> > >  configs/odroid-c2_defconfig           | 2 +-
> > >  configs/p200_defconfig                | 2 +-
> > >  configs/p201_defconfig                | 2 +-
> > >  configs/videostrong-kii-pro_defconfig | 2 +-
> > >  configs/wetek-hub_defconfig           | 2 +-
> > >  configs/wetek-play2_defconfig         | 2 +-
> > >  dts/arch/arm64/amlogic                | 1 +
> > >  9 files changed, 9 insertions(+), 7 deletions(-)
> > >  create mode 120000 dts/arch/arm64/amlogic
> > >
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > > diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
> > > index d6c89058061..8ddb59161a0 100644
> > > --- a/arch/arm/mach-meson/Kconfig
> > > +++ b/arch/arm/mach-meson/Kconfig
> > > @@ -25,6 +25,7 @@ choice
> > >  config MESON_GXBB
> > >         bool "GXBB"
> > >         select MESON_GX
> > > +       imply OF_UPSTREAM
> > >         help
> > >           Select this if your SoC is an S905
> > >
> > > diff --git a/configs/nanopi-k2_defconfig b/configs/nanopi-k2_defconfig
> > > index 41dbf7981f8..2e1c756bf7a 100644
> > > --- a/configs/nanopi-k2_defconfig
> > > +++ b/configs/nanopi-k2_defconfig
> > > @@ -6,7 +6,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
> > >  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
> > >  CONFIG_ENV_SIZE=0x2000
> > >  CONFIG_DM_GPIO=y
> > > -CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> > > +CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-nanopi-k2"
> > >  CONFIG_OF_LIBFDT_OVERLAY=y
> > >  CONFIG_DM_RESET=y
> > >  CONFIG_DEBUG_UART_BASE=0xc81004c0
> >
> > So now I am wondering if we can (later) have the SoC be implied when
> > using OF_UPSTREAM so we can do:
> >
> > CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> >
> > and it will add the 'amlogic/' automatically?
> >
> > Perhaps that might be a way to bridge the gap in terms of file layout?
>
> That's going to start to look real ugly real quick I suspect and I'm not
> sure what it really gets us? It seems to me that the convention of
> "vendor/board" has already been well enough adapted outside of the
> kernel, with the odd sticking point being getting everyone used to
> whatever will be happening for 32bit boards long term. So I think hiding
> the vendor part of the string here will be more, not less, confusing
> long term.

Now that I dig in a bit, I see that the devicetree-rebasing tree does
not have any Makefiles in it. How does Linux build with it? Does
anyone have instructions?

Regards,
Simon
Tom Rini Dec. 28, 2023, 3:25 p.m. UTC | #4
On Thu, Dec 28, 2023 at 03:09:41PM +0000, Simon Glass wrote:
> Hi Tom,
> 
> On Thu, Dec 28, 2023 at 1:56 PM Tom Rini <trini@konsulko.com> wrote:
> >
> > On Thu, Dec 28, 2023 at 01:37:11PM +0000, Simon Glass wrote:
> > > Hi Sumit,
> > >
> > > On Thu, Dec 28, 2023 at 11:59 AM Sumit Garg <sumit.garg@linaro.org> wrote:
> > > >
> > > > Although there were still some variations in board DTS files based on
> > > > meson-gxbb SoC but I think those were minor differences from upstream
> > > > and shouldn't impact boot on these devices.
> > > >
> > > > So switch to upstream DT via mirroring amlogic/ directory from
> > > > devicetree-rebasing/src/arm64/amlogic/ directory. And thereby directly
> > > > building DTB from there including *-u-boot.dtsi files from
> > > > arch/$(ARCH)/dts/ directory.
> > > >
> > > > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
> > > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > ---
> > > >
> > > > Changes in v3:
> > > > --------------
> > > > - Dropped Makefile portion and enabled OF_UPSTREAM for SoC instead.
> > > >
> > > > Changes in v2:
> > > > --------------
> > > > - Picked up review tag
> > > >
> > > >  arch/arm/mach-meson/Kconfig           | 1 +
> > > >  configs/nanopi-k2_defconfig           | 2 +-
> > > >  configs/odroid-c2_defconfig           | 2 +-
> > > >  configs/p200_defconfig                | 2 +-
> > > >  configs/p201_defconfig                | 2 +-
> > > >  configs/videostrong-kii-pro_defconfig | 2 +-
> > > >  configs/wetek-hub_defconfig           | 2 +-
> > > >  configs/wetek-play2_defconfig         | 2 +-
> > > >  dts/arch/arm64/amlogic                | 1 +
> > > >  9 files changed, 9 insertions(+), 7 deletions(-)
> > > >  create mode 120000 dts/arch/arm64/amlogic
> > > >
> > >
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > >
> > > > diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
> > > > index d6c89058061..8ddb59161a0 100644
> > > > --- a/arch/arm/mach-meson/Kconfig
> > > > +++ b/arch/arm/mach-meson/Kconfig
> > > > @@ -25,6 +25,7 @@ choice
> > > >  config MESON_GXBB
> > > >         bool "GXBB"
> > > >         select MESON_GX
> > > > +       imply OF_UPSTREAM
> > > >         help
> > > >           Select this if your SoC is an S905
> > > >
> > > > diff --git a/configs/nanopi-k2_defconfig b/configs/nanopi-k2_defconfig
> > > > index 41dbf7981f8..2e1c756bf7a 100644
> > > > --- a/configs/nanopi-k2_defconfig
> > > > +++ b/configs/nanopi-k2_defconfig
> > > > @@ -6,7 +6,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
> > > >  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
> > > >  CONFIG_ENV_SIZE=0x2000
> > > >  CONFIG_DM_GPIO=y
> > > > -CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> > > > +CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-nanopi-k2"
> > > >  CONFIG_OF_LIBFDT_OVERLAY=y
> > > >  CONFIG_DM_RESET=y
> > > >  CONFIG_DEBUG_UART_BASE=0xc81004c0
> > >
> > > So now I am wondering if we can (later) have the SoC be implied when
> > > using OF_UPSTREAM so we can do:
> > >
> > > CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> > >
> > > and it will add the 'amlogic/' automatically?
> > >
> > > Perhaps that might be a way to bridge the gap in terms of file layout?
> >
> > That's going to start to look real ugly real quick I suspect and I'm not
> > sure what it really gets us? It seems to me that the convention of
> > "vendor/board" has already been well enough adapted outside of the
> > kernel, with the odd sticking point being getting everyone used to
> > whatever will be happening for 32bit boards long term. So I think hiding
> > the vendor part of the string here will be more, not less, confusing
> > long term.
> 
> Now that I dig in a bit, I see that the devicetree-rebasing tree does
> not have any Makefiles in it. How does Linux build with it? Does
> anyone have instructions?

Linux doesn't build with it, it's the relevant parts of the kernel tree
extracted for other projects to more easily use (more or less).
Simon Glass Dec. 28, 2023, 7:48 p.m. UTC | #5
Hi Tom,

On Thu, Dec 28, 2023 at 3:25 PM Tom Rini <trini@konsulko.com> wrote:
>
> On Thu, Dec 28, 2023 at 03:09:41PM +0000, Simon Glass wrote:
> > Hi Tom,
> >
> > On Thu, Dec 28, 2023 at 1:56 PM Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Thu, Dec 28, 2023 at 01:37:11PM +0000, Simon Glass wrote:
> > > > Hi Sumit,
> > > >
> > > > On Thu, Dec 28, 2023 at 11:59 AM Sumit Garg <sumit.garg@linaro.org> wrote:
> > > > >
> > > > > Although there were still some variations in board DTS files based on
> > > > > meson-gxbb SoC but I think those were minor differences from upstream
> > > > > and shouldn't impact boot on these devices.
> > > > >
> > > > > So switch to upstream DT via mirroring amlogic/ directory from
> > > > > devicetree-rebasing/src/arm64/amlogic/ directory. And thereby directly
> > > > > building DTB from there including *-u-boot.dtsi files from
> > > > > arch/$(ARCH)/dts/ directory.
> > > > >
> > > > > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
> > > > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > > ---
> > > > >
> > > > > Changes in v3:
> > > > > --------------
> > > > > - Dropped Makefile portion and enabled OF_UPSTREAM for SoC instead.
> > > > >
> > > > > Changes in v2:
> > > > > --------------
> > > > > - Picked up review tag
> > > > >
> > > > >  arch/arm/mach-meson/Kconfig           | 1 +
> > > > >  configs/nanopi-k2_defconfig           | 2 +-
> > > > >  configs/odroid-c2_defconfig           | 2 +-
> > > > >  configs/p200_defconfig                | 2 +-
> > > > >  configs/p201_defconfig                | 2 +-
> > > > >  configs/videostrong-kii-pro_defconfig | 2 +-
> > > > >  configs/wetek-hub_defconfig           | 2 +-
> > > > >  configs/wetek-play2_defconfig         | 2 +-
> > > > >  dts/arch/arm64/amlogic                | 1 +
> > > > >  9 files changed, 9 insertions(+), 7 deletions(-)
> > > > >  create mode 120000 dts/arch/arm64/amlogic
> > > > >
> > > >
> > > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > >
> > > > > diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
> > > > > index d6c89058061..8ddb59161a0 100644
> > > > > --- a/arch/arm/mach-meson/Kconfig
> > > > > +++ b/arch/arm/mach-meson/Kconfig
> > > > > @@ -25,6 +25,7 @@ choice
> > > > >  config MESON_GXBB
> > > > >         bool "GXBB"
> > > > >         select MESON_GX
> > > > > +       imply OF_UPSTREAM
> > > > >         help
> > > > >           Select this if your SoC is an S905
> > > > >
> > > > > diff --git a/configs/nanopi-k2_defconfig b/configs/nanopi-k2_defconfig
> > > > > index 41dbf7981f8..2e1c756bf7a 100644
> > > > > --- a/configs/nanopi-k2_defconfig
> > > > > +++ b/configs/nanopi-k2_defconfig
> > > > > @@ -6,7 +6,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
> > > > >  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
> > > > >  CONFIG_ENV_SIZE=0x2000
> > > > >  CONFIG_DM_GPIO=y
> > > > > -CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> > > > > +CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-nanopi-k2"
> > > > >  CONFIG_OF_LIBFDT_OVERLAY=y
> > > > >  CONFIG_DM_RESET=y
> > > > >  CONFIG_DEBUG_UART_BASE=0xc81004c0
> > > >
> > > > So now I am wondering if we can (later) have the SoC be implied when
> > > > using OF_UPSTREAM so we can do:
> > > >
> > > > CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> > > >
> > > > and it will add the 'amlogic/' automatically?
> > > >
> > > > Perhaps that might be a way to bridge the gap in terms of file layout?
> > >
> > > That's going to start to look real ugly real quick I suspect and I'm not
> > > sure what it really gets us? It seems to me that the convention of
> > > "vendor/board" has already been well enough adapted outside of the
> > > kernel, with the odd sticking point being getting everyone used to
> > > whatever will be happening for 32bit boards long term. So I think hiding
> > > the vendor part of the string here will be more, not less, confusing
> > > long term.
> >
> > Now that I dig in a bit, I see that the devicetree-rebasing tree does
> > not have any Makefiles in it. How does Linux build with it? Does
> > anyone have instructions?
>
> Linux doesn't build with it, it's the relevant parts of the kernel tree
> extracted for other projects to more easily use (more or less).

Hmmm, in that case can we add Makefiles into the U-Boot version of the
tree, for U-Boot use?

Regards,
Simon
Tom Rini Dec. 28, 2023, 8:32 p.m. UTC | #6
On Thu, Dec 28, 2023 at 07:48:13PM +0000, Simon Glass wrote:
> Hi Tom,
> 
> On Thu, Dec 28, 2023 at 3:25 PM Tom Rini <trini@konsulko.com> wrote:
> >
> > On Thu, Dec 28, 2023 at 03:09:41PM +0000, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Thu, Dec 28, 2023 at 1:56 PM Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Thu, Dec 28, 2023 at 01:37:11PM +0000, Simon Glass wrote:
> > > > > Hi Sumit,
> > > > >
> > > > > On Thu, Dec 28, 2023 at 11:59 AM Sumit Garg <sumit.garg@linaro.org> wrote:
> > > > > >
> > > > > > Although there were still some variations in board DTS files based on
> > > > > > meson-gxbb SoC but I think those were minor differences from upstream
> > > > > > and shouldn't impact boot on these devices.
> > > > > >
> > > > > > So switch to upstream DT via mirroring amlogic/ directory from
> > > > > > devicetree-rebasing/src/arm64/amlogic/ directory. And thereby directly
> > > > > > building DTB from there including *-u-boot.dtsi files from
> > > > > > arch/$(ARCH)/dts/ directory.
> > > > > >
> > > > > > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
> > > > > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > > > ---
> > > > > >
> > > > > > Changes in v3:
> > > > > > --------------
> > > > > > - Dropped Makefile portion and enabled OF_UPSTREAM for SoC instead.
> > > > > >
> > > > > > Changes in v2:
> > > > > > --------------
> > > > > > - Picked up review tag
> > > > > >
> > > > > >  arch/arm/mach-meson/Kconfig           | 1 +
> > > > > >  configs/nanopi-k2_defconfig           | 2 +-
> > > > > >  configs/odroid-c2_defconfig           | 2 +-
> > > > > >  configs/p200_defconfig                | 2 +-
> > > > > >  configs/p201_defconfig                | 2 +-
> > > > > >  configs/videostrong-kii-pro_defconfig | 2 +-
> > > > > >  configs/wetek-hub_defconfig           | 2 +-
> > > > > >  configs/wetek-play2_defconfig         | 2 +-
> > > > > >  dts/arch/arm64/amlogic                | 1 +
> > > > > >  9 files changed, 9 insertions(+), 7 deletions(-)
> > > > > >  create mode 120000 dts/arch/arm64/amlogic
> > > > > >
> > > > >
> > > > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > > >
> > > > > > diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
> > > > > > index d6c89058061..8ddb59161a0 100644
> > > > > > --- a/arch/arm/mach-meson/Kconfig
> > > > > > +++ b/arch/arm/mach-meson/Kconfig
> > > > > > @@ -25,6 +25,7 @@ choice
> > > > > >  config MESON_GXBB
> > > > > >         bool "GXBB"
> > > > > >         select MESON_GX
> > > > > > +       imply OF_UPSTREAM
> > > > > >         help
> > > > > >           Select this if your SoC is an S905
> > > > > >
> > > > > > diff --git a/configs/nanopi-k2_defconfig b/configs/nanopi-k2_defconfig
> > > > > > index 41dbf7981f8..2e1c756bf7a 100644
> > > > > > --- a/configs/nanopi-k2_defconfig
> > > > > > +++ b/configs/nanopi-k2_defconfig
> > > > > > @@ -6,7 +6,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
> > > > > >  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
> > > > > >  CONFIG_ENV_SIZE=0x2000
> > > > > >  CONFIG_DM_GPIO=y
> > > > > > -CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> > > > > > +CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-nanopi-k2"
> > > > > >  CONFIG_OF_LIBFDT_OVERLAY=y
> > > > > >  CONFIG_DM_RESET=y
> > > > > >  CONFIG_DEBUG_UART_BASE=0xc81004c0
> > > > >
> > > > > So now I am wondering if we can (later) have the SoC be implied when
> > > > > using OF_UPSTREAM so we can do:
> > > > >
> > > > > CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> > > > >
> > > > > and it will add the 'amlogic/' automatically?
> > > > >
> > > > > Perhaps that might be a way to bridge the gap in terms of file layout?
> > > >
> > > > That's going to start to look real ugly real quick I suspect and I'm not
> > > > sure what it really gets us? It seems to me that the convention of
> > > > "vendor/board" has already been well enough adapted outside of the
> > > > kernel, with the odd sticking point being getting everyone used to
> > > > whatever will be happening for 32bit boards long term. So I think hiding
> > > > the vendor part of the string here will be more, not less, confusing
> > > > long term.
> > >
> > > Now that I dig in a bit, I see that the devicetree-rebasing tree does
> > > not have any Makefiles in it. How does Linux build with it? Does
> > > anyone have instructions?
> >
> > Linux doesn't build with it, it's the relevant parts of the kernel tree
> > extracted for other projects to more easily use (more or less).
> 
> Hmmm, in that case can we add Makefiles into the U-Boot version of the
> tree, for U-Boot use?

No? Why would we do that? I think you're missing how the amlogic
conversion works.
Simon Glass Dec. 31, 2023, 12:47 p.m. UTC | #7
Hi Tom,

On Thu, Dec 28, 2023 at 1:32 PM Tom Rini <trini@konsulko.com> wrote:
>
> On Thu, Dec 28, 2023 at 07:48:13PM +0000, Simon Glass wrote:
> > Hi Tom,
> >
> > On Thu, Dec 28, 2023 at 3:25 PM Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Thu, Dec 28, 2023 at 03:09:41PM +0000, Simon Glass wrote:
> > > > Hi Tom,
> > > >
> > > > On Thu, Dec 28, 2023 at 1:56 PM Tom Rini <trini@konsulko.com> wrote:
> > > > >
> > > > > On Thu, Dec 28, 2023 at 01:37:11PM +0000, Simon Glass wrote:
> > > > > > Hi Sumit,
> > > > > >
> > > > > > On Thu, Dec 28, 2023 at 11:59 AM Sumit Garg <sumit.garg@linaro.org> wrote:
> > > > > > >
> > > > > > > Although there were still some variations in board DTS files based on
> > > > > > > meson-gxbb SoC but I think those were minor differences from upstream
> > > > > > > and shouldn't impact boot on these devices.
> > > > > > >
> > > > > > > So switch to upstream DT via mirroring amlogic/ directory from
> > > > > > > devicetree-rebasing/src/arm64/amlogic/ directory. And thereby directly
> > > > > > > building DTB from there including *-u-boot.dtsi files from
> > > > > > > arch/$(ARCH)/dts/ directory.
> > > > > > >
> > > > > > > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
> > > > > > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > > > > ---
> > > > > > >
> > > > > > > Changes in v3:
> > > > > > > --------------
> > > > > > > - Dropped Makefile portion and enabled OF_UPSTREAM for SoC instead.
> > > > > > >
> > > > > > > Changes in v2:
> > > > > > > --------------
> > > > > > > - Picked up review tag
> > > > > > >
> > > > > > >  arch/arm/mach-meson/Kconfig           | 1 +
> > > > > > >  configs/nanopi-k2_defconfig           | 2 +-
> > > > > > >  configs/odroid-c2_defconfig           | 2 +-
> > > > > > >  configs/p200_defconfig                | 2 +-
> > > > > > >  configs/p201_defconfig                | 2 +-
> > > > > > >  configs/videostrong-kii-pro_defconfig | 2 +-
> > > > > > >  configs/wetek-hub_defconfig           | 2 +-
> > > > > > >  configs/wetek-play2_defconfig         | 2 +-
> > > > > > >  dts/arch/arm64/amlogic                | 1 +
> > > > > > >  9 files changed, 9 insertions(+), 7 deletions(-)
> > > > > > >  create mode 120000 dts/arch/arm64/amlogic
> > > > > > >
> > > > > >
> > > > > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > > > >
> > > > > > > diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
> > > > > > > index d6c89058061..8ddb59161a0 100644
> > > > > > > --- a/arch/arm/mach-meson/Kconfig
> > > > > > > +++ b/arch/arm/mach-meson/Kconfig
> > > > > > > @@ -25,6 +25,7 @@ choice
> > > > > > >  config MESON_GXBB
> > > > > > >         bool "GXBB"
> > > > > > >         select MESON_GX
> > > > > > > +       imply OF_UPSTREAM
> > > > > > >         help
> > > > > > >           Select this if your SoC is an S905
> > > > > > >
> > > > > > > diff --git a/configs/nanopi-k2_defconfig b/configs/nanopi-k2_defconfig
> > > > > > > index 41dbf7981f8..2e1c756bf7a 100644
> > > > > > > --- a/configs/nanopi-k2_defconfig
> > > > > > > +++ b/configs/nanopi-k2_defconfig
> > > > > > > @@ -6,7 +6,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
> > > > > > >  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
> > > > > > >  CONFIG_ENV_SIZE=0x2000
> > > > > > >  CONFIG_DM_GPIO=y
> > > > > > > -CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> > > > > > > +CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-nanopi-k2"
> > > > > > >  CONFIG_OF_LIBFDT_OVERLAY=y
> > > > > > >  CONFIG_DM_RESET=y
> > > > > > >  CONFIG_DEBUG_UART_BASE=0xc81004c0
> > > > > >
> > > > > > So now I am wondering if we can (later) have the SoC be implied when
> > > > > > using OF_UPSTREAM so we can do:
> > > > > >
> > > > > > CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
> > > > > >
> > > > > > and it will add the 'amlogic/' automatically?
> > > > > >
> > > > > > Perhaps that might be a way to bridge the gap in terms of file layout?
> > > > >
> > > > > That's going to start to look real ugly real quick I suspect and I'm not
> > > > > sure what it really gets us? It seems to me that the convention of
> > > > > "vendor/board" has already been well enough adapted outside of the
> > > > > kernel, with the odd sticking point being getting everyone used to
> > > > > whatever will be happening for 32bit boards long term. So I think hiding
> > > > > the vendor part of the string here will be more, not less, confusing
> > > > > long term.
> > > >
> > > > Now that I dig in a bit, I see that the devicetree-rebasing tree does
> > > > not have any Makefiles in it. How does Linux build with it? Does
> > > > anyone have instructions?
> > >
> > > Linux doesn't build with it, it's the relevant parts of the kernel tree
> > > extracted for other projects to more easily use (more or less).
> >
> > Hmmm, in that case can we add Makefiles into the U-Boot version of the
> > tree, for U-Boot use?
>
> No? Why would we do that? I think you're missing how the amlogic
> conversion works.

I will reply on the other thread about this.

Regards,
Simon
diff mbox series

Patch

diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
index d6c89058061..8ddb59161a0 100644
--- a/arch/arm/mach-meson/Kconfig
+++ b/arch/arm/mach-meson/Kconfig
@@ -25,6 +25,7 @@  choice
 config MESON_GXBB
 	bool "GXBB"
 	select MESON_GX
+	imply OF_UPSTREAM
 	help
 	  Select this if your SoC is an S905
 
diff --git a/configs/nanopi-k2_defconfig b/configs/nanopi-k2_defconfig
index 41dbf7981f8..2e1c756bf7a 100644
--- a/configs/nanopi-k2_defconfig
+++ b/configs/nanopi-k2_defconfig
@@ -6,7 +6,7 @@  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DM_GPIO=y
-CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-nanopi-k2"
+CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-nanopi-k2"
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig
index 5f9f323e06e..ce5eaec3cd2 100644
--- a/configs/odroid-c2_defconfig
+++ b/configs/odroid-c2_defconfig
@@ -6,7 +6,7 @@  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DM_GPIO=y
-CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-odroidc2"
+CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-odroidc2"
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
diff --git a/configs/p200_defconfig b/configs/p200_defconfig
index cd579ef5f14..b6946034795 100644
--- a/configs/p200_defconfig
+++ b/configs/p200_defconfig
@@ -6,7 +6,7 @@  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DM_GPIO=y
-CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-p200"
+CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-p200"
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
diff --git a/configs/p201_defconfig b/configs/p201_defconfig
index b2f0a0ccdb4..dcc1454be16 100644
--- a/configs/p201_defconfig
+++ b/configs/p201_defconfig
@@ -7,7 +7,7 @@  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DM_GPIO=y
-CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-p201"
+CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-p201"
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
diff --git a/configs/videostrong-kii-pro_defconfig b/configs/videostrong-kii-pro_defconfig
index 3eda8f14a21..7a5af234471 100644
--- a/configs/videostrong-kii-pro_defconfig
+++ b/configs/videostrong-kii-pro_defconfig
@@ -6,7 +6,7 @@  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DM_GPIO=y
-CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-kii-pro"
+CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-kii-pro"
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
diff --git a/configs/wetek-hub_defconfig b/configs/wetek-hub_defconfig
index fd92b041e73..85cff73f50f 100644
--- a/configs/wetek-hub_defconfig
+++ b/configs/wetek-hub_defconfig
@@ -6,7 +6,7 @@  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DM_GPIO=y
-CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-wetek-hub"
+CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-wetek-hub"
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
diff --git a/configs/wetek-play2_defconfig b/configs/wetek-play2_defconfig
index b887419a6ba..efdf820165b 100644
--- a/configs/wetek-play2_defconfig
+++ b/configs/wetek-play2_defconfig
@@ -6,7 +6,7 @@  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DM_GPIO=y
-CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-wetek-play2"
+CONFIG_DEFAULT_DEVICE_TREE="amlogic/meson-gxbb-wetek-play2"
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
diff --git a/dts/arch/arm64/amlogic b/dts/arch/arm64/amlogic
new file mode 120000
index 00000000000..73f7c3e7bd0
--- /dev/null
+++ b/dts/arch/arm64/amlogic
@@ -0,0 +1 @@ 
+../../../devicetree-rebasing/src/arm64/amlogic/
\ No newline at end of file