public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] twister: Let SPL load U-Boot from MMC
@ 2018-05-14  7:17 Ladislav Michl
  2018-05-17 10:24 ` Stefano Babic
  2018-05-24 12:42 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Ladislav Michl @ 2018-05-14  7:17 UTC (permalink / raw)
  To: u-boot

MMC is not initialized in SPL, so it cannot load u-boot.img
preventing boot from MMC.

Also driver specific functions are guarded with generic
configuration options which leads to build failures when device
driver is not enabled in config. Fix that by using driver
specific defines.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 Stefano,

 if want this patch to be splitted, just let me know.
 I didn't want to make it two fewliners...

 board/technexion/twister/twister.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/board/technexion/twister/twister.c b/board/technexion/twister/twister.c
index 1166886e1d..0590e5f8af 100644
--- a/board/technexion/twister/twister.c
+++ b/board/technexion/twister/twister.c
@@ -18,10 +18,8 @@
 #include <spl.h>
 #include <mmc.h>
 #include <asm/gpio.h>
-#ifdef CONFIG_USB_EHCI_HCD
 #include <usb.h>
 #include <asm/ehci-omap.h>
-#endif
 #include "twister.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -45,7 +43,7 @@ static const u32 gpmc_XR16L2751[] = {
 	XR16L2751_GPMC_CONFIG6,
 };
 
-#ifdef CONFIG_USB_EHCI_HCD
+#ifdef CONFIG_USB_EHCI_OMAP
 static struct omap_usbhs_board_data usbhs_bdata = {
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
@@ -118,19 +116,20 @@ void set_muxconf_regs(void)
 
 int board_eth_init(bd_t *bis)
 {
+#ifdef CONFIG_DRIVER_TI_EMAC
 	davinci_emac_initialize();
-
+#endif
 	/* init cs for extern lan */
 	enable_gpmc_cs_config(gpmc_smc911, &gpmc_cfg->cs[5],
 		CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
-	if (smc911x_initialize(0, CONFIG_SMC911X_BASE) <= 0)
-		printf("\nError initializing SMC911x controlleri\n");
-
+#ifdef CONFIG_SMC911X
+	return smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#else
 	return 0;
+#endif
 }
 
-#if defined(CONFIG_MMC_OMAP_HS) && \
-	!defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_MMC_OMAP_HS)
 int board_mmc_init(bd_t *bis)
 {
 	return omap_mmc_init(0, 0, 0, -1, -1);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-24 12:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-14  7:17 [U-Boot] [PATCH] twister: Let SPL load U-Boot from MMC Ladislav Michl
2018-05-17 10:24 ` Stefano Babic
2018-05-24 12:42 ` [U-Boot] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox