Skip to contentSkip to conversation

efi disks in u-boot

U-Boot Simon Glass 2 participants 3 messages Nov 13, 2018 – Nov 15, 2018 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi Akahsi,

Quoted 15 lines · AKASHI Takahiro

Hello Simon,

You said, in efi/lib_loader/efi_disk.c,

===8<===
* TODO(sjg at chromium.org): Actually with CONFIG_BLK, U-Boot does have this.
* Consider converting the code to look up devices as needed. The EFI device
* could be a child of the UCLASS_BLK block device, perhaps.
*
* This gets called from do_bootefi_exec().
*/
efi_status_t efi_disk_register(void)
{
===>8===

Quoted 5 lines

What do you mean by this statement?
Is it different from the code under "#if CONFIG_BLK"?

I guess that you would suggest that some hook function be called in blk_create_device() and blk_unbind_all(). No?

I would actually like EFI to use the U-Boot DM devices directly, with just the minimal amount of plumbing. Perhaps an EFI child device that gets created for each block device?

Regards,
Simon

#2 lore raw

Hi Simon,

Quoted 19 lines · Simon Glass

Hi Akahsi,

Quoted 15 lines · AKASHI Takahiro

Hello Simon,

You said, in efi/lib_loader/efi_disk.c,

===8<===
* TODO(sjg at chromium.org): Actually with CONFIG_BLK, U-Boot does have this.
* Consider converting the code to look up devices as needed. The EFI device
* could be a child of the UCLASS_BLK block device, perhaps.
*
* This gets called from do_bootefi_exec().
*/
efi_status_t efi_disk_register(void)
{
===>8===

Quoted 8 lines
Quoted 5 lines

What do you mean by this statement?
Is it different from the code under "#if CONFIG_BLK"?

I guess that you would suggest that some hook function be called in blk_create_device() and blk_unbind_all(). No?

I would actually like EFI to use the U-Boot DM devices directly, with just the minimal amount of plumbing.

Under the current implementation, any u-boot disk device is statically associated with device path proctocol as well as block io protocol & file system protocol only once in efi_init_obj_list().
If I understand you correctly, you're suggesting that, for example, efi_disk_from_path() should directly search for a u-boot device instead of look into a pre-created list of device path protocol objects with efi_search_protocol(). Right?

It sounds reasonable and quite straight forward, but I wonder why Alex and Rob didn't take this approach. Was there any discussion in the past?

Thanks,
-Takahiro Akashi

Quoted 5 lines

Perhaps an EFI child device that
gets created for each block device?

Regards,
Simon

#3 lore raw

Hi Akashi-san,

Quoted 39 lines · Takahiro

Hi Simon,

Quoted 19 lines · Simon Glass

Hi Akahsi,

Quoted 15 lines · AKASHI Takahiro

Hello Simon,

You said, in efi/lib_loader/efi_disk.c,

===8<===
* TODO(sjg at chromium.org): Actually with CONFIG_BLK, U-Boot does have this.
* Consider converting the code to look up devices as needed. The EFI device
* could be a child of the UCLASS_BLK block device, perhaps.
*
* This gets called from do_bootefi_exec().
*/
efi_status_t efi_disk_register(void)
{
===>8===

Quoted 8 lines
Quoted 5 lines

What do you mean by this statement?
Is it different from the code under "#if CONFIG_BLK"?

I guess that you would suggest that some hook function be called in blk_create_device() and blk_unbind_all(). No?

I would actually like EFI to use the U-Boot DM devices directly, with just the minimal amount of plumbing.

Under the current implementation, any u-boot disk device is statically associated with device path proctocol as well as block io protocol & file system protocol only once in efi_init_obj_list().
If I understand you correctly, you're suggesting that, for example, efi_disk_from_path() should directly search for a u-boot device instead of look into a pre-created list of device path protocol objects with efi_search_protocol(). Right?

Quoted 2 lines

It sounds reasonable and quite straight forward, but I wonder why Alex and Rob didn't take this approach. Was there any discussion in the past?

Yes, Alex did not want to limit this to only DM boards. That was an unfortunate mistake, IMO. We are now starting to get rid of non-DM boards.

Quoted 10 lines

Thanks,
-Takahiro Akashi

Quoted 5 lines

Perhaps an EFI child device that
gets created for each block device?

Regards,
Simon