All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 0/8] Pending patches for merging
@ 2013-12-16 22:43 Otavio Salvador
  2013-12-16 22:43 ` [U-Boot] [PATCH v3 1/8] wandboard: add Future Eletronics 7" WVGA LCD extension board Otavio Salvador
                   ` (7 more replies)
  0 siblings, 8 replies; 25+ messages in thread
From: Otavio Salvador @ 2013-12-16 22:43 UTC (permalink / raw)
  To: u-boot

This sends all the patches I've been keeping in my tree and are awaiting to be
applied. Basically:

 * Wandboard LCD support and environment changes
 * mx28evk environment changes
 * SabreSD eMMC installation support
 * IOMUX fix
 * FDT loadaddr fix
 * FEC Anatop clock fix

Changes in v3:
- rebased on imx/master
- new patch

Changes in v2:
- Change loadaddr to allow use with more than 1G of RAM

Otavio Salvador (8):
  wandboard: add Future Eletronics 7" WVGA LCD extension board
  mx6sabresd: Add eMMC specific environment to allow U-Boot update
  imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro
  mx28evk: Use 512k for fdt partition to align it
  mx28evk: Add 'nandboot' environment command
  mx28evk: Extend environment to easy write of NAND system
  ARM: mx6: Change the FDT loading address to avoid overlaping
  ARM: mx6: Allow enablement of FEC Anatop based clock for all MX6

 arch/arm/cpu/armv7/mx6/clock.c             |  21 +--
 arch/arm/include/asm/imx-common/iomux-v3.h |   2 +
 board/wandboard/wandboard.c                | 240 ++++++++++++++++++++++++++---
 include/configs/cgtqmx6eval.h              |   2 +-
 include/configs/mx28evk.h                  |  55 ++++++-
 include/configs/mx6sabre_common.h          |  25 ++-
 include/configs/mx6sabresd.h               |   2 +
 include/configs/nitrogen6x.h               |   2 +-
 include/configs/udoo.h                     |   2 +-
 include/configs/wandboard.h                |  37 ++++-
 10 files changed, 346 insertions(+), 42 deletions(-)

-- 
1.8.4.3

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

* [U-Boot] [PATCH v3 1/8] wandboard: add Future Eletronics 7" WVGA LCD extension board
  2013-12-16 22:43 [U-Boot] [PATCH v3 0/8] Pending patches for merging Otavio Salvador
@ 2013-12-16 22:43 ` Otavio Salvador
  2013-12-19 10:36   ` Stefano Babic
  2013-12-16 22:43 ` [U-Boot] [PATCH v3 2/8] mx6sabresd: Add eMMC specific environment to allow U-Boot update Otavio Salvador
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: Otavio Salvador @ 2013-12-16 22:43 UTC (permalink / raw)
  To: u-boot

This adds support for the 7" WVGA produced by Future Eletronics and
make it dynamically detect if it is connected or not based on the
touchscreen controller.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes in v3:
- rebased on imx/master

Changes in v2: None

 board/wandboard/wandboard.c | 240 +++++++++++++++++++++++++++++++++++++++-----
 include/configs/wandboard.h |  35 ++++++-
 2 files changed, 251 insertions(+), 24 deletions(-)

diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
index 0043bc6..7debf30 100644
--- a/board/wandboard/wandboard.c
+++ b/board/wandboard/wandboard.c
@@ -15,6 +15,7 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/gpio.h>
 #include <asm/imx-common/iomux-v3.h>
+#include <asm/imx-common/mxc_i2c.h>
 #include <asm/imx-common/boot_mode.h>
 #include <asm/io.h>
 #include <asm/sizes.h>
@@ -25,6 +26,7 @@
 #include <miiphy.h>
 #include <netdev.h>
 #include <linux/fb.h>
+#include <i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -39,6 +41,10 @@ DECLARE_GLOBAL_DATA_PTR;
 #define ENET_PAD_CTRL  (PAD_CTL_PUS_100K_UP |			\
 	PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
 
+#define I2C_PAD_CTRL	(PAD_CTL_PUS_100K_UP |			\
+	PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS |	\
+	PAD_CTL_ODE | PAD_CTL_SRE_FAST)
+
 #define USDHC1_CD_GPIO		IMX_GPIO_NR(1, 2)
 #define USDHC3_CD_GPIO		IMX_GPIO_NR(3, 9)
 #define ETH_PHY_RESET		IMX_GPIO_NR(3, 29)
@@ -208,50 +214,236 @@ int board_phy_config(struct phy_device *phydev)
 }
 
 #if defined(CONFIG_VIDEO_IPUV3)
-static struct fb_videomode const hdmi = {
-	.name           = "HDMI",
-	.refresh        = 60,
-	.xres           = 1024,
-	.yres           = 768,
-	.pixclock       = 15385,
-	.left_margin    = 220,
-	.right_margin   = 40,
-	.upper_margin   = 21,
-	.lower_margin   = 7,
-	.hsync_len      = 60,
-	.vsync_len      = 10,
-	.sync           = FB_SYNC_EXT,
-	.vmode          = FB_VMODE_NONINTERLACED
+struct i2c_pads_info i2c_pad_info = {
+	.scl = {
+		.i2c_mode = MX6_PAD_KEY_COL3__I2C2_SCL
+			| MUX_PAD_CTRL(I2C_PAD_CTRL),
+		.gpio_mode = MX6_PAD_KEY_COL3__GPIO4_IO12
+			| MUX_PAD_CTRL(I2C_PAD_CTRL),
+		.gp = IMX_GPIO_NR(4, 12)
+	},
+	.sda = {
+		.i2c_mode = MX6_PAD_KEY_ROW3__I2C2_SDA
+			| MUX_PAD_CTRL(I2C_PAD_CTRL),
+		.gpio_mode = MX6_PAD_KEY_ROW3__GPIO4_IO13
+			| MUX_PAD_CTRL(I2C_PAD_CTRL),
+		.gp = IMX_GPIO_NR(4, 13)
+	}
 };
 
-int board_video_skip(void)
-{
-	int ret;
+static iomux_v3_cfg_t const fwadapt_7wvga_pads[] = {
+	MX6_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK,
+	MX6_PAD_DI0_PIN2__IPU1_DI0_PIN02, /* HSync */
+	MX6_PAD_DI0_PIN3__IPU1_DI0_PIN03, /* VSync */
+	MX6_PAD_DI0_PIN4__IPU1_DI0_PIN04
+		| MUX_PAD_CTRL(PAD_CTL_DSE_120ohm), /* Contrast */
+	MX6_PAD_DI0_PIN15__IPU1_DI0_PIN15, /* DISP0_DRDY */
+
+	MX6_PAD_DISP0_DAT0__IPU1_DISP0_DATA00,
+	MX6_PAD_DISP0_DAT1__IPU1_DISP0_DATA01,
+	MX6_PAD_DISP0_DAT2__IPU1_DISP0_DATA02,
+	MX6_PAD_DISP0_DAT3__IPU1_DISP0_DATA03,
+	MX6_PAD_DISP0_DAT4__IPU1_DISP0_DATA04,
+	MX6_PAD_DISP0_DAT5__IPU1_DISP0_DATA05,
+	MX6_PAD_DISP0_DAT6__IPU1_DISP0_DATA06,
+	MX6_PAD_DISP0_DAT7__IPU1_DISP0_DATA07,
+	MX6_PAD_DISP0_DAT8__IPU1_DISP0_DATA08,
+	MX6_PAD_DISP0_DAT9__IPU1_DISP0_DATA09,
+	MX6_PAD_DISP0_DAT10__IPU1_DISP0_DATA10,
+	MX6_PAD_DISP0_DAT11__IPU1_DISP0_DATA11,
+	MX6_PAD_DISP0_DAT12__IPU1_DISP0_DATA12,
+	MX6_PAD_DISP0_DAT13__IPU1_DISP0_DATA13,
+	MX6_PAD_DISP0_DAT14__IPU1_DISP0_DATA14,
+	MX6_PAD_DISP0_DAT15__IPU1_DISP0_DATA15,
+	MX6_PAD_DISP0_DAT16__IPU1_DISP0_DATA16,
+	MX6_PAD_DISP0_DAT17__IPU1_DISP0_DATA17,
+
+	MX6_PAD_SD4_DAT2__GPIO2_IO10
+		| MUX_PAD_CTRL(NO_PAD_CTRL), /* DISP0_BKLEN */
+	MX6_PAD_SD4_DAT3__GPIO2_IO11
+		| MUX_PAD_CTRL(NO_PAD_CTRL), /* DISP0_VDDEN */
+};
 
-	ret = ipuv3_fb_init(&hdmi, 0, IPU_PIX_FMT_RGB24);
+struct display_info_t {
+	int	bus;
+	int	addr;
+	int	pixfmt;
+	int	(*detect)(struct display_info_t const *dev);
+	void	(*enable)(struct display_info_t const *dev);
+	struct	fb_videomode mode;
+};
 
-	if (ret) {
-		printf("HDMI cannot be configured: %d\n", ret);
-		return ret;
-	}
+static int detect_hdmi(struct display_info_t const *dev)
+{
+	struct hdmi_regs *hdmi	= (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
+	return readb(&hdmi->phy_stat0) & HDMI_DVI_STAT;
+}
 
+static void do_enable_hdmi(struct display_info_t const *dev)
+{
 	imx_enable_hdmi_phy();
+}
 
-	return ret;
+static int detect_i2c(struct display_info_t const *dev)
+{
+	return ((0 == i2c_set_bus_num(dev->bus)) &&
+			(0 == i2c_probe(dev->addr)));
+}
+
+static void enable_fwadapt_7wvga(struct display_info_t const *dev)
+{
+	imx_iomux_v3_setup_multiple_pads(
+		fwadapt_7wvga_pads,
+		ARRAY_SIZE(fwadapt_7wvga_pads));
+
+	gpio_direction_output(IMX_GPIO_NR(2, 10), 1);
+	gpio_direction_output(IMX_GPIO_NR(2, 11), 1);
+}
+
+static struct display_info_t const displays[] = {{
+	.bus	= -1,
+	.addr	= 0,
+	.pixfmt	= IPU_PIX_FMT_RGB24,
+	.detect	= detect_hdmi,
+	.enable	= do_enable_hdmi,
+	.mode	= {
+		.name           = "HDMI",
+		.refresh        = 60,
+		.xres           = 1024,
+		.yres           = 768,
+		.pixclock       = 15385,
+		.left_margin    = 220,
+		.right_margin   = 40,
+		.upper_margin   = 21,
+		.lower_margin   = 7,
+		.hsync_len      = 60,
+		.vsync_len      = 10,
+		.sync           = FB_SYNC_EXT,
+		.vmode          = FB_VMODE_NONINTERLACED
+} }, {
+	.bus	= 0,
+	.addr	= 0x10,
+	.pixfmt	= IPU_PIX_FMT_RGB666,
+	.detect	= detect_i2c,
+	.enable	= enable_fwadapt_7wvga,
+	.mode	= {
+		.name           = "FWBADAPT-LCD-F07A-0102",
+		.refresh        = 60,
+		.xres           = 800,
+		.yres           = 480,
+		.pixclock       = 33260,
+		.left_margin    = 128,
+		.right_margin   = 128,
+		.upper_margin   = 22,
+		.lower_margin   = 22,
+		.hsync_len      = 1,
+		.vsync_len      = 1,
+		.sync           = 0,
+		.vmode          = FB_VMODE_NONINTERLACED
+} } };
+
+int board_video_skip(void)
+{
+	int i;
+	int ret;
+	int detected = 0;
+	char const *panel = getenv("panel");
+	if (!panel) {
+		for (i = 0; i < ARRAY_SIZE(displays); i++) {
+			struct display_info_t const *dev = displays+i;
+			if (dev->detect && dev->detect(dev)) {
+				panel = dev->mode.name;
+				detected = 1;
+				break;
+			}
+		}
+		if (!panel) {
+			panel = displays[0].mode.name;
+			printf("No panel detected: default to %s\n", panel);
+			i = 0;
+		}
+	} else {
+		for (i = 0; i < ARRAY_SIZE(displays); i++) {
+			if (!strcmp(panel, displays[i].mode.name))
+				break;
+		}
+	}
+	if (i < ARRAY_SIZE(displays)) {
+		ret = ipuv3_fb_init(&displays[i].mode, 0,
+				    displays[i].pixfmt);
+
+		if (!ret) {
+			displays[i].enable(displays+i);
+			printf("Display: %s (%ux%u) %s\n",
+			       displays[i].mode.name,
+			       displays[i].mode.xres,
+			       displays[i].mode.yres,
+			       (detected ? "[auto]" : ""));
+		} else
+			printf("LCD %s cannot be configured: %d\n",
+			       displays[i].mode.name, ret);
+	} else {
+		printf("unsupported panel %s\n", panel);
+		return -EINVAL;
+	}
+
+	return 0;
 }
 
 static void setup_display(void)
 {
 	struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+	struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
 	int reg;
 
 	enable_ipu_clock();
 	imx_setup_hdmi();
 
+	/* Turn on LDB0, LDB1, IPU,IPU DI0 clocks */
+	reg = __raw_readl(&mxc_ccm->CCGR3);
+	reg |=  MXC_CCM_CCGR3_LDB_DI0_MASK | MXC_CCM_CCGR3_LDB_DI1_MASK;
+	writel(reg, &mxc_ccm->CCGR3);
+
+	/* set LDB0, LDB1 clk select to 011/011 */
+	reg = readl(&mxc_ccm->cs2cdr);
+	reg &= ~(MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK
+		 | MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK);
+	reg |= (3 << MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_OFFSET)
+	      | (3 << MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_OFFSET);
+	writel(reg, &mxc_ccm->cs2cdr);
+
+	reg = readl(&mxc_ccm->cscmr2);
+	reg |= MXC_CCM_CSCMR2_LDB_DI0_IPU_DIV | MXC_CCM_CSCMR2_LDB_DI1_IPU_DIV;
+	writel(reg, &mxc_ccm->cscmr2);
+
 	reg = readl(&mxc_ccm->chsccdr);
 	reg |= (CHSCCDR_CLK_SEL_LDB_DI0
 		<< MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET);
+	reg |= (CHSCCDR_CLK_SEL_LDB_DI0
+		<< MXC_CCM_CHSCCDR_IPU1_DI1_CLK_SEL_OFFSET);
 	writel(reg, &mxc_ccm->chsccdr);
+
+	reg = IOMUXC_GPR2_BGREF_RRMODE_EXTERNAL_RES
+	     | IOMUXC_GPR2_DI1_VS_POLARITY_ACTIVE_LOW
+	     | IOMUXC_GPR2_DI0_VS_POLARITY_ACTIVE_LOW
+	     | IOMUXC_GPR2_BIT_MAPPING_CH1_SPWG
+	     | IOMUXC_GPR2_DATA_WIDTH_CH1_18BIT
+	     | IOMUXC_GPR2_BIT_MAPPING_CH0_SPWG
+	     | IOMUXC_GPR2_DATA_WIDTH_CH0_18BIT
+	     | IOMUXC_GPR2_LVDS_CH0_MODE_DISABLED
+	     | IOMUXC_GPR2_LVDS_CH1_MODE_ENABLED_DI0;
+	writel(reg, &iomux->gpr[2]);
+
+	reg = readl(&iomux->gpr[3]);
+	reg = (reg & ~(IOMUXC_GPR3_LVDS1_MUX_CTL_MASK
+			| IOMUXC_GPR3_HDMI_MUX_CTL_MASK))
+	    | (IOMUXC_GPR3_MUX_SRC_IPU1_DI0
+	       << IOMUXC_GPR3_LVDS1_MUX_CTL_OFFSET);
+	writel(reg, &iomux->gpr[3]);
+
+	/* Disable LCD backlight */
+	imx_iomux_v3_setup_pad(MX6_PAD_DI0_PIN4__GPIO4_IO20);
+	gpio_direction_input(IMX_GPIO_NR(4, 20));
 }
 #endif /* CONFIG_VIDEO_IPUV3 */
 
@@ -309,6 +501,8 @@ int board_init(void)
 	/* address of boot parameters */
 	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
+	setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info);
+
 	return 0;
 }
 
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index e9c7e64..85f3c16 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -55,6 +55,12 @@
 #define CONFIG_LOADADDR			0x12000000
 #define CONFIG_SYS_TEXT_BASE		0x17800000
 
+/* I2C Configs */
+#define CONFIG_CMD_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_MXC
+#define CONFIG_SYS_I2C_SPEED		100000
+
 /* MMC Configuration */
 #define CONFIG_FSL_ESDHC
 #define CONFIG_FSL_USDHC
@@ -97,6 +103,7 @@
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_BMP_LOGO
 #define CONFIG_IPUV3_CLK 260000000
+#define CONFIG_CMD_HDMIDETECT
 #define CONFIG_IMX_HDMI
 
 #if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
@@ -134,7 +141,33 @@
 			"fi; "	\
 		"fi\0" \
 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-		"root=${mmcroot}\0" \
+		"root=${mmcroot}; run videoargs\0" \
+	"videoargs=" \
+		"setenv nextcon 0; " \
+		"if hdmidet; then " \
+			"setenv bootargs ${bootargs} " \
+				"video=mxcfb${nextcon}:dev=hdmi,1280x720M at 60," \
+					"if=RGB24; " \
+			"setenv fbmen fbmem=28M; " \
+			"setexpr nextcon ${nextcon} + 1; " \
+		"else " \
+			"echo - no HDMI monitor;" \
+		"fi; " \
+		"i2c dev 0; " \
+		"if i2c probe 0x10; then " \
+			"setenv bootargs ${bootargs} " \
+				"video=mxcfb${nextcon}:dev=lcd,800x480 at 60," \
+					"if=RGB666; " \
+			"if test 0 -eq ${nextcon}; then " \
+				"setenv fbmem fbmem=10M; " \
+			"else " \
+				"setenv fbmem ${fbmem},10M; " \
+			"fi; " \
+			"setexpr nextcon ${nextcon} + 1; " \
+		"else " \
+			"echo '- no FWBADAPT-7WVGA-LCD-F07A-0102 display';" \
+		"fi; " \
+		"setenv bootargs ${bootargs} ${fbmem}\0" \
 	"loadbootscript=" \
 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
 	"bootscript=echo Running bootscript from mmc ...; " \
-- 
1.8.4.3

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

* [U-Boot] [PATCH v3 2/8] mx6sabresd: Add eMMC specific environment to allow U-Boot update
  2013-12-16 22:43 [U-Boot] [PATCH v3 0/8] Pending patches for merging Otavio Salvador
  2013-12-16 22:43 ` [U-Boot] [PATCH v3 1/8] wandboard: add Future Eletronics 7" WVGA LCD extension board Otavio Salvador
@ 2013-12-16 22:43 ` Otavio Salvador
  2014-01-03 14:30   ` Stefano Babic
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 3/8] imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro Otavio Salvador
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: Otavio Salvador @ 2013-12-16 22:43 UTC (permalink / raw)
  To: u-boot

A new 'update_emmc_firmware' target is added to allow for easy U-Boot
update in the eMMC as it has secury boot partition and this needs
specific handling on how to program the specific partition.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes in v3: None
Changes in v2: None

 include/configs/mx6sabre_common.h | 23 +++++++++++++++++++++++
 include/configs/mx6sabresd.h      |  2 ++
 2 files changed, 25 insertions(+)

diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h
index d52c9a8..a214324 100644
--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -90,6 +90,28 @@
 #define CONFIG_LOADADDR                        0x12000000
 #define CONFIG_SYS_TEXT_BASE           0x17800000
 
+#ifdef CONFIG_SUPPORT_EMMC_BOOT
+#define EMMC_ENV \
+	"emmcdev=2\0" \
+	"update_emmc_firmware=" \
+		"if test ${ip_dyn} = yes; then " \
+			"setenv get_cmd dhcp; " \
+		"else " \
+			"setenv get_cmd tftp; " \
+		"fi; " \
+		"if ${get_cmd} ${update_sd_firmware_filename}; then " \
+			"if mmc dev ${emmcdev} && " \
+				"mmc open ${emmcdev} 1; then "	\
+				"setexpr fw_sz ${filesize} / 0x200; " \
+				"setexpr fw_sz ${fw_sz} + 1; "	\
+				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
+				"mmc close ${emmcdev} 1; " \
+			"fi; "	\
+		"fi\0"
+#else
+#define EMMC_DEV ""
+#endif
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"script=boot.scr\0" \
 	"uimage=uImage\0" \
@@ -116,6 +138,7 @@
 				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
 			"fi; "	\
 		"fi\0" \
+	EMMC_ENV	  \
 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
 		"root=${mmcroot}\0" \
 	"loadbootscript=" \
diff --git a/include/configs/mx6sabresd.h b/include/configs/mx6sabresd.h
index 3229bc7..7653ecb 100644
--- a/include/configs/mx6sabresd.h
+++ b/include/configs/mx6sabresd.h
@@ -30,6 +30,8 @@
 #define CONFIG_SYS_MMC_ENV_DEV		1	/* SDHC3 */
 #endif
 
+#define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
+
 /* Framebuffer */
 #define CONFIG_VIDEO
 #define CONFIG_VIDEO_IPUV3
-- 
1.8.4.3

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

* [U-Boot] [PATCH v3 3/8] imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro
  2013-12-16 22:43 [U-Boot] [PATCH v3 0/8] Pending patches for merging Otavio Salvador
  2013-12-16 22:43 ` [U-Boot] [PATCH v3 1/8] wandboard: add Future Eletronics 7" WVGA LCD extension board Otavio Salvador
  2013-12-16 22:43 ` [U-Boot] [PATCH v3 2/8] mx6sabresd: Add eMMC specific environment to allow U-Boot update Otavio Salvador
@ 2013-12-16 22:44 ` Otavio Salvador
  2013-12-19 10:40   ` Stefano Babic
  2014-01-03 14:30   ` Stefano Babic
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 4/8] mx28evk: Use 512k for fdt partition to align it Otavio Salvador
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 25+ messages in thread
From: Otavio Salvador @ 2013-12-16 22:44 UTC (permalink / raw)
  To: u-boot

The macro allows easy setting in per-pin, as for example:

,----
| imx_iomux_v3_setup_pad(MX6_PAD_NANDF_D1__GPIO_2_1 | MUX_MODE_SION);
`----

The IOMUX_CONFIG_SION allows for reading PAD value from PSR register.

The following quote from the datasheet:

,----
| ...
| 28.4.2.2 GPIO Write Mode
| The programming sequence for driving output signals should be as follows:
| 1. Configure IOMUX to select GPIO mode (Via IOMUXC), also enable SION if need
| to read loopback pad value through PSR
| 2. Configure GPIO direction register to output (GPIO_GDIR[GDIR] set to 1b).
| 3. Write value to data register (GPIO_DR).
| ...
`----

This fixes the gpio_get_value to properly work when a GPIO is set for
output and has no conflicts.

Thanks for Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>, Fabio
Estevam <fabio.estevam@freescale.com> and Eric B?nard
<eric@eukrea.com> for helping to properly trace this down.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes in v3: None
Changes in v2: None

 arch/arm/include/asm/imx-common/iomux-v3.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/include/asm/imx-common/iomux-v3.h b/arch/arm/include/asm/imx-common/iomux-v3.h
index dc2b3ef..dec11a1 100644
--- a/arch/arm/include/asm/imx-common/iomux-v3.h
+++ b/arch/arm/include/asm/imx-common/iomux-v3.h
@@ -63,6 +63,8 @@ typedef u64 iomux_v3_cfg_t;
 #define MUX_SEL_INPUT_SHIFT	59
 #define MUX_SEL_INPUT_MASK	((iomux_v3_cfg_t)0xf << MUX_SEL_INPUT_SHIFT)
 
+#define MUX_MODE_SION		((iomux_v3_cfg_t)IOMUX_CONFIG_SION << \
+	MUX_MODE_SHIFT)
 #define MUX_PAD_CTRL(x)		((iomux_v3_cfg_t)(x) << MUX_PAD_CTRL_SHIFT)
 
 #define IOMUX_PAD(pad_ctrl_ofs, mux_ctrl_ofs, mux_mode, sel_input_ofs,	\
-- 
1.8.4.3

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

* [U-Boot] [PATCH v3 4/8] mx28evk: Use 512k for fdt partition to align it
  2013-12-16 22:43 [U-Boot] [PATCH v3 0/8] Pending patches for merging Otavio Salvador
                   ` (2 preceding siblings ...)
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 3/8] imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro Otavio Salvador
@ 2013-12-16 22:44 ` Otavio Salvador
  2013-12-19 10:41   ` Stefano Babic
  2014-01-03 14:33   ` Stefano Babic
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 5/8] mx28evk: Add 'nandboot' environment command Otavio Salvador
                   ` (3 subsequent siblings)
  7 siblings, 2 replies; 25+ messages in thread
From: Otavio Salvador @ 2013-12-16 22:44 UTC (permalink / raw)
  To: u-boot

Using 512k for fdt partition allow it to be aligned with the other
small partitions and 512k erase block size.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes in v3: None
Changes in v2: None

 include/configs/mx28evk.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 22fdb3a..3de0599 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -96,7 +96,7 @@
 		"512k(environment),"		\
 		"512k(redundant-environment),"	\
 		"4m(kernel),"			\
-		"128k(fdt),"			\
+		"512k(fdt),"			\
 		"8m(ramdisk),"			\
 		"-(filesystem)"
 #endif
-- 
1.8.4.3

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

* [U-Boot] [PATCH v3 5/8] mx28evk: Add 'nandboot' environment command
  2013-12-16 22:43 [U-Boot] [PATCH v3 0/8] Pending patches for merging Otavio Salvador
                   ` (3 preceding siblings ...)
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 4/8] mx28evk: Use 512k for fdt partition to align it Otavio Salvador
@ 2013-12-16 22:44 ` Otavio Salvador
  2013-12-19 10:45   ` Stefano Babic
                     ` (2 more replies)
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 6/8] mx28evk: Extend environment to easy write of NAND system Otavio Salvador
                   ` (2 subsequent siblings)
  7 siblings, 3 replies; 25+ messages in thread
From: Otavio Salvador @ 2013-12-16 22:44 UTC (permalink / raw)
  To: u-boot

This reads the kernel, ftd and boot into ubifs filesystem. While on
that, the SD firmware filename definition has been moved next to the
other SD related commands.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes in v3: None
Changes in v2: None

 include/configs/mx28evk.h | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 3de0599..6c9fa00 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -162,7 +162,6 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"update_nand_full_filename=u-boot.nand\0" \
 	"update_nand_firmware_filename=u-boot.sb\0"	\
-	"update_sd_firmware_filename=u-boot.sd\0" \
 	"update_nand_firmware_maxsz=0x100000\0"	\
 	"update_nand_stride=0x40\0"	/* MX28 datasheet ch. 12.12 */ \
 	"update_nand_count=0x4\0"	/* MX28 datasheet ch. 12.12 */ \
@@ -190,6 +189,23 @@
 		"nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
 		"nand write ${loadaddr} ${fw_off} ${filesize} ; " \
 		"fi\0" \
+	"nandargs=setenv bootargs console=${console_mainline},${baudrate} " \
+		"rootfstype=ubifs ubi.mtd=6 root=ubi0_0 ${mtdparts}\0" \
+	"nandboot="		/* Boot from NAND */ \
+		"mtdparts default; " \
+		"run nandargs; " \
+		"nand read ${loadaddr} kernel 0x00400000; " \
+		"if test ${boot_fdt} = yes; then " \
+			"nand read ${fdt_addr} fdt 0x00080000; " \
+			"bootm ${loadaddr} - ${fdt_addr}; " \
+		"else " \
+			"if test ${boot_fdt} = no; then " \
+				"bootm; " \
+			"else " \
+				"echo \"ERROR: Set boot_fdt to yes or no.\"; " \
+			"fi; " \
+		"fi\0" \
+	"update_sd_firmware_filename=u-boot.sd\0" \
 	"update_sd_firmware="		/* Update the SD firmware partition */ \
 		"if mmc rescan ; then "	\
 		"if tftp ${update_sd_firmware_filename} ; then " \
-- 
1.8.4.3

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

* [U-Boot] [PATCH v3 6/8] mx28evk: Extend environment to easy write of NAND system
  2013-12-16 22:43 [U-Boot] [PATCH v3 0/8] Pending patches for merging Otavio Salvador
                   ` (4 preceding siblings ...)
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 5/8] mx28evk: Add 'nandboot' environment command Otavio Salvador
@ 2013-12-16 22:44 ` Otavio Salvador
  2014-01-03 14:34   ` Stefano Babic
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 7/8] ARM: mx6: Change the FDT loading address to avoid overlaping Otavio Salvador
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 8/8] ARM: mx6: Allow enablement of FEC Anatop based clock for all MX6 Otavio Salvador
  7 siblings, 1 reply; 25+ messages in thread
From: Otavio Salvador @ 2013-12-16 22:44 UTC (permalink / raw)
  To: u-boot

This adds following new targets:

 - update_nand_kernel
 - update_nand_fdt
 - update_nand_filesystem

and to avoid confusion, the 'update_nand_full' has been renamed to
'update_nand_firmware_full'.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes in v3: None
Changes in v2: None

 include/configs/mx28evk.h | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 6c9fa00..4fd67eb 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -160,6 +160,7 @@
 
 /* Extra Environment */
 #define CONFIG_EXTRA_ENV_SETTINGS \
+	"ubifs_file=filesystem.ubifs\0" \
 	"update_nand_full_filename=u-boot.nand\0" \
 	"update_nand_firmware_filename=u-boot.sb\0"	\
 	"update_nand_firmware_maxsz=0x100000\0"	\
@@ -170,7 +171,7 @@
 		"nand info ; " \
 		"setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
 		"setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
-	"update_nand_full="		    /* Update FCB, DBBT and FW */ \
+	"update_nand_firmware_full=" /* Update FCB, DBBT and FW */ \
 		"if tftp ${update_nand_full_filename} ; then " \
 		"run update_nand_get_fcb_size ; " \
 		"nand scrub -y 0x0 ${filesize} ; " \
@@ -189,6 +190,38 @@
 		"nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
 		"nand write ${loadaddr} ${fw_off} ${filesize} ; " \
 		"fi\0" \
+	"update_nand_kernel="		/* Update kernel */ \
+		"mtdparts default; " \
+		"nand erase.part kernel; " \
+		"if test ${ip_dyn} = yes; then " \
+			"setenv get_cmd dhcp; " \
+		"else " \
+			"setenv get_cmd tftp; " \
+		"fi; " \
+		"${get_cmd} ${uimage}; " \
+		"nand write ${loadaddr} kernel ${filesize}\0" \
+	"update_nand_fdt="		/* Update fdt */ \
+		"mtdparts default; " \
+		"nand erase.part fdt; " \
+		"if test ${ip_dyn} = yes; then " \
+			"setenv get_cmd dhcp; " \
+		"else " \
+			"setenv get_cmd tftp; " \
+		"fi; " \
+		"${get_cmd} ${fdt_file}; " \
+		"nand write ${loadaddr} fdt ${filesize}\0" \
+	"update_nand_filesystem="		/* Update filesystem */ \
+		"mtdparts default; " \
+		"nand erase.part filesystem; " \
+		"if test ${ip_dyn} = yes; then " \
+			"setenv get_cmd dhcp; " \
+		"else " \
+			"setenv get_cmd tftp; " \
+		"fi; " \
+		"${get_cmd} ${ubifs_file}; " \
+		"ubi part filesystem; " \
+		"ubi create filesystem; " \
+		"ubi write ${loadaddr} filesystem ${filesize}\0" \
 	"nandargs=setenv bootargs console=${console_mainline},${baudrate} " \
 		"rootfstype=ubifs ubi.mtd=6 root=ubi0_0 ${mtdparts}\0" \
 	"nandboot="		/* Boot from NAND */ \
-- 
1.8.4.3

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

* [U-Boot] [PATCH v3 7/8] ARM: mx6: Change the FDT loading address to avoid overlaping
  2013-12-16 22:43 [U-Boot] [PATCH v3 0/8] Pending patches for merging Otavio Salvador
                   ` (5 preceding siblings ...)
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 6/8] mx28evk: Extend environment to easy write of NAND system Otavio Salvador
@ 2013-12-16 22:44 ` Otavio Salvador
  2013-12-19 10:47   ` Stefano Babic
  2014-01-03 14:34   ` Stefano Babic
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 8/8] ARM: mx6: Allow enablement of FEC Anatop based clock for all MX6 Otavio Salvador
  7 siblings, 2 replies; 25+ messages in thread
From: Otavio Salvador @ 2013-12-16 22:44 UTC (permalink / raw)
  To: u-boot

This patch fixes allow for the DeviceTree and initrd relocation fixing
the boot of FSL 3.10.9-1.0.0-alpha kernel.

This changes following boards:

 - mx6sabreauto
 - mx6sabresd
 - wandboard
 - udoo
 - nitrogen6x
 - cgtqmx6eval

The reasoning, as explained by Hui Liu, is:

,----
| The FDT blob will be placed at DDR physical addr: 0x11000000. When Linux kernel
| Boot up, it will decompress the compressed kernel image and place the decompressed
| kernel image at the low end of the DDR memory and start running from it. If the
| decompressed kernel image is bigger for example than 16M, it may over written the
| fdt blob which u-boot loaded to the DDR memory @0x11000000 with fdt_addr=0x11000000
|
| To expand the fdt_addr from 0x11000000 to 0x18000000, which can avoid the override
| Since we will not likely have one kernel image larger than 128MB.
`----

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes in v3: None
Changes in v2:
- Change loadaddr to allow use with more than 1G of RAM

 include/configs/cgtqmx6eval.h     | 2 +-
 include/configs/mx6sabre_common.h | 2 +-
 include/configs/nitrogen6x.h      | 2 +-
 include/configs/udoo.h            | 2 +-
 include/configs/wandboard.h       | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/configs/cgtqmx6eval.h b/include/configs/cgtqmx6eval.h
index d5db8f5..29a023c 100644
--- a/include/configs/cgtqmx6eval.h
+++ b/include/configs/cgtqmx6eval.h
@@ -81,7 +81,7 @@
 	"console=ttymxc1\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
-	"fdt_addr=0x11000000\0" \
+	"fdt_addr=0x18000000\0" \
 	"boot_fdt=try\0" \
 	"mmcdev=1\0" \
 	"mmcpart=1\0" \
diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h
index a214324..d6ebf83 100644
--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -116,7 +116,7 @@
 	"script=boot.scr\0" \
 	"uimage=uImage\0" \
 	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
-	"fdt_addr=0x11000000\0" \
+	"fdt_addr=0x18000000\0" \
 	"boot_fdt=try\0" \
 	"ip_dyn=yes\0" \
 	"console=" CONFIG_CONSOLE_DEV "\0" \
diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 957dabe..41a6d71 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -179,7 +179,7 @@
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
 	"fdt_file=imx6q-sabrelite.dtb\0" \
-	"fdt_addr=0x11000000\0" \
+	"fdt_addr=0x18000000\0" \
 	"boot_fdt=try\0" \
 	"ip_dyn=yes\0" \
 	"mmcdev=0\0" \
diff --git a/include/configs/udoo.h b/include/configs/udoo.h
index b9a493c..c187361 100644
--- a/include/configs/udoo.h
+++ b/include/configs/udoo.h
@@ -93,7 +93,7 @@
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
 	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
-	"fdt_addr=0x11000000\0" \
+	"fdt_addr=0x18000000\0" \
 	"boot_fdt=try\0" \
 	"ip_dyn=yes\0" \
 	"mmcdev=0\0" \
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index 85f3c16..5252705 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -120,7 +120,7 @@
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
 	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
-	"fdt_addr=0x11000000\0" \
+	"fdt_addr=0x18000000\0" \
 	"boot_fdt=try\0" \
 	"ip_dyn=yes\0" \
 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
-- 
1.8.4.3

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

* [U-Boot] [PATCH v3 8/8] ARM: mx6: Allow enablement of FEC Anatop based clock for all MX6
  2013-12-16 22:43 [U-Boot] [PATCH v3 0/8] Pending patches for merging Otavio Salvador
                   ` (6 preceding siblings ...)
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 7/8] ARM: mx6: Change the FDT loading address to avoid overlaping Otavio Salvador
@ 2013-12-16 22:44 ` Otavio Salvador
  2013-12-19 10:50   ` Stefano Babic
  2014-01-03 14:35   ` Stefano Babic
  7 siblings, 2 replies; 25+ messages in thread
From: Otavio Salvador @ 2013-12-16 22:44 UTC (permalink / raw)
  To: u-boot

The enable_fec_anatop_clock method should be available for all MX6
variant as it is not MX6 SoloLite specific. This moves the code out of
the #ifdef/#endif and we make it conditional to CONFIG_FEC_MXC
instead.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes in v3:
- new patch

Changes in v2: None

 arch/arm/cpu/armv7/mx6/clock.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index 873d9d0..d87e73b 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -310,7 +310,18 @@ static u32 get_mmdc_ch0_clk(void)
 	return freq / (podf + 1);
 
 }
+#else
+static u32 get_mmdc_ch0_clk(void)
+{
+	u32 cbcdr = __raw_readl(&imx_ccm->cbcdr);
+	u32 mmdc_ch0_podf = (cbcdr & MXC_CCM_CBCDR_MMDC_CH0_PODF_MASK) >>
+				MXC_CCM_CBCDR_MMDC_CH0_PODF_OFFSET;
+
+	return get_periph_clk() / (mmdc_ch0_podf + 1);
+}
+#endif
 
+#ifdef CONFIG_FEC_MXC
 int enable_fec_anatop_clock(void)
 {
 	u32 reg = 0;
@@ -339,16 +350,6 @@ int enable_fec_anatop_clock(void)
 
 	return 0;
 }
-
-#else
-static u32 get_mmdc_ch0_clk(void)
-{
-	u32 cbcdr = __raw_readl(&imx_ccm->cbcdr);
-	u32 mmdc_ch0_podf = (cbcdr & MXC_CCM_CBCDR_MMDC_CH0_PODF_MASK) >>
-				MXC_CCM_CBCDR_MMDC_CH0_PODF_OFFSET;
-
-	return get_periph_clk() / (mmdc_ch0_podf + 1);
-}
 #endif
 
 static u32 get_usdhc_clk(u32 port)
-- 
1.8.4.3

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

* [U-Boot] [PATCH v3 1/8] wandboard: add Future Eletronics 7" WVGA LCD extension board
  2013-12-16 22:43 ` [U-Boot] [PATCH v3 1/8] wandboard: add Future Eletronics 7" WVGA LCD extension board Otavio Salvador
@ 2013-12-19 10:36   ` Stefano Babic
  2014-01-03 17:47     ` Otavio Salvador
  0 siblings, 1 reply; 25+ messages in thread
From: Stefano Babic @ 2013-12-19 10:36 UTC (permalink / raw)
  To: u-boot

Hi Otavio,

one minor point.

On 16/12/2013 23:43, Otavio Salvador wrote:

> +int board_video_skip(void)
> +{
> +	int i;
> +	int ret;
> +	int detected = 0;
> +	char const *panel = getenv("panel");
> +	if (!panel) {
> +		for (i = 0; i < ARRAY_SIZE(displays); i++) {
> +			struct display_info_t const *dev = displays+i;
> +			if (dev->detect && dev->detect(dev)) {
> +				panel = dev->mode.name;
> +				detected = 1;
> +				break;
> +			}
> +		}
> +		if (!panel) {
> +			panel = displays[0].mode.name;
> +			printf("No panel detected: default to %s\n", panel);
> +			i = 0;
> +		}
> +	} else {
> +		for (i = 0; i < ARRAY_SIZE(displays); i++) {
> +			if (!strcmp(panel, displays[i].mode.name))
> +				break;
> +		}
> +	}
> +	if (i < ARRAY_SIZE(displays)) {
> +		ret = ipuv3_fb_init(&displays[i].mode, 0,
> +				    displays[i].pixfmt);
> +
> +		if (!ret) {
> +			displays[i].enable(displays+i);
> +			printf("Display: %s (%ux%u) %s\n",
> +			       displays[i].mode.name,
> +			       displays[i].mode.xres,
> +			       displays[i].mode.yres,
> +			       (detected ? "[auto]" : ""));
> +		} else
> +			printf("LCD %s cannot be configured: %d\n",
> +			       displays[i].mode.name, ret);
> +	} else {
> +		printf("unsupported panel %s\n", panel);
> +		return -EINVAL;
> +	}
> +
> +	return 0;
>  }
>  

This is identical to the nitrogen one, and quite identical to the same
function in sabresd. Or better, function in sabresd is older and has not
received the fixes as nitrogen (line with dev->detect).

IMHO the function is generic to be factorized. The display_info_t
structure lets us to specialize the behavior for each board, and the
generic part can be put in a common part.



>  static void setup_display(void)
>  {
>  	struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
> +	struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
>  	int reg;
>  
>  	enable_ipu_clock();
>  	imx_setup_hdmi();
>  
> +	/* Turn on LDB0, LDB1, IPU,IPU DI0 clocks */
> +	reg = __raw_readl(&mxc_ccm->CCGR3);
> +	reg |=  MXC_CCM_CCGR3_LDB_DI0_MASK | MXC_CCM_CCGR3_LDB_DI1_MASK;
> +	writel(reg, &mxc_ccm->CCGR3);
> +
> +	/* set LDB0, LDB1 clk select to 011/011 */
> +	reg = readl(&mxc_ccm->cs2cdr);
> +	reg &= ~(MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK
> +		 | MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK);
> +	reg |= (3 << MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_OFFSET)
> +	      | (3 << MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_OFFSET);
> +	writel(reg, &mxc_ccm->cs2cdr);
> +
> +	reg = readl(&mxc_ccm->cscmr2);
> +	reg |= MXC_CCM_CSCMR2_LDB_DI0_IPU_DIV | MXC_CCM_CSCMR2_LDB_DI1_IPU_DIV;
> +	writel(reg, &mxc_ccm->cscmr2);
> +
>  	reg = readl(&mxc_ccm->chsccdr);
>  	reg |= (CHSCCDR_CLK_SEL_LDB_DI0
>  		<< MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET);
> +	reg |= (CHSCCDR_CLK_SEL_LDB_DI0
> +		<< MXC_CCM_CHSCCDR_IPU1_DI1_CLK_SEL_OFFSET);
>  	writel(reg, &mxc_ccm->chsccdr);
> +
> +	reg = IOMUXC_GPR2_BGREF_RRMODE_EXTERNAL_RES
> +	     | IOMUXC_GPR2_DI1_VS_POLARITY_ACTIVE_LOW
> +	     | IOMUXC_GPR2_DI0_VS_POLARITY_ACTIVE_LOW
> +	     | IOMUXC_GPR2_BIT_MAPPING_CH1_SPWG
> +	     | IOMUXC_GPR2_DATA_WIDTH_CH1_18BIT
> +	     | IOMUXC_GPR2_BIT_MAPPING_CH0_SPWG
> +	     | IOMUXC_GPR2_DATA_WIDTH_CH0_18BIT
> +	     | IOMUXC_GPR2_LVDS_CH0_MODE_DISABLED
> +	     | IOMUXC_GPR2_LVDS_CH1_MODE_ENABLED_DI0;
> +	writel(reg, &iomux->gpr[2]);
> +
> +	reg = readl(&iomux->gpr[3]);
> +	reg = (reg & ~(IOMUXC_GPR3_LVDS1_MUX_CTL_MASK
> +			| IOMUXC_GPR3_HDMI_MUX_CTL_MASK))
> +	    | (IOMUXC_GPR3_MUX_SRC_IPU1_DI0
> +	       << IOMUXC_GPR3_LVDS1_MUX_CTL_OFFSET);
> +	writel(reg, &iomux->gpr[3]);
> +
> +	/* Disable LCD backlight */
> +	imx_iomux_v3_setup_pad(MX6_PAD_DI0_PIN4__GPIO4_IO20);
> +	gpio_direction_input(IMX_GPIO_NR(4, 20));
>  }
>  #endif /* CONFIG_VIDEO_IPUV3 */
>  

This function is also quite identical to all boards.You add here only
the disable of the LCD backlight. I can recognize some parts, that are
surely common to all implementations (enabling clocks). Even if the
setup of gpr[2]/[3] is identical, I can imagine that it could be board
specific. Anyway, any chance to factorize the code ?


>  
> diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
> index e9c7e64..85f3c16 100644
> --- a/include/configs/wandboard.h
> +++ b/include/configs/wandboard.h
> @@ -55,6 +55,12 @@
>  #define CONFIG_LOADADDR			0x12000000
>  #define CONFIG_SYS_TEXT_BASE		0x17800000
>  
> +/* I2C Configs */
> +#define CONFIG_CMD_I2C
> +#define CONFIG_SYS_I2C
> +#define CONFIG_SYS_I2C_MXC
> +#define CONFIG_SYS_I2C_SPEED		100000
> +
>  /* MMC Configuration */
>  #define CONFIG_FSL_ESDHC
>  #define CONFIG_FSL_USDHC
> @@ -97,6 +103,7 @@
>  #define CONFIG_VIDEO_LOGO
>  #define CONFIG_VIDEO_BMP_LOGO
>  #define CONFIG_IPUV3_CLK 260000000
> +#define CONFIG_CMD_HDMIDETECT
>  #define CONFIG_IMX_HDMI
>  
>  #if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
> @@ -134,7 +141,33 @@
>  			"fi; "	\
>  		"fi\0" \
>  	"mmcargs=setenv bootargs console=${console},${baudrate} " \
> -		"root=${mmcroot}\0" \
> +		"root=${mmcroot}; run videoargs\0" \
> +	"videoargs=" \
> +		"setenv nextcon 0; " \
> +		"if hdmidet; then " \
> +			"setenv bootargs ${bootargs} " \
> +				"video=mxcfb${nextcon}:dev=hdmi,1280x720M at 60," \
> +					"if=RGB24; " \
> +			"setenv fbmen fbmem=28M; " \
> +			"setexpr nextcon ${nextcon} + 1; " \
> +		"else " \
> +			"echo - no HDMI monitor;" \
> +		"fi; " \
> +		"i2c dev 0; " \
> +		"if i2c probe 0x10; then " \
> +			"setenv bootargs ${bootargs} " \
> +				"video=mxcfb${nextcon}:dev=lcd,800x480 at 60," \
> +					"if=RGB666; " \

Why do we need this ? The kernel should get the setup for display from
DTS (display-timings node). Do you need to short-circuit DTS setup ?

> +			"if test 0 -eq ${nextcon}; then " \
> +				"setenv fbmem fbmem=10M; " \
> +			"else " \
> +				"setenv fbmem ${fbmem},10M; " \
> +			"fi; " \
> +			"setexpr nextcon ${nextcon} + 1; " \
> +		"else " \
> +			"echo '- no FWBADAPT-7WVGA-LCD-F07A-0102 display';" \
> +		"fi; " \
> +		"setenv bootargs ${bootargs} ${fbmem}\0" \
>  	"loadbootscript=" \
>  		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
>  	"bootscript=echo Running bootscript from mmc ...; " \

I was against adding so many scripts in CONFIG_ENV_EXTRA, but as Simon's
patches to move the default environment outside u-boot are not yet in
mainline, I will not stop patches for this.

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 3/8] imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 3/8] imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro Otavio Salvador
@ 2013-12-19 10:40   ` Stefano Babic
  2014-01-03 14:30   ` Stefano Babic
  1 sibling, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2013-12-19 10:40 UTC (permalink / raw)
  To: u-boot

Hi Otavio,

On 16/12/2013 23:44, Otavio Salvador wrote:
> The macro allows easy setting in per-pin, as for example:
> 
> ,----
> | imx_iomux_v3_setup_pad(MX6_PAD_NANDF_D1__GPIO_2_1 | MUX_MODE_SION);
> `----
> 
> The IOMUX_CONFIG_SION allows for reading PAD value from PSR register.
> 
> The following quote from the datasheet:
> 
> ,----
> | ...
> | 28.4.2.2 GPIO Write Mode
> | The programming sequence for driving output signals should be as follows:
> | 1. Configure IOMUX to select GPIO mode (Via IOMUXC), also enable SION if need
> | to read loopback pad value through PSR
> | 2. Configure GPIO direction register to output (GPIO_GDIR[GDIR] set to 1b).
> | 3. Write value to data register (GPIO_DR).
> | ...
> `----
> 
> This fixes the gpio_get_value to properly work when a GPIO is set for
> output and has no conflicts.
> 
> Thanks for Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>, Fabio
> Estevam <fabio.estevam@freescale.com> and Eric B?nard
> <eric@eukrea.com> for helping to properly trace this down.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> Changes in v3: None
> Changes in v2: None
> 
>  arch/arm/include/asm/imx-common/iomux-v3.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/include/asm/imx-common/iomux-v3.h b/arch/arm/include/asm/imx-common/iomux-v3.h
> index dc2b3ef..dec11a1 100644
> --- a/arch/arm/include/asm/imx-common/iomux-v3.h
> +++ b/arch/arm/include/asm/imx-common/iomux-v3.h
> @@ -63,6 +63,8 @@ typedef u64 iomux_v3_cfg_t;
>  #define MUX_SEL_INPUT_SHIFT	59
>  #define MUX_SEL_INPUT_MASK	((iomux_v3_cfg_t)0xf << MUX_SEL_INPUT_SHIFT)
>  
> +#define MUX_MODE_SION		((iomux_v3_cfg_t)IOMUX_CONFIG_SION << \
> +	MUX_MODE_SHIFT)
>  #define MUX_PAD_CTRL(x)		((iomux_v3_cfg_t)(x) << MUX_PAD_CTRL_SHIFT)
>  
>  #define IOMUX_PAD(pad_ctrl_ofs, mux_ctrl_ofs, mux_mode, sel_input_ofs,	\
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 4/8] mx28evk: Use 512k for fdt partition to align it
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 4/8] mx28evk: Use 512k for fdt partition to align it Otavio Salvador
@ 2013-12-19 10:41   ` Stefano Babic
  2014-01-03 14:33   ` Stefano Babic
  1 sibling, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2013-12-19 10:41 UTC (permalink / raw)
  To: u-boot

On 16/12/2013 23:44, Otavio Salvador wrote:
> Using 512k for fdt partition allow it to be aligned with the other
> small partitions and 512k erase block size.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> Changes in v3: None
> Changes in v2: None
> 
>  include/configs/mx28evk.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
> index 22fdb3a..3de0599 100644
> --- a/include/configs/mx28evk.h
> +++ b/include/configs/mx28evk.h
> @@ -96,7 +96,7 @@
>  		"512k(environment),"		\
>  		"512k(redundant-environment),"	\
>  		"4m(kernel),"			\
> -		"128k(fdt),"			\
> +		"512k(fdt),"			\
>  		"8m(ramdisk),"			\
>  		"-(filesystem)"
>  #endif
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 5/8] mx28evk: Add 'nandboot' environment command
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 5/8] mx28evk: Add 'nandboot' environment command Otavio Salvador
@ 2013-12-19 10:45   ` Stefano Babic
  2013-12-19 11:02   ` Fabio Estevam
  2014-01-03 14:33   ` Stefano Babic
  2 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2013-12-19 10:45 UTC (permalink / raw)
  To: u-boot

CC Fabio:

On 16/12/2013 23:44, Otavio Salvador wrote:
> This reads the kernel, ftd and boot into ubifs filesystem. While on
> that, the SD firmware filename definition has been moved next to the
> other SD related commands.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> Changes in v3: None
> Changes in v2: None
> 
>  include/configs/mx28evk.h | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
> index 3de0599..6c9fa00 100644
> --- a/include/configs/mx28evk.h
> +++ b/include/configs/mx28evk.h
> @@ -162,7 +162,6 @@
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	"update_nand_full_filename=u-boot.nand\0" \
>  	"update_nand_firmware_filename=u-boot.sb\0"	\
> -	"update_sd_firmware_filename=u-boot.sd\0" \
>  	"update_nand_firmware_maxsz=0x100000\0"	\
>  	"update_nand_stride=0x40\0"	/* MX28 datasheet ch. 12.12 */ \
>  	"update_nand_count=0x4\0"	/* MX28 datasheet ch. 12.12 */ \
> @@ -190,6 +189,23 @@
>  		"nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
>  		"nand write ${loadaddr} ${fw_off} ${filesize} ; " \
>  		"fi\0" \
> +	"nandargs=setenv bootargs console=${console_mainline},${baudrate} " \
> +		"rootfstype=ubifs ubi.mtd=6 root=ubi0_0 ${mtdparts}\0" \
> +	"nandboot="		/* Boot from NAND */ \
> +		"mtdparts default; " \
> +		"run nandargs; " \
> +		"nand read ${loadaddr} kernel 0x00400000; " \
> +		"if test ${boot_fdt} = yes; then " \
> +			"nand read ${fdt_addr} fdt 0x00080000; " \
> +			"bootm ${loadaddr} - ${fdt_addr}; " \
> +		"else " \
> +			"if test ${boot_fdt} = no; then " \
> +				"bootm; " \
> +			"else " \
> +				"echo \"ERROR: Set boot_fdt to yes or no.\"; " \
> +			"fi; " \
> +		"fi\0" \
> +	"update_sd_firmware_filename=u-boot.sd\0" \
>  	"update_sd_firmware="		/* Update the SD firmware partition */ \
>  		"if mmc rescan ; then "	\
>  		"if tftp ${update_sd_firmware_filename} ; then " \
> 

Again, I will not block patches if we have not (yet) another solution.

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 7/8] ARM: mx6: Change the FDT loading address to avoid overlaping
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 7/8] ARM: mx6: Change the FDT loading address to avoid overlaping Otavio Salvador
@ 2013-12-19 10:47   ` Stefano Babic
  2014-01-03 14:34   ` Stefano Babic
  1 sibling, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2013-12-19 10:47 UTC (permalink / raw)
  To: u-boot

Hi Otavio,

On 16/12/2013 23:44, Otavio Salvador wrote:
> This patch fixes allow for the DeviceTree and initrd relocation fixing
> the boot of FSL 3.10.9-1.0.0-alpha kernel.
> 
> This changes following boards:
> 
>  - mx6sabreauto
>  - mx6sabresd
>  - wandboard
>  - udoo
>  - nitrogen6x
>  - cgtqmx6eval
> 
> The reasoning, as explained by Hui Liu, is:
> 
> ,----
> | The FDT blob will be placed at DDR physical addr: 0x11000000. When Linux kernel
> | Boot up, it will decompress the compressed kernel image and place the decompressed
> | kernel image at the low end of the DDR memory and start running from it. If the
> | decompressed kernel image is bigger for example than 16M, it may over written the
> | fdt blob which u-boot loaded to the DDR memory @0x11000000 with fdt_addr=0x11000000
> |
> | To expand the fdt_addr from 0x11000000 to 0x18000000, which can avoid the override
> | Since we will not likely have one kernel image larger than 128MB.
> `----
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> Changes in v3: None
> Changes in v2:
> - Change loadaddr to allow use with more than 1G of RAM
> 
>  include/configs/cgtqmx6eval.h     | 2 +-
>  include/configs/mx6sabre_common.h | 2 +-
>  include/configs/nitrogen6x.h      | 2 +-
>  include/configs/udoo.h            | 2 +-
>  include/configs/wandboard.h       | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/configs/cgtqmx6eval.h b/include/configs/cgtqmx6eval.h
> index d5db8f5..29a023c 100644
> --- a/include/configs/cgtqmx6eval.h
> +++ b/include/configs/cgtqmx6eval.h
> @@ -81,7 +81,7 @@
>  	"console=ttymxc1\0" \
>  	"fdt_high=0xffffffff\0" \
>  	"initrd_high=0xffffffff\0" \
> -	"fdt_addr=0x11000000\0" \
> +	"fdt_addr=0x18000000\0" \
>  	"boot_fdt=try\0" \
>  	"mmcdev=1\0" \
>  	"mmcpart=1\0" \
> diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h
> index a214324..d6ebf83 100644
> --- a/include/configs/mx6sabre_common.h
> +++ b/include/configs/mx6sabre_common.h
> @@ -116,7 +116,7 @@
>  	"script=boot.scr\0" \
>  	"uimage=uImage\0" \
>  	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
> -	"fdt_addr=0x11000000\0" \
> +	"fdt_addr=0x18000000\0" \
>  	"boot_fdt=try\0" \
>  	"ip_dyn=yes\0" \
>  	"console=" CONFIG_CONSOLE_DEV "\0" \
> diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
> index 957dabe..41a6d71 100644
> --- a/include/configs/nitrogen6x.h
> +++ b/include/configs/nitrogen6x.h
> @@ -179,7 +179,7 @@
>  	"fdt_high=0xffffffff\0" \
>  	"initrd_high=0xffffffff\0" \
>  	"fdt_file=imx6q-sabrelite.dtb\0" \
> -	"fdt_addr=0x11000000\0" \
> +	"fdt_addr=0x18000000\0" \
>  	"boot_fdt=try\0" \
>  	"ip_dyn=yes\0" \
>  	"mmcdev=0\0" \
> diff --git a/include/configs/udoo.h b/include/configs/udoo.h
> index b9a493c..c187361 100644
> --- a/include/configs/udoo.h
> +++ b/include/configs/udoo.h
> @@ -93,7 +93,7 @@
>  	"fdt_high=0xffffffff\0" \
>  	"initrd_high=0xffffffff\0" \
>  	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
> -	"fdt_addr=0x11000000\0" \
> +	"fdt_addr=0x18000000\0" \
>  	"boot_fdt=try\0" \
>  	"ip_dyn=yes\0" \
>  	"mmcdev=0\0" \
> diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
> index 85f3c16..5252705 100644
> --- a/include/configs/wandboard.h
> +++ b/include/configs/wandboard.h
> @@ -120,7 +120,7 @@
>  	"fdt_high=0xffffffff\0" \
>  	"initrd_high=0xffffffff\0" \
>  	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
> -	"fdt_addr=0x11000000\0" \
> +	"fdt_addr=0x18000000\0" \
>  	"boot_fdt=try\0" \
>  	"ip_dyn=yes\0" \
>  	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
> 

We discussed in a previous thread why this is the preferred solution,
instead of simply dropping fdt_addr as we initially thought - see Tom's
remark in the thread.

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 8/8] ARM: mx6: Allow enablement of FEC Anatop based clock for all MX6
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 8/8] ARM: mx6: Allow enablement of FEC Anatop based clock for all MX6 Otavio Salvador
@ 2013-12-19 10:50   ` Stefano Babic
  2014-01-03 14:35   ` Stefano Babic
  1 sibling, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2013-12-19 10:50 UTC (permalink / raw)
  To: u-boot

Hi Otavio,

On 16/12/2013 23:44, Otavio Salvador wrote:
> The enable_fec_anatop_clock method should be available for all MX6
> variant as it is not MX6 SoloLite specific. This moves the code out of
> the #ifdef/#endif and we make it conditional to CONFIG_FEC_MXC
> instead.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> Changes in v3:
> - new patch
> 
> Changes in v2: None
> 
>  arch/arm/cpu/armv7/mx6/clock.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
> index 873d9d0..d87e73b 100644
> --- a/arch/arm/cpu/armv7/mx6/clock.c
> +++ b/arch/arm/cpu/armv7/mx6/clock.c
> @@ -310,7 +310,18 @@ static u32 get_mmdc_ch0_clk(void)
>  	return freq / (podf + 1);
>  
>  }
> +#else
> +static u32 get_mmdc_ch0_clk(void)
> +{
> +	u32 cbcdr = __raw_readl(&imx_ccm->cbcdr);
> +	u32 mmdc_ch0_podf = (cbcdr & MXC_CCM_CBCDR_MMDC_CH0_PODF_MASK) >>
> +				MXC_CCM_CBCDR_MMDC_CH0_PODF_OFFSET;
> +
> +	return get_periph_clk() / (mmdc_ch0_podf + 1);
> +}
> +#endif
>  
> +#ifdef CONFIG_FEC_MXC
>  int enable_fec_anatop_clock(void)
>  {
>  	u32 reg = 0;
> @@ -339,16 +350,6 @@ int enable_fec_anatop_clock(void)
>  
>  	return 0;
>  }
> -
> -#else
> -static u32 get_mmdc_ch0_clk(void)
> -{
> -	u32 cbcdr = __raw_readl(&imx_ccm->cbcdr);
> -	u32 mmdc_ch0_podf = (cbcdr & MXC_CCM_CBCDR_MMDC_CH0_PODF_MASK) >>
> -				MXC_CCM_CBCDR_MMDC_CH0_PODF_OFFSET;
> -
> -	return get_periph_clk() / (mmdc_ch0_podf + 1);
> -}
>  #endif
>  
>  static u32 get_usdhc_clk(u32 port)
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 5/8] mx28evk: Add 'nandboot' environment command
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 5/8] mx28evk: Add 'nandboot' environment command Otavio Salvador
  2013-12-19 10:45   ` Stefano Babic
@ 2013-12-19 11:02   ` Fabio Estevam
  2014-01-03 14:33   ` Stefano Babic
  2 siblings, 0 replies; 25+ messages in thread
From: Fabio Estevam @ 2013-12-19 11:02 UTC (permalink / raw)
  To: u-boot

On Mon, Dec 16, 2013 at 8:44 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> This reads the kernel, ftd and boot into ubifs filesystem. While on
> that, the SD firmware filename definition has been moved next to the
> other SD related commands.
>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>

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

* [U-Boot] [PATCH v3 2/8] mx6sabresd: Add eMMC specific environment to allow U-Boot update
  2013-12-16 22:43 ` [U-Boot] [PATCH v3 2/8] mx6sabresd: Add eMMC specific environment to allow U-Boot update Otavio Salvador
@ 2014-01-03 14:30   ` Stefano Babic
  2014-01-03 14:48     ` Stefano Babic
  0 siblings, 1 reply; 25+ messages in thread
From: Stefano Babic @ 2014-01-03 14:30 UTC (permalink / raw)
  To: u-boot

On 16/12/2013 23:43, Otavio Salvador wrote:
> A new 'update_emmc_firmware' target is added to allow for easy U-Boot
> update in the eMMC as it has secury boot partition and this needs
> specific handling on how to program the specific partition.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 3/8] imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 3/8] imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro Otavio Salvador
  2013-12-19 10:40   ` Stefano Babic
@ 2014-01-03 14:30   ` Stefano Babic
  1 sibling, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2014-01-03 14:30 UTC (permalink / raw)
  To: u-boot

On 16/12/2013 23:44, Otavio Salvador wrote:
> The macro allows easy setting in per-pin, as for example:
> 
> ,----
> | imx_iomux_v3_setup_pad(MX6_PAD_NANDF_D1__GPIO_2_1 | MUX_MODE_SION);
> `----
> 
> The IOMUX_CONFIG_SION allows for reading PAD value from PSR register.
> 
> The following quote from the datasheet:
> 
> ,----
> | ...
> | 28.4.2.2 GPIO Write Mode
> | The programming sequence for driving output signals should be as follows:
> | 1. Configure IOMUX to select GPIO mode (Via IOMUXC), also enable SION if need
> | to read loopback pad value through PSR
> | 2. Configure GPIO direction register to output (GPIO_GDIR[GDIR] set to 1b).
> | 3. Write value to data register (GPIO_DR).
> | ...
> `----
> 
> This fixes the gpio_get_value to properly work when a GPIO is set for
> output and has no conflicts.
> 
> Thanks for Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>, Fabio
> Estevam <fabio.estevam@freescale.com> and Eric B?nard
> <eric@eukrea.com> for helping to properly trace this down.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 4/8] mx28evk: Use 512k for fdt partition to align it
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 4/8] mx28evk: Use 512k for fdt partition to align it Otavio Salvador
  2013-12-19 10:41   ` Stefano Babic
@ 2014-01-03 14:33   ` Stefano Babic
  1 sibling, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2014-01-03 14:33 UTC (permalink / raw)
  To: u-boot

On 16/12/2013 23:44, Otavio Salvador wrote:
> Using 512k for fdt partition allow it to be aligned with the other
> small partitions and 512k erase block size.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 5/8] mx28evk: Add 'nandboot' environment command
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 5/8] mx28evk: Add 'nandboot' environment command Otavio Salvador
  2013-12-19 10:45   ` Stefano Babic
  2013-12-19 11:02   ` Fabio Estevam
@ 2014-01-03 14:33   ` Stefano Babic
  2 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2014-01-03 14:33 UTC (permalink / raw)
  To: u-boot

On 16/12/2013 23:44, Otavio Salvador wrote:
> This reads the kernel, ftd and boot into ubifs filesystem. While on
> that, the SD firmware filename definition has been moved next to the
> other SD related commands.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 6/8] mx28evk: Extend environment to easy write of NAND system
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 6/8] mx28evk: Extend environment to easy write of NAND system Otavio Salvador
@ 2014-01-03 14:34   ` Stefano Babic
  0 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2014-01-03 14:34 UTC (permalink / raw)
  To: u-boot

On 16/12/2013 23:44, Otavio Salvador wrote:
> This adds following new targets:
> 
>  - update_nand_kernel
>  - update_nand_fdt
>  - update_nand_filesystem
> 
> and to avoid confusion, the 'update_nand_full' has been renamed to
> 'update_nand_firmware_full'.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 7/8] ARM: mx6: Change the FDT loading address to avoid overlaping
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 7/8] ARM: mx6: Change the FDT loading address to avoid overlaping Otavio Salvador
  2013-12-19 10:47   ` Stefano Babic
@ 2014-01-03 14:34   ` Stefano Babic
  1 sibling, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2014-01-03 14:34 UTC (permalink / raw)
  To: u-boot

On 16/12/2013 23:44, Otavio Salvador wrote:
> This patch fixes allow for the DeviceTree and initrd relocation fixing
> the boot of FSL 3.10.9-1.0.0-alpha kernel.
> 
> This changes following boards:
> 
>  - mx6sabreauto
>  - mx6sabresd
>  - wandboard
>  - udoo
>  - nitrogen6x
>  - cgtqmx6eval
> 
> The reasoning, as explained by Hui Liu, is:
> 
> ,----
> | The FDT blob will be placed at DDR physical addr: 0x11000000. When Linux kernel
> | Boot up, it will decompress the compressed kernel image and place the decompressed
> | kernel image at the low end of the DDR memory and start running from it. If the
> | decompressed kernel image is bigger for example than 16M, it may over written the
> | fdt blob which u-boot loaded to the DDR memory @0x11000000 with fdt_addr=0x11000000
> |
> | To expand the fdt_addr from 0x11000000 to 0x18000000, which can avoid the override
> | Since we will not likely have one kernel image larger than 128MB.
> `----
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 8/8] ARM: mx6: Allow enablement of FEC Anatop based clock for all MX6
  2013-12-16 22:44 ` [U-Boot] [PATCH v3 8/8] ARM: mx6: Allow enablement of FEC Anatop based clock for all MX6 Otavio Salvador
  2013-12-19 10:50   ` Stefano Babic
@ 2014-01-03 14:35   ` Stefano Babic
  1 sibling, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2014-01-03 14:35 UTC (permalink / raw)
  To: u-boot

On 16/12/2013 23:44, Otavio Salvador wrote:
> The enable_fec_anatop_clock method should be available for all MX6
> variant as it is not MX6 SoloLite specific. This moves the code out of
> the #ifdef/#endif and we make it conditional to CONFIG_FEC_MXC
> instead.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 2/8] mx6sabresd: Add eMMC specific environment to allow U-Boot update
  2014-01-03 14:30   ` Stefano Babic
@ 2014-01-03 14:48     ` Stefano Babic
  0 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2014-01-03 14:48 UTC (permalink / raw)
  To: u-boot

On 03/01/2014 15:30, Stefano Babic wrote:
> On 16/12/2013 23:43, Otavio Salvador wrote:
>> A new 'update_emmc_firmware' target is added to allow for easy U-Boot
>> update in the eMMC as it has secury boot partition and this needs
>> specific handling on how to program the specific partition.
>>
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
> 
> Applied to u-boot-imx, thanks !
> 


Sorry, discharged. The patch does not compile clean. Please fix and
resubmit, thanks !

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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] 25+ messages in thread

* [U-Boot] [PATCH v3 1/8] wandboard: add Future Eletronics 7" WVGA LCD extension board
  2013-12-19 10:36   ` Stefano Babic
@ 2014-01-03 17:47     ` Otavio Salvador
  0 siblings, 0 replies; 25+ messages in thread
From: Otavio Salvador @ 2014-01-03 17:47 UTC (permalink / raw)
  To: u-boot

Hello Stefano,

On Thu, Dec 19, 2013 at 8:36 AM, Stefano Babic <sbabic@denx.de> wrote:
> one minor point.
>
> On 16/12/2013 23:43, Otavio Salvador wrote:
>
>> +int board_video_skip(void)
>> +{
>> +     int i;
>> +     int ret;
>> +     int detected = 0;
>> +     char const *panel = getenv("panel");
>> +     if (!panel) {
>> +             for (i = 0; i < ARRAY_SIZE(displays); i++) {
>> +                     struct display_info_t const *dev = displays+i;
>> +                     if (dev->detect && dev->detect(dev)) {
>> +                             panel = dev->mode.name;
>> +                             detected = 1;
>> +                             break;
>> +                     }
>> +             }
>> +             if (!panel) {
>> +                     panel = displays[0].mode.name;
>> +                     printf("No panel detected: default to %s\n", panel);
>> +                     i = 0;
>> +             }
>> +     } else {
>> +             for (i = 0; i < ARRAY_SIZE(displays); i++) {
>> +                     if (!strcmp(panel, displays[i].mode.name))
>> +                             break;
>> +             }
>> +     }
>> +     if (i < ARRAY_SIZE(displays)) {
>> +             ret = ipuv3_fb_init(&displays[i].mode, 0,
>> +                                 displays[i].pixfmt);
>> +
>> +             if (!ret) {
>> +                     displays[i].enable(displays+i);
>> +                     printf("Display: %s (%ux%u) %s\n",
>> +                            displays[i].mode.name,
>> +                            displays[i].mode.xres,
>> +                            displays[i].mode.yres,
>> +                            (detected ? "[auto]" : ""));
>> +             } else
>> +                     printf("LCD %s cannot be configured: %d\n",
>> +                            displays[i].mode.name, ret);
>> +     } else {
>> +             printf("unsupported panel %s\n", panel);
>> +             return -EINVAL;
>> +     }
>> +
>> +     return 0;
>>  }
>>
>
> This is identical to the nitrogen one, and quite identical to the same
> function in sabresd. Or better, function in sabresd is older and has not
> received the fixes as nitrogen (line with dev->detect).
>
> IMHO the function is generic to be factorized. The display_info_t
> structure lets us to specialize the behavior for each board, and the
> generic part can be put in a common part.
...
>
> This function is also quite identical to all boards.You add here only
> the disable of the LCD backlight. I can recognize some parts, that are
> surely common to all implementations (enabling clocks). Even if the
> setup of gpr[2]/[3] is identical, I can imagine that it could be board
> specific. Anyway, any chance to factorize the code ?

I agree with both remarks but I think we're late in the release cycle
for this kind of refactoring; I prefer to merge this patch as is for
now and send a patch, on top of this one, to rework this.

Can we go further this way? I am awaiting for this patch to be
merged/reviewed for quite a while already.

>> diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
>> index e9c7e64..85f3c16 100644
>> --- a/include/configs/wandboard.h
>> +++ b/include/configs/wandboard.h
>> @@ -55,6 +55,12 @@
>>  #define CONFIG_LOADADDR                      0x12000000
>>  #define CONFIG_SYS_TEXT_BASE         0x17800000
>>
>> +/* I2C Configs */
>> +#define CONFIG_CMD_I2C
>> +#define CONFIG_SYS_I2C
>> +#define CONFIG_SYS_I2C_MXC
>> +#define CONFIG_SYS_I2C_SPEED         100000
>> +
>>  /* MMC Configuration */
>>  #define CONFIG_FSL_ESDHC
>>  #define CONFIG_FSL_USDHC
>> @@ -97,6 +103,7 @@
>>  #define CONFIG_VIDEO_LOGO
>>  #define CONFIG_VIDEO_BMP_LOGO
>>  #define CONFIG_IPUV3_CLK 260000000
>> +#define CONFIG_CMD_HDMIDETECT
>>  #define CONFIG_IMX_HDMI
>>
>>  #if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S)
>> @@ -134,7 +141,33 @@
>>                       "fi; "  \
>>               "fi\0" \
>>       "mmcargs=setenv bootargs console=${console},${baudrate} " \
>> -             "root=${mmcroot}\0" \
>> +             "root=${mmcroot}; run videoargs\0" \
>> +     "videoargs=" \
>> +             "setenv nextcon 0; " \
>> +             "if hdmidet; then " \
>> +                     "setenv bootargs ${bootargs} " \
>> +                             "video=mxcfb${nextcon}:dev=hdmi,1280x720M at 60," \
>> +                                     "if=RGB24; " \
>> +                     "setenv fbmen fbmem=28M; " \
>> +                     "setexpr nextcon ${nextcon} + 1; " \
>> +             "else " \
>> +                     "echo - no HDMI monitor;" \
>> +             "fi; " \
>> +             "i2c dev 0; " \
>> +             "if i2c probe 0x10; then " \
>> +                     "setenv bootargs ${bootargs} " \
>> +                             "video=mxcfb${nextcon}:dev=lcd,800x480 at 60," \
>> +                                     "if=RGB666; " \
>
> Why do we need this ? The kernel should get the setup for display from
> DTS (display-timings node). Do you need to short-circuit DTS setup ?

Current kernel still does not use DTS (it is based on 3.0.35 FSL fork).

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

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

end of thread, other threads:[~2014-01-03 17:47 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-16 22:43 [U-Boot] [PATCH v3 0/8] Pending patches for merging Otavio Salvador
2013-12-16 22:43 ` [U-Boot] [PATCH v3 1/8] wandboard: add Future Eletronics 7" WVGA LCD extension board Otavio Salvador
2013-12-19 10:36   ` Stefano Babic
2014-01-03 17:47     ` Otavio Salvador
2013-12-16 22:43 ` [U-Boot] [PATCH v3 2/8] mx6sabresd: Add eMMC specific environment to allow U-Boot update Otavio Salvador
2014-01-03 14:30   ` Stefano Babic
2014-01-03 14:48     ` Stefano Babic
2013-12-16 22:44 ` [U-Boot] [PATCH v3 3/8] imx: Easy enabling of SION per-pin using MUX_MODE_SION helper macro Otavio Salvador
2013-12-19 10:40   ` Stefano Babic
2014-01-03 14:30   ` Stefano Babic
2013-12-16 22:44 ` [U-Boot] [PATCH v3 4/8] mx28evk: Use 512k for fdt partition to align it Otavio Salvador
2013-12-19 10:41   ` Stefano Babic
2014-01-03 14:33   ` Stefano Babic
2013-12-16 22:44 ` [U-Boot] [PATCH v3 5/8] mx28evk: Add 'nandboot' environment command Otavio Salvador
2013-12-19 10:45   ` Stefano Babic
2013-12-19 11:02   ` Fabio Estevam
2014-01-03 14:33   ` Stefano Babic
2013-12-16 22:44 ` [U-Boot] [PATCH v3 6/8] mx28evk: Extend environment to easy write of NAND system Otavio Salvador
2014-01-03 14:34   ` Stefano Babic
2013-12-16 22:44 ` [U-Boot] [PATCH v3 7/8] ARM: mx6: Change the FDT loading address to avoid overlaping Otavio Salvador
2013-12-19 10:47   ` Stefano Babic
2014-01-03 14:34   ` Stefano Babic
2013-12-16 22:44 ` [U-Boot] [PATCH v3 8/8] ARM: mx6: Allow enablement of FEC Anatop based clock for all MX6 Otavio Salvador
2013-12-19 10:50   ` Stefano Babic
2014-01-03 14:35   ` 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.