diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-07-31 14:09:26 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-07-31 19:59:54 +0200 |
commit | e3040756e6a6d119198f76299efd81eb3a2d641a (patch) | |
tree | d92d1b8f6f964f02bfa4420d6e9f23f5bbd49ab4 /arch/arm/mach-imx | |
parent | 5f7811292054b39a82109da66e8d1e79e862b758 (diff) | |
download | barebox-e3040756e6a6d119198f76299efd81eb3a2d641a.tar.gz barebox-e3040756e6a6d119198f76299efd81eb3a2d641a.tar.xz |
ARM i.MX: Add support for internal serial boot mode
This mode is needed for bootstrapping a board via USB serial.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/Kconfig | 10 | ||||
-rw-r--r-- | arch/arm/mach-imx/include/mach/barebox.lds.h | 12 | ||||
-rw-r--r-- | arch/arm/mach-imx/include/mach/imx-flash-header.h | 9 |
3 files changed, 30 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 5b7724561a..e54d498e6f 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -101,6 +101,16 @@ config ARCH_IMX_INTERNAL_BOOT_NOR config ARCH_IMX_INTERNAL_BOOT_ONENAND bool "OneNAND" +config ARCH_IMX_INTERNAL_BOOT_SERIAL + bool "Serial (read help)" + help + Normally the first instruction of the barebox image contains a jump + to the real start of the image which means that you can start it by + jumping to the load address. With serial boot images this is not + possible because the first instruction is occupied by a magic for the + ROM boot code. You can still start this image as a second stage loader, + but you have to add 0x400 to the entry point. + endchoice config NAND_IMX_BOOT diff --git a/arch/arm/mach-imx/include/mach/barebox.lds.h b/arch/arm/mach-imx/include/mach/barebox.lds.h index a2932bd79f..2e60282c6d 100644 --- a/arch/arm/mach-imx/include/mach/barebox.lds.h +++ b/arch/arm/mach-imx/include/mach/barebox.lds.h @@ -1,6 +1,16 @@ #ifdef CONFIG_ARCH_IMX_INTERNAL_BOOT +#ifdef CONFIG_ARCH_IMX_INTERNAL_BOOT_SERIAL +#define PRE_IMAGE \ + .pre_image : { \ + KEEP(*(.flash_header_0x0*)) \ + KEEP(*(.dcd_entry_0x0*)) \ + KEEP(*(.image_len_0x0*)) \ + . = 0x400; \ + } +#else + #define PRE_IMAGE \ .pre_image : { \ KEEP(*(.flash_header_start*)) \ @@ -19,4 +29,4 @@ . = 0x2000; \ } #endif - +#endif 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 ca2fe9f3d3..a51d4736fa 100644 --- a/arch/arm/mach-imx/include/mach/imx-flash-header.h +++ b/arch/arm/mach-imx/include/mach/imx-flash-header.h @@ -15,6 +15,11 @@ #define __dcd_entry_section __section(.dcd_entry_0x0100) #define __image_len_section __section(.image_len_0x0100) #define FLASH_HEADER_OFFSET 0x0100 +#elif defined(CONFIG_ARCH_IMX_INTERNAL_BOOT_SERIAL) + #define __flash_header_section __section(.flash_header_0x0) + #define __dcd_entry_section __section(.dcd_entry_0x0) + #define __image_len_section __section(.image_len_0x0) + #define FLASH_HEADER_OFFSET 0x0 #else #define __flash_header_section __section(.flash_header_0x0400) #define __dcd_entry_section __section(.dcd_entry_0x0400) @@ -34,6 +39,10 @@ #define __dcd_entry_0x0400 __section(.dcd_entry_0x0400) #define __image_len_0x0400 __section(.image_len_0x0400) +#define __flash_header_0x0 __section(.flash_header_0x0) +#define __dcd_entry_0x0 __section(.dcd_entry_0x0) +#define __image_len_0x0 __section(.image_len_0x0) + /* * NOR is not automatically copied anywhere by the boot ROM */ |