Skip to contentSkip to conversation

tools: arm: imx: Implement BOOT_OFFSET command for imximage

PATCH New Marek Vasut 5 participants 17 messages Apr 25, 2013 – May 5, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tools: arm: imx: Implement BOOT_OFFSET command for imximage

Implement BOOT_OFFSET command for imximage. This command is parallel to current BOOT_FROM command, but allows more flexibility in configuring arbitrary image header offset. Also add an imximage.cfg with default offset values into arm/arch/imx-common/ so the board-specific imximage.cfg can include this file to avoid magic constants.

The syntax of BOOT_OFFSET command is "BOOT_OFFSET <u32 offset>".

Cc Albert ARIBAUD <[email protected]>
Cc Beno?t Th?baudeau <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Scott Wood <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>
---
 arch/arm/include/asm/imx-common/imximage.cfg |   30 ++++++++++++++++++++++++++
 doc/README.imximage                          |   18 ++++++++++++++++
 tools/imximage.c                             |    6 ++++++
 tools/imximage.h                             |    6 ++++++
 4 files changed, 60 insertions(+)
 create mode 100644 arch/arm/include/asm/imx-common/imximage.cfg
arch/arm/include/asm/imx-common/imximage.cfg new file +30 -0
new file mode 100644
index 0000000..95daa3d
@@ -0,0 +1,30 @@
+/*
+ * i.MX image header offset values
+ * Copyright (C) 2013 Marek Vasut <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License or (at your option) any later version.
+ */
+
+/*
+ * NOTE: This file must be kept in sync with tools/imximage.h because
+ *       tools/imximage.c can not cross-include headers from arch/arm/
+ *       and vice-versa.
+ */
+
+#ifndef __ASM_IMX_COMMON_IMXIMAGE_CFG__
+#define __ASM_IMX_COMMON_IMXIMAGE_CFG__
+
+/* Standard image header offset for NAND, SATA, SD, SPI flash. */
+#define FLASH_OFFSET_STANDARD	0x400
+/* Specific image header offset for booting from OneNAND. */
+#define FLASH_OFFSET_ONENAND	0x100
+/* Specific image header offset for booting from memory-mapped NOR. */
+#define FLASH_OFFSET_NOR	0x1000
+
+#endif  /* __ASM_IMX_COMMON_IMXIMAGE_CFG__ */
doc/README.imximage +18 -0
index 073e3fc..802eb90 100644
@@ -65,9 +65,27 @@ Configuration command line syntax:
 				This command need appear the fist before
 				other valid commands in configuration file.
 
+	BOOT_OFFSET		value
+
+				This command is parallel to BOOT_FROM and
+				is preferred over BOOT_FROM.
+
+				value:  Offset of the image header, this
+					value shall be set to one of the
+					values found in the file:
+						arch/arm/include/asm/\
+						imx-common/imximage.cfg
+				Example:
+				BOOT_OFFSET FLASH_OFFSET_STANDARD
+
 	BOOT_FROM		nand/spi/sd/onenand/nor/sata
+
+				This command is parallel to BOOT_OFFSET and
+				is to be deprecated in favor of BOOT_OFFSET.
+
 				Example:
 				BOOT_FROM spi
+
 	DATA			type address value
 
 				type: word=4, halfword=2, byte=1
tools/imximage.c +6 -0
index c018562..5e8e470 100644
@@ -37,6 +37,7 @@
  */
 static table_entry_t imximage_cmds[] = {
 	{CMD_BOOT_FROM,         "BOOT_FROM",            "boot command",	  },
+	{CMD_BOOT_OFFSET,       "BOOT_OFFSET",          "Boot offset",	  },
 	{CMD_DATA,              "DATA",                 "Reg Write Data", },
 	{CMD_IMAGE_VERSION,     "IMAGE_VERSION",        "image version",  },
 	{-1,                    "",                     "",	          },
@@ -352,6 +353,11 @@ static void parse_cfg_cmd(struct imx_header *imxhdr, int32_t cmd, char *token,
 		if (unlikely(cmd_ver_first != 1))
 			cmd_ver_first = 0;
 		break;
+	case CMD_BOOT_OFFSET:
+		imxhdr->flash_offset = get_cfg_value(token, name, lineno);
+		if (unlikely(cmd_ver_first != 1))
+			cmd_ver_first = 0;
+		break;
 	case CMD_DATA:
 		value = get_cfg_value(token, name, lineno);
 		(*set_dcd_val)(imxhdr, name, lineno, fld, value, dcd_len);
tools/imximage.h +6 -0
index dfd2e9e..99e124a 100644
@@ -31,6 +31,11 @@
 
 #define HEADER_OFFSET	0x400
 
+/*
+ * NOTE: This file must be kept in sync with arch/arm/include/asm/\
+ *       imx-common/imximage.cfg because tools/imximage.c can not
+ *       cross-include headers from arch/arm/ and vice-versa.
+ */
 #define CMD_DATA_STR	"DATA"
 #define FLASH_OFFSET_UNDEFINED	0xFFFFFFFF
 #define FLASH_OFFSET_STANDARD	0x400
@@ -52,6 +57,7 @@ enum imximage_cmd {
 	CMD_INVALID,
 	CMD_IMAGE_VERSION,
 	CMD_BOOT_FROM,
+	CMD_BOOT_OFFSET,
 	CMD_DATA
 };
 
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v3 2/2 arm: mx5: Add support for DENX M53EVK

Add basic support for the DENX M53EVK board. Currently supported is:
MMC (incl. booting)
NAND (incl. booting)
Ethernet, I2C, USB, SATA, RTC.

Cc Albert ARIBAUD <[email protected]>
Cc Beno?t Th?baudeau <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Scott Wood <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
---
 MAINTAINERS                    |    1 +
 board/denx/m53evk/Makefile     |   40 ++++
 board/denx/m53evk/imximage.cfg |  108 +++++++++++
 board/denx/m53evk/m53evk.c     |  408 ++++++++++++++++++++++++++++++++++++++++
 boards.cfg                     |    1 +
 include/configs/m53evk.h       |  256 +++++++++++++++++++++++++
 6 files changed, 814 insertions(+)
 create mode 100644 board/denx/m53evk/Makefile
 create mode 100644 board/denx/m53evk/imximage.cfg
 create mode 100644 board/denx/m53evk/m53evk.c
 create mode 100644 include/configs/m53evk.h

V2: Init M4IF and WEIM
Clean up config file
V3: Rebase on top of Fabio's patches
Use WEIM and M4IF bit placement from imx-regs.h Use BOOT_OFFSET instead of BOOT_FROM in imximage.cfg Use CONFIG_REVISION_TAG

MAINTAINERS +1 -0
index 643a5ac..e109be6 100644
@@ -954,6 +954,7 @@ Marek Vasut <[email protected]>
 	mx23_olinuxino	i.MX23
 	m28evk		i.MX28
 	sc_sps_1	i.MX28
+	m53evk		i.MX53
 
 Hugo Villeneuve <[email protected]>
 
board/denx/m53evk/Makefile new file +40 -0
new file mode 100644
index 0000000..bfb040a
@@ -0,0 +1,40 @@
+#
+# DENX M53EVK
+# Copyright (C) 2012-2013 Marek Vasut <[email protected]>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS	:= m53evk.o
+
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/denx/m53evk/imximage.cfg new file +108 -0

108 lines not on this page · raw message

board/denx/m53evk/m53evk.c new file +408 -0

408 lines not on this page · raw message

boards.cfg +1 -0
index 8b7933f..b0249b8 100644
@@ -246,6 +246,7 @@ am335x_evm_usbspl            arm         armv7       am335x              ti
 ti814x_evm                   arm         armv7       ti814x              ti             am33xx
 pcm051                       arm         armv7       pcm051              phytec         am33xx      pcm051
 highbank                     arm         armv7       highbank            -              highbank
+m53evk                       arm         armv7       m53evk              denx		mx5		m53evk:IMX_CONFIG=board/denx/m53evk/imximage.cfg
 mx51_efikamx                 arm         armv7       mx51_efikamx        genesi         mx5		mx51_efikamx:MACH_TYPE=MACH_TYPE_MX51_EFIKAMX,IMX_CONFIG=board/genesi/mx51_efikamx/imximage_mx.cfg
 mx51_efikasb                 arm         armv7       mx51_efikamx        genesi         mx5		mx51_efikamx:MACH_TYPE=MACH_TYPE_MX51_EFIKASB,IMX_CONFIG=board/genesi/mx51_efikamx/imximage_sb.cfg
 mx51evk                      arm         armv7       mx51evk             freescale      mx5		mx51evk:IMX_CONFIG=board/freescale/mx51evk/imximage.cfg
include/configs/m53evk.h new file +256 -0

256 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#2 lore raw

PATCH v3 2/2 arm: mx5: Add support for DENX M53EVK

Dear Marek Vasut,

In message <[email protected]> you wrote:
...

MAINTAINERS Marek Vasut <[email protected]> · line 957

Quoted 7 lines
MAINTAINERS +1 -0
@@ -954,6 +954,7 @@ Marek Vasut <[email protected]>
 	mx23_olinuxino	i.MX23
 	m28evk		i.MX28
 	sc_sps_1	i.MX28
+	m53evk		i.MX53

Please keep this list (and all similar ones) sorted. Thanks.

MAINTAINERS Marek Vasut <[email protected]> · line 960

Quoted 3 lines
MAINTAINERS +3 -0
+#define CONFIG_SYS_SDRAM_BASE		(PHYS_SDRAM_1)
+#define CONFIG_SYS_INIT_RAM_ADDR	(IRAM_BASE_ADDR)
+#define CONFIG_SYS_INIT_RAM_SIZE	(IRAM_SIZE)

Are the parens needed / useful here?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Do not underestimate the value of print statements for debugging.
Don't have aesthetic convulsions when using them, either.
#3 lore raw

PATCH v3 2/2 arm: mx5: Add support for DENX M53EVK

Hello Wolfgang,

Quoted 9 lines

Dear Marek Vasut,

In message <[email protected]> you wrote:
...

Quoted 4 lines
MAINTAINERS +0 -0
@@ -954,6 +954,7 @@ Marek Vasut <[email protected]>
 
Quoted 7 lines

MAINTAINERS Marek Vasut <[email protected]>

Quoted 5 lines
MAINTAINERS +1 -0
 	mx23_olinuxino	i.MX23
 	m28evk		i.MX28
 	sc_sps_1	i.MX28
 
+	m53evk		i.MX53

Please keep this list (and all similar ones) sorted. Thanks.

It's sorted, by CPU first and by board name seconds. I think it's easier to search it that way, what do you say?

Quoted 5 lines

MAINTAINERS Marek Vasut <[email protected]>

Quoted 3 lines
MAINTAINERS +3 -0
+#define CONFIG_SYS_SDRAM_BASE		(PHYS_SDRAM_1)
+#define CONFIG_SYS_INIT_RAM_ADDR	(IRAM_BASE_ADDR)
+#define CONFIG_SYS_INIT_RAM_SIZE	(IRAM_SIZE)

Are the parens needed / useful here?

No, not anymore

Best regards,
Marek Vasut

#4 lore raw

PATCH v3 2/2 arm: mx5: Add support for DENX M53EVK

In reply to Marek Vasut

Dear Marek Vasut,

Quoted 6 lines · Marek Vasut

Add basic support for the DENX M53EVK board. Currently supported is:
MMC (incl. booting)
NAND (incl. booting)
Ethernet, I2C, USB, SATA, RTC.

[...]

Quoted 6 lines
board/denx/m53evk/m53evk.c new file +0 -0
new file mode 100644
index 0000000..3289f28
@@ -0,0 +1,408 @@

[...]

Quoted 6 lines
board/denx/m53evk/m53evk.c new file +6 -0
+#ifdef CONFIG_USB_EHCI_MX5
+int board_ehci_hcd_init(int port)
+{
+	if (port == 0) {
+		/* USB OTG PWRON */
+		mxc_request_iomux(MX53_PIN_GPIO_4, IOMUX_CONFIG_ALT1);

board/denx/m53evk/m53evk.c line 97

Quoted 10 lines
board/denx/m53evk/m53evk.c new file +10 -0
+		mxc_iomux_set_pad(MX53_PIN_GPIO_4,
+				PAD_CTL_PKE_ENABLE |
+				PAD_CTL_100K_PD |
+				PAD_CTL_DRV_HIGH
+				);
+		gpio_direction_output(IOMUX_TO_GPIO(MX53_PIN_GPIO_4), 0);
+
+		/* USB OTG Over Current */
+		mxc_request_iomux(MX53_PIN_GPIO_18, IOMUX_CONFIG_ALT1);
+		mxc_iomux_set_input(MX53_USBOH3_IPP_IND_OTG_OC_SELECT_INPUT, 1);

It looks like there is something wrong here: The last line connects OTG.OC to EIM_D21.ALT6, but the line before sets GPIO_18 as GPIO7[13] instead of setting EIM_D21 as OTG.OC.

Best regards,
Beno?t

#5 lore raw

PATCH v3 2/2 arm: mx5: Add support for DENX M53EVK

Quoted 17 lines · Beno?t Th?baudeau

Dear Marek Vasut,

Quoted 6 lines · Marek Vasut

Add basic support for the DENX M53EVK board. Currently supported is:
MMC (incl. booting)
NAND (incl. booting)
Ethernet, I2C, USB, SATA, RTC.

[...]

Quoted 6 lines
board/denx/m53evk/m53evk.c new file +0 -0
new file mode 100644
index 0000000..3289f28
@@ -0,0 +1,408 @@

[...]

Quoted 10 lines

board/denx/m53evk/m53evk.c line 91

Quoted 10 lines
board/denx/m53evk/m53evk.c new file +10 -0
+#ifdef CONFIG_USB_EHCI_MX5
+int board_ehci_hcd_init(int port)
+{
+	if (port == 0) {
+		/* USB OTG PWRON */
+		mxc_request_iomux(MX53_PIN_GPIO_4, IOMUX_CONFIG_ALT1);
+		mxc_iomux_set_pad(MX53_PIN_GPIO_4,
+				PAD_CTL_PKE_ENABLE |
+				PAD_CTL_100K_PD |
+				PAD_CTL_DRV_HIGH

And here you set PKE without PUE, which means that PAD_CTL_100K_PD will have no effect on the pad, i.e. the keeper will be enabled, not a 100-k PD.

Quoted 11 lines

board/denx/m53evk/m53evk.c line 97

Quoted 6 lines
board/denx/m53evk/m53evk.c new file +6 -0
+				);
+		gpio_direction_output(IOMUX_TO_GPIO(MX53_PIN_GPIO_4), 0);
+
+		/* USB OTG Over Current */
+		mxc_request_iomux(MX53_PIN_GPIO_18, IOMUX_CONFIG_ALT1);
+		mxc_iomux_set_input(MX53_USBOH3_IPP_IND_OTG_OC_SELECT_INPUT, 1);

It looks like there is something wrong here: The last line connects OTG.OC to EIM_D21.ALT6, but the line before sets GPIO_18 as GPIO7[13] instead of setting
EIM_D21 as OTG.OC.

Best regards,
Beno?t

#6 lore raw

PATCH v3 2/2 arm: mx5: Add support for DENX M53EVK

In reply to Benoît Thébaudeau

Dear Marek Vasut,

Quoted 30 lines · Beno?t Th?baudeau

Dear Marek Vasut,

Quoted 6 lines · Marek Vasut

Add basic support for the DENX M53EVK board. Currently supported is:
MMC (incl. booting)
NAND (incl. booting)
Ethernet, I2C, USB, SATA, RTC.

[...]

Quoted 6 lines
board/denx/m53evk/m53evk.c new file +0 -0
new file mode 100644
index 0000000..3289f28
@@ -0,0 +1,408 @@

[...]

Quoted 13 lines
board/denx/m53evk/m53evk.c new file +13 -0
+#ifdef CONFIG_USB_EHCI_MX5
+int board_ehci_hcd_init(int port)
+{
+	if (port == 0) {
+		/* USB OTG PWRON */
+		mxc_request_iomux(MX53_PIN_GPIO_4, IOMUX_CONFIG_ALT1);
+		mxc_iomux_set_pad(MX53_PIN_GPIO_4,
+				PAD_CTL_PKE_ENABLE |
+				PAD_CTL_100K_PD |
+				PAD_CTL_DRV_HIGH
+				);
+		gpio_direction_output(IOMUX_TO_GPIO(MX53_PIN_GPIO_4), 0);
+
Quoted 8 lines

board/denx/m53evk/m53evk.c line 97

Quoted 3 lines
board/denx/m53evk/m53evk.c new file +3 -0
+		/* USB OTG Over Current */
+		mxc_request_iomux(MX53_PIN_GPIO_18, IOMUX_CONFIG_ALT1);
+		mxc_iomux_set_input(MX53_USBOH3_IPP_IND_OTG_OC_SELECT_INPUT, 1);

It looks like there is something wrong here: The last line connects OTG.OC to EIM_D21.ALT6, but the line before sets GPIO_18 as GPIO7[13] instead of setting
EIM_D21 as OTG.OC.

According to http://www.denx-cs.de/doku/?q=m53pinout , USB_OTG_OC is on ball D7 (i.e. GPIO_18), and ball V3 (i.e. EIM_D21) is not on the SoM connector.

So can you clarify what's going on with this signal? Is it handled by software as a GPIO, and EIM_D21 is just tied high or low on the SoM to make the hardware controller not complain about a false OC detection?

Best regards,
Beno?t

#7 lore raw

PATCH v3 2/2 arm: mx5: Add support for DENX M53EVK

Dear Beno?t Th?baudeau,

Quoted 46 lines

Dear Marek Vasut,

Quoted 34 lines · Beno?t Th?baudeau

Dear Marek Vasut,

Quoted 6 lines · Marek Vasut

Add basic support for the DENX M53EVK board. Currently supported is:
MMC (incl. booting)
NAND (incl. booting)
Ethernet, I2C, USB, SATA, RTC.

[...]

Quoted 6 lines
board/denx/m53evk/m53evk.c new file +0 -0
new file mode 100644
index 0000000..3289f28
@@ -0,0 +1,408 @@

[...]

Quoted 13 lines
board/denx/m53evk/m53evk.c new file +13 -0
+#ifdef CONFIG_USB_EHCI_MX5
+int board_ehci_hcd_init(int port)
+{
+	if (port == 0) {
+		/* USB OTG PWRON */
+		mxc_request_iomux(MX53_PIN_GPIO_4, IOMUX_CONFIG_ALT1);
+		mxc_iomux_set_pad(MX53_PIN_GPIO_4,
+				PAD_CTL_PKE_ENABLE |
+				PAD_CTL_100K_PD |
+				PAD_CTL_DRV_HIGH
+				);
+		gpio_direction_output(IOMUX_TO_GPIO(MX53_PIN_GPIO_4), 0);
+
Quoted 8 lines

board/denx/m53evk/m53evk.c line 97

Quoted 3 lines
board/denx/m53evk/m53evk.c new file +3 -0
+		/* USB OTG Over Current */
+		mxc_request_iomux(MX53_PIN_GPIO_18, IOMUX_CONFIG_ALT1);
+		mxc_iomux_set_input(MX53_USBOH3_IPP_IND_OTG_OC_SELECT_INPUT, 1);

It looks like there is something wrong here: The last line connects OTG.OC to EIM_D21.ALT6, but the line before sets GPIO_18 as GPIO7[13] instead of setting
EIM_D21 as OTG.OC.

Quoted 7 lines

According to http://www.denx-cs.de/doku/?q=m53pinout , USB_OTG_OC is on ball D7 (i.e. GPIO_18), and ball V3 (i.e. EIM_D21) is not on the SoM connector.

So can you clarify what's going on with this signal? Is it handled by software as a GPIO, and EIM_D21 is just tied high or low on the SoM to make the hardware controller not complain about a false OC detection?

Yes, the OTG OC is handled by GPIO.

Best regards,
Marek Vasut

#8 lore raw

PATCH v3 2/2 arm: mx5: Add support for DENX M53EVK

Dear Marek Vasut,

Quoted 52 lines · Marek Vasut

Dear Beno?t Th?baudeau,

Quoted 50 lines

Dear Marek Vasut,

Quoted 34 lines · Beno?t Th?baudeau

Dear Marek Vasut,

Quoted 6 lines · Marek Vasut

Add basic support for the DENX M53EVK board. Currently supported is:
MMC (incl. booting)
NAND (incl. booting)
Ethernet, I2C, USB, SATA, RTC.

[...]

Quoted 6 lines
board/denx/m53evk/m53evk.c new file +0 -0
new file mode 100644
index 0000000..3289f28
@@ -0,0 +1,408 @@

[...]

Quoted 13 lines
board/denx/m53evk/m53evk.c new file +13 -0
+#ifdef CONFIG_USB_EHCI_MX5
+int board_ehci_hcd_init(int port)
+{
+	if (port == 0) {
+		/* USB OTG PWRON */
+		mxc_request_iomux(MX53_PIN_GPIO_4, IOMUX_CONFIG_ALT1);
+		mxc_iomux_set_pad(MX53_PIN_GPIO_4,
+				PAD_CTL_PKE_ENABLE |
+				PAD_CTL_100K_PD |
+				PAD_CTL_DRV_HIGH
+				);
+		gpio_direction_output(IOMUX_TO_GPIO(MX53_PIN_GPIO_4), 0);
+
Quoted 8 lines

board/denx/m53evk/m53evk.c line 97

Quoted 3 lines
board/denx/m53evk/m53evk.c new file +3 -0
+		/* USB OTG Over Current */
+		mxc_request_iomux(MX53_PIN_GPIO_18, IOMUX_CONFIG_ALT1);
+		mxc_iomux_set_input(MX53_USBOH3_IPP_IND_OTG_OC_SELECT_INPUT, 1);

It looks like there is something wrong here: The last line connects OTG.OC to EIM_D21.ALT6, but the line before sets GPIO_18 as GPIO7[13] instead of setting
EIM_D21 as OTG.OC.

According to http://www.denx-cs.de/doku/?q=m53pinout , USB_OTG_OC is on ball D7 (i.e. GPIO_18), and ball V3 (i.e. EIM_D21) is not on the SoM connector.

Quoted 5 lines
Quoted 3 lines

So can you clarify what's going on with this signal? Is it handled by software as a GPIO, and EIM_D21 is just tied high or low on the SoM to make the hardware controller not complain about a false OC detection?

Yes, the OTG OC is handled by GPIO.

So should "mxc_iomux_set_input(MX53_USBOH3_IPP_IND_OTG_OC_SELECT_INPUT, 1);" be dropped or not?

Best regards,
Beno?t

#9 lore raw

PATCH v3 2/2 arm: mx5: Add support for DENX M53EVK

Dear Beno?t Th?baudeau,

Quoted 29 lines

Dear Marek Vasut,

Quoted 26 lines · Marek Vasut

Dear Beno?t Th?baudeau,

Quoted 24 lines

Dear Marek Vasut,

Quoted 21 lines · Beno?t Th?baudeau

Dear Marek Vasut,

Quoted 6 lines · Marek Vasut

Add basic support for the DENX M53EVK board. Currently supported
is: MMC (incl. booting)
NAND (incl. booting)
Ethernet, I2C, USB, SATA, RTC.

[...]

Quoted 6 lines
(quoted diff) +0 -0

b/board/denx/m53evk/m53evk.c new file mode 100644
index 0000000..3289f28

board/denx/m53evk/m53evk.c new file +0 -0
@@ -0,0 +1,408 @@

[...]

Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
board/denx/m53evk/m53evk.c new file +4 -0
+#ifdef CONFIG_USB_EHCI_MX5
+int board_ehci_hcd_init(int port)
+{
+	if (port == 0) {
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

board/denx/m53evk/m53evk.c

Quoted 8 lines
board/denx/m53evk/m53evk.c new file +8 -0
+		/* USB OTG PWRON */
+		mxc_request_iomux(MX53_PIN_GPIO_4, IOMUX_CONFIG_ALT1);
+		mxc_iomux_set_pad(MX53_PIN_GPIO_4,
+				PAD_CTL_PKE_ENABLE |
+				PAD_CTL_100K_PD |
+				PAD_CTL_DRV_HIGH
+				);
+		gpio_direction_output(IOMUX_TO_GPIO(MX53_PIN_GPIO_4), 

0);

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

board/denx/m53evk/m53evk.c line 107

Quoted 4 lines
board/denx/m53evk/m53evk.c new file +4 -0
+
+		/* USB OTG Over Current */
+		mxc_request_iomux(MX53_PIN_GPIO_18, IOMUX_CONFIG_ALT1);
+		

mxc_iomux_set_input(MX53_USBOH3_IPP_IND_OTG_OC_SELECT_INPUT, 1);

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines

It looks like there is something wrong here: The last line connects OTG.OC to EIM_D21.ALT6, but the line before sets GPIO_18 as GPIO7[13] instead of setting
EIM_D21 as OTG.OC.

According to http://www.denx-cs.de/doku/?q=m53pinout , USB_OTG_OC is on ball D7 (i.e. GPIO_18), and ball V3 (i.e. EIM_D21) is not on the SoM connector.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

So can you clarify what's going on with this signal? Is it handled by software as a GPIO, and EIM_D21 is just tied high or low on the SoM to make the hardware controller not complain about a false OC detection?

Yes, the OTG OC is handled by GPIO.

So should "mxc_iomux_set_input(MX53_USBOH3_IPP_IND_OTG_OC_SELECT_INPUT, 1);" be dropped or not?

Yes.

Best regards,
Marek Vasut

#10 lore raw

PATCH v3 2/2 arm: mx5: Add support for DENX M53EVK

In reply to Marek Vasut
Quoted 13 lines · Marek Vasut

Add basic support for the DENX M53EVK board. Currently supported is:
MMC (incl. booting)
NAND (incl. booting)
Ethernet, I2C, USB, SATA, RTC.

Cc Albert ARIBAUD <[email protected]>
Cc Beno?t Th?baudeau <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Scott Wood <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Quoted 1 line

---

Applied to u-boot-imx, thanks.

Benoit's 24/25 will then fix the remaining issue - I am applying also that.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
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
=====================================================================
#11 lore raw

PATCH 1/2 tools: arm: imx: Implement BOOT_OFFSET command for imximage

In reply to Marek Vasut

Hi Marek,

Quoted 143 lines · Marek Vasut

Implement BOOT_OFFSET command for imximage. This command is parallel to current BOOT_FROM command, but allows more flexibility in configuring arbitrary image header offset. Also add an imximage.cfg with default offset values into arm/arch/imx-common/ so the board-specific imximage.cfg can include this file to avoid magic constants.

The syntax of BOOT_OFFSET command is "BOOT_OFFSET <u32 offset>".

Cc Albert ARIBAUD <[email protected]>
Cc Beno?t Th?baudeau <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Scott Wood <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>
---
 arch/arm/include/asm/imx-common/imximage.cfg |   30
 ++++++++++++++++++++++++++
 doc/README.imximage                          |   18 ++++++++++++++++
 tools/imximage.c                             |    6 ++++++
 tools/imximage.h                             |    6 ++++++
 4 files changed, 60 insertions(+)
 create mode 100644 arch/arm/include/asm/imx-common/imximage.cfg
arch/arm/include/asm/imx-common/imximage.cfg new file +30 -0
new file mode 100644
index 0000000..95daa3d
@@ -0,0 +1,30 @@
+/*
+ * i.MX image header offset values
+ * Copyright (C) 2013 Marek Vasut <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License or (at your option) any later version.
+ */
+
+/*
+ * NOTE: This file must be kept in sync with tools/imximage.h because
+ *       tools/imximage.c can not cross-include headers from arch/arm/
+ *       and vice-versa.
+ */
+
+#ifndef __ASM_IMX_COMMON_IMXIMAGE_CFG__
+#define __ASM_IMX_COMMON_IMXIMAGE_CFG__
+
+/* Standard image header offset for NAND, SATA, SD, SPI flash. */
+#define FLASH_OFFSET_STANDARD	0x400
+/* Specific image header offset for booting from OneNAND. */
+#define FLASH_OFFSET_ONENAND	0x100
+/* Specific image header offset for booting from memory-mapped NOR. */
+#define FLASH_OFFSET_NOR	0x1000
+
+#endif  /* __ASM_IMX_COMMON_IMXIMAGE_CFG__ */
doc/README.imximage +18 -0
index 073e3fc..802eb90 100644
@@ -65,9 +65,27 @@ Configuration command line syntax:
 				This command need appear the fist before
 				other valid commands in configuration file.
 
+	BOOT_OFFSET		value
+
+				This command is parallel to BOOT_FROM and
+				is preferred over BOOT_FROM.
+
+				value:  Offset of the image header, this
+					value shall be set to one of the
+					values found in the file:
+						arch/arm/include/asm/\
+						imx-common/imximage.cfg
+				Example:
+				BOOT_OFFSET FLASH_OFFSET_STANDARD
+
 	BOOT_FROM		nand/spi/sd/onenand/nor/sata
+
+				This command is parallel to BOOT_OFFSET and
+				is to be deprecated in favor of BOOT_OFFSET.
+
 				Example:
 				BOOT_FROM spi
+
 	DATA			type address value
 
 				type: word=4, halfword=2, byte=1
tools/imximage.c +6 -0
index c018562..5e8e470 100644
@@ -37,6 +37,7 @@
  */
 static table_entry_t imximage_cmds[] = {
 	{CMD_BOOT_FROM,         "BOOT_FROM",            "boot command",	  },
+	{CMD_BOOT_OFFSET,       "BOOT_OFFSET",          "Boot offset",	  },
 	{CMD_DATA,              "DATA",                 "Reg Write Data", },
 	{CMD_IMAGE_VERSION,     "IMAGE_VERSION",        "image version",  },
 	{-1,                    "",                     "",	          },
@@ -352,6 +353,11 @@ static void parse_cfg_cmd(struct imx_header *imxhdr,
 int32_t cmd, char *token,
 		if (unlikely(cmd_ver_first != 1))
 			cmd_ver_first = 0;
 		break;
+	case CMD_BOOT_OFFSET:
+		imxhdr->flash_offset = get_cfg_value(token, name, lineno);
+		if (unlikely(cmd_ver_first != 1))
+			cmd_ver_first = 0;
+		break;
 	case CMD_DATA:
 		value = get_cfg_value(token, name, lineno);
tools/imximage.c +0 -0
 		(*set_dcd_val)(imxhdr, name, lineno, fld, value, dcd_len);
tools/imximage.h +6 -1
index dfd2e9e..99e124a 100644
@@ -31,6 +31,11 @@
 
 #define HEADER_OFFSET	0x400
 
+/*
+ * NOTE: This file must be kept in sync with arch/arm/include/asm/\
+ *       imx-common/imximage.cfg because tools/imximage.c can not
+ *       cross-include headers from arch/arm/ and vice-versa.
+ */
 #define CMD_DATA_STR	"DATA"
 #define FLASH_OFFSET_UNDEFINED	0xFFFFFFFF
 #define FLASH_OFFSET_STANDARD	0x400
@@ -52,6 +57,7 @@ enum imximage_cmd {
 	CMD_INVALID,
 	CMD_IMAGE_VERSION,
 	CMD_BOOT_FROM,
+	CMD_BOOT_OFFSET,
 	CMD_DATA
 };
 
--
Quoted 1 line

1.7.10.4

This looks good to me.

Best regards,
Beno?t

#12 lore raw

PATCH 1/2 tools: arm: imx: Implement BOOT_OFFSET command for imximage

Dear Beno?t Th?baudeau,

Quoted 2 lines

Hi Marek,

[...]

Quoted 8 lines
Quoted 8 lines
tools/imximage.h +1 -0
@@ -52,6 +57,7 @@ enum imximage_cmd {
 
 	CMD_INVALID,
 	CMD_IMAGE_VERSION,
 	CMD_BOOT_FROM,
 
+	CMD_BOOT_OFFSET,
 
Quoted 8 lines
Quoted 6 lines

CMD_DATA

};

--
1.7.10.4

This looks good to me.

Yes, and it keeps compat too. Btw can you maybe use "[...]" to cut out the irrelevant parts of the emails so the relevant replies are easier to find please?

Best regards,
Marek Vasut

#13 lore raw

PATCH 1/2 tools: arm: imx: Implement BOOT_OFFSET command for imximage

Dear Marek Vasut,

Quoted 12 lines · Marek Vasut
Quoted 12 lines
Quoted 12 lines
tools/imximage.h +1 -0
@@ -52,6 +57,7 @@ enum imximage_cmd {
 
 	CMD_INVALID,
 	CMD_IMAGE_VERSION,
 	CMD_BOOT_FROM,
 
+	CMD_BOOT_OFFSET,
 

CMD_DATA

};

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

--
1.7.10.4

This looks good to me.

Yes, and it keeps compat too. Btw can you maybe use "[...]" to cut out the irrelevant parts of the emails so the relevant replies are easier to find please?

Will do. ;)

Best regards,
Beno?t

#14 lore raw

PATCH 1/2 tools: arm: imx: Implement BOOT_OFFSET command for imximage

In reply to Marek Vasut
Quoted 132 lines · Marek Vasut

Implement BOOT_OFFSET command for imximage. This command is parallel to current BOOT_FROM command, but allows more flexibility in configuring arbitrary image header offset. Also add an imximage.cfg with default offset values into arm/arch/imx-common/ so the board-specific imximage.cfg can include this file to avoid magic constants.

The syntax of BOOT_OFFSET command is "BOOT_OFFSET <u32 offset>".

Cc Albert ARIBAUD <[email protected]>
Cc Beno?t Th?baudeau <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Scott Wood <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>
---
 arch/arm/include/asm/imx-common/imximage.cfg |   30 ++++++++++++++++++++++++++
 doc/README.imximage                          |   18 ++++++++++++++++
 tools/imximage.c                             |    6 ++++++
 tools/imximage.h                             |    6 ++++++
 4 files changed, 60 insertions(+)
 create mode 100644 arch/arm/include/asm/imx-common/imximage.cfg
arch/arm/include/asm/imx-common/imximage.cfg new file +30 -0
new file mode 100644
index 0000000..95daa3d
@@ -0,0 +1,30 @@
+/*
+ * i.MX image header offset values
+ * Copyright (C) 2013 Marek Vasut <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License or (at your option) any later version.
+ */
+
+/*
+ * NOTE: This file must be kept in sync with tools/imximage.h because
+ *       tools/imximage.c can not cross-include headers from arch/arm/
+ *       and vice-versa.
+ */
+
+#ifndef __ASM_IMX_COMMON_IMXIMAGE_CFG__
+#define __ASM_IMX_COMMON_IMXIMAGE_CFG__
+
+/* Standard image header offset for NAND, SATA, SD, SPI flash. */
+#define FLASH_OFFSET_STANDARD	0x400
+/* Specific image header offset for booting from OneNAND. */
+#define FLASH_OFFSET_ONENAND	0x100
+/* Specific image header offset for booting from memory-mapped NOR. */
+#define FLASH_OFFSET_NOR	0x1000
+
+#endif  /* __ASM_IMX_COMMON_IMXIMAGE_CFG__ */
doc/README.imximage +18 -0
index 073e3fc..802eb90 100644
@@ -65,9 +65,27 @@ Configuration command line syntax:
 				This command need appear the fist before
 				other valid commands in configuration file.
 
+	BOOT_OFFSET		value
+
+				This command is parallel to BOOT_FROM and
+				is preferred over BOOT_FROM.
+
+				value:  Offset of the image header, this
+					value shall be set to one of the
+					values found in the file:
+						arch/arm/include/asm/\
+						imx-common/imximage.cfg
+				Example:
+				BOOT_OFFSET FLASH_OFFSET_STANDARD
+
 	BOOT_FROM		nand/spi/sd/onenand/nor/sata
+
+				This command is parallel to BOOT_OFFSET and
+				is to be deprecated in favor of BOOT_OFFSET.
+
 				Example:
 				BOOT_FROM spi
+
 	DATA			type address value
 
 				type: word=4, halfword=2, byte=1
tools/imximage.c +6 -0
index c018562..5e8e470 100644
@@ -37,6 +37,7 @@
  */
 static table_entry_t imximage_cmds[] = {
 	{CMD_BOOT_FROM,         "BOOT_FROM",            "boot command",	  },
+	{CMD_BOOT_OFFSET,       "BOOT_OFFSET",          "Boot offset",	  },
 	{CMD_DATA,              "DATA",                 "Reg Write Data", },
 	{CMD_IMAGE_VERSION,     "IMAGE_VERSION",        "image version",  },
 	{-1,                    "",                     "",	          },
@@ -352,6 +353,11 @@ static void parse_cfg_cmd(struct imx_header *imxhdr, int32_t cmd, char *token,
 		if (unlikely(cmd_ver_first != 1))
 			cmd_ver_first = 0;
 		break;
+	case CMD_BOOT_OFFSET:
+		imxhdr->flash_offset = get_cfg_value(token, name, lineno);
+		if (unlikely(cmd_ver_first != 1))
+			cmd_ver_first = 0;
+		break;
 	case CMD_DATA:
 		value = get_cfg_value(token, name, lineno);
 		(*set_dcd_val)(imxhdr, name, lineno, fld, value, dcd_len);
tools/imximage.h +5 -0
index dfd2e9e..99e124a 100644
@@ -31,6 +31,11 @@
 
 #define HEADER_OFFSET	0x400
 
+/*
+ * NOTE: This file must be kept in sync with arch/arm/include/asm/\
+ *       imx-common/imximage.cfg because tools/imximage.c can not
+ *       cross-include headers from arch/arm/ and vice-versa.
+ */
 #define CMD_DATA_STR	"DATA"
 #define FLASH_OFFSET_UNDEFINED	0xFFFFFFFF
 #define FLASH_OFFSET_STANDARD	0x400

tools/imximage.h enum imximage_cmd { · line 63

Quoted 7 lines
tools/imximage.h +1 -0
@@ -52,6 +57,7 @@ enum imximage_cmd {
 	CMD_INVALID,
 	CMD_IMAGE_VERSION,
 	CMD_BOOT_FROM,
+	CMD_BOOT_OFFSET,
 	CMD_DATA
 };
 

It looks great.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
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
=====================================================================
#15 lore raw

PATCH 1/2 tools: arm: imx: Implement BOOT_OFFSET command for imximage

In reply to Marek Vasut
Quoted 7 lines · Marek Vasut

Implement BOOT_OFFSET command for imximage. This command is parallel to current BOOT_FROM command, but allows more flexibility in configuring arbitrary image header offset. Also add an imximage.cfg with default offset values into arm/arch/imx-common/ so the board-specific imximage.cfg can include this file to avoid magic constants.

The syntax of BOOT_OFFSET command is "BOOT_OFFSET <u32 offset>".

Look good. Thanks.

Thanks,
Stefan

#16 lore raw

PATCH 1/2 tools: arm: imx: Implement BOOT_OFFSET command for imximage

In reply to Marek Vasut
Quoted 8 lines · Marek Vasut

Implement BOOT_OFFSET command for imximage. This command is parallel to current BOOT_FROM command, but allows more flexibility in configuring arbitrary image header offset. Also add an imximage.cfg with default offset values into arm/arch/imx-common/ so the board-specific imximage.cfg can include this file to avoid magic constants.

The syntax of BOOT_OFFSET command is "BOOT_OFFSET <u32 offset>".

Quoted 8 lines
Cc Albert ARIBAUD <[email protected]>
Cc Beno?t Th?baudeau <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Scott Wood <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Tom Rini <[email protected]>

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
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
=====================================================================