summaryrefslogtreecommitdiffstats
path: root/include/config_distro_bootcmd.h
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2016-04-14 16:07:54 +0200
committerTom Rini <trini@konsulko.com>2016-04-18 17:11:50 -0400
commitff2545ab78212717b5d81bc0fb6a91fd393f3cb1 (patch)
treebbaea51c449996f4ea4ad1dbbc04ca040dbdf952 /include/config_distro_bootcmd.h
parent1c39809b92c217877e160ee91a82743c9d4f3ed1 (diff)
downloadblackbird-obmc-uboot-ff2545ab78212717b5d81bc0fb6a91fd393f3cb1.tar.gz
blackbird-obmc-uboot-ff2545ab78212717b5d81bc0fb6a91fd393f3cb1.zip
efi_loader: Fall back to fdtfile naming convention
When there is no $fdtfile variable set, we still have a good chance that on 32bit arm the fdtfile really is just called $soc-$board.dtb. Enable the exports for $soc and $board in our distr defaults and make use of them in the efi boot script. Reported-by: Andreas Faerber <afaerber@suse.de> Reported-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include/config_distro_bootcmd.h')
-rw-r--r--include/config_distro_bootcmd.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index dddebc3224..7f673448c9 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -99,6 +99,21 @@
#endif
#ifdef BOOTEFI_NAME
+#if defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
+/*
+ * On 32bit ARM systems there is a reasonable number of systems that follow
+ * the $soc-$board$boardver.dtb name scheme for their device trees. Use that
+ * scheme if we don't have an explicit fdtfile variable.
+ */
+#define BOOTENV_EFI_SET_FDTFILE_FALLBACK \
+ "if test -z \"${fdtfile}\" -a -n \"${soc}\"; then " \
+ "setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; " \
+ "fi; "
+#else
+#define BOOTENV_EFI_SET_FDTFILE_FALLBACK
+#endif
+
+
#define BOOTENV_SHARED_EFI \
"boot_efi_binary=" \
"load ${devtype} ${devnum}:${distro_bootpart} " \
@@ -111,14 +126,16 @@
\
"load_efi_dtb=" \
"load ${devtype} ${devnum}:${distro_bootpart} " \
- "${fdt_addr_r} ${prefix}${fdtfile}\0" \
+ "${fdt_addr_r} ${prefix}${efi_fdtfile}\0" \
\
"efi_dtb_prefixes=/ /dtb/ /dtb/current/\0" \
"scan_dev_for_efi=" \
+ "setenv efi_fdtfile ${fdtfile}; " \
+ BOOTENV_EFI_SET_FDTFILE_FALLBACK \
"for prefix in ${efi_dtb_prefixes}; do " \
"if test -e ${devtype} " \
"${devnum}:${distro_bootpart} " \
- "${prefix}${fdtfile}; then " \
+ "${prefix}${efi_fdtfile}; then " \
"run load_efi_dtb; " \
"fi;" \
"done;" \
@@ -128,7 +145,8 @@
"efi/boot/"BOOTEFI_NAME"; " \
"run boot_efi_binary; " \
"echo EFI LOAD FAILED: continuing...; " \
- "fi; \0"
+ "fi; " \
+ "setenv efi_fdtfile\0"
#define SCAN_DEV_FOR_EFI "run scan_dev_for_efi;"
#else
#define BOOTENV_SHARED_EFI
OpenPOWER on IntegriCloud