Hi Mike, 2011/11/29 Macpaul Lin <macp...@gmail.com>
> Hi Mike, > > This reply didn't CC to u-boot mailing list. So I forward it again. > 2011/11/24 Mike Frysinger <vap...@gentoo.org> > >> On Tuesday 22 November 2011 21:16:50 Macpaul Lin wrote: >> > 2011/11/19 Mike Frysinger <vap...@gentoo.org> >> > > > +.globl turnoff_watchdog >> > > > +turnoff_watchdog: >> > > > + >> > > >> > > can't this be C code ? >> > >> > This is because after reset, the watchdog might be enabled if there is >> > another boot loader has ran before u-boot. >> > If the other boot loader enabled watchdog but didn't stop it, >> > it might cause u-boot to be reset during assembly initialization phase. >> > So we need to disable watchdog here. >> >> > The initialize procedure of NDS32 N1213 CPU is mentioned as follows. > > 1st, we set correct vector size in the system registers inside the cpu to > make sure the > vector table works well. > 2nd, do dram/ddr dram controller initialize since there are no memory like > SRAM on > SoC could be able to used as stack. > 3rd, do this watchdog disable to prevent the continuous boot strap will be > interrupted by > hardware reset due to watchdog timeout. > 4th, do small stack setup to prepare C environment which based on step > No.2, dram/ddr > controller initialize. With out this memory initialization, the C stack > couldn't be initialized > and board_init_f() cannot be executed. > > Of course you can do disable watchdog timer later inside board_init_f(), > but we're afraid > of to increase the probability of boot up fail caused by watchdog reset. > > >> my point is, why can't turnoff_watchdog() be written in C ? why does >> this func >> need to be written in assembly ? >> >> looking at the start.S, seems like there's a bit of logic there that >> should be >> in C and not a lot of asm. *shrug* too late now i guess. >> -mike >> > > Which left in start.S included the copy loop for relocation, and .got, > .bss fixup. > Others are vectors and I/D cache operation if you want to use in > board_init_f(). > Please give us your idea and see if this will be better. > > Thanks! > Thanks. -- Best regards, Macpaul Lin
_______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot