diff mbox series

[v2,2/4] board: vexpress64: default to hardware device tree

Message ID 20250115135209.13946-3-harrison.mutai@arm.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series Enable bloblist support on Vexpress64 | expand

Commit Message

Harrison Mutai Jan. 15, 2025, 1:52 p.m. UTC
When booting into the Linux kernel with semi-hosting, use the device
tree provided by hardware unless one is provided in the current
directory.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
---
 include/configs/vexpress_aemv8.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Simon Glass Jan. 16, 2025, 1:26 a.m. UTC | #1
Hi Harrison,

On Wed, 15 Jan 2025 at 06:52, Harrison Mutai <harrison.mutai@arm.com> wrote:
>
> When booting into the Linux kernel with semi-hosting, use the device
> tree provided by hardware unless one is provided in the current
> directory.
>
> Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
> ---
>  include/configs/vexpress_aemv8.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>

Thinking about standard boot, could we add a bootdev for hostfs? Then
we could drop these scripts.

> diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h
> index 8020689e39..2341b3a938 100644
> --- a/include/configs/vexpress_aemv8.h
> +++ b/include/configs/vexpress_aemv8.h
> @@ -169,12 +169,14 @@
>                 "  if load hostfs - ${kernel_addr_r} ${kernel_name}; then"      \
>                 "    setenv fdt_high 0xffffffffffffffff;"               \
>                 "    setenv initrd_high 0xffffffffffffffff;"            \
> -               "    load hostfs - ${fdt_addr_r} ${fdtfile};"                   \
> +               "    if test -n load hostfs - ${fdt_addr_r} ${fdtfile}; then"                   \
> +               "        fdt move $fdtcontroladdr $fdt_addr_r;"                 \
> +               "    fi;"                       \
>                 "    load hostfs - ${ramdisk_addr_r} ${ramdisk_name};" \
>                 "    fdt addr ${fdt_addr_r};"                           \
>                 "    fdt resize;"                                       \
>                 "    fdt chosen ${ramdisk_addr_r} ${filesize};" \
> -               "    booti $kernel_addr_r - $fdt_addr_r;"               \
> +               "    booti $kernel_addr_r - ${fdt_addr_r};"             \
>                 "  fi;"                                                 \
>                 "fi\0"
>  #define BOOTENV_DEV_NAME_SMH(devtypeu, devtypel, instance) "smh "
> --
> 2.46.2
>

Regards,
Simon
Harrison Mutai Jan. 16, 2025, 11:20 a.m. UTC | #2
Hi Simon,

On 16/01/2025 01:26, Simon Glass wrote:
> Hi Harrison,
> 
> On Wed, 15 Jan 2025 at 06:52, Harrison Mutai <harrison.mutai@arm.com> wrote:
>>
>> When booting into the Linux kernel with semi-hosting, use the device
>> tree provided by hardware unless one is provided in the current
>> directory.
>>
>> Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
>> ---
>>   include/configs/vexpress_aemv8.h | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
> 
> Thinking about standard boot, could we add a bootdev for hostfs? Then
> we could drop these scripts.
> 
I have a patch in progress to migrate vexpress64 to standard boot that 
tries to do this. However, it's not quite ready for upstreaming. For 
one, there's other boot targets in this file that would need similar 
treatment (e.g., AFS, MEM). Would it be possible to transition these in 
a piece-wise manner?
>> diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h
>> index 8020689e39..2341b3a938 100644
>> --- a/include/configs/vexpress_aemv8.h
>> +++ b/include/configs/vexpress_aemv8.h
>> @@ -169,12 +169,14 @@
>>                  "  if load hostfs - ${kernel_addr_r} ${kernel_name}; then"      \
>>                  "    setenv fdt_high 0xffffffffffffffff;"               \
>>                  "    setenv initrd_high 0xffffffffffffffff;"            \
>> -               "    load hostfs - ${fdt_addr_r} ${fdtfile};"                   \
>> +               "    if test -n load hostfs - ${fdt_addr_r} ${fdtfile}; then"                   \
>> +               "        fdt move $fdtcontroladdr $fdt_addr_r;"                 \
>> +               "    fi;"                       \
>>                  "    load hostfs - ${ramdisk_addr_r} ${ramdisk_name};" \
>>                  "    fdt addr ${fdt_addr_r};"                           \
>>                  "    fdt resize;"                                       \
>>                  "    fdt chosen ${ramdisk_addr_r} ${filesize};" \
>> -               "    booti $kernel_addr_r - $fdt_addr_r;"               \
>> +               "    booti $kernel_addr_r - ${fdt_addr_r};"             \
>>                  "  fi;"                                                 \
>>                  "fi\0"
>>   #define BOOTENV_DEV_NAME_SMH(devtypeu, devtypel, instance) "smh "
>> --
>> 2.46.2
>>
> 
> Regards,
> Simon
All the best,
Harrison
Harrison Mutai Jan. 16, 2025, 11:33 a.m. UTC | #3
On 16/01/2025 11:20, Harrison Mutai wrote:
> Hi Simon,
> 
> On 16/01/2025 01:26, Simon Glass wrote:
>> Hi Harrison,
>>
>> On Wed, 15 Jan 2025 at 06:52, Harrison Mutai <harrison.mutai@arm.com> 
>> wrote:
>>>
>>> When booting into the Linux kernel with semi-hosting, use the device
>>> tree provided by hardware unless one is provided in the current
>>> directory.
>>>
>>> Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
>>> ---
>>>   include/configs/vexpress_aemv8.h | 6 ++++--
>>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>>
>>
>> Thinking about standard boot, could we add a bootdev for hostfs? Then
>> we could drop these scripts.
>>
> I have a patch in progress to migrate vexpress64 to standard boot that 
> tries to do this. However, it's not quite ready for upstreaming. For 
> one, there's other boot targets in this file that would need similar 
> treatment (e.g., AFS, MEM). Would it be possible to transition these in 
> a piece-wise manner?

Notably, we do already have fs/sandbox/host_bootdev.c. What was the 
original intent of this?

>>> diff --git a/include/configs/vexpress_aemv8.h b/include/configs/ 
>>> vexpress_aemv8.h
>>> index 8020689e39..2341b3a938 100644
>>> --- a/include/configs/vexpress_aemv8.h
>>> +++ b/include/configs/vexpress_aemv8.h
>>> @@ -169,12 +169,14 @@
>>>                  "  if load hostfs - ${kernel_addr_r} ${kernel_name}; 
>>> then"      \
>>>                  "    setenv fdt_high 
>>> 0xffffffffffffffff;"               \
>>>                  "    setenv initrd_high 
>>> 0xffffffffffffffff;"            \
>>> -               "    load hostfs - ${fdt_addr_r} 
>>> ${fdtfile};"                   \
>>> +               "    if test -n load hostfs - ${fdt_addr_r} 
>>> ${fdtfile}; then"                   \
>>> +               "        fdt move $fdtcontroladdr 
>>> $fdt_addr_r;"                 \
>>> +               "    fi;"                       \
>>>                  "    load hostfs - ${ramdisk_addr_r} 
>>> ${ramdisk_name};" \
>>>                  "    fdt addr 
>>> ${fdt_addr_r};"                           \
>>>                  "    fdt 
>>> resize;"                                       \
>>>                  "    fdt chosen ${ramdisk_addr_r} ${filesize};" \
>>> -               "    booti $kernel_addr_r - 
>>> $fdt_addr_r;"               \
>>> +               "    booti $kernel_addr_r - 
>>> ${fdt_addr_r};"             \
>>>                  "  
>>> fi;"                                                 \
>>>                  "fi\0"
>>>   #define BOOTENV_DEV_NAME_SMH(devtypeu, devtypel, instance) "smh "
>>> -- 
>>> 2.46.2
>>>
>>
>> Regards,
>> Simon
> All the best,
> Harrison
> 

Regards,
Harrison
diff mbox series

Patch

diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h
index 8020689e39..2341b3a938 100644
--- a/include/configs/vexpress_aemv8.h
+++ b/include/configs/vexpress_aemv8.h
@@ -169,12 +169,14 @@ 
 		"  if load hostfs - ${kernel_addr_r} ${kernel_name}; then"	\
 		"    setenv fdt_high 0xffffffffffffffff;"		\
 		"    setenv initrd_high 0xffffffffffffffff;"		\
-		"    load hostfs - ${fdt_addr_r} ${fdtfile};"			\
+		"    if test -n load hostfs - ${fdt_addr_r} ${fdtfile}; then"			\
+		"        fdt move $fdtcontroladdr $fdt_addr_r;"			\
+		"    fi;"			\
 		"    load hostfs - ${ramdisk_addr_r} ${ramdisk_name};" \
 		"    fdt addr ${fdt_addr_r};"				\
 		"    fdt resize;"					\
 		"    fdt chosen ${ramdisk_addr_r} ${filesize};"	\
-		"    booti $kernel_addr_r - $fdt_addr_r;"		\
+		"    booti $kernel_addr_r - ${fdt_addr_r};"		\
 		"  fi;"							\
 		"fi\0"
 #define BOOTENV_DEV_NAME_SMH(devtypeu, devtypel, instance) "smh "