File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717#include <log.h>
1818#include <malloc.h>
1919#include <net.h>
20+ #include <part.h>
2021#include <efi_loader.h>
2122#include <efi_variable.h>
2223#include <asm/unaligned.h>
@@ -314,6 +315,7 @@ static efi_status_t search_default_file(struct udevice *dev,
314315static efi_status_t fill_default_file_path (struct udevice * blk ,
315316 struct efi_device_path * * dp )
316317{
318+ struct blk_desc * desc = dev_get_uclass_plat (blk );
317319 efi_status_t ret ;
318320 struct udevice * partition ;
319321
@@ -322,6 +324,26 @@ static efi_status_t fill_default_file_path(struct udevice *blk,
322324 if (ret == EFI_SUCCESS )
323325 return ret ;
324326
327+ /* try EFI system partition */
328+ if (desc -> uclass_id == efi_system_partition .uclass_id &&
329+ desc -> devnum == efi_system_partition .devnum ) {
330+ device_foreach_child (partition , blk ) {
331+ struct disk_part * part ;
332+ enum uclass_id id ;
333+
334+ id = device_get_uclass_id (partition );
335+ if (id != UCLASS_PARTITION )
336+ continue ;
337+
338+ part = dev_get_uclass_plat (partition );
339+ if (part -> partnum == efi_system_partition .part ) {
340+ ret = search_default_file (partition , dp );
341+ if (ret == EFI_SUCCESS )
342+ return ret ;
343+ }
344+ }
345+ }
346+
325347 /* try the partitions */
326348 device_foreach_child (partition , blk ) {
327349 enum uclass_id id ;
You can’t perform that action at this time.
0 commit comments