summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-12-02 14:02:20 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2009-12-03 11:12:51 +0100
commitd870137a17bf02e0c2d88ecb6c1346e443b434a3 (patch)
tree522f11f99d8defc0492764410245ab2307961094
parentc762cdbb021987177e9e8912cb0f8b8dd46cf213 (diff)
downloadbarebox-d870137a17bf02e0c2d88ecb6c1346e443b434a3.tar.gz
barebox-d870137a17bf02e0c2d88ecb6c1346e443b434a3.tar.xz
i.MX flash header: make it work on i.MX35
The flash header is used on different i.MXs other than the i.MX25, so rename it. Also, add a possibility to put a flash header on different offsets (0x100, 0x400 and 0x1000), needed for different boot mediums. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-imx/Kconfig4
-rw-r--r--arch/arm/mach-imx/include/mach/imx-flash-header.h48
-rw-r--r--arch/arm/mach-imx/include/mach/imx25-flash-header.h44
-rw-r--r--arch/arm/mach-imx/include/mach/u-boot.lds.h23
-rw-r--r--include/asm-generic/u-boot.lds.h2
5 files changed, 71 insertions, 50 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 8927bb4732..a0e828a8c0 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -29,6 +29,10 @@ config BOARDINFO
config ARCH_HAS_FEC_IMX
bool
+config ARCH_IMX_INTERNAL_BOOT
+ bool "support internal boot mode"
+ depends on ARCH_IMX25 || ARCH_IMX35
+
comment "Freescale i.MX System-on-Chip"
choice
diff --git a/arch/arm/mach-imx/include/mach/imx-flash-header.h b/arch/arm/mach-imx/include/mach/imx-flash-header.h
new file mode 100644
index 0000000000..831a3aa1e3
--- /dev/null
+++ b/arch/arm/mach-imx/include/mach/imx-flash-header.h
@@ -0,0 +1,48 @@
+#ifndef __MACH_FLASH_HEADER_H
+#define __MACH_FLASH_HEADER_H
+
+#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)
+
+#define __flash_header_0x400 __section(.flash_header_0x400)
+#define __dcd_entry_0x400 __section(.dcd_entry_0x400)
+#define __image_len_0x400 __section(.image_len_0x400)
+
+#define __flash_header_0x1000 __section(.flash_header_0x1000)
+#define __dcd_entry_0x1000 __section(.dcd_entry_0x1000)
+#define __image_len_0x1000 __section(.image_len_0x1000)
+
+struct imx_dcd_entry {
+ unsigned long ptr_type;
+ unsigned long addr;
+ unsigned long val;
+};
+
+#define DCD_BARKER 0xb17219e9
+
+struct imx_rsa_public_key {
+ unsigned char rsa_exponent[4];
+ unsigned char *rsa_modululs;
+ unsigned short *exponent_size;
+ unsigned short modulus_size;
+ unsigned char init_flag;
+};
+
+#define APP_CODE_BARKER 0x000000b1
+
+struct imx_flash_header {
+ unsigned long app_code_jump_vector;
+ unsigned long app_code_barker;
+ unsigned long app_code_csf;
+ unsigned long dcd_ptr_ptr;
+ unsigned long super_root_key;
+ unsigned long dcd;
+ unsigned long app_dest;
+ unsigned long dcd_barker;
+ unsigned long dcd_block_len;
+};
+
+#endif /* __MACH_FLASH_HEADER_H */
diff --git a/arch/arm/mach-imx/include/mach/imx25-flash-header.h b/arch/arm/mach-imx/include/mach/imx25-flash-header.h
deleted file mode 100644
index 59860dbda7..0000000000
--- a/arch/arm/mach-imx/include/mach/imx25-flash-header.h
+++ /dev/null
@@ -1,44 +0,0 @@
-
-#define __flash_header_start __section(.flash_header_start)
-#define __flash_header __section(.flash_header)
-#define __dcd_entry __section(.dcd_entry)
-#define __image_len __section(.image_len)
-
-struct mx25_dcd_entry {
- unsigned long ptr_type;
- unsigned long addr;
- unsigned long val;
-};
-
-#define DCD_BARKER 0xb17219e9
-
-struct mx25_dcd_header {
- unsigned long barker;
- unsigned long block_len;
-};
-
-struct mx25_rsa_public_key {
- unsigned char rsa_exponent[4];
- unsigned char *rsa_modululs;
- unsigned short *exponent_size;
- unsigned short modulus_size;
- unsigned char init_flag;
-};
-
-#define APP_CODE_BARKER 0x000000b1
-
-struct mx25_flash_header {
- void *app_code_jump_vector;
- unsigned long app_code_barker;
- void *app_code_csf;
- struct mx25_dcd_header **dcd_ptr_ptr;
- struct mx25_rsa_public_key *super_root_key;
- struct mx25_dcd_header *dcd;
- void *app_dest;
-};
-
-struct mx25_nand_flash_header {
- struct mx25_flash_header flash_header;
- struct mx25_dcd_header dcd_header;
-};
-
diff --git a/arch/arm/mach-imx/include/mach/u-boot.lds.h b/arch/arm/mach-imx/include/mach/u-boot.lds.h
index 52eb458f0f..8e1eccda5b 100644
--- a/arch/arm/mach-imx/include/mach/u-boot.lds.h
+++ b/arch/arm/mach-imx/include/mach/u-boot.lds.h
@@ -1,9 +1,22 @@
-#define PRE_IMAGE .pre_image : { \
+#ifdef CONFIG_ARCH_IMX_INTERNAL_BOOT
+
+#define PRE_IMAGE \
+ .pre_image : { \
KEEP(*(.flash_header_start*)) \
- . = ALIGN(0x400); \
- KEEP(*(.flash_header*)) \
- KEEP(*(.dcd_entry*)) \
- KEEP(*(.image_len*)) \
+ . = 0x100; \
+ KEEP(*(.flash_header_0x100*)) \
+ KEEP(*(.dcd_entry_0x100*)) \
+ KEEP(*(.image_len_0x100*)) \
+ . = 0x400; \
+ KEEP(*(.flash_header_0x400*)) \
+ KEEP(*(.dcd_entry_0x400*)) \
+ KEEP(*(.image_len_0x400*)) \
+ . = 0x1000; \
+ KEEP(*(.flash_header_0x1000*)) \
+ KEEP(*(.dcd_entry_0x1000*)) \
+ KEEP(*(.image_len_0x1000*)) \
+ . = 0x2000; \
}
+#endif
diff --git a/include/asm-generic/u-boot.lds.h b/include/asm-generic/u-boot.lds.h
index 1a5f2f7753..2202627534 100644
--- a/include/asm-generic/u-boot.lds.h
+++ b/include/asm-generic/u-boot.lds.h
@@ -1,5 +1,5 @@
-#ifdef CONFIG_ARCH_IMX25
+#if defined CONFIG_ARCH_IMX25 || defined CONFIG_ARCH_IMX35
#include <mach/u-boot.lds.h>
#endif