[U-Boot] porting u-boot, few final questions

DaveKucharczyk david.kucharczyk at gmail.com
Tue Nov 11 18:39:42 CET 2014


So the issues of the variables changing were due to me initializing
everything in board_early_init_f(). I moved everything out of it except uart
setup. If I setup the uart in board_init() instead of board_early_init_f()
then the early cpu info stuff is missed. I guess there’s an opportunity for
improvement there.

I still have a question pertaining to the changing variables though. It has
to do with pre and post relocation. Variables declared in functions
pre-reloc will be different when used in functions post-reloc.

For instance. If I set a variable in board_early_init_f() and then, without
changing it, print it in board_late_init() then it will be different. 

So my question is how can I get around this?

This is where I’m stuck…

I’m trying to write the reset cause to SRAM in board_late_init(). The reset
cause is printed early by default when defining CONFIG_DISPLAY_CPUINFO in
the header file. 

When I access the register in board_late_init() it prints 0, which is wrong.

I tried…

and this(which is what arch/arm/imx-common/cpu.c uses to print reset cause)…

All return 0 when called in board_late_init() even though at startup the
correct reset cause is displayed, but I have to write it to SRAM later on.
And by that time it's 0. 

I think this has to do with what Wolfgang said about ds, bss, and stack, but
if someone can shed some light that would be great. :) Thanks




--
View this message in context: http://u-boot.10912.n7.nabble.com/porting-u-boot-MMU-question-tp194761p195618.html
Sent from the U-Boot mailing list archive at Nabble.com.


More information about the U-Boot mailing list