[PATCH 2/2] config: efi-x86_payload: Enable DEBUG_UART

Heinrich Schuchardt xypron.glpk at gmx.de
Sat Jan 4 02:11:09 CET 2025


On 1/3/25 17:16, Heinrich Schuchardt wrote:
> On 28.11.24 04:47, Kever Yang wrote:
>> The efi_stub is useing DEBUG_UART interface by default, Enable it.
>
> As Simon already wrote in a code comment the implementation of the EFI
> stub is broken as it is not hardware agnostic.
>
> In the EFI stub we should never directly access hardware. Please, use
> SimpleTextOutputProtocol.OutputString() for printing.
>
>>
>> Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
>> ---
>>
>>   configs/efi-x86_payload32_defconfig | 1 +
>>   configs/efi-x86_payload64_defconfig | 1 +
>>   2 files changed, 2 insertions(+)
>>
>> diff --git a/configs/efi-x86_payload32_defconfig b/configs/efi-
>> x86_payload32_defconfig
>> index 071ddb8e36d..f0b9acc358d 100644
>> --- a/configs/efi-x86_payload32_defconfig
>> +++ b/configs/efi-x86_payload32_defconfig
>> @@ -5,6 +5,7 @@ CONFIG_DEFAULT_DEVICE_TREE="efi-x86_payload"
>>   CONFIG_PRE_CON_BUF_ADDR=0x100000
>>   CONFIG_VENDOR_EFI=y
>>   CONFIG_TARGET_EFI_PAYLOAD=y
>> +CONFIG_DEBUG_UART=y
>
> On x86 this uses the NS16550 UART driver. This is fine as long as we
> don't use the debug UART in the EFI stub. But correcting this is for a
> separate patch.
>
> Having a debug UART available after the EFI stub makes sense.
>
> I will update the commit message when merging.
>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>
>>   CONFIG_EFI=y
>>   CONFIG_EFI_STUB=y
>>   CONFIG_FIT=y
>> diff --git a/configs/efi-x86_payload64_defconfig b/configs/efi-
>> x86_payload64_defconfig
>> index 71612d7fb19..b02a861e59c 100644
>> --- a/configs/efi-x86_payload64_defconfig
>> +++ b/configs/efi-x86_payload64_defconfig
>> @@ -5,6 +5,7 @@ CONFIG_DEFAULT_DEVICE_TREE="efi-x86_payload"
>>   CONFIG_PRE_CON_BUF_ADDR=0x100000
>>   CONFIG_VENDOR_EFI=y
>>   CONFIG_TARGET_EFI_PAYLOAD=y
>> +CONFIG_DEBUG_UART=y

Building fails without a value DEBUG_UART_BASE.

Looking at function putc() in lib/efi/efi_stub.c I guess this should be
DEBUG_UART_BASE=0x3f8.

Best regards

Heinrich

>>   CONFIG_EFI=y
>>   CONFIG_EFI_STUB=y
>>   CONFIG_EFI_STUB_64BIT=y
>



More information about the U-Boot mailing list