On Fri, Dec 16, 2011 at 2:36 AM, Olof Kindgren <[email protected]>wrote:
> 2011/12/16 Jonas Bonn <[email protected]>: > > On Thu, 2011-12-15 at 17:49 +0000, Julius Baxter wrote: > > > >> In the reset vector currently in the kernel ( > >> > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=arch/openrisc/kernel/head.S;hb=HEAD > >> ) I see this: > >> > >> /* ---[ 0x100: RESET exception > ]----------------------------------------- */ > >> .org 0x100 > >> /* Jump to .init code at _start which lives in the .head section > >> * and will be discarded after boot. > >> */ > >> LOAD_SYMBOL_2_GPR(r4, _start) > >> tophys (r3,r4) /* MMU disabled */ > >> l.jr r3 > >> l.nop > >> > >> Which does not appear to clear registers at reset. > > > > Keep reading... what does _start do? Exactly... it starts by clearing > > registers!!! > > > > The problem, perhaps, is that the register clear is assuming that r0 > > really is 0...??? Perhaps the first thing we should be doing is loading > > r0 with a 0: > > > > l.movhi r0,hi(0) > > l.ori r0,r0,0 > > > > I haven't seen or heard about this issue before... why is this suddenly > > a problem for you? > > > > > It could be a simulator issue. Simulators sometimes handles these > things differently. (BTW, which sim are you using, Matthew?). And FPGA > will in almost all cases set the FFs to zero, so it wouldn't be an > issue there. > > Anyway, if this is the problem, hard-wiring r0 to zero would solve > both problems that Matthew reported > > -- > Olof Kindgren > This is a simulator issue that was not seen before most likely because no one tried to boot Linux in an RTL simulation. RTL simulators can assign more than '0' or '1' values during simulation. In this case, uninitialized values, 'X', which dominate binary values, are being assigned which cause the pipeline to stall when code tests for '0's and '1's. For reference, I am using ModelSim. I have been convinced that the best long term solution is to make sure newlib and Linux both initialize the structures before it attempts to use them. It would be nice if someone could submit such a patch, as it will take me a while to get back to the software side of things and make one myself. ---Matthew Hicks
_______________________________________________ OpenRISC mailing list [email protected] http://lists.openrisc.net/listinfo/openrisc
