Message ID | CAEg67GmsMwVm0Hh23EjdR_SmRpbz_51MBGgjjn2WGkv3jjncXg@mail.gmail.com |
---|---|
State | Changes Requested |
Headers | show |
Series | ti-k3-r5-loader: support devicetree customisation | expand |
On Wed, Jul 5, 2023 at 5:16 PM Patrick Oppenlander <patrick.oppenlander@gmail.com> wrote: > > This is duplicated from the U-Boot makefile & Kconfig. > > Similarly to U-Boot custom boards sometimes need to adjust the U-Boot > devicetree. For example, the AM64x SDRAM controller supports inline ECC > which needs to be enabled in the R5 loader devicetree. > > Please note that some versions of U-Boot have broken external devicetree > support and may require manual patching to build. See commit > 3609e1dc5f4d4c238dcd23e045ba6223310feffa in the U-Boot tree. > Ping adding Andreas to cc. Hi Andreas, could you take a look at this. For our project we need to enable inline ECC support, which requires customisation of the R5 loader devicetree. Thanks, Patrick
Hello Patrick, On Wed, 5 Jul 2023 17:16:34 +1000 Patrick Oppenlander <patrick.oppenlander@gmail.com> wrote: > +config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_DTS_PATH > + string "Device Tree Source file paths" > + help > + Space-separated list of paths to device tree source files > + that will be copied to arch/ARCH/dts/ before starting the > + build. > + > + To use this device tree source file, the TI K3 R5 Loader > + configuration file must refer to it. > diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk > b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk > index 8311e1b401..012f4ee52d 100644 > --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk > +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk > @@ -77,7 +77,12 @@ TI_K3_R5_LOADER_MAKE_OPTS += > TI_SECURE_DEV_PKG=$(TI_CORE_SECDEV_K3_INSTALL_DIR) > endif > endif > > +TI_K3_R5_LOADER_CUSTOM_DTS_PATH = $(call > qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_DTS_PATH)) > + > define TI_K3_R5_LOADER_BUILD_CMDS > + $(if $(TI_K3_R5_LOADER_CUSTOM_DTS_PATH), > + cp -f $(TI_K3_R5_LOADER_CUSTOM_DTS_PATH) $(@D)/arch/arm/dts/ > + ) > $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) > $(TI_K3_R5_LOADER_MAKE_OPTS) > endef > This patch is badly line-wrapped. Could you resend with "git send-email"? Thanks! Thomas
From: Patrick Oppenlander <patrick.oppenlander@gmail.com>
Hi Thomas,
sorry about that. Resend below.
Patrick
---
boot/ti-k3-r5-loader/Config.in | 10 ++++++++++
boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 5 +++++
2 files changed, 15 insertions(+)
diff --git a/boot/ti-k3-r5-loader/Config.in b/boot/ti-k3-r5-loader/Config.in
index 2419babe70..580abf59ec 100644
--- a/boot/ti-k3-r5-loader/Config.in
+++ b/boot/ti-k3-r5-loader/Config.in
@@ -92,3 +92,13 @@ config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_CONFIG_FILE
Path to the TI K3 R5 Loader configuration file.
endif
+
+config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_DTS_PATH
+ string "Device Tree Source file paths"
+ help
+ Space-separated list of paths to device tree source files
+ that will be copied to arch/ARCH/dts/ before starting the
+ build.
+
+ To use this device tree source file, the TI K3 R5 Loader
+ configuration file must refer to it.
diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
index 8311e1b401..012f4ee52d 100644
--- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
+++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
@@ -77,7 +77,12 @@ TI_K3_R5_LOADER_MAKE_OPTS += TI_SECURE_DEV_PKG=$(TI_CORE_SECDEV_K3_INSTALL_DIR)
endif
endif
+TI_K3_R5_LOADER_CUSTOM_DTS_PATH = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_DTS_PATH))
+
define TI_K3_R5_LOADER_BUILD_CMDS
+ $(if $(TI_K3_R5_LOADER_CUSTOM_DTS_PATH),
+ cp -f $(TI_K3_R5_LOADER_CUSTOM_DTS_PATH) $(@D)/arch/arm/dts/
+ )
$(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
endef
On Mon, 4 Sep 2023 09:06:09 +1000 patrick.oppenlander@gmail.com wrote: > From: Patrick Oppenlander <patrick.oppenlander@gmail.com> > > Hi Thomas, > > sorry about that. Resend below. > > Patrick This also doesn't work, because now your commit log would be: ============================================================= Hi Thomas, sorry about that. Resend below. Patrick ============================================================= Your commit log should be a proper commit log, which explains the change and its rationale. Thanks a lot! Thomas
Hi Thomas, I messed that up, sorry. I'll send it again. Patrick On Tue, Sep 5, 2023 at 2:26 AM Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote: > > On Mon, 4 Sep 2023 09:06:09 +1000 > patrick.oppenlander@gmail.com wrote: > > > From: Patrick Oppenlander <patrick.oppenlander@gmail.com> > > > > Hi Thomas, > > > > sorry about that. Resend below. > > > > Patrick > > This also doesn't work, because now your commit log would be: > > ============================================================= > Hi Thomas, > > sorry about that. Resend below. > > Patrick > ============================================================= > > Your commit log should be a proper commit log, which explains the > change and its rationale. > > Thanks a lot! > > Thomas > -- > Thomas Petazzoni, co-owner and CEO, Bootlin > Embedded Linux and Kernel engineering and training > https://bootlin.com
diff --git a/boot/ti-k3-r5-loader/Config.in b/boot/ti-k3-r5-loader/Config.in index 2419babe70..580abf59ec 100644 --- a/boot/ti-k3-r5-loader/Config.in +++ b/boot/ti-k3-r5-loader/Config.in @@ -92,3 +92,13 @@ config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_CONFIG_FILE Path to the TI K3 R5 Loader configuration file. endif + +config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_DTS_PATH + string "Device Tree Source file paths" + help + Space-separated list of paths to device tree source files + that will be copied to arch/ARCH/dts/ before starting the + build. + + To use this device tree source file, the TI K3 R5 Loader + configuration file must refer to it. diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk index 8311e1b401..012f4ee52d 100644 --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk @@ -77,7 +77,12 @@ TI_K3_R5_LOADER_MAKE_OPTS += TI_SECURE_DEV_PKG=$(TI_CORE_SECDEV_K3_INSTALL_DIR) endif endif +TI_K3_R5_LOADER_CUSTOM_DTS_PATH = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_DTS_PATH)) + define TI_K3_R5_LOADER_BUILD_CMDS + $(if $(TI_K3_R5_LOADER_CUSTOM_DTS_PATH), + cp -f $(TI_K3_R5_LOADER_CUSTOM_DTS_PATH) $(@D)/arch/arm/dts/ + ) $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D)
This is duplicated from the U-Boot makefile & Kconfig. Similarly to U-Boot custom boards sometimes need to adjust the U-Boot devicetree. For example, the AM64x SDRAM controller supports inline ECC which needs to be enabled in the R5 loader devicetree. Please note that some versions of U-Boot have broken external devicetree support and may require manual patching to build. See commit 3609e1dc5f4d4c238dcd23e045ba6223310feffa in the U-Boot tree. Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com> --- boot/ti-k3-r5-loader/Config.in | 10 ++++++++++ boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 5 +++++ 2 files changed, 15 insertions(+) $(TI_K3_R5_LOADER_MAKE_OPTS) endef