[U-Boot] [PATCH v6 4/6] fdt: add decode helper library

Wolfgang Denk wd at denx.de
Wed Oct 26 21:39:46 CEST 2011


Dear Simon Glass,

In message <1319519734-28704-5-git-send-email-sjg at chromium.org> you wrote:
> This library provides useful functions to drivers which want to use
> the fdt to control their operation. Functions are provided to:
> 
> - look up and enumerate a device type (for example assigning i2c bus 0,
>      i2c bus 1, etc.)
> - decode basic types from the fdt, like addresses and integers
> 
> While this library is not strictly necessary, it helps to minimise the
> changes to a driver, in order to make it work under fdt control. Less
> code is required, and so the barrier to switch drivers over is lower.
> 
> Additional functions to read arrays and GPIOs could be made available
> here also.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> Changes in v2:
> - Add example proposed decode helper library
> 
> Changes in v3:
> - Simplify decode library to remove provide only primitive functions
> - Remove i2c decode function
> - Rename fdt_decode to fdtdec, since it will be used a lot
> - Moved fdt_decode.c to /lib
> - Export almost all functions from fdtdec, to allow widespread use
> - Remove use of FDT_ERR_MISSING which is not strictly needed now
> 
> Changes in v4:
> - Add assert on sprintf() string length
> - Rename addr_t to fdt_addr_t to make it more fdt-specific
> - Remove gpio.h header in fdtdec.c which is not needed yet
> 
> Changes in v5:
> - Corrected const nit in fdtdec.c missed in v4
> 
> Changes in v6:
> - Move the fdt check into fdtdec since all archs will need it
> 
>  include/fdtdec.h |  128 +++++++++++++++++++++++++++++++++++++++++++++++
>  lib/Makefile     |    1 +
>  lib/fdtdec.c     |  147 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 276 insertions(+), 0 deletions(-)
>  create mode 100644 include/fdtdec.h
>  create mode 100644 lib/fdtdec.c

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Plan to throw one away. You will anyway."
                              - Fred Brooks, "The Mythical Man Month"


More information about the U-Boot mailing list