From: "Eric Bénard" <eric@eukrea.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] i.MX53: add serial downloader bootsource
Date: Wed, 10 Apr 2013 16:10:58 +0200 [thread overview]
Message-ID: <1365603058-9368-2-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1365603058-9368-1-git-send-email-eric@eukrea.com>
Signed-off-by: Eric Bénard <eric@eukrea.com>
---
arch/arm/mach-imx/boot.c | 70 +++++++++++++++++++++++++-----------------------
1 file changed, 37 insertions(+), 33 deletions(-)
diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c
index bd0cb84..2e3f7ca 100644
--- a/arch/arm/mach-imx/boot.c
+++ b/arch/arm/mach-imx/boot.c
@@ -172,39 +172,43 @@ void imx53_boot_save_loc(void __iomem *src_base)
int instance;
uint32_t cfg1 = readl(src_base + IMX53_SRC_SBMR);
- switch ((cfg1 & 0xff) >> 4) {
- case 2:
- src = BOOTSOURCE_HD;
- break;
- case 3:
- if (cfg1 & (1 << 3))
- src = BOOTSOURCE_SPI;
- else
- src = BOOTSOURCE_I2C;
- break;
- case 4:
- case 5:
- case 6:
- case 7:
- src = BOOTSOURCE_MMC;
- break;
- default:
- break;
- }
-
- if (cfg1 & (1 << 7))
- src = BOOTSOURCE_NAND;
-
-
- switch (src) {
- case BOOTSOURCE_MMC:
- case BOOTSOURCE_SPI:
- case BOOTSOURCE_I2C:
- instance = (cfg1 >> 21) & 0x3;
- break;
- default:
- instance = 0;
- break;
+ if ((cfg1 & 0x03000000) >> 24 == 0x3)
+ src = BOOTSOURCE_SERIAL;
+ else {
+ switch ((cfg1 & 0xff) >> 4) {
+ case 2:
+ src = BOOTSOURCE_HD;
+ break;
+ case 3:
+ if (cfg1 & (1 << 3))
+ src = BOOTSOURCE_SPI;
+ else
+ src = BOOTSOURCE_I2C;
+ break;
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ src = BOOTSOURCE_MMC;
+ break;
+ default:
+ break;
+ }
+
+ if (cfg1 & (1 << 7))
+ src = BOOTSOURCE_NAND;
+
+
+ switch (src) {
+ case BOOTSOURCE_MMC:
+ case BOOTSOURCE_SPI:
+ case BOOTSOURCE_I2C:
+ instance = (cfg1 >> 21) & 0x3;
+ break;
+ default:
+ instance = 0;
+ break;
+ }
}
bootsource_set(src);
--
1.7.11.7
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-04-10 14:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-10 14:10 [PATCH 1/2] mx53-loco: provide the right header for serial downloader Eric Bénard
2013-04-10 14:10 ` Eric Bénard [this message]
2013-04-10 16:08 ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-11 8:02 ` Sascha Hauer
2013-04-11 8:12 ` Eric Bénard
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=1365603058-9368-2-git-send-email-eric@eukrea.com \
--to=eric@eukrea.com \
--cc=barebox@lists.infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.