All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] arm, imx6: add support for SD/MMC Manufacture Mode
@ 2018-05-25 17:37 Jay Carlson
  0 siblings, 0 replies; 4+ messages in thread
From: Jay Carlson @ 2018-05-25 17:37 UTC (permalink / raw)
  To: u-boot

From: Jay Carlson <jcarlson@unl.edu>

This patch adds support for booting blank i.MX6 devices in SD/MMC Manufacture
Mode: a fallback mode which the boot ROM enters when no fuses or boot mode 
pins have been set, the USB serial downloader connection is inactive, and there
is an SD card inserted into uSDHC1. The i.MX7 and i.MX8, which both have 
a Boot_SW_Info data structure which can be parsed to determine boot source, is
unaffected by this patch.

Signed-off-by: Jay Carlson <jay.d.carlson@gmail.com>
---
 arch/arm/mach-imx/spl.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index a20b30d154..8ecae8605c 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -43,6 +43,16 @@ u32 spl_boot_device(void)
 	 */
 	if (is_usbotg_phy_active())
 		return BOOT_DEVICE_BOARD;
+	
+	/**
+	 * To support SD/MMC Manufacture Mode, we check that BOOT_MODE == 0
+	 * and that BT_FUSE_SEL == 0. If this was disabled via
+	 * blowing DISABLE_SDMMC_MFG, or if SDMMC MFG mode failed,
+	 * we would be in USB download mode, which the previous line would 
+	 * have detected.
+	 */
+	if (((bmode >> 24) & 0x03) == 0x00 && (bmode >> 4) == 0x00)
+		return BOOT_DEVICE_MMC1;
 
 	/* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
 	switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
-- 
2.16.1.windows.4

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

* [U-Boot] [PATCH v2] arm, imx6: add support for SD/MMC Manufacture Mode
  2018-06-22  5:16 Jay Carlson
@ 2018-07-23  8:46 ` Stefano Babic
  0 siblings, 0 replies; 4+ messages in thread
From: Stefano Babic @ 2018-07-23  8:46 UTC (permalink / raw)
  To: u-boot

Hi Jay,

On 22/06/2018 07:16, Jay Carlson wrote:
> This patch adds support for booting blank i.MX6 devices in SD/MMC Manufacture
> Mode: a fallback mode which the boot ROM enters when no fuses or boot mode 
> pins have been set, the USB serial downloader connection is inactive, and there
> is an SD card inserted into uSDHC1. The i.MX7 and i.MX8, which both have 
> a Boot_SW_Info data structure which can be parsed to determine boot source, is
> unaffected by this patch.
> 
> Signed-off-by: Jay Carlson <jay.d.carlson@gmail.com>
> ---
>  arch/arm/mach-imx/spl.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
> index a20b30d154..8ecae8605c 100644
> --- a/arch/arm/mach-imx/spl.c
> +++ b/arch/arm/mach-imx/spl.c
> @@ -43,6 +43,16 @@ u32 spl_boot_device(void)
>  	 */
>  	if (is_usbotg_phy_active())
>  		return BOOT_DEVICE_BOARD;
> +	
> +	/**
> +	 * To support SD/MMC Manufacture Mode, we check that BOOT_MODE == 0
> +	 * and that BT_FUSE_SEL == 0. If this was disabled via
> +	 * blowing DISABLE_SDMMC_MFG, or if SDMMC MFG mode failed,
> +	 * we would be in USB download mode, which the previous line would 
> +	 * have detected.
> +	 */
> +	if (((bmode >> 24) & 0x03) == 0x00 && (bmode >> 4) == 0x00)
> +		return BOOT_DEVICE_MMC1;
>  
>  	/* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
>  	switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
> 

This looks to me a fix for a custom board, but it does not seem that can
be applied general for all devices. I understand that this works in your
use case, where you have soldered eMMC and in factory you install the
software via SD card. But this is one use case.

Your change goes into general code (mach-imx/spl.c), and then it can
breaks many projects. You coul write your board_boot_order() in your
boot code to set the order of the device to be booted.

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] 4+ messages in thread

* [U-Boot] [PATCH v2] arm, imx6: add support for SD/MMC Manufacture Mode
@ 2018-06-22  5:16 Jay Carlson
  2018-07-23  8:46 ` Stefano Babic
  0 siblings, 1 reply; 4+ messages in thread
From: Jay Carlson @ 2018-06-22  5:16 UTC (permalink / raw)
  To: u-boot

This patch adds support for booting blank i.MX6 devices in SD/MMC Manufacture
Mode: a fallback mode which the boot ROM enters when no fuses or boot mode 
pins have been set, the USB serial downloader connection is inactive, and there
is an SD card inserted into uSDHC1. The i.MX7 and i.MX8, which both have 
a Boot_SW_Info data structure which can be parsed to determine boot source, is
unaffected by this patch.

Signed-off-by: Jay Carlson <jay.d.carlson@gmail.com>
---
 arch/arm/mach-imx/spl.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index a20b30d154..8ecae8605c 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -43,6 +43,16 @@ u32 spl_boot_device(void)
 	 */
 	if (is_usbotg_phy_active())
 		return BOOT_DEVICE_BOARD;
+	
+	/**
+	 * To support SD/MMC Manufacture Mode, we check that BOOT_MODE == 0
+	 * and that BT_FUSE_SEL == 0. If this was disabled via
+	 * blowing DISABLE_SDMMC_MFG, or if SDMMC MFG mode failed,
+	 * we would be in USB download mode, which the previous line would 
+	 * have detected.
+	 */
+	if (((bmode >> 24) & 0x03) == 0x00 && (bmode >> 4) == 0x00)
+		return BOOT_DEVICE_MMC1;
 
 	/* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
 	switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
-- 
2.16.1.windows.4

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

* [U-Boot] [PATCH v2] arm, imx6: add support for SD/MMC Manufacture Mode
@ 2018-06-22  5:12 Jay Carlson
  0 siblings, 0 replies; 4+ messages in thread
From: Jay Carlson @ 2018-06-22  5:12 UTC (permalink / raw)
  To: u-boot

From: Jay Carlson <jcarlson@unl.edu>

This patch adds support for booting blank i.MX6 devices in SD/MMC Manufacture
Mode: a fallback mode which the boot ROM enters when no fuses or boot mode 
pins have been set, the USB serial downloader connection is inactive, and there
is an SD card inserted into uSDHC1. The i.MX7 and i.MX8, which both have 
a Boot_SW_Info data structure which can be parsed to determine boot source, is
unaffected by this patch.

Signed-off-by: Jay Carlson <jay.d.carlson@gmail.com>
---
 arch/arm/mach-imx/spl.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index a20b30d154..8ecae8605c 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -43,6 +43,16 @@ u32 spl_boot_device(void)
 	 */
 	if (is_usbotg_phy_active())
 		return BOOT_DEVICE_BOARD;
+	
+	/**
+	 * To support SD/MMC Manufacture Mode, we check that BOOT_MODE == 0
+	 * and that BT_FUSE_SEL == 0. If this was disabled via
+	 * blowing DISABLE_SDMMC_MFG, or if SDMMC MFG mode failed,
+	 * we would be in USB download mode, which the previous line would 
+	 * have detected.
+	 */
+	if (((bmode >> 24) & 0x03) == 0x00 && (bmode >> 4) == 0x00)
+		return BOOT_DEVICE_MMC1;
 
 	/* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
 	switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
-- 
2.16.1.windows.4

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

end of thread, other threads:[~2018-07-23  8:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-25 17:37 [U-Boot] [PATCH v2] arm, imx6: add support for SD/MMC Manufacture Mode Jay Carlson
2018-06-22  5:12 Jay Carlson
2018-06-22  5:16 Jay Carlson
2018-07-23  8:46 ` Stefano Babic

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.