FPGARelated.com
Forums

Booting Linux from my own bootloader

Started by Martin Brückner April 26, 2010
Martin Br=FCckner wrote:
> When I started with this project I was sure that Linux invalidates > caches
Whatever Linux does, it doesn't matter unless the CPU is able to see and execute it.
On Wed, 28 Apr 2010 00:12:05 +0200, Martin Br&#4294967295;ckner <bj2spam@alice-dsl.net>
wrote:

>Am Tue, 27 Apr 2010 11:17:03 +0100 >schrieb Brian Drummond <brian_drummond@btconnect.com>: > >> On Tue, 27 Apr 2010 10:03:34 +0200, Martin Br&#4294967295;ckner >> <bj2spam@alice-dsl.net> wrote:
>> >> > (*linux)(); >> >> >> >> With the assumption that data pointers can be properly >> >> cast to function pointers, that line should jump to >> >> location 0x4002b4 and start executing the code there.
>> Xilinx example code typically has boilerplate to do things like >> invalidate caches and set up interrupt state before handing over to >> "real" code.
>> Have you covered these bases in your own code? > >When I started with this project I was sure that Linux invalidates >caches and sets up the interrupt state a
You are probably correct on interrupts, but on caches...
>Anyway, all I tried out yet was disabling the cache but that did not >help.
That would do it. Lets Linux invalidate, then enable them when safe. If that's not your problem, then I can't help further. The only other gotchas I remember are: (1) the interrupt vector table has to be on a 64k boundary. The tools let you put it anywhere but the bottom 16 address bits are chopped by the PPC! (2) Downloading a bitfile via Impact, there was one (probably V2Pro-specific) tick box that had to be set to reset the PPC correctly. The only reason I mention this was that starting via XMD worked correctly. - Brian
Am Wed, 28 Apr 2010 12:12:48 +0100
schrieb Brian Drummond <brian_drummond@btconnect.com>:

> On Wed, 28 Apr 2010 00:12:05 +0200, Martin Br=FCckner <bj2spam@alice-dsl.=
net>
> wrote: >=20 > >Am Tue, 27 Apr 2010 11:17:03 +0100 > >schrieb Brian Drummond <brian_drummond@btconnect.com>: > > > >> On Tue, 27 Apr 2010 10:03:34 +0200, Martin Br=FCckner > >> <bj2spam@alice-dsl.net> wrote: >=20 > >> >> > (*linux)(); > >> >>=20 > >> >> With the assumption that data pointers can be properly > >> >> cast to function pointers, that line should jump to=20 > >> >> location 0x4002b4 and start executing the code there. >=20 > >> Xilinx example code typically has boilerplate to do things like > >> invalidate caches and set up interrupt state before handing over to > >> "real" code. >=20 > >> Have you covered these bases in your own code? > > > >When I started with this project I was sure that Linux invalidates > >caches and sets up the interrupt state a >=20 > You are probably correct on interrupts, but on caches... >=20 > >Anyway, all I tried out yet was disabling the cache but that did not > >help.=20 >=20 > That would do it. Lets Linux invalidate, then enable them when safe. > If that's not your problem, then I can't help further. >=20 > The only other gotchas I remember are: >=20 > (1) the interrupt vector table has to be on a 64k boundary. The tools let=
you
> put it anywhere but the bottom 16 address bits are chopped by the PPC!
Good to know but in my linker script the interrupt vector starts at 0x00000000
>=20 > (2) Downloading a bitfile via Impact, there was one (probably V2Pro-speci=
fic)
> tick box that had to be set to reset the PPC correctly. The only reason I > mention this was that starting via XMD worked correctly.
Yes, there was this box for V2P FPGAs.
>=20 > - Brian >=20
Thank you all for your help. I solved the problem with the help of the second PowerPC core integrated in the Virtex 5. Martin