[PATCH] dtc: parse NOP in dtb input

David Gibson david at gibson.dropbear.id.au
Tue Jun 12 14:31:04 EST 2007


On Sat, Jun 09, 2007 at 11:21:31PM -0500, Milton Miller wrote:
> Version 16 and later of the flat device tree format allow NOPs
> to be placed in the tree.  When processing dtb input, dtc must
> recognise them.
> 
> Previously it would produce the error message
> FATAL ERROR: Invalid opcode word 00000004 in device tree blob
> 
> Signed-off-by: Milton Miller <miltonm at bga.com>
> --- 
> 
> I was trying to look at the output of convert_flattree_inplace
> when I found this.  ftdump.c was able to process the input,
> producing // [NOP] comments when encountered.

Oops, we didn't parse NOPs already.  That's a bit of an oversight.

[snip]
> @@ -774,6 +775,13 @@ static struct node *unflatten_tree(struc
>  			die("Premature OF_DT_END in device tree blob\n");
>  			break;
>  
> +		case OF_DT_NOP:
> +			if (flags & FTF_NOPS)
> +				break;
> +
> +			die("OF_DT_NOP in device tree blob\n");
> +			break;
> +

Actually, I think we should accept the NOPs (with at most a warning)
on all DTB versions.  They may not have been defined for the early
versions, but they're not ambiguous.

-- 
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



More information about the Linuxppc-dev mailing list