[U-Boot] [PATCH] driver/mxc_i2c: Move static data structure to global_data

Wolfgang Denk wd at denx.de
Tue Feb 11 20:59:18 CET 2014


Dear York Sun,

In message <52FA7DFD.5060406 at freescale.com> you wrote:
>
> Thanks for the insight. I am not using SPL either. I need this driver to run
> before u-boot relocates to DDR. Everything is in flash. I need to find a
> writable location for the variable srdata. I can put this section in linker script
> 
>        .data.sram :
>        {
>                drivers/i2c/built-in.o (.data)
>        } > sram
}

Please do not invent totally new ways to have writable data before
relocation.  Use the existing machanisms.  While running from flash,
we have but what little memory we can find in on-chip memory or SRAM
or data chace; we use this for the stack and global data (which should
be kept as small as possible, to allow for a as much stack as possible).

So ideally keep this data on the stack, and if there is no way around
it, in the global data structure.

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
A dog always bit deepest on the veterinary hand.
                                    - Terry Pratchett, _Wyrd Sisters_


More information about the U-Boot mailing list