diff options
author | Steffen Trumtrar <s.trumtrar@pengutronix.de> | 2016-08-09 14:37:32 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-08-18 08:19:25 +0200 |
commit | a308f2eb318a862c1974ade82f1d0c399b313e9a (patch) | |
tree | 1e6ab5b2479507ef114105013f3820f5c394e37a /arch/arm/boards | |
parent | c926a121c0250f28687f8e2ec13d7eb9d05b84f3 (diff) | |
download | barebox-a308f2eb318a862c1974ade82f1d0c399b313e9a.tar.gz barebox-a308f2eb318a862c1974ade82f1d0c399b313e9a.tar.xz |
ARM: socfpga: socrates: register bbu handlers
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards')
-rw-r--r-- | arch/arm/boards/ebv-socrates/board.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/boards/ebv-socrates/board.c b/arch/arm/boards/ebv-socrates/board.c index 5d2d619914..f3207b88ef 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); |