[U-Boot-Users] Re: ENV_IS_EMBEDDED functionality

Wolfgang Denk wd at denx.de
Sat Jan 14 00:48:23 CET 2006


In message <43C82439.6030102 at comcast.net> you wrote:
> Thanks for the quick response. There are some Blackfin related questions 
> on the old list, but the attempt made a couple of years ago to submit 
> the patches was rejected for a lot of reasons. I was not involved at 
> that time.  I am attempting to determine if this ENV_IS_EMBEDDED 
> approach is also going to be rejected so I can find another way. It is 

Yes. Please don't invent new stuff without need. The existing code is
ugly (being a mess of #ifdef's), but serves a purpose  (minimal  code
footprint  because all these things get computed at compile time) and
covers all existing configurations so far.

> The source of my confusion is that ENV_IS_EMBEDDED is defined as follows 
> in environment.h
> #if (CFG_ENV_ADDR >= CFG_MONITOR_BASE) && \
>       (CFG_ENV_ADDR+CFG_ENV_SIZE) <= (CFG_MONITOR_BASE+CFG_MONITOR_LEN)
> #define ENV_IS_EMBEDDED 1
> #endif
> Isn't CFG_MONITOR_BASE the address where u-boot resides for execution? 

No. It's the start address  of  the  image  in  flash.  As  mentioned
before, this has *nothing* to do with execution.

> It is defined that way on the Blackfin code
> because CFG_MONITOR_BASE is defined as TEXT_BASE and TEXT_BASE is 
> defined as 0x07FC0000. The flash
> memory is located at CFG_FLASH_BASE (defined as 0x20000000) and 
> CFG_ENV_ADDR is 0x20004000. U-boot is loaded into flash at 0x20000000, 

Ummm... then 0x07FC0000 must be  a  RAM  address,  right?  Then  your
definition   of   CFG_MONITOR_BASE   is   broken.   You  should  have
CFG_MONITOR_BASE = 0x20000000.

> so the environment data does reside in flash even though the 
> ENV_IS_EMBEDDED test fails. The code gets around this by just defining 

Misconfiguration.

> it directly. So is CFG_MONITOR_BASE incorrectly defined and it should be 
> a flash address?? BTW the u-boot code is not compiled PIC, so the 

Yes.

> execution address must matc the link address.

...or you must relocate it.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There's an old story about the person who wished his computer were as
easy to use as his telephone. That wish has come  true,  since  I  no
longer know how to use my telephone.




More information about the U-Boot mailing list