[PATCH 1/2] dm: core: Add functions to read 8/16-bit integers

Simon Glass sjg at chromium.org
Tue Jul 12 12:58:58 CEST 2022


Hi Stefan,

On Tue, 14 Jun 2022 at 07:22, Stefan Herbrechtsmeier
<stefan.herbrechtsmeier-oss at weidmueller.com> wrote:
>
> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>
>
> Add functions to read 8/16-bit integers like the existing functions for
> 32/64-bit to simplify read of 8/16-bit integers from device tree
> properties.
>
> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>
> ---
>
>  arch/sandbox/dts/test.dts |  2 ++
>  drivers/core/of_access.c  | 38 +++++++++++++++++++++++
>  drivers/core/ofnode.c     | 62 +++++++++++++++++++++++++++++++++++++
>  drivers/core/read.c       | 21 +++++++++++++
>  include/dm/of_access.h    | 32 +++++++++++++++++++
>  include/dm/ofnode.h       | 40 ++++++++++++++++++++++++
>  include/dm/read.h         | 65 +++++++++++++++++++++++++++++++++++++++
>  test/dm/test-fdt.c        | 19 ++++++++++++
>  8 files changed, 279 insertions(+)

This looks good but is very expensive in terms of code size. Can you
update your u8 and u16 functions to reuse the existing u32 function
and just convert the value?

Regards,
Simon


More information about the U-Boot mailing list