[U-Boot] [PATCH v0 13/20] efi_loader: use proper device-paths for partitions

Mark Kettenis mark.kettenis at xs4all.nl
Sun Aug 6 18:37:18 UTC 2017


> Date: Sun, 6 Aug 2017 20:21:45 +0200 (CEST)
> From: Mark Kettenis <mark.kettenis at xs4all.nl>
> 
> > Mind sending me or pastebin'ing your u-boot .config?  There are some
> > different device-path construction depending on legacy vs
> > CONFIG_DM+CONFIG_BLK (the legacy case *looks* right to me, and is used
> > by vexpress_ca15_tc2.. so I think it should work..)
> 
> See below.  The Banana Pi (and all other sunxi boards) indeed uses the
> legacy code path.  And I think there is a bug in the legacy codepath
> where it encodes the partition in the "file" path component.

If I fix the code to not insert the partition number there, I can boot
from SD card and SATA again.

diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index b5acf73f98..8ba0db2d7a 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -305,8 +305,8 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part)
 	struct efi_device_path_file_path *fp;
 	char devname[32] = { 0 }; /* fp->str is u16[32] long */
 
-	snprintf(devname, sizeof(devname), "%d.%d.%d", desc->if_type,
-		 desc->devnum, part);
+	snprintf(devname, sizeof(devname), "%d.%d", desc->if_type,
+		 desc->devnum);
 
 	memcpy(buf, &ROOT, sizeof(ROOT));
 	buf += sizeof(ROOT);


More information about the U-Boot mailing list