[U-Boot] [PATCH] atngw100: Use virtual address in CONFIG_ENV_ADDR

Wolfgang Denk wd at denx.de
Fri Aug 28 13:56:10 CEST 2009


Dear Haavard Skinnemoen,

In message <1251448970-15252-1-git-send-email-haavard.skinnemoen at atmel.com> you wrote:
> Ever since the CFI driver was rewritten to use virtual addresses, thus
> eliminating the whole point of the map_physmem() macro, ATNGW100 has
> been broken like this:
> 
> U-Boot> saveenv
> Saving Environment to Flash...
> Error: start and/or end address not on sector boundary
> 
> So let's take a different approach and store the virtual address in
> CONFIG_ENV_ADDR. I personally believe that's rubbish and will break
> whenever we decide to change the virtual-to-physical mapping in any way,
> but it looks like it's the direction in which u-boot is currently
> moving, and it does fix the problem.
> 
> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen at atmel.com>
> ---
>  include/configs/atngw100.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/configs/atngw100.h b/include/configs/atngw100.h
> index 4ed5514..9777ec0 100644
> --- a/include/configs/atngw100.h
> +++ b/include/configs/atngw100.h
> @@ -155,7 +155,7 @@
>  
>  #define CONFIG_ENV_IS_IN_FLASH		1
>  #define CONFIG_ENV_SIZE			65536
> -#define CONFIG_ENV_ADDR			(CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE - CONFIG_ENV_SIZE)
> +#define CONFIG_ENV_ADDR			(0xa0000000 + CONFIG_SYS_FLASH_SIZE - CONFIG_ENV_SIZE)

This is definitely a change to the worse.

I feel a strong urge to NAK this. There must be a better way to fix
the problems you are experiencing.

Stefan, can you please comment, too?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
He who hesitates is not only lost, but miles from the next exit.


More information about the U-Boot mailing list