summaryrefslogtreecommitdiffstats
path: root/board
diff options
context:
space:
mode:
authorDaniel Kochmański <dkochmanski@turtle-solutions.eu>2015-05-29 17:21:00 +0200
committerHans de Goede <hdegoede@redhat.com>2015-07-24 16:17:09 +0200
commitbf5b9b103c9ad9fa041b9913fb3a031c14566f5d (patch)
tree471ade2f3f9b47939a1cd850ec6b2246b67d358d /board
parenta151403fd2da05a6f05d1f0e16ff7b8986a73823 (diff)
downloadtalos-obmc-uboot-bf5b9b103c9ad9fa041b9913fb3a031c14566f5d.tar.gz
talos-obmc-uboot-bf5b9b103c9ad9fa041b9913fb3a031c14566f5d.zip
sunxi: spl: Remove redundant check from `board_mmc_init` for signature
Remove the boot signature check from board_mmc_init() in spl mode, as it is already done in spl_boot_device() in this case, and update the comments to reflect this. Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu> CC: Roy Spliet <r.spliet@ultimaker.com> Cc: Ian Campbell <ijc@hellion.org.uk> [hdegoede@redhat.com: Disable the check only for SPL instead of always] Acked-by: Hans De Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'board')
-rw-r--r--board/sunxi/board.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 76e4b9bcc1..7220af3454 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -294,17 +294,19 @@ int board_mmc_init(bd_t *bis)
return -1;
#endif
-#if CONFIG_MMC_SUNXI_SLOT == 0 && CONFIG_MMC_SUNXI_SLOT_EXTRA == 2
+#if !defined(CONFIG_SPL_BUILD) && CONFIG_MMC_SUNXI_SLOT_EXTRA == 2
/*
- * Both mmc0 and mmc2 are bootable, figure out where we're booting
- * from. Try mmc0 first, just like the brom does.
+ * On systems with an emmc (mmc2), figure out if we are booting from
+ * the emmc and if we are make it "mmc dev 0" so that boot.scr, etc.
+ * are searched there first. Note we only do this for u-boot proper,
+ * not for the SPL, see spl_boot_device().
*/
- if (sunxi_mmc_has_egon_boot_signature(mmc0))
- return 0;
-
- /* no bootable card in mmc0, so we must be booting from mmc2, swap */
- mmc0->block_dev.dev = 1;
- mmc1->block_dev.dev = 0;
+ if (!sunxi_mmc_has_egon_boot_signature(mmc0) &&
+ sunxi_mmc_has_egon_boot_signature(mmc1)) {
+ /* Booting from emmc / mmc2, swap */
+ mmc0->block_dev.dev = 1;
+ mmc1->block_dev.dev = 0;
+ }
#endif
return 0;
OpenPOWER on IntegriCloud