From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ravi Babu Date: Tue, 14 Jun 2016 16:32:21 +0530 Subject: [U-Boot] [RFC PATCH v1 3/6] dfu: spl: add generic spl-dfu function in common-spl In-Reply-To: <1465902144-30934-1-git-send-email-ravibabu@ti.com> References: <1465902144-30934-1-git-send-email-ravibabu@ti.com> Message-ID: <1465902144-30934-4-git-send-email-ravibabu@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Add generic spl-dfu function in common-spl, specific implemention for configuring dfu memory device is done in platform board specific source file. Signed-off-by: Ravi Babu --- common/spl/spl.c | 9 +++++++++ include/spl.h | 1 + 2 files changed, 10 insertions(+) diff --git a/common/spl/spl.c b/common/spl/spl.c index 82e7f58..0726378 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -273,6 +273,11 @@ static void announce_boot_device(u32 boot_device) static inline void announce_boot_device(u32 boot_device) { } #endif +__weak int spl_run_dfu(void) +{ + return 0; +} + static int spl_load_image(u32 boot_device) { switch (boot_device) { @@ -367,6 +372,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2) spl_board_init(); #endif + if (spl_run_dfu()) + goto os_boot; + board_boot_order(spl_boot_list); for (i = 0; i < ARRAY_SIZE(spl_boot_list) && spl_boot_list[i] != BOOT_DEVICE_NONE; i++) { @@ -381,6 +389,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) hang(); } +os_boot: switch (spl_image.os) { case IH_OS_U_BOOT: debug("Jumping to U-Boot\n"); diff --git a/include/spl.h b/include/spl.h index 8849678..f21a76a 100644 --- a/include/spl.h +++ b/include/spl.h @@ -149,4 +149,5 @@ bool spl_was_boot_source(void); int spl_dfu_mmc(int usb_index, int mmc_dev, char *dfu_alt_info); int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr); int spl_dfu_ram_load_image(void); +int spl_run_dfu(void); #endif -- 1.7.9.5