9
0
Fork 0

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>
This commit is contained in:
Sascha Hauer 2009-12-02 14:02:20 +01:00
parent c762cdbb02
commit d870137a17
5 changed files with 71 additions and 50 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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;
};

View File

@ -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

View File

@ -1,5 +1,5 @@
#ifdef CONFIG_ARCH_IMX25
#if defined CONFIG_ARCH_IMX25 || defined CONFIG_ARCH_IMX35
#include <mach/u-boot.lds.h>
#endif