From: DaveKucharczyk Date: Tue, 11 Nov 2014 10:39:42 -0700 (MST) Subject: [U-Boot] porting u-boot, few final questions In-Reply-To: <1415658068088-195488.post@n7.nabble.com> References: <545A90D3.7030607@denx.de> <1415304221761-194989.post@n7.nabble.com> <1415632455656-195399.post@n7.nabble.com> <20141110154744.0F12438230A@gemini.denx.de> <5460FBE0.3070506@mail.bg> <1415652312700-195451.post@n7.nabble.com> <1415658068088-195488.post@n7.nabble.com> Message-ID: <1415727582773-195618.post@n7.nabble.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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.