[U-Boot] [PATCH] fdt: add new fdt address parsing functions

Stephen Warren swarren at wwwdotorg.org
Thu Aug 6 23:35:05 CEST 2015


On 08/06/2015 03:31 PM, Stephen Warren wrote:
> fdtdec_get_addr_size() hard-codes the number of cells used to represent
> an address or size in DT. This is incorrect in many cases depending on
> the DT binding for a particular node or property (e.g. it is incorrect
> for the "reg" property). In most cases, DT parsing code must use the
> properties #address-cells and #size-cells to parse addres properties.
>
> This change splits up the implementation of fdtdec_get_addr_size() so
> that the core logic can be used for both hard-coded and non-hard-coded
> cases. Various wrapper functions are implemented that support cases
> where hard-coded cell counts should or should not be used, and where
> the client does and doesn't know the parent node ID that contains the
> properties #address-cells and #size-cells.

> diff --git a/lib/fdtdec.c b/lib/fdtdec.c
> index 95b59b586ff0..3afec045e9bd 100644
> --- a/lib/fdtdec.c
> +++ b/lib/fdtdec.c
> @@ -1,3 +1,5 @@
> +#define DEBUG
> +
>   /*

Uggh. That part will of course have to be dropped, but I'll hold off 
resending in case there are any other comments.


More information about the U-Boot mailing list