Skip to contentSkip to conversation

twister: Let SPL load U-Boot from MMC

PATCH In review Ladislav Michl 3 participants 3 messages May 14, 2018 – May 24, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 twister: Let SPL load U-Boot from MMC

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.

---
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(-)
board/technexion/twister/twister.c +8 -9
index 1166886e1d..0590e5f8af 100644
@@ -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);
Signature · 1 line
2.17.0
#1 lore raw

PATCH 1/1 twister: Let SPL load U-Boot from MMC

Hi Ladislav,

Quoted 8 lines · Ladislav Michl

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.

Quoted 7 lines

---
Stefano,

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

Patch is fine IMHO. It will be pushed by Tom's TI tree.

Quoted 45 lines
 board/technexion/twister/twister.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
board/technexion/twister/twister.c +6 -7
index 1166886e1d..0590e5f8af 100644
@@ -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

board/technexion/twister/twister.c void set_muxconf_regs(void) · line 135

Quoted 10 lines
board/technexion/twister/twister.c +2 -2
 	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);

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#2 lore raw
In reply to Ladislav Michl
Quoted 10 lines · Ladislav Michl

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180524/344bbf1c/attachment.sig>