From mboxrd@z Thu Jan 1 00:00:00 1970 From: gvb.uboot Date: Thu, 01 Nov 2007 19:53:54 -0400 Subject: [U-Boot-Users] [RFC][PATCH] fdt fixup In-Reply-To: References: Message-ID: <472A6712.6040601@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Kumar Gala wrote: > This code adds a generic fixup mechanism that allows us to get ride of > needing explicit paths to device nodes. > > diff --git a/common/fdt_support.c b/common/fdt_support.c > index 7a81469..2c1e8ac 100644 > --- a/common/fdt_support.c > +++ b/common/fdt_support.c > @@ -363,4 +363,125 @@ int fdt_bd_t(void *fdt) > } > #endif /* ifdef CONFIG_OF_HAS_BD_T */ > > +/* > + * "Setter" functions used to add/modify FDT entries. > + */ > +#ifdef CONFIG_HAS_ETH0 > +static int fdt_set_eth0(void *blob, int nodeoffset, const char *name, bd_t *bd) > +{ > + /* Fix it up if it exists, don't create it if it doesn't exist */ > + if (fdt_get_property(blob, nodeoffset, name, 0)) { > + return fdt_setprop(blob, nodeoffset, name, bd->bi_enetaddr, 6); > + } > + return 0; > +} [snip a bunch more setter functions] Hi Kumar, The direction Grant Likely went with 5xxx and where Sergej was heading with 82xx (if only I got around to applying his patch) and where I want to go is to replace the table-driven methodology with direct calls to more generic functions, eliminating the hordes of specialized "setter" functions (all nearly identical). Discussions and patches: If we get the mpc5xxx style setter functions combined with your fdt_node_offset_by_prop_and_compat() finding changes, I think we would be in fat city. Best regards, gvb P.S. Is David done changing libfdt yet??? ;-) I saw you are still keeping up with him...