summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx/include')
-rw-r--r--arch/arm/mach-imx/include/mach/barebox.lds.h12
-rw-r--r--arch/arm/mach-imx/include/mach/imx-flash-header.h34
2 files changed, 31 insertions, 15 deletions
diff --git a/arch/arm/mach-imx/include/mach/barebox.lds.h b/arch/arm/mach-imx/include/mach/barebox.lds.h
index 8e1eccda5b..a2932bd79f 100644
--- a/arch/arm/mach-imx/include/mach/barebox.lds.h
+++ b/arch/arm/mach-imx/include/mach/barebox.lds.h
@@ -5,13 +5,13 @@
.pre_image : { \
KEEP(*(.flash_header_start*)) \
. = 0x100; \
- KEEP(*(.flash_header_0x100*)) \
- KEEP(*(.dcd_entry_0x100*)) \
- KEEP(*(.image_len_0x100*)) \
+ KEEP(*(.flash_header_0x0100*)) \
+ KEEP(*(.dcd_entry_0x0100*)) \
+ KEEP(*(.image_len_0x0100*)) \
. = 0x400; \
- KEEP(*(.flash_header_0x400*)) \
- KEEP(*(.dcd_entry_0x400*)) \
- KEEP(*(.image_len_0x400*)) \
+ KEEP(*(.flash_header_0x0400*)) \
+ KEEP(*(.dcd_entry_0x0400*)) \
+ KEEP(*(.image_len_0x0400*)) \
. = 0x1000; \
KEEP(*(.flash_header_0x1000*)) \
KEEP(*(.dcd_entry_0x1000*)) \
diff --git a/arch/arm/mach-imx/include/mach/imx-flash-header.h b/arch/arm/mach-imx/include/mach/imx-flash-header.h
index 831a3aa1e3..f1054da08f 100644
--- a/arch/arm/mach-imx/include/mach/imx-flash-header.h
+++ b/arch/arm/mach-imx/include/mach/imx-flash-header.h
@@ -3,17 +3,33 @@
#define __flash_header_start __section(.flash_header_start)
-#define __flash_header_0x100 __section(.flash_header_0x100)
-#define __dcd_entry_0x100 __section(.dcd_entry_0x100)
-#define __image_len_0x100 __section(.image_len_0x100)
+#if defined(CONFIG_ARCH_IMX_INTERNAL_BOOT_NOR)
+ #define __flash_header_section __section(.flash_header_0x1000)
+ #define __dcd_entry_section __section(.dcd_entry_0x1000)
+ #define __image_len_section __section(.image_len_0x1000)
+ #define FLASH_HEADER_OFFSET 0x1000
+#elif defined(CONFIG_ARCH_IMX_INTERNAL_BOOT_ONENAND)
+ #define __flash_header_section __section(.flash_header_0x0100)
+ #define __dcd_entry_section __section(.dcd_entry_0x0100)
+ #define __image_len_section __section(.image_len_0x0100)
+ #define FLASH_HEADER_OFFSET 0x0100
+#else
+ #define __flash_header_section __section(.flash_header_0x0400)
+ #define __dcd_entry_section __section(.dcd_entry_0x0400)
+ #define __image_len_section __section(.image_len_0x0400)
+ #define FLASH_HEADER_OFFSET 0x0400
+#endif
-#define __flash_header_0x400 __section(.flash_header_0x400)
-#define __dcd_entry_0x400 __section(.dcd_entry_0x400)
-#define __image_len_0x400 __section(.image_len_0x400)
+/*
+ * NOR is not automatically copied anywhere by the boot ROM
+ */
+#if defined (CONFIG_ARCH_IMX_INTERNAL_BOOT_NOR)
+ #define DEST_BASE IMX_CS0_BASE
+#else
+ #define DEST_BASE TEXT_BASE
+#endif
-#define __flash_header_0x1000 __section(.flash_header_0x1000)
-#define __dcd_entry_0x1000 __section(.dcd_entry_0x1000)
-#define __image_len_0x1000 __section(.image_len_0x1000)
+#define FLASH_HEADER_BASE (DEST_BASE + FLASH_HEADER_OFFSET)
struct imx_dcd_entry {
unsigned long ptr_type;