From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bX6IE-00078s-QC for barebox@lists.infradead.org; Tue, 09 Aug 2016 12:38:07 +0000 From: Steffen Trumtrar Date: Tue, 9 Aug 2016 14:37:32 +0200 Message-Id: <1470746252-3146-7-git-send-email-s.trumtrar@pengutronix.de> In-Reply-To: <1470746252-3146-1-git-send-email-s.trumtrar@pengutronix.de> References: <1470746252-3146-1-git-send-email-s.trumtrar@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 7/7] ARM: socfpga: socrates: register bbu handlers To: barebox@lists.infradead.org Cc: Steffen Trumtrar Signed-off-by: Steffen Trumtrar --- 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 #include #include +#include +#include +#include #include #include #include @@ -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