Skip to contentSkip to conversation

mx6sabreauto: Do not enable WEIM by default

PATCH New Fabio Estevam 2 participants 3 messages Jul 10, 2017 – Jul 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mx6sabreauto: Do not enable WEIM by default

From: Fabio Estevam <[email protected]>

WEIM cannot be used when I2C3 is enabled due to pin conflict, so keep WEIM disabled by default.

I2C3 controls GPIO I2C expander (USB host and OTG have VBUS controlled by the GPIO I2C expander), magnetometer, accelerometer.

Not disabling WEIM in U-Boot causes I2C3 to behave badly when booting a NXP 4.1 kernel, which leads to probe failure on several devices, including the lack of USB:

imx_usb 2184000.usb: Can't register ci_hdrc platform device, err=-517

By keeping WEIM disabled in U-Boot these kernel issues are gone.

---
 board/freescale/mx6sabreauto/mx6sabreauto.c | 9 ++++++++-
 configs/mx6sabreauto_defconfig              | 2 +-
 include/configs/mx6sabreauto.h              | 2 ++
 3 files changed, 11 insertions(+), 2 deletions(-)
board/freescale/mx6sabreauto/mx6sabreauto.c +8 -1
index 927ebe4..8faf479 100644
@@ -197,6 +197,7 @@ static int port_exp_direction_output(unsigned gpio, int value)
 	return 0;
 }
 
+#ifdef CONFIG_MTD_NOR_FLASH
 static iomux_v3_cfg_t const eimnor_pads[] = {
 	IOMUX_PADS(PAD_EIM_D16__EIM_DATA16	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL)),
 	IOMUX_PADS(PAD_EIM_D17__EIM_DATA17	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL)),
@@ -292,6 +293,7 @@ static void setup_iomux_eimnor(void)
 
 	eimnor_cs_setup();
 }
+#endif
 
 static void setup_iomux_enet(void)
 {
@@ -571,8 +573,10 @@ int board_early_init_f(void)
 #ifdef CONFIG_NAND_MXS
 	setup_gpmi_nand();
 #endif
-	eim_clk_setup();
 
+#ifdef CONFIG_MTD_NOR_FLASH
+	eim_clk_setup();
+#endif
 	return 0;
 }
 
@@ -601,7 +605,10 @@ int board_init(void)
 #ifdef CONFIG_VIDEO_IPUV3
 	setup_display();
 #endif
+
+#ifdef CONFIG_MTD_NOR_FLASH
 	setup_iomux_eimnor();
+#endif
 	return 0;
 }
 
configs/mx6sabreauto_defconfig +1 -1
index c1b3bbf..f8b2f7d 100644
@@ -38,7 +38,7 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_SF=y
-CONFIG_MTD_NOR_FLASH=y
+# CONFIG_MTD_NOR_FLASH is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_USB=y
include/configs/mx6sabreauto.h +2 -0
index fd0d5ce..2c08fd1 100644
@@ -31,6 +31,7 @@
 
 #include "mx6sabre_common.h"
 
+#ifdef CONFIG_MTD_NOR_FLASH
 #define CONFIG_SYS_FLASH_BASE           WEIM_ARB_BASE_ADDR
 #define CONFIG_SYS_FLASH_SECT_SIZE      (128 * 1024)
 #define CONFIG_SYS_MAX_FLASH_BANKS 1    /* max number of memory banks */
@@ -40,6 +41,7 @@
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE /* Use buffered writes*/
 #define CONFIG_SYS_FLASH_EMPTY_INFO
 #define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
+#endif
 
 #define CONFIG_SYS_FSL_USDHC_NUM	2
 #if defined(CONFIG_ENV_IS_IN_MMC)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 mx6sabre: Use PARTUUID to specify the rootfs location

From: Fabio Estevam <[email protected]>

mx6sabre boards can run different kernel versions, such as NXP 4.1 or mainline.

Currently the rootfs location is passed via mmcblk number and the problem with this approach is that the mmcblk number for the eMMC changes depending on the kernel version.

In order to avoid such issue, use UUID method to specify the rootfs location.

Succesfully tested booting a NXP 4.1 and also a mainline kernel on a mx6qsabresd and mx6dlsabreauto.

---
 configs/mx6sabreauto_defconfig    | 1 +
 configs/mx6sabresd_defconfig      | 1 +
 include/configs/mx6sabre_common.h | 5 +++--
 include/configs/mx6sabreauto.h    | 1 -
 include/configs/mx6sabresd.h      | 1 -
 5 files changed, 5 insertions(+), 4 deletions(-)
configs/mx6sabreauto_defconfig +1 -0
index f8b2f7d..73b81ea 100644
@@ -22,6 +22,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
+CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
configs/mx6sabresd_defconfig +1 -0
index a1d0c84..7adc7da 100644
@@ -23,6 +23,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
+CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
include/configs/mx6sabre_common.h +3 -2
index 9b0fe5a..d4e4628 100644
@@ -77,7 +77,7 @@
 	"initrd_high=0xffffffff\0" \
 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
 	"mmcpart=1\0" \
-	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
+	"finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
 	"update_sd_firmware=" \
 		"if test ${ip_dyn} = yes; then " \
 			"setenv get_cmd dhcp; " \
@@ -93,7 +93,7 @@
 		"fi\0" \
 	EMMC_ENV	  \
 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-		"root=${mmcroot}\0" \
+		"root=PARTUUID=${uuid} rootwait rw\0" \
 	"loadbootscript=" \
 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
 	"bootscript=echo Running bootscript from mmc ...; " \
@@ -101,6 +101,7 @@
 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
 	"mmcboot=echo Booting from mmc ...; " \
+		"run finduuid; " \
 		"run mmcargs; " \
 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
 			"if run loadfdt; then " \
include/configs/mx6sabreauto.h +0 -1
index 2c08fd1..1883eb0 100644
@@ -16,7 +16,6 @@
 #define CONFIG_MACH_TYPE	3529
 #define CONFIG_MXC_UART_BASE	UART4_BASE
 #define CONSOLE_DEV		"ttymxc3"
-#define CONFIG_MMCROOT			"/dev/mmcblk0p2"
 
 /* USB Configs */
 #define CONFIG_USB_HOST_ETHER
include/configs/mx6sabresd.h +0 -1
index 3eba70a..27e7672 100644
@@ -16,7 +16,6 @@
 #define CONFIG_MACH_TYPE	3980
 #define CONFIG_MXC_UART_BASE	UART1_BASE
 #define CONSOLE_DEV		"ttymxc0"
-#define CONFIG_MMCROOT			"/dev/mmcblk1p2"
 
 #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/2 mx6sabreauto: Do not enable WEIM by default

In reply to Fabio Estevam
Quoted 12 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

WEIM cannot be used when I2C3 is enabled due to pin conflict, so keep WEIM disabled by default.

I2C3 controls GPIO I2C expander (USB host and OTG have VBUS controlled by the GPIO I2C expander), magnetometer, accelerometer.

Not disabling WEIM in U-Boot causes I2C3 to behave badly when booting a NXP 4.1 kernel, which leads to probe failure on several devices, including the lack of USB:

Quoted 7 lines

imx_usb 2184000.usb: Can't register ci_hdrc platform device, err=-517

By keeping WEIM disabled in U-Boot these kernel issues are gone.

---

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