Porting "prep" from ppc to powerpc.
Is anyone already doing this? I asked around here a few weeks ago and got the advice:
Quoted 3 lines
In theory.. copy the files from ppc/platforms/prep.* to powerpc/platforms/prep/
and make some Kconfigs and see what breaks :)
Unfortunately, there isn't a ppc/platforms/prep. Under arch/ppc there's:
./boot/simple/misc-prep.c./boot/simple/prepmap.c./boot/utils/mkprep.c
./configs/prep_defconfig./platforms/prep_pci.c./platforms/prep_setup.c./syslib/prep_nvram.c
And I'm not sure which are relevant. Any hints?
Rob
Quoted 6 lines · Rob Landley
Is anyone already doing this? I asked around here a few weeks ago and got the advice:
Quoted 3 lines
In theory.. copy the files from ppc/platforms/prep.* to powerpc/platforms/prep/
and make some Kconfigs and see what breaks :)
Actually, I don't really recommend that method in any case.
Instead I suggest making a Kconfig under arch/powerpc, then adding things until it builds, then adding things until it boots. When you need to know what has to be done at a particular point, consult arch/ppc.
Quoted 11 lines
Unfortunately, there isn't a ppc/platforms/prep. Under
arch/ppcthere's:
./boot/simple/misc-prep.c./boot/simple/prepmap.c./boot/utils/mkprep.c
./configs/prep_defconfig./platforms/prep_pci.c./platforms/prep_setup.c./syslib/prep_nvram.cAnd I'm not sure which are relevant. Any hints?
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 2 lines · David Gibson
Quoted 1 line · Rob Landley
Is anyone already doing this? I asked around here a few weeks ago and got
the
Quoted 6 lines
Quoted 5 lines
advice:
Quoted 3 lines
In theory.. copy the files from ppc/platforms/prep.* to powerpc/platforms/prep/
and make some Kconfigs and see what breaks :)
Quoted 6 lines
Actually, I don't really recommend that method in any case.
Instead I suggest making a
Kconfigunderarch/powerpc, then adding things until it builds, then adding things until it boots. When you need to know what has to be done at a particular point, consultarch/ppc.
So study the old code until I figure out what should be in the Kconfig, what "things" to add for it to build, and what "things" to add until it boots. And the hint as to where to start is... study the old code.
Right. Copying the old implementation to the new directory and debugging it sounded like something I might be able to do. Starting from scratch? Not so much.
Rob
Quoted 1 line · Rob Landley
Is anyone already doing this?
I'm interested but I don't have the time right now.
Quoted 17 lines
I asked around here a few weeks ago and got the
advice:Quoted 3 lines
In theory.. copy the files from ppc/platforms/prep.* to powerpc/platforms/prep/
and make some Kconfigs and see what breaks :)Unfortunately, there isn't a ppc/platforms/prep. Under
arch/ppcthere's:
./boot/simple/misc-prep.c./boot/simple/prepmap.c./boot/utils/mkprep.c
./configs/prep_defconfig./platforms/prep_pci.c./platforms/prep_setup.c./syslib/prep_nvram.c
Quoted 1 line
And I'm not sure which are relevant. Any hints?
I was thinking of writing a bootwrapper that would convert residual data to flat device tree. There is a lot of valuable information in the residual data, like the interrupt routing (which is correct if you can read the spec, which is not what the code in arch/ppc did).
Gabriel
Quoted 6 lines · Gabriel Paubert
I was thinking of writing a bootwrapper that would convert residual data to flat device tree. There is a lot of valuable information in the residual data, like the interrupt routing (which is correct if you can read the spec, which is not what the code in
arch/ppcdid).
We were wondering the other day how reliable the residual data are...
David Gibson's been toying with that too already, you should sync with him.
Cheers,
Ben.
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 6 lines · Gabriel Paubert
I was thinking of writing a bootwrapper that would convert residual data to flat device tree. There is a lot of valuable information in the residual data, like the interrupt routing (which is correct if you can read the spec, which is not what the code in
arch/ppcdid).We were wondering the other day how reliable the residual data are...
On the boards I use, they are very good. And there is some information (memory size, tb and cpu freq, etc...) that I'd rather take from the residual data than trying to guess.
Quoted 2 lines
David Gibson's been toying with that too already, you should sync with him.
I've not yet started to write anything (finishing a hardware project).
Regards,
Gabriel
Quoted 12 lines · Gabriel Paubert
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 6 lines · Gabriel Paubert
I was thinking of writing a bootwrapper that would convert residual data to flat device tree. There is a lot of valuable information in the residual data, like the interrupt routing (which is correct if you can read the spec, which is not what the code in
arch/ppcdid).We were wondering the other day how reliable the residual data are...
Quoted 8 lines
On the boards I use, they are very good. And there is some information (memory size, tb and cpu freq, etc...) that I'd rather take from the residual data than trying to guess.
Quoted 2 lines
David Gibson's been toying with that too already, you should sync with him.
I've not yet started to write anything (finishing a hardware project).
Ok, well, anyway, that's good to know that they are good.
Ben.
Quoted 4 lines · Gabriel Paubert
Quoted 1 line · Rob Landley
Is anyone already doing this?
I'm interested but I don't have the time right now.
I'm interested but don't have the expertise.
I don't have prep documentation, I'm not familiar with the internals of the powerpc architecture (beyond the endianness/word size/alignment checklist for porting userspace programs from arch to arch), I know just enough about Open Firmware to really dislike it, and I don't actually have prep hardware. I do have qemu, but it doesn't actually work even with the old ARCH=ppc prep kernels. It segfaults trying to decompress them.
I was hoping to use a prep kernel to debug qemu, but my build system (which already builds several other architecutres from the same script) can't do ARCH=ppc because that doesn't understand "make headers_install", so I have to build them by hand supplying different architectures at different steps of the process. Which puts it waaaaay down on my todo list.
Fixing the Linux build system to actually work for prep would be nice, but it sounds like teaching ARCH=ppc to do "make headers install" would be a couple orders of magnitude easier...
Rob
Quoted 2 lines · Rob Landley
I know just enough about Open
Firmware to really dislike it,
You need to learn more or fix your taste :-)
Ben.