diff mbox

[U-Boot] pm9263: save environment at the NOR Flash end

Message ID 1315847907-28519-1-git-send-email-dimov@ronetix.at
State Changes Requested
Delegated to: Reinhard Meyer
Headers show

Commit Message

Asen Dimov Sept. 12, 2011, 5:18 p.m. UTC
This patch moves the sector for the environment from the gap between U-Boot
and the Linux kernel to the end of the NOR flash and this way lets the U-Boot
rom file to increase a little bit when adding functionality.

Signed-off-by: Asen Chavdarov Dimov <dimov@ronetix.at>
---
 include/configs/pm9263.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Wolfgang Denk Sept. 12, 2011, 6:39 p.m. UTC | #1
Dear Asen Chavdarov Dimov,

In message <1315847907-28519-1-git-send-email-dimov@ronetix.at> you wrote:
> This patch moves the sector for the environment from the gap between U-Boot
> and the Linux kernel to the end of the NOR flash and this way lets the U-Boot
> rom file to increase a little bit when adding functionality.
> 
> Signed-off-by: Asen Chavdarov Dimov <dimov@ronetix.at>
> ---
>  include/configs/pm9263.h |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h
> index 1e282d2..f1bd389 100644
> --- a/include/configs/pm9263.h
> +++ b/include/configs/pm9263.h
> @@ -340,9 +340,11 @@
>  #elif defined(CONFIG_SYS_USE_FLASH) /* CFG_USE_FLASH */
>  
>  #define CONFIG_ENV_IS_IN_FLASH	1
> -#define CONFIG_ENV_OFFSET	0x40000
>  #define CONFIG_ENV_SECT_SIZE	0x10000
>  #define	CONFIG_ENV_SIZE		0x10000
> +#define NORFLASH_SIZE		0x400000 /* 4MiB */
> +#define CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE + NORFLASH_SIZE - \
> +				CONFIG_ENV_SIZE)
>  #define CONFIG_ENV_OVERWRITE	1

NAK.  You should never define any static memory sizes like
NORFLASH_SIZE.  This is a value that gets automatically detected by
the flash driver.

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h
index 1e282d2..f1bd389 100644
--- a/include/configs/pm9263.h
+++ b/include/configs/pm9263.h
@@ -340,9 +340,11 @@ 
 #elif defined(CONFIG_SYS_USE_FLASH) /* CFG_USE_FLASH */
 
 #define CONFIG_ENV_IS_IN_FLASH	1
-#define CONFIG_ENV_OFFSET	0x40000
 #define CONFIG_ENV_SECT_SIZE	0x10000
 #define	CONFIG_ENV_SIZE		0x10000
+#define NORFLASH_SIZE		0x400000 /* 4MiB */
+#define CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE + NORFLASH_SIZE - \
+				CONFIG_ENV_SIZE)
 #define CONFIG_ENV_OVERWRITE	1
 
 /* JFFS Partition offset set */