[PATCH 3/6] bootwrapper: Add device tree ops for flattened device tree

Mark A. Greer mgreer at mvista.com
Thu Aug 3 03:05:14 EST 2006


On Wed, Aug 02, 2006 at 09:10:54AM -0700, Tom Rini wrote:
> On Wed, Jul 19, 2006 at 04:05:44PM -0700, Mark A. Greer wrote:
> 
> > This patch adds the device tree operations (dt_ops) for a flattened
> > device tree (fdt).
> [snip]
> > +/* Definitions used by the flattened device tree */
> [snip]
> ...
> > +struct fdt_bus {
> > +	u64	(*map)(u32 *addr, u32 *range, int na, int ns, int pna);
> > +	int	(*translate)(u32 *addr, u64 offset, int na);
> > +};
> 
> All of that should live in an fdt.h.

Why?  Its never used outside of fdt.c and therefore should not be in
fdt.h.

> > +
> > +static inline struct boot_param_header *
> > +fdt_get_bph(void *dt_blob)
> > +{
> > +	return (struct boot_param_header *)dt_blob;
> > +}
> 
> Er, can't we just do this in the few places directly?

Sure.

> > +		if (!(new_dtb_start = malloc(new_total_size))) {
> > +			printf("Can't alloc space for new fdt\n\r");
> > +			exit();
> > +		}
> 
> Wasn't there a panic("Message") or so, for bootwrapper stuff?  If not,
> maybe there should be..

There isn't now.  Easy enough to add unless someone else objects.

Mark



More information about the Linuxppc-dev mailing list