diff mbox series

[meta-ti,master/kirkstone,2/2] recipes-bsp: u-boot: Add logic to handle fragment u-boot configs

Message ID 20230908131427.2237438-1-c-shilwant@ti.com
State Superseded
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti,master/kirkstone,1/2] conf: machine: Add am62xx-sip-evm configuration | expand

Commit Message

Chirag Shilwant Sept. 8, 2023, 1:14 p.m. UTC
- Add u-boot-mergeconfig.inc which will ensure we handle fragment u-boot configs.
- Include u-boot-mergeconfig.inc in u-boot-ti.inc.
- Add a new variable UBOOT_CONFIG_FRAGMENT which stores the name of fragment defconfig to be used.

Signed-off-by: Chirag Shilwant <c-shilwant@ti.com>
---
 meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf     | 1 +
 meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc | 7 +++++++
 meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc          | 1 +
 3 files changed, 9 insertions(+)
 create mode 100644 meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc

Comments

Bajjuri, Praneeth Sept. 8, 2023, 2:16 p.m. UTC | #1
On 9/8/2023 8:14 AM, Chirag Shilwant wrote:
> - Add u-boot-mergeconfig.inc which will ensure we handle fragment u-boot configs.
> - Include u-boot-mergeconfig.inc in u-boot-ti.inc.
> - Add a new variable UBOOT_CONFIG_FRAGMENT which stores the name of fragment defconfig to be used.

This patch has to be split,
The config fragment part belongs separately as its own patch and should 
go first.

am62xxsip machine including the necessary uboot config is its seperate 
patch on top

> 
> Signed-off-by: Chirag Shilwant <c-shilwant@ti.com>
> ---
>   meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf     | 1 +
>   meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc | 7 +++++++
>   meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc          | 1 +
>   3 files changed, 9 insertions(+)
>   create mode 100644 meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
> 
> diff --git a/meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf b/meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf
> index 472da1cc..a5be1130 100644
> --- a/meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf
> +++ b/meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf
> @@ -9,3 +9,4 @@ SYSFW_CONFIG = "evm"
>   SYSFW_SUFFIX = "hs-fs"
>   
>   UBOOT_MACHINE = "am62x_evm_r5_defconfig"
> +UBOOT_CONFIG_FRAGMENT = "am62xsip_sk_r5.config"
> diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
> new file mode 100644
> index 00000000..69db6260
> --- /dev/null
> +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
> @@ -0,0 +1,7 @@
> +do_compile:prepend () {
> +   if [ -n "${UBOOT_CONFIG_FRAGMENT}" ]
> +   then
> +       oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} ${UBOOT_CONFIG_FRAGMENT}
> +       oe_runmake -C ${S} O=${B} olddefconfig
> +   fi
> +}
> diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
> index f3285c23..5292517b 100644
> --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
> +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
> @@ -7,6 +7,7 @@ SPL_BINARY ?= "MLO"
>   
>   require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot-common.inc
>   require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot.inc
> +require u-boot-mergeconfig.inc
>   
>   FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:"
>
Ryan Eatmon Sept. 8, 2023, 2:30 p.m. UTC | #2
On 9/8/2023 9:16 AM, Bajjuri, Praneeth wrote:
> 
> 
> On 9/8/2023 8:14 AM, Chirag Shilwant wrote:
>> - Add u-boot-mergeconfig.inc which will ensure we handle fragment 
>> u-boot configs.
>> - Include u-boot-mergeconfig.inc in u-boot-ti.inc.
>> - Add a new variable UBOOT_CONFIG_FRAGMENT which stores the name of 
>> fragment defconfig to be used.
> 
> This patch has to be split,
> The config fragment part belongs separately as its own patch and should 
> go first.
> 
> am62xxsip machine including the necessary uboot config is its seperate 
> patch on top

Agreed.

1) Add UBOOT_CONFIG_FRAGMENT support to u-boot.
2) Add am62xx sip machine using this new feature.  (merge the other 
patch with this change).

>>
>> Signed-off-by: Chirag Shilwant <c-shilwant@ti.com>
>> ---
>>   meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf     | 1 +
>>   meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc | 7 +++++++
>>   meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc          | 1 +
>>   3 files changed, 9 insertions(+)
>>   create mode 100644 
>> meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
>>
>> diff --git a/meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf 
>> b/meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf
>> index 472da1cc..a5be1130 100644
>> --- a/meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf
>> +++ b/meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf
>> @@ -9,3 +9,4 @@ SYSFW_CONFIG = "evm"
>>   SYSFW_SUFFIX = "hs-fs"
>>   UBOOT_MACHINE = "am62x_evm_r5_defconfig"
>> +UBOOT_CONFIG_FRAGMENT = "am62xsip_sk_r5.config"
>> diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc 
>> b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
>> new file mode 100644
>> index 00000000..69db6260
>> --- /dev/null
>> +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
>> @@ -0,0 +1,7 @@
>> +do_compile:prepend () {
>> +   if [ -n "${UBOOT_CONFIG_FRAGMENT}" ]
>> +   then
>> +       oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} 
>> ${UBOOT_CONFIG_FRAGMENT}
>> +       oe_runmake -C ${S} O=${B} olddefconfig
>> +   fi
>> +}
>> diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc 
>> b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
>> index f3285c23..5292517b 100644
>> --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
>> +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
>> @@ -7,6 +7,7 @@ SPL_BINARY ?= "MLO"
>>   require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot-common.inc
>>   require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot.inc
>> +require u-boot-mergeconfig.inc
>>   FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:"
diff mbox series

Patch

diff --git a/meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf b/meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf
index 472da1cc..a5be1130 100644
--- a/meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf
+++ b/meta-ti-bsp/conf/machine/am62xx-sip-evm-k3r5.conf
@@ -9,3 +9,4 @@  SYSFW_CONFIG = "evm"
 SYSFW_SUFFIX = "hs-fs"
 
 UBOOT_MACHINE = "am62x_evm_r5_defconfig"
+UBOOT_CONFIG_FRAGMENT = "am62xsip_sk_r5.config"
diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
new file mode 100644
index 00000000..69db6260
--- /dev/null
+++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-mergeconfig.inc
@@ -0,0 +1,7 @@ 
+do_compile:prepend () {
+   if [ -n "${UBOOT_CONFIG_FRAGMENT}" ]
+   then
+       oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} ${UBOOT_CONFIG_FRAGMENT}
+       oe_runmake -C ${S} O=${B} olddefconfig
+   fi
+}
diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
index f3285c23..5292517b 100644
--- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
+++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
@@ -7,6 +7,7 @@  SPL_BINARY ?= "MLO"
 
 require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot-common.inc
 require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot.inc
+require u-boot-mergeconfig.inc
 
 FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:"