[PATCH v2 17/21] dm: core: Correctly read <ranges> of simple-bus

Simon Glass sjg at chromium.org
Fri Mar 12 16:47:09 CET 2021


On Fri, 12 Mar 2021 at 06:37, Bin Meng <bmeng.cn at gmail.com> wrote:
>
> At present we decode simple bus <ranges> using the following assumption:
>
> - parent #address-cells 1
> - child #address-cells 1
> - child #size-cells 1
>
> However this might not always be the case.
>
> Update to use fdt_addr_t and fdt_size_t in 'struct simple_bus_plat', and
> use fdt_read_ranges() to correctly decode it according to the actual
> parent and child #address-cells / #size-cells under a Kconfig option
> CONFIG_SIMPLE_BUS_CORRECT_RANGE which can be turned on for any board
> that needs it.
>
> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
>
> ---
>
> Changes in v2:
> - include <asm/global_data.h>
> - use a Kconfig option CONFIG_SIMPLE_BUS_CORRECT_RANGE to control the
>   new behavior for boards that want this
>
>  drivers/core/Kconfig      | 13 +++++++++++++
>  drivers/core/simple-bus.c | 32 +++++++++++++++++++++++++-------
>  include/dm/simple_bus.h   |  6 +++---
>  3 files changed, 41 insertions(+), 10 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list