[PATCH] rockchip: rk3588-rock-5b: Enable CONFIG_PCI_INIT_R to support EFI networking

Jonas Karlman jonas at kwiboo.se
Tue Nov 7 11:41:19 CET 2023


Hi Martin,

On 2023-11-07 10:45, Martin Roukala wrote:
> Hi Jonas,
> 
> On 06/11/2023 20:15, Jonas Karlman wrote:
>> Hi Martin,
>>
>> On 2023-11-04 14:04, Martin Roukala (né Peres) wrote:
>>> When u-boot chainloads an EFI bootloader such as iPXE, we want to have
>>> already initialized the PCI subsystem so that network driver is loaded
>>> and ready to use by the bootloader.
>>
>> This change slows down boot from emmc/sd-card where scanning for pci
>> devices typically is unnecessary.
> 
> True.
> 
>>
>> If pci must be initialized and scanned before an EFI app is started to
>> find pci network controllers, then pci should probably be initialized by
>> the efi bootmeth, not by enabling CONFIG_PCI_INIT_R for a single board.
> 
> Unfortunately, it isn't that simple. I am chainloading iPXE immediately, 
> so we never end up calling bootmeth... and so iPXE fails to find any NIC 
> because u-boot did not initialize the PCI subsystem.

How are you chainloading iPXE?, if it is not started using standard boot
procedure (the efi bootmeth). If you are running custom script to load
iPXE you can probably run "pci enum;net list;" before loading iPXE to
init pci network.

> 
> IMO, the defconfig should work in all situations. If someone wants to 
> speed up their use case, they are free to disable the features they 
> don't need.

IMO, the defconfig should work for generic use case with standard boot,
and with the lazy loading principle of not probing devices/drivers until
they are needed/used.

PCI_INIT_R will force probing of pci devices that may not be needed and
add a ~1 second timeout delay for each unoccupied M.2 slot on this board.

> 
> A generic solution may be for u-boot to start probing the PCI bus when 
> asked to enumerate the NICs through SNP by the EFI binary... but until 
> this is done, the defaults should just work.

Agree, this should be solved using a generic solution. Do not agree on
changing defaults for a specific use-case that affect other use-cases
and where other workarounds may be applied.

Regards,
Jonas

> 
> Regards,
> Martin
> 
>>
>> Regards,
>> Jonas
>>
>>>
>>> Fixes: 191ece249a96 ("rockchip: rk3588-rock-5b: Enable support for PCIe SATA cards")
>>> Signed-off-by: Martin Roukala (né Peres) <martin.roukala at mupuf.org>
>>> ---
>>>   configs/rock5b-rk3588_defconfig | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/configs/rock5b-rk3588_defconfig b/configs/rock5b-rk3588_defconfig
>>> index 0595325e81..938137c851 100644
>>> --- a/configs/rock5b-rk3588_defconfig
>>> +++ b/configs/rock5b-rk3588_defconfig
>>> @@ -36,6 +36,7 @@ CONFIG_OF_BOARD_SETUP=y
>>>   CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-rock-5b.dtb"
>>>   # CONFIG_DISPLAY_CPUINFO is not set
>>>   CONFIG_DISPLAY_BOARDINFO_LATE=y
>>> +CONFIG_PCI_INIT_R=y
>>>   CONFIG_SPL_MAX_SIZE=0x40000
>>>   CONFIG_SPL_PAD_TO=0x7f8000
>>>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>>



More information about the U-Boot mailing list