Skip to contentSkip to conversation

mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size

PATCH New Fabio Estevam 3 participants 9 messages May 21, 2019 – Jun 10, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size

Currently the mx6qsabresd board does not boot:

U-Boot SPL 2019.07-rc2 (May 16 2019 - 14:28:55 -0300) Trying to boot from MMC1
spl: could not find mmc device 0. error: -19
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

The reason for the boot failure is that that the SPL size got greater than the 68KB limit (4KB header + 64KB max size) as explained in include/configs/imx6_spl.h.

Remove the CONFIG_SPL_DM option, so that the SPL binary could fit into the allowed size and the board can boot again.

---
Changes since v1:
- Improve the commit log by explaining that the boot failure is caused by SPL size overflow

 configs/mx6sabresd_defconfig | 1 -
 1 file changed, 1 deletion(-)
configs/mx6sabresd_defconfig +0 -1
index d3ed3c4543..5c2d055561 100644
@@ -65,7 +65,6 @@ CONFIG_SPL_MULTI_DTB_FIT=y
 CONFIG_SPL_OF_LIST="imx6dl-sabresd imx6q-sabresd imx6qp-sabresd"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
-CONFIG_SPL_DM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_FASTBOOT_BUF_SIZE=0x10000000
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 2/3 mx6sabresd: Select pinctrl driver

With the conversion to DM we should select the pinctrl driver.

---
Changes since v1:
- None

 configs/mx6sabresd_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/mx6sabresd_defconfig +2 -0
index 5c2d055561..f7ba632b2a 100644
@@ -81,6 +81,8 @@ CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_MII=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX6=y
 CONFIG_PCI=y
 CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 2/3 mx6sabresd: Select pinctrl driver

Quoted 2 lines

With the conversion to DM we should select the pinctrl driver.

Applied to u-boot-imx, master, thanks !

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
=====================================================================
#3 lore raw

PATCH v2 3/3 mx6sabresd: Remove U-Boot proper mmc initialization

In reply to Fabio Estevam

After the conversion to DM there is no need to have mmc initialization code inside U-Boot proper.

Remove the unneeded code.

---
Changes since v1:
- None

 board/freescale/mx6sabresd/mx6sabresd.c | 44 -------------------------
 1 file changed, 44 deletions(-)
board/freescale/mx6sabresd/mx6sabresd.c +0 -44
index 385a18e923..cdfc5ff77f 100644
@@ -287,49 +287,6 @@ int board_mmc_getcd(struct mmc *mmc)
 
 int board_mmc_init(bd_t *bis)
 {
-#ifndef CONFIG_SPL_BUILD
-	int ret;
-	int i;
-
-	/*
-	 * According to the board_mmc_init() the following map is done:
-	 * (U-Boot device node)    (Physical Port)
-	 * mmc0                    SD2
-	 * mmc1                    SD3
-	 * mmc2                    eMMC
-	 */
-	for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) {
-		switch (i) {
-		case 0:
-			SETUP_IOMUX_PADS(usdhc2_pads);
-			gpio_request(USDHC2_CD_GPIO, "USDHC2 CD");
-			gpio_direction_input(USDHC2_CD_GPIO);
-			usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
-			break;
-		case 1:
-			SETUP_IOMUX_PADS(usdhc3_pads);
-			gpio_request(USDHC3_CD_GPIO, "USDHC3 CD");
-			gpio_direction_input(USDHC3_CD_GPIO);
-			usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
-			break;
-		case 2:
-			SETUP_IOMUX_PADS(usdhc4_pads);
-			usdhc_cfg[2].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
-			break;
-		default:
-			printf("Warning: you configured more USDHC controllers"
-			       "(%d) then supported by the board (%d)\n",
-			       i + 1, CONFIG_SYS_FSL_USDHC_NUM);
-			return -EINVAL;
-		}
-
-		ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]);
-		if (ret)
-			return ret;
-	}
-
-	return 0;
-#else
 	struct src *psrc = (struct src *)SRC_BASE_ADDR;
 	unsigned reg = readl(&psrc->sbmr1) >> 11;
 	/*
@@ -363,7 +320,6 @@ int board_mmc_init(bd_t *bis)
 	}
 
 	return fsl_esdhc_initialize(bis, &usdhc_cfg[0]);
-#endif
 }
 #endif
 
Signature · 1 line
2.17.1
#4 lore raw

PATCH v2 3/3 mx6sabresd: Remove U-Boot proper mmc

Quoted 4 lines

After the conversion to DM there is no need to have mmc initialization code inside U-Boot proper.
Remove the unneeded code.

Applied to u-boot-imx, master, thanks !

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
=====================================================================
#5 lore raw

PATCH v2 1/3 mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size

In reply to Fabio Estevam
Quoted 29 lines · Fabio Estevam

Currently the mx6qsabresd board does not boot:

U-Boot SPL 2019.07-rc2 (May 16 2019 - 14:28:55 -0300) Trying to boot from MMC1
spl: could not find mmc device 0. error: -19
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

The reason for the boot failure is that that the SPL size got greater than the 68KB limit (4KB header + 64KB max size) as explained in include/configs/imx6_spl.h.

Remove the CONFIG_SPL_DM option, so that the SPL binary could fit into the allowed size and the board can boot again.

---
Changes since v1:
- Improve the commit log by explaining that the boot failure is caused by SPL size overflow

 configs/mx6sabresd_defconfig | 1 -
 1 file changed, 1 deletion(-)
configs/mx6sabresd_defconfig +0 -0
index d3ed3c4543..5c2d055561 100644

configs/mx6sabresd_defconfig CONFIG_SPL_MULTI_DTB_FIT=y · line 70

Quoted 7 lines
configs/mx6sabresd_defconfig +0 -1
@@ -65,7 +65,6 @@ CONFIG_SPL_MULTI_DTB_FIT=y
 CONFIG_SPL_OF_LIST="imx6dl-sabresd imx6q-sabresd imx6qp-sabresd"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
-CONFIG_SPL_DM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_FASTBOOT_BUF_SIZE=0x10000000

Since we care about the SPL size, is there any reason why we have CONFIG_SPL_FS_EXT4?

AFAICS, u-boot.img is not on a filesystem, so why do we need ext2/3/4?

Thanks,
Eze

#6 lore raw

PATCH v2 1/3 mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size

Hi Ezequiel,

Quoted 3 lines · Ezequiel Garcia

Since we care about the SPL size, is there any reason why we have CONFIG_SPL_FS_EXT4?

AFAICS, u-boot.img is not on a filesystem, so why do we need ext2/3/4?

Yes, I will remove CONFIG_SPL_FS_EXT4 and CONFIG_SPL_I2C_SUPPORT=y in my next round of patches to reduce SPL size on mx6sabresd.

Thanks

#7 lore raw

PATCH v2 1/3 mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size

Quoted 11 lines · Fabio Estevam

Hi Ezequiel,

Quoted 3 lines · Ezequiel Garcia

Since we care about the SPL size, is there any reason why we have CONFIG_SPL_FS_EXT4?

AFAICS, u-boot.img is not on a filesystem, so why do we need ext2/3/4?

Yes, I will remove CONFIG_SPL_FS_EXT4 and CONFIG_SPL_I2C_SUPPORT=y in my next round of patches to reduce SPL size on mx6sabresd.

Perhaps instead of per-board, we can check the MX6 lot.

PS: Not needed on Wandboard either, and I found a way to move to TINY_MMC. Interestingly, and as we would expect, turning off EXT had more impact.

#8 lore raw

PATCH v2 1/3 mx6sabresd: Remove CONFIG_SPL_DM to

In reply to Fabio Estevam
Quoted 11 lines

Currently the mx6qsabresd board does not boot:
U-Boot SPL 2019.07-rc2 (May 16 2019 - 14:28:55 -0300) Trying to boot from MMC1
spl: could not find mmc device 0. error: -19
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
The reason for the boot failure is that that the SPL size got greater than the 68KB limit (4KB header + 64KB max size) as explained in include/configs/imx6_spl.h. Remove the CONFIG_SPL_DM option, so that the SPL binary could fit into the allowed size and the board can boot again.

Quoted 1 line

Applied to u-boot-imx, master, thanks !

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
=====================================================================