PReP residual to device-tree converter
From: Paul Mackerras <hidden>
Date: 2008-05-26 06:25:34
Here is a program that takes a PReP residual blob as input and generates a device tree as output. Currently the back-end uses printf to output the tree in dts format, but it would be easy to do an alternative back-end that outputs a dtb. The idea is that this will end up in the wrapper (with a dtb back-end), making it straightforward to support PReP in arch/powerpc. I would like people that have PReP machines to take a copy of /proc/residual, run this program on it, and check that the output is sane. If it isn't, or if it is missing bits, send me the residual blob with a description of what's wrong in the generated dts. Since I have only tested this with 2 blobs, both from IBM machines, it is very likely that there are some assumptions in there that break on PRePs from Motorola or other manufacturers. To compile this program you'll need residual.h and pnp.h from include/asm-ppc. I found it easiest to create a symlink called "asm" in the current directory, pointing to $kernelsource/include/asm-ppc, and use -I. on the gcc command line. Or you can copy residual.h and pnp.h somewhere and munge the #include lines. Paul. #include <stdio.h> #include <stddef.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <unistd.h> #define __KERNEL__ #include <asm/residual.h> RESIDUAL resid; int indent; void prindent(void) { int i;