All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size
@ 2019-05-21 13:37 Fabio Estevam
  2019-05-21 13:37 ` [U-Boot] [PATCH v2 2/3] mx6sabresd: Select pinctrl driver Fabio Estevam
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Fabio Estevam @ 2019-05-21 13:37 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
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(-)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index d3ed3c4543..5c2d055561 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -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
-- 
2.17.1

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

* [U-Boot] [PATCH v2 2/3] mx6sabresd: Select pinctrl driver
  2019-05-21 13:37 [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size Fabio Estevam
@ 2019-05-21 13:37 ` Fabio Estevam
  2019-06-10  9:49   ` sbabic at denx.de
  2019-05-21 13:37 ` [U-Boot] [PATCH v2 3/3] mx6sabresd: Remove U-Boot proper mmc initialization Fabio Estevam
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2019-05-21 13:37 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v1:
- None

 configs/mx6sabresd_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 5c2d055561..f7ba632b2a 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -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
-- 
2.17.1

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

* [U-Boot] [PATCH v2 3/3] mx6sabresd: Remove U-Boot proper mmc initialization
  2019-05-21 13:37 [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size Fabio Estevam
  2019-05-21 13:37 ` [U-Boot] [PATCH v2 2/3] mx6sabresd: Select pinctrl driver Fabio Estevam
@ 2019-05-21 13:37 ` Fabio Estevam
  2019-06-10  9:40   ` [U-Boot] [PATCH v2 3/3] mx6sabresd: Remove U-Boot proper mmc sbabic at denx.de
  2019-05-24 21:31 ` [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size Ezequiel Garcia
  2019-06-10  9:39 ` [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to sbabic at denx.de
  3 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2019-05-21 13:37 UTC (permalink / raw)
  To: u-boot

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

Remove the unneeded code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v1:
- None

 board/freescale/mx6sabresd/mx6sabresd.c | 44 -------------------------
 1 file changed, 44 deletions(-)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c
index 385a18e923..cdfc5ff77f 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -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
 
-- 
2.17.1

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

* [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size
  2019-05-21 13:37 [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size Fabio Estevam
  2019-05-21 13:37 ` [U-Boot] [PATCH v2 2/3] mx6sabresd: Select pinctrl driver Fabio Estevam
  2019-05-21 13:37 ` [U-Boot] [PATCH v2 3/3] mx6sabresd: Remove U-Boot proper mmc initialization Fabio Estevam
@ 2019-05-24 21:31 ` Ezequiel Garcia
  2019-05-24 21:41   ` Fabio Estevam
  2019-06-10  9:39 ` [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to sbabic at denx.de
  3 siblings, 1 reply; 9+ messages in thread
From: Ezequiel Garcia @ 2019-05-24 21:31 UTC (permalink / raw)
  To: u-boot

On Tue, 2019-05-21 at 10:37 -0300, Fabio Estevam wrote:
> 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.
> 
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
> 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(-)
> 
> diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
> index d3ed3c4543..5c2d055561 100644
> --- a/configs/mx6sabresd_defconfig
> +++ b/configs/mx6sabresd_defconfig
> @@ -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

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

* [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size
  2019-05-24 21:31 ` [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size Ezequiel Garcia
@ 2019-05-24 21:41   ` Fabio Estevam
  2019-05-24 22:36     ` Ezequiel Garcia
  0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2019-05-24 21:41 UTC (permalink / raw)
  To: u-boot

Hi Ezequiel,

On Fri, May 24, 2019 at 6:31 PM Ezequiel Garcia <ezequiel@collabora.com> wrote:

> 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

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

* [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size
  2019-05-24 21:41   ` Fabio Estevam
@ 2019-05-24 22:36     ` Ezequiel Garcia
  0 siblings, 0 replies; 9+ messages in thread
From: Ezequiel Garcia @ 2019-05-24 22:36 UTC (permalink / raw)
  To: u-boot

On Fri, 2019-05-24 at 18:41 -0300, Fabio Estevam wrote:
> Hi Ezequiel,
> 
> On Fri, May 24, 2019 at 6:31 PM Ezequiel Garcia <ezequiel@collabora.com> wrote:
> 
> > 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.

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

* [U-Boot]  [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to
  2019-05-21 13:37 [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size Fabio Estevam
                   ` (2 preceding siblings ...)
  2019-05-24 21:31 ` [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size Ezequiel Garcia
@ 2019-06-10  9:39 ` sbabic at denx.de
  3 siblings, 0 replies; 9+ messages in thread
From: sbabic at denx.de @ 2019-06-10  9:39 UTC (permalink / raw)
  To: u-boot

> 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.
> Signed-off-by: Fabio Estevam <festevam@gmail.com>

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

Best regards,
Stefano Babic

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

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

* [U-Boot]  [PATCH v2 3/3] mx6sabresd: Remove U-Boot proper mmc
  2019-05-21 13:37 ` [U-Boot] [PATCH v2 3/3] mx6sabresd: Remove U-Boot proper mmc initialization Fabio Estevam
@ 2019-06-10  9:40   ` sbabic at denx.de
  0 siblings, 0 replies; 9+ messages in thread
From: sbabic at denx.de @ 2019-06-10  9:40 UTC (permalink / raw)
  To: u-boot

> After the conversion to DM there is no need to have mmc initialization
> code inside U-Boot proper.
> Remove the unneeded code.
> Signed-off-by: Fabio Estevam <festevam@gmail.com>

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

Best regards,
Stefano Babic

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

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

* [U-Boot]  [PATCH v2 2/3] mx6sabresd: Select pinctrl driver
  2019-05-21 13:37 ` [U-Boot] [PATCH v2 2/3] mx6sabresd: Select pinctrl driver Fabio Estevam
@ 2019-06-10  9:49   ` sbabic at denx.de
  0 siblings, 0 replies; 9+ messages in thread
From: sbabic at denx.de @ 2019-06-10  9:49 UTC (permalink / raw)
  To: u-boot

> With the conversion to DM we should select the pinctrl driver.
> Signed-off-by: Fabio Estevam <festevam@gmail.com>

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

Best regards,
Stefano Babic

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

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

end of thread, other threads:[~2019-06-10  9:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-21 13:37 [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size Fabio Estevam
2019-05-21 13:37 ` [U-Boot] [PATCH v2 2/3] mx6sabresd: Select pinctrl driver Fabio Estevam
2019-06-10  9:49   ` sbabic at denx.de
2019-05-21 13:37 ` [U-Boot] [PATCH v2 3/3] mx6sabresd: Remove U-Boot proper mmc initialization Fabio Estevam
2019-06-10  9:40   ` [U-Boot] [PATCH v2 3/3] mx6sabresd: Remove U-Boot proper mmc sbabic at denx.de
2019-05-24 21:31 ` [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to decrease the SPL size Ezequiel Garcia
2019-05-24 21:41   ` Fabio Estevam
2019-05-24 22:36     ` Ezequiel Garcia
2019-06-10  9:39 ` [U-Boot] [PATCH v2 1/3] mx6sabresd: Remove CONFIG_SPL_DM to sbabic at denx.de

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.