From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: [PATCH 7/7] ARM: socfpga: socrates: register bbu handlers
Date: Tue, 9 Aug 2016 14:37:32 +0200 [thread overview]
Message-ID: <1470746252-3146-7-git-send-email-s.trumtrar@pengutronix.de> (raw)
In-Reply-To: <1470746252-3146-1-git-send-email-s.trumtrar@pengutronix.de>
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
arch/arm/boards/ebv-socrates/board.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/arch/arm/boards/ebv-socrates/board.c b/arch/arm/boards/ebv-socrates/board.c
index 5d2d61991431..f3207b88efdf 100644
--- a/arch/arm/boards/ebv-socrates/board.c
+++ b/arch/arm/boards/ebv-socrates/board.c
@@ -2,6 +2,9 @@
#include <types.h>
#include <driver.h>
#include <init.h>
+#include <bbu.h>
+#include <bootsource.h>
+#include <filetype.h>
#include <asm/armlinux.h>
#include <linux/micrel_phy.h>
#include <linux/phy.h>
@@ -26,12 +29,45 @@ static int phy_fixup(struct phy_device *dev)
static int socrates_init(void)
{
+ enum bootsource bootsource = bootsource_get();
+ uint32_t flag_qspi = 0;
+ uint32_t flag_mmc = 0;
+
if (!of_machine_is_compatible("ebv,socrates"))
return 0;
if (IS_ENABLED(CONFIG_PHYLIB))
phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, phy_fixup);
+ switch (bootsource) {
+ case BOOTSOURCE_MMC:
+ flag_mmc |= BBU_HANDLER_FLAG_DEFAULT;
+ break;
+ case BOOTSOURCE_SPI:
+ flag_qspi |= BBU_HANDLER_FLAG_DEFAULT;
+ break;
+ default:
+ break;
+ }
+
+ bbu_register_std_file_update("qspi-xload0", flag_qspi,
+ "/dev/mtd0.prebootloader0",
+ filetype_socfpga_xload);
+ bbu_register_std_file_update("qspi-xload1", 0,
+ "/dev/mtd0.prebootloader1",
+ filetype_socfpga_xload);
+ bbu_register_std_file_update("qspi-xload2", 0,
+ "/dev/mtd0.prebootloader2",
+ filetype_socfpga_xload);
+ bbu_register_std_file_update("qspi-xload3", 0,
+ "/dev/mtd0.prebootloader3",
+ filetype_socfpga_xload);
+ bbu_register_std_file_update("qspi", 0, "/dev/mtd0.barebox",
+ filetype_arm_barebox);
+
+ bbu_register_std_file_update("mmc-xload", flag_mmc, "/dev/mmc0.0",
+ filetype_socfpga_xload);
+
return 0;
}
postcore_initcall(socrates_init);
--
2.8.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2016-08-09 12:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-09 12:37 [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Steffen Trumtrar
2016-08-09 12:37 ` [PATCH 2/7] ARM: socfpga: defconfig: add bootstrap_devfs Steffen Trumtrar
2016-08-09 17:48 ` Trent Piepho
2016-08-10 6:14 ` Steffen Trumtrar
2016-08-09 12:37 ` [PATCH 3/7] ARM: socfpga: xload: support more qspi partitions Steffen Trumtrar
2016-08-09 12:37 ` [PATCH 4/7] socfpga: remove dt entries that are upstream Steffen Trumtrar
2016-08-09 12:37 ` [PATCH 5/7] ARM: socfpga: socrates: set alias for ethernet0 Steffen Trumtrar
2016-08-09 12:37 ` [PATCH 6/7] ARM: socfpga: socrates: add qspi partitions Steffen Trumtrar
2016-08-09 12:37 ` Steffen Trumtrar [this message]
2016-08-18 6:23 ` [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Sascha Hauer
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=1470746252-3146-7-git-send-email-s.trumtrar@pengutronix.de \
--to=s.trumtrar@pengutronix.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox