[U-Boot] [PATCH v2 1/2] efi_loader: Pass fdt address directly to bootefi cmd

Stephen Warren swarren at wwwdotorg.org
Thu Apr 14 19:55:46 CEST 2016


On 04/14/2016 09:35 AM, Andreas Färber wrote:
> Am 14.04.2016 um 16:07 schrieb Alexander Graf:
>> The bootefi cmd today fetches its device tree pointer from either the
>> location appointed by "fdt addr" with a fallback to the U-Boot control
>> fdt.
>>
>> This integration is unusual for U-Boot and diverges from the way we
>> usually handle parameters to boot commands. So let's pass the fdt
>> directly into the bootefi command instead and move the control fdt
>> logic into the distro boot script.

>> diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
>> index ad9045e..dddebc3 100644
>> --- a/include/config_distro_bootcmd.h
>> +++ b/include/config_distro_bootcmd.h
>> @@ -103,12 +103,15 @@
>>   	"boot_efi_binary="                                                \
>>   		"load ${devtype} ${devnum}:${distro_bootpart} "           \
>>   			"${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; "      \
>> -		"bootefi ${kernel_addr_r}\0"                              \
>> +		"if fdt addr ${fdt_addr_r}; then "                        \
>> +			"bootefi ${kernel_addr_r} ${fdt_addr_r};"         \
>> +		"else"                                                    \
>> +			"bootefi ${kernel_addr_r} ${fdtcontroladdr};"     \
>
> Stephen, didn't you say you had problems with this? Might've been nice
> to put this behavioral change into a separate patch as before, but well:
>
> Reviewed-by: Andreas Färber <afaerber at suse.de>

The issue was with bootefi assuming that the control FDT was what gets 
passed to the EFI binary. With the above, the command takes an explicit 
parameter and hence makes no such assumption. It would be nice if there 
was an "fdt validate its a device tree" rather than "fdt addr" command 
to use here, but there isn't right now.



More information about the U-Boot mailing list