Skip to contentSkip to conversation

imx: kconfig: introduce IMX_FIXED_IVT_OFFSET

PATCH New Peng Fan 2 participants 3 messages Jun 29, 2016 – Jul 13, 2016

Subsystems (2)
lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/2 imx: kconfig: introduce IMX_FIXED_IVT_OFFSET

Introduce IMX_FIXED_IVT_OFFSET, which means different boot medias use the same IVT offset. To i.MX7, different boot medias' IVT offset is fixed at 0x400. So select IMX_FIXED_IVT_OFFSET for i.MX7D.

Cc Stefano Babic <[email protected]>
---
 arch/arm/cpu/armv7/mx7/Kconfig | 1 +
 arch/arm/imx-common/Kconfig    | 7 +++++++
 2 files changed, 8 insertions(+)
arch/arm/cpu/armv7/mx7/Kconfig +1 -0
index ecfa4a2..6e70394 100644
@@ -7,6 +7,7 @@ config MX7
 
 config MX7D
 	select ROM_UNIFIED_SECTIONS
+	select IMX_FIXED_IVT_OFFSET
 	bool
 
 choice
arch/arm/imx-common/Kconfig +7 -0
index 1b7da5a..b248ef3 100644
@@ -4,6 +4,13 @@ config IMX_CONFIG
 config ROM_UNIFIED_SECTIONS
 	bool
 
+config IMX_FIXED_IVT_OFFSET
+	bool "The IVT offset for different medias fixed or not"
+	help
+	  The IVT offset for different boot medias are fixed or not.
+	  To i.MX7, the IVT offset for different boot medias are
+	  fixed.
+
 config IMX_RDC
 	bool "i.MX Resource domain controller driver"
 	depends on ARCH_MX6 || ARCH_MX7
Signature · 1 line
2.6.2
author
#1 lore raw

PATCH 2/2 imximage: differentiate IVT offset for IMX_FIXED_IVT_OFFSET

When IMX_FIXED_IVT_OFFSET defined, use FLASH_OFFSET_STANDARD for different boot medias. This is needed for i.MX7.

Cc Stefano Babic <[email protected]>
---
 tools/imximage.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
tools/imximage.h +8 -1
index c7b9b5c..531dc7b 100644
@@ -26,10 +26,17 @@
 #define FLASH_OFFSET_NAND	FLASH_OFFSET_STANDARD
 #define FLASH_OFFSET_SD		FLASH_OFFSET_STANDARD
 #define FLASH_OFFSET_SPI	FLASH_OFFSET_STANDARD
+#define FLASH_OFFSET_SATA	FLASH_OFFSET_STANDARD
+
+#ifdef CONFIG_IMX_FIXED_IVT_OFFSET
+#define FLASH_OFFSET_ONENAND	FLASH_OFFSET_STANDARD
+#define FLASH_OFFSET_NOR	FLASH_OFFSET_STANDARD
+#define FLASH_OFFSET_QSPI	FLASH_OFFSET_STANDARD
+#else
 #define FLASH_OFFSET_ONENAND	0x100
 #define FLASH_OFFSET_NOR	0x1000
-#define FLASH_OFFSET_SATA	FLASH_OFFSET_STANDARD
 #define FLASH_OFFSET_QSPI	0x1000
+#endif
 
 /* Initial Load Region Size */
 #define FLASH_LOADSIZE_UNDEFINED	0xFFFFFFFF
Signature · 1 line
2.6.2
#2 lore raw

PATCH 1/2 imx: kconfig: introduce IMX_FIXED_IVT_OFFSET

In reply to Peng Fan

Hi Peng,

Quoted 4 lines · Peng Fan

Introduce IMX_FIXED_IVT_OFFSET, which means different boot medias use the same IVT offset. To i.MX7, different boot medias' IVT offset is fixed at 0x400. So select IMX_FIXED_IVT_OFFSET for i.MX7D.

It is nice that this discrepancy in the IVT offset is getting rid with new SOCs. Very good idea by Hardware Designs.

However, I do not think it is a great to add a CONFIG_ switch. Reason is that mkimage is a tool, and it can be maybe compiled once and used with several SOCs without rebuilding. If you are using inside a Yocto-build, there is not problem, else...

That means that some diversities should be managed at runtime by mkimage itself, without rebuilding. We have two possibilities for that:

- adding some parameters tro mkimage. Well, this remains often undocumented and the parameter can conflict with other image types. I mention this, but I do not like.

- add this kind of flag to the imximage.cfg file.

There is already a BOOT_OFFSET attribute, see for example board/freescale/vf610twr/imximage.cfg:

#include <asm/imx-common/imximage.cfg>

/* image version */
IMAGE_VERSION 2

/* Boot Offset 0x400, valid for both SD and NAND boot */
BOOT_OFFSET FLASH_OFFSET_STANDARD

asm/imx-common/imximage.cfg contains i.MX6 offsets, but nevertheless, can we used the same way for i.MX7, too ?

Quoted 28 lines
Cc Stefano Babic <[email protected]>
---
 arch/arm/cpu/armv7/mx7/Kconfig | 1 +
 arch/arm/imx-common/Kconfig    | 7 +++++++
 2 files changed, 8 insertions(+)
arch/arm/cpu/armv7/mx7/Kconfig +1 -0
index ecfa4a2..6e70394 100644
@@ -7,6 +7,7 @@ config MX7
 
 config MX7D
 	select ROM_UNIFIED_SECTIONS
+	select IMX_FIXED_IVT_OFFSET
 	bool
 
 choice
arch/arm/imx-common/Kconfig +0 -0
index 1b7da5a..b248ef3 100644
@@ -4,6 +4,13 @@ config IMX_CONFIG
 config ROM_UNIFIED_SECTIONS
 	bool
 

arch/arm/imx-common/Kconfig config IMX_CONFIG · line 16

Quoted 10 lines
arch/arm/imx-common/Kconfig +7 -0
+config IMX_FIXED_IVT_OFFSET
+	bool "The IVT offset for different medias fixed or not"
+	help
+	  The IVT offset for different boot medias are fixed or not.
+	  To i.MX7, the IVT offset for different boot medias are
+	  fixed.
+
 config IMX_RDC
 	bool "i.MX Resource domain controller driver"
 	depends on ARCH_MX6 || ARCH_MX7

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================