diff mbox series

tisdk-uenv: Add instructions to load initramfs while booting linux

Message ID 20260303104930.889956-1-m-shah@ti.com
State Changes Requested
Delegated to: Ryan Eatmon
Headers show
Series tisdk-uenv: Add instructions to load initramfs while booting linux | expand

Commit Message

Moteen Shah March 3, 2026, 10:49 a.m. UTC
Add instructions to load initramfs image and update the boot command
to use the image to boot the linux kernel.

Signed-off-by: Moteen Shah <m-shah@ti.com>
---
 .../recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt  | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

PRC Automation March 3, 2026, 11:04 a.m. UTC | #1
meta-arago / na / 20260303104930.889956-1-m-shah

PRC Results: FAIL

=========================================================
  check-yocto-patches: PASS
=========================================================
Patches
----------------------------------------
WARN - [PATCH] tisdk-uenv: Add instructions to load initramfs while booting linux
    WARN: Missing branches specifier [master/scarthgap/XXXXX]. (META-2)
        patch:69
            Subject: [PATCH] tisdk-uenv: Add instructions to load initramfs while booting linux
    
    For details on the above errors/warnings visit: https://lists.yoctoproject.org/g/meta-ti/wiki/40887



=========================================================
  apply-yocto-patch: PASS
=========================================================
master
=====================
Summary:
- Patch Series: [PATCH] tisdk-uenv: Add instructions to load initramfs while booting linux
- Submitter: From: Moteen Shah <m-shah@ti.com>
- Date: Date: Tue, 3 Mar 2026 16:19:30 +0530
- Num Patches: 1
- Mailing List (public inbox) Commit SHA: bfd42e0a50f352920681956519d89bed7057492c

Applied to:
- Repository: lcpd-prc-meta-arago
- Base Branch: master-wip
- Commit Author: Ryan Eatmon <reatmon@ti.com>
- Commit Subject: arago.conf: Remove temporary hack for DEFAULTTUNE on armv7a
- Commit SHA: 58966cd5a2d433b4c915e652f21f2e2b2475ec21

Patches
----------------------------------------
All patches applied



=========================================================
  check-yocto-repo: PASS
=========================================================
master
=====================
PASS



=========================================================
  yocto-check-layers: FAIL
=========================================================
master - FAIL
=====================
ERROR: Nothing PROVIDES 'xen-guest-image-minimal'
ERROR: Required build target 'meta-world-pkgdata' has no buildable providers.
Bryan Brattlof March 3, 2026, 1:52 p.m. UTC | #2
On March  3, 2026 thus sayeth Moteen Shah:
> Add instructions to load initramfs image and update the boot command
> to use the image to boot the linux kernel.
> 

I'm not sure it's wise of us to split the U-Boot scripting like this. 
Depending on which virtual/bootloader is selected could change the names 
and paths of these functions. (mainline vs ti-u-boot-2024.04)

We can move all the scripts here in uEnv (or in the script node inside 
the fitImage for SE boards) or stuff them all in U-Boot but adding a 
hard dependency between the like this will be unfun to support.

> Signed-off-by: Moteen Shah <m-shah@ti.com>
> ---
>  .../recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt  | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> index 0af0eef3..5ac61b34 100644
> --- a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> +++ b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> @@ -7,3 +7,18 @@
>  #       default on all newer U-Boot images.  This also means that some
>  #       variables such as bootdelay cannot be changed by this file since
>  #       it is not evaluated until the bootcmd is run.
> +
> +# Initramfs configuration
> +# Name of the initramfs file in the boot partition
> +name_initramfs=ti-core-initramfs.cpio.xz
> +
> +# Command to load initramfs from boot partition (mmc device:partition)
> +# Adjust the device number (0 or 1) based on your setup
> +# mmcdev is set to 1 by default, partition 1 is the boot partition
> +get_initramfs_mmc=fatload mmc ${mmcdev}:1 ${rdaddr} ${name_initramfs}
> +
> +# Load initramfs and set up variables
> +load_initramfs=if run get_initramfs_mmc; then setenv _initramfs ${rdaddr}:${filesize}; setenv rd_spec ${_initramfs}; echo Initramfs loaded at ${rdaddr}, size ${filesize}; else echo WARNING: Initramfs not found, continuing without initramfs; setenv rd_spec -; fi
> +
> +# Custom boot command that loads initramfs before kernel
> +init_mmc=run args_all args_mmc load_initramfs
> \ No newline at end of file

Oops :)

~Bryan
Ryan Eatmon March 3, 2026, 2:59 p.m. UTC | #3
On 3/3/2026 4:49 AM, Moteen Shah wrote:
> Add instructions to load initramfs image and update the boot command
> to use the image to boot the linux kernel.
> 
> Signed-off-by: Moteen Shah <m-shah@ti.com>
> ---
>   .../recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt  | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> index 0af0eef3..5ac61b34 100644
> --- a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> +++ b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> @@ -7,3 +7,18 @@
>   #       default on all newer U-Boot images.  This also means that some
>   #       variables such as bootdelay cannot be changed by this file since
>   #       it is not evaluated until the bootcmd is run.
> +
> +# Initramfs configuration
> +# Name of the initramfs file in the boot partition
> +name_initramfs=ti-core-initramfs.cpio.xz
> +
> +# Command to load initramfs from boot partition (mmc device:partition)
> +# Adjust the device number (0 or 1) based on your setup
> +# mmcdev is set to 1 by default, partition 1 is the boot partition
> +get_initramfs_mmc=fatload mmc ${mmcdev}:1 ${rdaddr} ${name_initramfs}
> +
> +# Load initramfs and set up variables
> +load_initramfs=if run get_initramfs_mmc; then setenv _initramfs ${rdaddr}:${filesize}; setenv rd_spec ${_initramfs}; echo Initramfs loaded at ${rdaddr}, size ${filesize}; else echo WARNING: Initramfs not found, continuing without initramfs; setenv rd_spec -; fi
> +
> +# Custom boot command that loads initramfs before kernel
> +init_mmc=run args_all args_mmc load_initramfs
> \ No newline at end of file

Does this work if there is no ti-core-initramsfs.cpio.xz in the boot 
partition?  Or is this assuming that there will always be an initramfs? 
Because that is a problem if it is required all the time in all cases 
for all platforms.
Ryan Eatmon March 3, 2026, 4:54 p.m. UTC | #4
On 3/3/2026 8:59 AM, Ryan Eatmon via lists.yoctoproject.org wrote:
> 
> 
> On 3/3/2026 4:49 AM, Moteen Shah wrote:
>> Add instructions to load initramfs image and update the boot command
>> to use the image to boot the linux kernel.
>>
>> Signed-off-by: Moteen Shah <m-shah@ti.com>
>> ---
>>   .../recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt  | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/ 
>> uEnv.txt b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>> index 0af0eef3..5ac61b34 100644
>> --- a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>> +++ b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>> @@ -7,3 +7,18 @@
>>   #       default on all newer U-Boot images.  This also means that some
>>   #       variables such as bootdelay cannot be changed by this file 
>> since
>>   #       it is not evaluated until the bootcmd is run.
>> +
>> +# Initramfs configuration
>> +# Name of the initramfs file in the boot partition
>> +name_initramfs=ti-core-initramfs.cpio.xz
>> +
>> +# Command to load initramfs from boot partition (mmc device:partition)
>> +# Adjust the device number (0 or 1) based on your setup
>> +# mmcdev is set to 1 by default, partition 1 is the boot partition
>> +get_initramfs_mmc=fatload mmc ${mmcdev}:1 ${rdaddr} ${name_initramfs}
>> +
>> +# Load initramfs and set up variables
>> +load_initramfs=if run get_initramfs_mmc; then setenv _initramfs 
>> ${rdaddr}:${filesize}; setenv rd_spec ${_initramfs}; echo Initramfs 
>> loaded at ${rdaddr}, size ${filesize}; else echo WARNING: Initramfs 
>> not found, continuing without initramfs; setenv rd_spec -; fi
>> +
>> +# Custom boot command that loads initramfs before kernel
>> +init_mmc=run args_all args_mmc load_initramfs
>> \ No newline at end of file
> 
> Does this work if there is no ti-core-initramsfs.cpio.xz in the boot 
> partition?  Or is this assuming that there will always be an initramfs? 
> Because that is a problem if it is required all the time in all cases 
> for all platforms.

Additionally, this is being done in meta-arago, but the 
ti-core-initramfs is staged in meta-ti so that it is available for all 
distros.

Is this something that should move to meta-ti?  Are these settings 
really a distro thing?  Or a BSP thing?
Andrew Davis March 3, 2026, 5:19 p.m. UTC | #5
On 3/3/26 4:49 AM, Moteen Shah via lists.yoctoproject.org wrote:
> Add instructions to load initramfs image and update the boot command
> to use the image to boot the linux kernel.
> 
> Signed-off-by: Moteen Shah <m-shah@ti.com>
> ---
>   .../recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt  | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> index 0af0eef3..5ac61b34 100644
> --- a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> +++ b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> @@ -7,3 +7,18 @@
>   #       default on all newer U-Boot images.  This also means that some
>   #       variables such as bootdelay cannot be changed by this file since
>   #       it is not evaluated until the bootcmd is run.
> +
> +# Initramfs configuration
> +# Name of the initramfs file in the boot partition
> +name_initramfs=ti-core-initramfs.cpio.xz
> +
> +# Command to load initramfs from boot partition (mmc device:partition)
> +# Adjust the device number (0 or 1) based on your setup
> +# mmcdev is set to 1 by default, partition 1 is the boot partition
> +get_initramfs_mmc=fatload mmc ${mmcdev}:1 ${rdaddr} ${name_initramfs}
> +

This belongs in u-boot default env, it is basically the same as `get_fdt_mmc`
and other helpers already there.

> +# Load initramfs and set up variables
> +load_initramfs=if run get_initramfs_mmc; then setenv _initramfs ${rdaddr}:${filesize}; setenv rd_spec ${_initramfs}; echo Initramfs loaded at ${rdaddr}, size ${filesize}; else echo WARNING: Initramfs not found, continuing without initramfs; setenv rd_spec -; fi
> +

This should be part of `mmcloados` in u-boot also.

> +# Custom boot command that loads initramfs before kernel
> +init_mmc=run args_all args_mmc load_initramfs

With the above added, you don't need to override `init_mmc` so
this line goes away too.

That leaves one line left, `name_initramfs`. How about just
setting a sane default name in u-boot. We got away with something
like this for K2 plats:

https://github.com/u-boot/u-boot/blob/master/board/ti/ks2_evm/k2e_evm.env#L12

although I'd recommend a more generic filename.

Andrew

> \ No newline at end of file
Moteen Shah March 4, 2026, 6:32 a.m. UTC | #6
On 03/03/26 22:49, Andrew Davis wrote:
> On 3/3/26 4:49 AM, Moteen Shah via lists.yoctoproject.org wrote:
>> Add instructions to load initramfs image and update the boot command
>> to use the image to boot the linux kernel.
>>
>> Signed-off-by: Moteen Shah <m-shah@ti.com>
>> ---
>>   .../recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt  | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git 
>> a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt 
>> b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>> index 0af0eef3..5ac61b34 100644
>> --- a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>> +++ b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>> @@ -7,3 +7,18 @@
>>   #       default on all newer U-Boot images.  This also means that some
>>   #       variables such as bootdelay cannot be changed by this file 
>> since
>>   #       it is not evaluated until the bootcmd is run.
>> +
>> +# Initramfs configuration
>> +# Name of the initramfs file in the boot partition
>> +name_initramfs=ti-core-initramfs.cpio.xz
>> +
>> +# Command to load initramfs from boot partition (mmc device:partition)
>> +# Adjust the device number (0 or 1) based on your setup
>> +# mmcdev is set to 1 by default, partition 1 is the boot partition
>> +get_initramfs_mmc=fatload mmc ${mmcdev}:1 ${rdaddr} ${name_initramfs}
>> +
>
> This belongs in u-boot default env, it is basically the same as 
> `get_fdt_mmc`
> and other helpers already there.
>
>> +# Load initramfs and set up variables
>> +load_initramfs=if run get_initramfs_mmc; then setenv _initramfs 
>> ${rdaddr}:${filesize}; setenv rd_spec ${_initramfs}; echo Initramfs 
>> loaded at ${rdaddr}, size ${filesize}; else echo WARNING: Initramfs 
>> not found, continuing without initramfs; setenv rd_spec -; fi
>> +
>
> This should be part of `mmcloados` in u-boot also.


mmcloados is only used by 'mmcboot' which is a differnt boot command 
other than bootcmd_ti_mmc?
We can consider adding the load_initramfs to 'get_kern_mmc' and we wont 
need to override the init_mmc with the change.

>
>> +# Custom boot command that loads initramfs before kernel
>> +init_mmc=run args_all args_mmc load_initramfs
>
> With the above added, you don't need to override `init_mmc` so
> this line goes away too.
>
> That leaves one line left, `name_initramfs`. How about just
> setting a sane default name in u-boot. We got away with something
> like this for K2 plats:

We don't expect the name of the cpio to be variable, as the name of the 
cpio stays the same for all K3 platforms which is 
"ti-core-initramfs.cpio.xz", I can remove the variable altogether maybe 
and directly use the image name to load. Thoughts?

Regards,
Moteen

>
> https://github.com/u-boot/u-boot/blob/master/board/ti/ks2_evm/k2e_evm.env#L12 
>
>
> although I'd recommend a more generic filename.
>
> Andrew
>
>> \ No newline at end of file
>
Ryan Eatmon March 4, 2026, 2:38 p.m. UTC | #7
On 3/4/2026 12:32 AM, Moteen Shah wrote:
> 
> On 03/03/26 22:49, Andrew Davis wrote:
>> On 3/3/26 4:49 AM, Moteen Shah via lists.yoctoproject.org wrote:
>>> Add instructions to load initramfs image and update the boot command
>>> to use the image to boot the linux kernel.
>>>
>>> Signed-off-by: Moteen Shah <m-shah@ti.com>
>>> ---
>>>   .../recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt  | 15 +++++++++++++++
>>>   1 file changed, 15 insertions(+)
>>>
>>> diff --git 
>>> a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt 
>>> b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>> index 0af0eef3..5ac61b34 100644
>>> --- a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>> +++ b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>> @@ -7,3 +7,18 @@
>>>   #       default on all newer U-Boot images.  This also means that some
>>>   #       variables such as bootdelay cannot be changed by this file 
>>> since
>>>   #       it is not evaluated until the bootcmd is run.
>>> +
>>> +# Initramfs configuration
>>> +# Name of the initramfs file in the boot partition
>>> +name_initramfs=ti-core-initramfs.cpio.xz
>>> +
>>> +# Command to load initramfs from boot partition (mmc device:partition)
>>> +# Adjust the device number (0 or 1) based on your setup
>>> +# mmcdev is set to 1 by default, partition 1 is the boot partition
>>> +get_initramfs_mmc=fatload mmc ${mmcdev}:1 ${rdaddr} ${name_initramfs}
>>> +
>>
>> This belongs in u-boot default env, it is basically the same as 
>> `get_fdt_mmc`
>> and other helpers already there.
>>
>>> +# Load initramfs and set up variables
>>> +load_initramfs=if run get_initramfs_mmc; then setenv _initramfs 
>>> ${rdaddr}:${filesize}; setenv rd_spec ${_initramfs}; echo Initramfs 
>>> loaded at ${rdaddr}, size ${filesize}; else echo WARNING: Initramfs 
>>> not found, continuing without initramfs; setenv rd_spec -; fi
>>> +
>>
>> This should be part of `mmcloados` in u-boot also.
> 
> 
> mmcloados is only used by 'mmcboot' which is a differnt boot command 
> other than bootcmd_ti_mmc?
> We can consider adding the load_initramfs to 'get_kern_mmc' and we wont 
> need to override the init_mmc with the change.
> 
>>
>>> +# Custom boot command that loads initramfs before kernel
>>> +init_mmc=run args_all args_mmc load_initramfs
>>
>> With the above added, you don't need to override `init_mmc` so
>> this line goes away too.
>>
>> That leaves one line left, `name_initramfs`. How about just
>> setting a sane default name in u-boot. We got away with something
>> like this for K2 plats:
> 
> We don't expect the name of the cpio to be variable, as the name of the 
> cpio stays the same for all K3 platforms which is 
> "ti-core-initramfs.cpio.xz", I can remove the variable altogether maybe 
> and directly use the image name to load. Thoughts?

That is a very Yocto centric take.  But we also support armbian and 
other distros.  They may not want to name the file the same way we chose 
in meta-ti.  The question is, should we paint ourselves into a corner 
from the beginning or allow for some flexibility?

Plus, even in Yocto, a user could choose to not use ti-core-initramfs 
and instead make their own with their own name.  Making this more 
flexible feels more friendly in the long run.

Just my two cents.


> Regards,
> Moteen
> 
>>
>> https://github.com/u-boot/u-boot/blob/master/board/ti/ks2_evm/k2e_evm.env#L12
>>
>> although I'd recommend a more generic filename.
>>
>> Andrew
>>
>>> \ No newline at end of file
>>
Andrew Davis March 4, 2026, 4:05 p.m. UTC | #8
On 3/4/26 8:38 AM, Ryan Eatmon wrote:
> 
> 
> On 3/4/2026 12:32 AM, Moteen Shah wrote:
>>
>> On 03/03/26 22:49, Andrew Davis wrote:
>>> On 3/3/26 4:49 AM, Moteen Shah via lists.yoctoproject.org wrote:
>>>> Add instructions to load initramfs image and update the boot command
>>>> to use the image to boot the linux kernel.
>>>>
>>>> Signed-off-by: Moteen Shah <m-shah@ti.com>
>>>> ---
>>>>   .../recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt  | 15 +++++++++++++++
>>>>   1 file changed, 15 insertions(+)
>>>>
>>>> diff --git a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>>> index 0af0eef3..5ac61b34 100644
>>>> --- a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>>> +++ b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>>> @@ -7,3 +7,18 @@
>>>>   #       default on all newer U-Boot images.  This also means that some
>>>>   #       variables such as bootdelay cannot be changed by this file since
>>>>   #       it is not evaluated until the bootcmd is run.
>>>> +
>>>> +# Initramfs configuration
>>>> +# Name of the initramfs file in the boot partition
>>>> +name_initramfs=ti-core-initramfs.cpio.xz
>>>> +
>>>> +# Command to load initramfs from boot partition (mmc device:partition)
>>>> +# Adjust the device number (0 or 1) based on your setup
>>>> +# mmcdev is set to 1 by default, partition 1 is the boot partition
>>>> +get_initramfs_mmc=fatload mmc ${mmcdev}:1 ${rdaddr} ${name_initramfs}
>>>> +
>>>
>>> This belongs in u-boot default env, it is basically the same as `get_fdt_mmc`
>>> and other helpers already there.
>>>
>>>> +# Load initramfs and set up variables
>>>> +load_initramfs=if run get_initramfs_mmc; then setenv _initramfs ${rdaddr}:${filesize}; setenv rd_spec ${_initramfs}; echo Initramfs loaded at ${rdaddr}, size ${filesize}; else echo WARNING: Initramfs not found, continuing without initramfs; setenv rd_spec -; fi
>>>> +
>>>
>>> This should be part of `mmcloados` in u-boot also.
>>
>>
>> mmcloados is only used by 'mmcboot' which is a differnt boot command other than bootcmd_ti_mmc?
>> We can consider adding the load_initramfs to 'get_kern_mmc' and we wont need to override the init_mmc with the change.
>>

Adding to `get_kern_mmc` wouldn't make sense, that is for loading the kernel as the
name suggests. If we don't go down the `mmcboot` path anymore then add it to whatever
path we do go down these days.

>>>
>>>> +# Custom boot command that loads initramfs before kernel
>>>> +init_mmc=run args_all args_mmc load_initramfs
>>>
>>> With the above added, you don't need to override `init_mmc` so
>>> this line goes away too.
>>>
>>> That leaves one line left, `name_initramfs`. How about just
>>> setting a sane default name in u-boot. We got away with something
>>> like this for K2 plats:
>>
>> We don't expect the name of the cpio to be variable, as the name of the cpio stays the same for all K3 platforms which is "ti-core-initramfs.cpio.xz", I can remove the variable altogether maybe and directly use the image name to load. Thoughts?
> 
> That is a very Yocto centric take.  But we also support armbian and other distros.  They may not want to name the file the same way we chose in meta-ti.  The question is, should we paint ourselves into a corner from the beginning or allow for some flexibility?
> 
> Plus, even in Yocto, a user could choose to not use ti-core-initramfs and instead make their own with their own name.  Making this more flexible feels more friendly in the long run.
> 

And you don't have to look too far, that encrypted boot series posted the other
day would have made use of a new named ti-encrypted-boot-initramfs.cpio.gz
(although the booting method would have been different)

> Just my two cents.
> 

Worth every penny :)

Andrew

> 
>> Regards,
>> Moteen
>>
>>>
>>> https://github.com/u-boot/u-boot/blob/master/board/ti/ks2_evm/k2e_evm.env#L12
>>>
>>> although I'd recommend a more generic filename.
>>>
>>> Andrew
>>>
>>>> \ No newline at end of file
>>>
>
Moteen Shah March 5, 2026, 6:51 a.m. UTC | #9
On 04/03/26 20:08, Ryan Eatmon wrote:
>
>
> On 3/4/2026 12:32 AM, Moteen Shah wrote:
>>
>> On 03/03/26 22:49, Andrew Davis wrote:
>>> On 3/3/26 4:49 AM, Moteen Shah via lists.yoctoproject.org wrote:
>>>> Add instructions to load initramfs image and update the boot command
>>>> to use the image to boot the linux kernel.
>>>>
>>>> Signed-off-by: Moteen Shah <m-shah@ti.com>
>>>> ---
>>>>   .../recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt  | 15 
>>>> +++++++++++++++
>>>>   1 file changed, 15 insertions(+)
>>>>
>>>> diff --git 
>>>> a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt 
>>>> b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>>> index 0af0eef3..5ac61b34 100644
>>>> --- a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>>> +++ b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>>> @@ -7,3 +7,18 @@
>>>>   #       default on all newer U-Boot images.  This also means that 
>>>> some
>>>>   #       variables such as bootdelay cannot be changed by this 
>>>> file since
>>>>   #       it is not evaluated until the bootcmd is run.
>>>> +
>>>> +# Initramfs configuration
>>>> +# Name of the initramfs file in the boot partition
>>>> +name_initramfs=ti-core-initramfs.cpio.xz
>>>> +
>>>> +# Command to load initramfs from boot partition (mmc 
>>>> device:partition)
>>>> +# Adjust the device number (0 or 1) based on your setup
>>>> +# mmcdev is set to 1 by default, partition 1 is the boot partition
>>>> +get_initramfs_mmc=fatload mmc ${mmcdev}:1 ${rdaddr} ${name_initramfs}
>>>> +
>>>
>>> This belongs in u-boot default env, it is basically the same as 
>>> `get_fdt_mmc`
>>> and other helpers already there.
>>>
>>>> +# Load initramfs and set up variables
>>>> +load_initramfs=if run get_initramfs_mmc; then setenv _initramfs 
>>>> ${rdaddr}:${filesize}; setenv rd_spec ${_initramfs}; echo Initramfs 
>>>> loaded at ${rdaddr}, size ${filesize}; else echo WARNING: Initramfs 
>>>> not found, continuing without initramfs; setenv rd_spec -; fi
>>>> +
>>>
>>> This should be part of `mmcloados` in u-boot also.
>>
>>
>> mmcloados is only used by 'mmcboot' which is a differnt boot command 
>> other than bootcmd_ti_mmc?
>> We can consider adding the load_initramfs to 'get_kern_mmc' and we 
>> wont need to override the init_mmc with the change.
>>
>>>
>>>> +# Custom boot command that loads initramfs before kernel
>>>> +init_mmc=run args_all args_mmc load_initramfs
>>>
>>> With the above added, you don't need to override `init_mmc` so
>>> this line goes away too.
>>>
>>> That leaves one line left, `name_initramfs`. How about just
>>> setting a sane default name in u-boot. We got away with something
>>> like this for K2 plats:
>>
>> We don't expect the name of the cpio to be variable, as the name of 
>> the cpio stays the same for all K3 platforms which is 
>> "ti-core-initramfs.cpio.xz", I can remove the variable altogether 
>> maybe and directly use the image name to load. Thoughts?
>
> That is a very Yocto centric take.  But we also support armbian and 
> other distros.  They may not want to name the file the same way we 
> chose in meta-ti.  The question is, should we paint ourselves into a 
> corner from the beginning or allow for some flexibility?
>
> Plus, even in Yocto, a user could choose to not use ti-core-initramfs 
> and instead make their own with their own name. Making this more 
> flexible feels more friendly in the long run.
>

I see. So we want to move the structure to something which tries to load 
any .cpio.xz present?
Other question, how do we tell other users to include the TPS6594 
module(to put it in a better way include the packagegroup for intramfs) 
while building their own initramfs(specifically for AM62a), is linux 
release doc the right place to do so?

Regards,
Moteen

> Just my two cents.
>
>
>> Regards,
>> Moteen
>>
>>>
>>> https://github.com/u-boot/u-boot/blob/master/board/ti/ks2_evm/k2e_evm.env#L12 
>>>
>>>
>>> although I'd recommend a more generic filename.
>>>
>>> Andrew
>>>
>>>> \ No newline at end of file
>>>
>
Ryan Eatmon March 5, 2026, 3:06 p.m. UTC | #10
On 3/5/2026 12:51 AM, Moteen Shah wrote:
> 
> On 04/03/26 20:08, Ryan Eatmon wrote:
>>
>>
>> On 3/4/2026 12:32 AM, Moteen Shah wrote:
>>>
>>> On 03/03/26 22:49, Andrew Davis wrote:
>>>> On 3/3/26 4:49 AM, Moteen Shah via lists.yoctoproject.org wrote:
>>>>> Add instructions to load initramfs image and update the boot command
>>>>> to use the image to boot the linux kernel.
>>>>>
>>>>> Signed-off-by: Moteen Shah <m-shah@ti.com>
>>>>> ---
>>>>>   .../recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt  | 15 
>>>>> +++++++++++++++
>>>>>   1 file changed, 15 insertions(+)
>>>>>
>>>>> diff --git 
>>>>> a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt 
>>>>> b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>>>> index 0af0eef3..5ac61b34 100644
>>>>> --- a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>>>> +++ b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
>>>>> @@ -7,3 +7,18 @@
>>>>>   #       default on all newer U-Boot images.  This also means that 
>>>>> some
>>>>>   #       variables such as bootdelay cannot be changed by this 
>>>>> file since
>>>>>   #       it is not evaluated until the bootcmd is run.
>>>>> +
>>>>> +# Initramfs configuration
>>>>> +# Name of the initramfs file in the boot partition
>>>>> +name_initramfs=ti-core-initramfs.cpio.xz
>>>>> +
>>>>> +# Command to load initramfs from boot partition (mmc 
>>>>> device:partition)
>>>>> +# Adjust the device number (0 or 1) based on your setup
>>>>> +# mmcdev is set to 1 by default, partition 1 is the boot partition
>>>>> +get_initramfs_mmc=fatload mmc ${mmcdev}:1 ${rdaddr} ${name_initramfs}
>>>>> +
>>>>
>>>> This belongs in u-boot default env, it is basically the same as 
>>>> `get_fdt_mmc`
>>>> and other helpers already there.
>>>>
>>>>> +# Load initramfs and set up variables
>>>>> +load_initramfs=if run get_initramfs_mmc; then setenv _initramfs 
>>>>> ${rdaddr}:${filesize}; setenv rd_spec ${_initramfs}; echo Initramfs 
>>>>> loaded at ${rdaddr}, size ${filesize}; else echo WARNING: Initramfs 
>>>>> not found, continuing without initramfs; setenv rd_spec -; fi
>>>>> +
>>>>
>>>> This should be part of `mmcloados` in u-boot also.
>>>
>>>
>>> mmcloados is only used by 'mmcboot' which is a differnt boot command 
>>> other than bootcmd_ti_mmc?
>>> We can consider adding the load_initramfs to 'get_kern_mmc' and we 
>>> wont need to override the init_mmc with the change.
>>>
>>>>
>>>>> +# Custom boot command that loads initramfs before kernel
>>>>> +init_mmc=run args_all args_mmc load_initramfs
>>>>
>>>> With the above added, you don't need to override `init_mmc` so
>>>> this line goes away too.
>>>>
>>>> That leaves one line left, `name_initramfs`. How about just
>>>> setting a sane default name in u-boot. We got away with something
>>>> like this for K2 plats:
>>>
>>> We don't expect the name of the cpio to be variable, as the name of 
>>> the cpio stays the same for all K3 platforms which is 
>>> "ti-core-initramfs.cpio.xz", I can remove the variable altogether 
>>> maybe and directly use the image name to load. Thoughts?
>>
>> That is a very Yocto centric take.  But we also support armbian and 
>> other distros.  They may not want to name the file the same way we 
>> chose in meta-ti.  The question is, should we paint ourselves into a 
>> corner from the beginning or allow for some flexibility?
>>
>> Plus, even in Yocto, a user could choose to not use ti-core-initramfs 
>> and instead make their own with their own name. Making this more 
>> flexible feels more friendly in the long run.
>>
> 
> I see. So we want to move the structure to something which tries to load 
> any .cpio.xz present?
> Other question, how do we tell other users to include the TPS6594 
> module(to put it in a better way include the packagegroup for intramfs) 
> while building their own initramfs(specifically for AM62a), is linux 
> release doc the right place to do so?

I would say so.


> Regards,
> Moteen
> 
>> Just my two cents.
>>
>>
>>> Regards,
>>> Moteen
>>>
>>>>
>>>> https://github.com/u-boot/u-boot/blob/master/board/ti/ks2_evm/k2e_evm.env#L12
>>>>
>>>> although I'd recommend a more generic filename.
>>>>
>>>> Andrew
>>>>
>>>>> \ No newline at end of file
>>>>
>>
Jon Cormier March 5, 2026, 3:28 p.m. UTC | #11
On Thu, Mar 5, 2026 at 10:06 AM Ryan Eatmon via lists.yoctoproject.org
<reatmon=ti.com@lists.yoctoproject.org> wrote:
>
>
>
> On 3/5/2026 12:51 AM, Moteen Shah wrote:
> >
> > On 04/03/26 20:08, Ryan Eatmon wrote:
> >>
> >>
> >> On 3/4/2026 12:32 AM, Moteen Shah wrote:
> >>>
> >>> On 03/03/26 22:49, Andrew Davis wrote:
> >>>> On 3/3/26 4:49 AM, Moteen Shah via lists.yoctoproject.org wrote:
> >>>>> Add instructions to load initramfs image and update the boot command
> >>>>> to use the image to boot the linux kernel.
> >>>>>
> >>>>> Signed-off-by: Moteen Shah <m-shah@ti.com>
> >>>>> ---
> >>>>>   .../recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt  | 15
> >>>>> +++++++++++++++
> >>>>>   1 file changed, 15 insertions(+)
> >>>>>
> >>>>> diff --git
> >>>>> a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> >>>>> b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> >>>>> index 0af0eef3..5ac61b34 100644
> >>>>> --- a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> >>>>> +++ b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
> >>>>> @@ -7,3 +7,18 @@
> >>>>>   #       default on all newer U-Boot images.  This also means that
> >>>>> some
> >>>>>   #       variables such as bootdelay cannot be changed by this
> >>>>> file since
> >>>>>   #       it is not evaluated until the bootcmd is run.
> >>>>> +
> >>>>> +# Initramfs configuration
> >>>>> +# Name of the initramfs file in the boot partition
> >>>>> +name_initramfs=ti-core-initramfs.cpio.xz
> >>>>> +
> >>>>> +# Command to load initramfs from boot partition (mmc
> >>>>> device:partition)
> >>>>> +# Adjust the device number (0 or 1) based on your setup
> >>>>> +# mmcdev is set to 1 by default, partition 1 is the boot partition
> >>>>> +get_initramfs_mmc=fatload mmc ${mmcdev}:1 ${rdaddr} ${name_initramfs}
> >>>>> +
> >>>>
> >>>> This belongs in u-boot default env, it is basically the same as
> >>>> `get_fdt_mmc`
> >>>> and other helpers already there.
> >>>>
> >>>>> +# Load initramfs and set up variables
> >>>>> +load_initramfs=if run get_initramfs_mmc; then setenv _initramfs
> >>>>> ${rdaddr}:${filesize}; setenv rd_spec ${_initramfs}; echo Initramfs
> >>>>> loaded at ${rdaddr}, size ${filesize}; else echo WARNING: Initramfs
> >>>>> not found, continuing without initramfs; setenv rd_spec -; fi
> >>>>> +
> >>>>
> >>>> This should be part of `mmcloados` in u-boot also.
> >>>
> >>>
> >>> mmcloados is only used by 'mmcboot' which is a differnt boot command
> >>> other than bootcmd_ti_mmc?
> >>> We can consider adding the load_initramfs to 'get_kern_mmc' and we
> >>> wont need to override the init_mmc with the change.
> >>>
> >>>>
> >>>>> +# Custom boot command that loads initramfs before kernel
> >>>>> +init_mmc=run args_all args_mmc load_initramfs
> >>>>
> >>>> With the above added, you don't need to override `init_mmc` so
> >>>> this line goes away too.
> >>>>
> >>>> That leaves one line left, `name_initramfs`. How about just
> >>>> setting a sane default name in u-boot. We got away with something
> >>>> like this for K2 plats:
> >>>
> >>> We don't expect the name of the cpio to be variable, as the name of
> >>> the cpio stays the same for all K3 platforms which is
> >>> "ti-core-initramfs.cpio.xz", I can remove the variable altogether
> >>> maybe and directly use the image name to load. Thoughts?
> >>
> >> That is a very Yocto centric take.  But we also support armbian and
> >> other distros.  They may not want to name the file the same way we
> >> chose in meta-ti.  The question is, should we paint ourselves into a
> >> corner from the beginning or allow for some flexibility?
> >>
> >> Plus, even in Yocto, a user could choose to not use ti-core-initramfs
> >> and instead make their own with their own name. Making this more
> >> flexible feels more friendly in the long run.
> >>
> >
> > I see. So we want to move the structure to something which tries to load
> > any .cpio.xz present?
> > Other question, how do we tell other users to include the TPS6594
> > module(to put it in a better way include the packagegroup for intramfs)
> > while building their own initramfs(specifically for AM62a), is linux
> > release doc the right place to do so?
>
> I would say so.
Note from an  outside perspective, atleast having the cpio defined in a variable
"name_initramfs=ti-core-initramfs.cpio.xz"
is sufficient to making it easier to override and load a custom file.
Instead of having to override the whole "get_initramfs_mmc" variable.
>
>
> > Regards,
> > Moteen
> >
> >> Just my two cents.
> >>
> >>
> >>> Regards,
> >>> Moteen
> >>>
> >>>>
> >>>> https://github.com/u-boot/u-boot/blob/master/board/ti/ks2_evm/k2e_evm.env#L12
> >>>>
> >>>> although I'd recommend a more generic filename.
> >>>>
> >>>> Andrew
> >>>>
> >>>>> \ No newline at end of file
> >>>>
> >>
>
> --
> Ryan Eatmon                reatmon@ti.com
> -----------------------------------------
> Texas Instruments, Inc.  -  LCPD  -  MGTS
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#17234): https://lists.yoctoproject.org/g/meta-arago/message/17234
> Mute This Topic: https://lists.yoctoproject.org/mt/118111608/7902621
> Group Owner: meta-arago+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-arago/unsub [jcormier@criticallink.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
diff mbox series

Patch

diff --git a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
index 0af0eef3..5ac61b34 100644
--- a/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
+++ b/meta-arago-distro/recipes-tisdk/tisdk-uenv/tisdk-uenv/uEnv.txt
@@ -7,3 +7,18 @@ 
 #       default on all newer U-Boot images.  This also means that some
 #       variables such as bootdelay cannot be changed by this file since
 #       it is not evaluated until the bootcmd is run.
+
+# Initramfs configuration
+# Name of the initramfs file in the boot partition
+name_initramfs=ti-core-initramfs.cpio.xz
+
+# Command to load initramfs from boot partition (mmc device:partition)
+# Adjust the device number (0 or 1) based on your setup
+# mmcdev is set to 1 by default, partition 1 is the boot partition
+get_initramfs_mmc=fatload mmc ${mmcdev}:1 ${rdaddr} ${name_initramfs}
+
+# Load initramfs and set up variables
+load_initramfs=if run get_initramfs_mmc; then setenv _initramfs ${rdaddr}:${filesize}; setenv rd_spec ${_initramfs}; echo Initramfs loaded at ${rdaddr}, size ${filesize}; else echo WARNING: Initramfs not found, continuing without initramfs; setenv rd_spec -; fi
+
+# Custom boot command that loads initramfs before kernel
+init_mmc=run args_all args_mmc load_initramfs
\ No newline at end of file