From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sat, 29 Aug 2015 17:45:37 +0200 Subject: [U-Boot] [PATCH] arm: socfpga: dm: Fix DM initialization failure after warm reset In-Reply-To: References: <55E01ECE.6020309@boschrexroth.de> <201508291646.25832.marex@denx.de> Message-ID: <201508291745.37378.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Saturday, August 29, 2015 at 04:49:37 PM, Simon Glass wrote: > Hi Marek, > > On 29 August 2015 at 08:46, Marek Vasut wrote: > > On Saturday, August 29, 2015 at 04:39:43 PM, Simon Glass wrote: > >> Hi Marek, > >> > >> On 29 August 2015 at 01:56, Marek Vasut wrote: > >> > On Saturday, August 29, 2015 at 01:21:31 AM, Simon Glass wrote: > >> > > Hi, > >> > > > >> > > On 28 August 2015 at 02:41, Jian Luo wrote: > >> > > > gd->dm_root is not cleared in SPL after warm reset. > >> > > > This might cause DM initilazation failure. > >> > > > > >> > > > Signed-off-by: Jian Luo > >> > > > --- > >> > > > > >> > > > arch/arm/mach-socfpga/spl.c | 6 ++++++ > >> > > > 1 file changed, 6 insertions(+) > >> > > > > >> > > > diff --git a/arch/arm/mach-socfpga/spl.c > >> > > > b/arch/arm/mach-socfpga/spl.c index 13ec24b..59fe1f2 100644 > >> > > > --- a/arch/arm/mach-socfpga/spl.c > >> > > > +++ b/arch/arm/mach-socfpga/spl.c > >> > > > @@ -181,5 +181,11 @@ void board_init_f(ulong dummy) > >> > > > > >> > > > /* Configure simple malloc base pointer into RAM. */ > >> > > > gd->malloc_base = CONFIG_SYS_TEXT_BASE + (1024 * 1024); > >> > > > > >> > > > + /* > >> > > > + * gd->dm_root might contain non-zero value after warm > >> > > > reset. + * Clear it to avoid dm_init error > >> > > > + */ > >> > > > + gd->dm_root = NULL; > >> > > > + > >> > > > > >> > > > board_init_r(NULL, 0); > >> > > > > >> > > > } > >> > > > > >> > > > -- > >> > > > 1.9.1 > >> > > > >> > > This does not look like the root cause to me. global_data is zeroed > >> > > by crt0.S if CONFIG_SPL_FRAMEWORK is set, which it seems to be for > >> > > socfpga. > >> > > > >> > > What boot path does 'warm reset' take? > >> > > >> > Warm reset resets the CPU core(s) and jumps to 0x0 in SRAM (without > >> > re-reading anything from the boot media). > >> > >> Does that mean it skips crt0.S? How come global_data is not zeroed > >> there? > > > > No, it does not mean it skips crt0.S . After the warm reset, the bootrom > > jumps onto the reset vector, so crt0.S (_main) must be executed. > > Then I don't understand the need for this patch. Apparently, the gd->dm_root is set to a non-NULL address for some (unknown) reason. I don't quite understand this myself. The only possibility which can lead to gd->dm_root being set to non-NULL address is that crt0.S _main is not executed, is that correct ?