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

Ivan T. Ivanov iivanov at suse.de
Tue Jan 16 10:11:03 CET 2024


On 01-10 10:00, Florian Fainelli wrote:
> 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 /
> 

Thanks!

> > 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.

I am not an expert on U-Boot, but I think mapping is always 1:1, so
explicit naming it that way looks redundant. As you can see even initial
naming don't specify it. But if you insist I could change it.

Regards,
Ivan



More information about the U-Boot mailing list