Patchwork [U-Boot] imximage: Add support for NOR boot

login
register
mail settings
Submitter Fabio Estevam
Date Dec. 3, 2011, 12:48 p.m.
Message ID <1322916517-9002-1-git-send-email-festevam@gmail.com>
Download mbox | patch
Permalink /patch/129082/
State Changes Requested
Delegated to: Stefano Babic
Headers show

Comments

Fabio Estevam - Dec. 3, 2011, 12:48 p.m.
From: Fabio Estevam <fabio.estevam@freescale.com>

Add support for NOR boot on imximage.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 doc/README.imximage |    7 +++++--
 tools/imximage.c    |    1 +
 tools/imximage.h    |    1 +
 3 files changed, 7 insertions(+), 2 deletions(-)
Stefano Babic - Dec. 4, 2011, 9:18 a.m.
Am 03/12/2011 13:48, schrieb Fabio Estevam:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Add support for NOR boot on imximage.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Hi Fabio,

>  This command copies the u-boot image at the address 0x400, as required
> -by the processor.
> +by the processor when booting from SD/MMC.

This is incomplete: this offset is valid also for NAND/PATA/SPI.

Best regards,
Stefano Babic
Wolfgang Denk - Dec. 5, 2011, 10:26 p.m.
Dear Fabio Estevam,

In message <1322916517-9002-1-git-send-email-festevam@gmail.com> you wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Add support for NOR boot on imximage.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
...
> --- a/tools/imximage.c
> +++ b/tools/imximage.c
> @@ -51,6 +51,7 @@ static table_entry_t imximage_bootops[] = {
>  	{FLASH_OFFSET_NAND,	"nand",		"NAND Flash",	},
>  	{FLASH_OFFSET_SD,	"sd",		"SD Card",	},
>  	{FLASH_OFFSET_ONENAND,	"onenand",	"OneNAND Flash",},
> +	{FLASH_OFFSET_NOR,	"nor",		"NOR Flash",	},

Can we please sort this list?  Thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/doc/README.imximage b/doc/README.imximage
index c74239d..21bf897 100644
--- a/doc/README.imximage
+++ b/doc/README.imximage
@@ -64,7 +64,7 @@  Configuration command line syntax:
 				This command need appear the fist before
 				other valid commands in configuration file.
 
-	BOOT_FROM		nand/spi/sd/onenand
+	BOOT_FROM		nand/spi/sd/onenand/nor
 				Example:
 				BOOT_FROM spi
 	DATA			type address value
@@ -187,7 +187,10 @@  I use dd:
 dd if=u-boot.imx of=/dev/mmcblk0 bs=512 seek=2
 
 This command copies the u-boot image at the address 0x400, as required
-by the processor.
+by the processor when booting from SD/MMC.
+
+Note: if copying u-boot.imx to NOR flash the offset should be
+0x1000. For onenand the offset is 0x100.
 
 Now remove your card from the PC and go to the target. If evrything went right,
 the u-boot prompt should come after power on.
diff --git a/tools/imximage.c b/tools/imximage.c
index 8e81bdb..c4fa135 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -51,6 +51,7 @@  static table_entry_t imximage_bootops[] = {
 	{FLASH_OFFSET_NAND,	"nand",		"NAND Flash",	},
 	{FLASH_OFFSET_SD,	"sd",		"SD Card",	},
 	{FLASH_OFFSET_ONENAND,	"onenand",	"OneNAND Flash",},
+	{FLASH_OFFSET_NOR,	"nor",		"NOR Flash",	},
 	{-1,			"",		"Invalid",	},
 };
 
diff --git a/tools/imximage.h b/tools/imximage.h
index d126a46..da1447f 100644
--- a/tools/imximage.h
+++ b/tools/imximage.h
@@ -37,6 +37,7 @@ 
 #define FLASH_OFFSET_SD		FLASH_OFFSET_STANDARD
 #define FLASH_OFFSET_SPI	FLASH_OFFSET_STANDARD
 #define FLASH_OFFSET_ONENAND	0x100
+#define FLASH_OFFSET_NOR	0x1000
 
 #define IVT_HEADER_TAG 0xD1
 #define IVT_VERSION 0x40