From: Maxime Ripard Date: Wed, 23 Aug 2017 08:08:29 +0000 (+0200) Subject: sunxi: Use sunxi_get_boot_device X-Git-Tag: v2017.11-rc2~129^2~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f4c3523c98588b528601f40c0c16106379ea6eda;p=u-boot sunxi: Use sunxi_get_boot_device Our current board code duplicates a bit the sunxi_get_boot_device logic. Now that we can use that function in the full-flavoured U-Boot, remove that duplication and call the function instead. Signed-off-by: Maxime Ripard --- diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 610fa89056..7fdcc4a74f 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -720,11 +721,14 @@ static void setup_environment(const void *fdt) int misc_init_r(void) { __maybe_unused int ret; + uint boot; env_set("fel_booted", NULL); env_set("fel_scriptaddr", NULL); + + boot = sunxi_get_boot_device(); /* determine if we are running in FEL mode */ - if (!is_boot0_magic(SPL_ADDR + 4)) { /* eGON.BT0 */ + if (boot == BOOT_DEVICE_BOARD) { env_set("fel_booted", "1"); parse_spl_header(SPL_ADDR); }