U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi Babu <ravibabu@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH v1 3/6] dfu: spl: add generic spl-dfu function in common-spl
Date: Tue, 14 Jun 2016 16:32:21 +0530	[thread overview]
Message-ID: <1465902144-30934-4-git-send-email-ravibabu@ti.com> (raw)
In-Reply-To: <1465902144-30934-1-git-send-email-ravibabu@ti.com>

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 <ravibabu@ti.com>
---
 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

  parent reply	other threads:[~2016-06-14 11:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14 11:02 [U-Boot] [RFC PATCH v1 0/6] SPL: DFU Support in SPL Ravi Babu
2016-06-14 11:02 ` [U-Boot] [RFC PATCH v1 1/6] spl: dfu: add dfu support " Ravi Babu
2016-06-24  8:50   ` Lukasz Majewski
2016-06-24  8:54     ` B, Ravi
2016-06-14 11:02 ` [U-Boot] [RFC PATCH v1 2/6] spl: dfu: adding dfu support functions for SPL-DFU Ravi Babu
2016-06-24  9:00   ` Lukasz Majewski
2016-06-24  9:02     ` B, Ravi
2016-06-14 11:02 ` Ravi Babu [this message]
2016-06-24  9:01   ` [U-Boot] [RFC PATCH v1 3/6] dfu: spl: add generic spl-dfu function in common-spl Lukasz Majewski
2016-06-14 11:02 ` [U-Boot] [RFC PATCH v1 4/6] dra7x: spl: dfu: adding SPL-DFU support for dra7x platform Ravi Babu
2016-06-24  9:10   ` Lukasz Majewski
2016-06-24  9:27     ` B, Ravi
2016-06-14 11:02 ` [U-Boot] [RFC PATCH v1 5/6] dfu: spl: dra7x: enable SPL-dfu " Ravi Babu
2016-06-24  9:12   ` Lukasz Majewski
2016-06-24  9:21     ` B, Ravi
2016-06-14 11:02 ` [U-Boot] [RFC PATCH v1 6/6] dfu: spl: am335x: SPL-DFU support for am335x Ravi Babu
2016-06-24  9:15   ` Lukasz Majewski
2016-06-24  9:29     ` B, Ravi
2016-06-21  8:39 ` [U-Boot] [RFC PATCH v1 0/6] SPL: DFU Support in SPL B, Ravi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465902144-30934-4-git-send-email-ravibabu@ti.com \
    --to=ravibabu@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox