[PATCH v4 2/6] rpi5: Use devicetree as alternative way to read IO base addresses

Florian Fainelli florian.fainelli at broadcom.com
Wed Jan 10 19:00:17 CET 2024


On 1/10/24 04:29, Ivan T. Ivanov wrote:
> From: Dmitry Malkin <dmitry at bedrocksystems.com>
> 
> MBOX and Watchdog on RPi5/bcm2712 has a different base IO offsets.

s/has a/have a /

> Find them via devicetree blob passed by bootloader.
> 
> Signed-off-by: Dmitry Malkin <dmitry at bedrocksystems.com>
> Reviewed-by: Matthias Brugger <mbrugger at suse.com>
> Signed-off-by: Ivan T. Ivanov <iivanov at suse.de>
> ---
>   arch/arm/mach-bcm283x/include/mach/base.h  |  5 ++-
>   arch/arm/mach-bcm283x/include/mach/mbox.h  |  3 +-
>   arch/arm/mach-bcm283x/include/mach/sdhci.h |  3 +-
>   arch/arm/mach-bcm283x/include/mach/timer.h |  3 +-
>   arch/arm/mach-bcm283x/include/mach/wdog.h  |  3 +-
>   arch/arm/mach-bcm283x/init.c               | 43 ++++++++++++++++++----
>   6 files changed, 43 insertions(+), 17 deletions(-)
> 
> diff --git a/arch/arm/mach-bcm283x/include/mach/base.h b/arch/arm/mach-bcm283x/include/mach/base.h
> index 4ccaf69693..6de99e7ea1 100644
> --- a/arch/arm/mach-bcm283x/include/mach/base.h
> +++ b/arch/arm/mach-bcm283x/include/mach/base.h
> @@ -6,7 +6,10 @@
>   #ifndef _BCM283x_BASE_H_
>   #define _BCM283x_BASE_H_
>   
> -extern unsigned long rpi_bcm283x_base;
> +extern unsigned long rpi_mbox_base;
> +extern unsigned long rpi_timer_base;
> +extern unsigned long rpi_sdhci_base;
> +extern unsigned long rpi_wdog_base;

Maybe suffix those variables with _phys_base to denote they are physical 
addresses, even if you seem to use a 1:1 mapping between virtual and 
physical, knowing which type of address we are dealing with right away 
is clearer.
-- 
Florian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4221 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240110/9e606fe0/attachment.bin>


More information about the U-Boot mailing list