[PATCH 16/20] dm: core: Correctly read <ranges> of simple-bus
Tom Rini
trini at konsulko.com
Wed Mar 3 14:23:37 CET 2021
On Tue, Mar 02, 2021 at 11:34:47PM +0800, Bin Meng 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.
>
> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
> ---
>
> drivers/core/simple-bus.c | 15 ++++++++++-----
> include/dm/simple_bus.h | 6 +++---
> 2 files changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/core/simple-bus.c b/drivers/core/simple-bus.c
> index b0c2c20958..b5863f2b2c 100644
> --- a/drivers/core/simple-bus.c
> +++ b/drivers/core/simple-bus.c
> @@ -6,6 +6,9 @@
> #include <common.h>
> #include <dm.h>
> #include <dm/simple_bus.h>
> +#include <fdt_support.h>
> +
> +DECLARE_GLOBAL_DATA_PTR;
You need to add <asm/global_data.h> here too.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210303/0481e47a/attachment.sig>
More information about the U-Boot
mailing list