|
|
5b6fc3b |
From 8bc6f62541436ebaf87133792726d9b48f878d09 Mon Sep 17 00:00:00 2001
|
|
|
262b414 |
From: Peter Robinson <pbrobinson@gmail.com>
|
|
|
ad36d48 |
Date: Tue, 5 Dec 2017 00:11:08 +0000
|
|
|
5b6fc3b |
Subject: [PATCH] distro: load FDT from any partition on boot device
|
|
|
262b414 |
|
|
|
262b414 |
In the EFI_LOADER boot path, we were only checking the FAT partition
|
|
|
262b414 |
containing the EFI payload for dtb files. But this is somewhat of a
|
|
|
262b414 |
fiction. In reality there will be one small (V)FAT partition containing
|
|
|
262b414 |
grub (or whatever the payload may be), and a second boot partition
|
|
|
262b414 |
containing kernel/initrd/fdt (typically ext4). It is this second
|
|
|
262b414 |
partition where we should be looking for a FDT to load.
|
|
|
262b414 |
|
|
|
262b414 |
So instead scan all the partitions of the disk containing the EFI
|
|
|
262b414 |
payload. This matches where grub looks for kernel/initrd (barring
|
|
|
262b414 |
custom grub.cfg, in which case the user can use grub's 'devicetree'
|
|
|
262b414 |
command to load the correct FDT).
|
|
|
262b414 |
|
|
|
262b414 |
The other option is somehow passing the ${fdtfile} to grub so that it
|
|
|
262b414 |
can load the FDT based on selected kernel version location (which grub
|
|
|
262b414 |
knows) and SoC/board specific ${fdtfile} (which grub does not know).
|
|
|
262b414 |
|
|
|
262b414 |
Signed-off-by: Rob Clark <robdclark@gmail.com>
|
|
|
ad36d48 |
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|
|
|
262b414 |
---
|
|
|
262b414 |
include/config_distro_bootcmd.h | 34 +++++++++++++++++++++++-----------
|
|
|
262b414 |
1 file changed, 23 insertions(+), 11 deletions(-)
|
|
|
262b414 |
|
|
|
262b414 |
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
|
|
|
5b6fc3b |
index 7746366ec8..c87f7c2a42 100644
|
|
|
262b414 |
--- a/include/config_distro_bootcmd.h
|
|
|
262b414 |
+++ b/include/config_distro_bootcmd.h
|
|
|
5b6fc3b |
@@ -135,25 +135,37 @@
|
|
|
262b414 |
"fi\0" \
|
|
|
262b414 |
\
|
|
|
262b414 |
"load_efi_dtb=" \
|
|
|
262b414 |
- "load ${devtype} ${devnum}:${distro_bootpart} " \
|
|
|
262b414 |
- "${fdt_addr_r} ${prefix}${efi_fdtfile}\0" \
|
|
|
262b414 |
+ "load ${devtype} ${devnum}:${dtb_devp} " \
|
|
|
262b414 |
+ "${fdt_addr_r} ${prefix}${efi_fdtfile} && " \
|
|
|
262b414 |
+ "run boot_efi_binary\0" \
|
|
|
262b414 |
\
|
|
|
262b414 |
"efi_dtb_prefixes=/ /dtb/ /dtb/current/\0" \
|
|
|
262b414 |
- "scan_dev_for_efi=" \
|
|
|
262b414 |
+ "scan_dev_for_dtb=" \
|
|
|
262b414 |
"setenv efi_fdtfile ${fdtfile}; " \
|
|
|
262b414 |
BOOTENV_EFI_SET_FDTFILE_FALLBACK \
|
|
|
262b414 |
- "for prefix in ${efi_dtb_prefixes}; do " \
|
|
|
262b414 |
- "if test -e ${devtype} " \
|
|
|
262b414 |
- "${devnum}:${distro_bootpart} " \
|
|
|
262b414 |
- "${prefix}${efi_fdtfile}; then " \
|
|
|
262b414 |
- "run load_efi_dtb; " \
|
|
|
262b414 |
- "fi;" \
|
|
|
262b414 |
- "done;" \
|
|
|
262b414 |
+ "part list ${devtype} ${devnum} dtb_devplist; " \
|
|
|
262b414 |
+ "env exists dtb_devplist || setenv dtb_devplist " \
|
|
|
262b414 |
+ "${distro_bootpart}; " \
|
|
|
262b414 |
+ "for dtb_devp in ${dtb_devplist}; do " \
|
|
|
262b414 |
+ "for prefix in ${efi_dtb_prefixes}; do " \
|
|
|
262b414 |
+ "if test -e ${devtype} " \
|
|
|
262b414 |
+ "${devnum}:${dtb_devp} " \
|
|
|
262b414 |
+ "${prefix}${efi_fdtfile};"\
|
|
|
262b414 |
+ " then " \
|
|
|
262b414 |
+ "echo Found DTB ${devtype} " \
|
|
|
262b414 |
+ "${devnum}:${dtb_devp} " \
|
|
|
262b414 |
+ "${prefix}${efi_fdtfile};"\
|
|
|
262b414 |
+ "run load_efi_dtb; " \
|
|
|
262b414 |
+ "fi;" \
|
|
|
262b414 |
+ "done; " \
|
|
|
262b414 |
+ "done; " \
|
|
|
262b414 |
+ "run boot_efi_binary\0" \
|
|
|
262b414 |
+ "scan_dev_for_efi=" \
|
|
|
262b414 |
"if test -e ${devtype} ${devnum}:${distro_bootpart} " \
|
|
|
262b414 |
"efi/fedora/"BOOTEFI_NAME"; then " \
|
|
|
262b414 |
"echo Found EFI removable media binary " \
|
|
|
262b414 |
"efi/fedora/"BOOTEFI_NAME"; " \
|
|
|
262b414 |
- "run boot_efi_binary; " \
|
|
|
262b414 |
+ "run scan_dev_for_dtb; " \
|
|
|
262b414 |
"echo EFI LOAD FAILED: continuing...; " \
|
|
|
262b414 |
"fi; " \
|
|
|
262b414 |
"setenv efi_fdtfile\0"
|
|
|
262b414 |
--
|
|
|
ad36d48 |
2.14.3
|
|
|
262b414 |
|