On Wed, Feb 23, 2011 at 10:40:32AM -0800, David Daney wrote:On 02/23/2011 09:41 AM, Grant Likely wrote:On Tue, Feb 22, 2011 at 12:57:50PM -0800, David Daney wrote:Signed-off-by: David Daney<ddaney@xxxxxxxxxxxxxxxxxx>
---
arch/mips/Kconfig | 2 +
arch/mips/cavium-octeon/octeon-platform.c | 280 +++++++++++++++++++++++++++++
arch/mips/cavium-octeon/setup.c | 17 ++
3 files changed, 299 insertions(+), 0 deletions(-)
I've got an odd feeling of foreboding about this patch. It makes me
nervous, but I can't articulate why yet. Gut-wise I'd rather see the
device tree pruned/fixed up before it gets unflattened,
I chose to work on the unflattened form because there were already
functions to do it. I didn't see anything that would make
manipulating the flattened form easy.
I agree that working on the unflattened form would be best. At a
minium the /proc/device-tree structure would better reflect reality.
What do you think about adding some helper functions to
drivers/of/fdt.c for the manipulation of the flattened form?
It would probably be easier/safer to link libfdt into the kernel
proper. It's already used in the powerpc bootwrapper, and there has
been talk about replacing some of fdt.c with libfdt. See
scripts/dtc/libfdt
or for the
kernel to have a separate .dtb linked in for each legacy platform.
I think there are too many variants to make this viable.
Out of curiosity, how many variants?
btw, did you know about the dtc '/include/' functionality? It is
possible to set up .dts include files that represent a SoC and can be
modified by the .dts files that include them. See
arch/powerpc/boot/dts/*5200*.dts