[PATCH 7/9] ARM: rockchip: dmc: add rk3588_ram_sizes to get full ram size

Michael Tretter m.tretter at pengutronix.de
Tue May 27 01:39:05 PDT 2025


On Tue, 27 May 2025 08:25:07 +0200, Sascha Hauer wrote:
> On Mon, May 26, 2025 at 06:33:28PM +0200, Marco Felsch wrote:
> > On 25-05-26, Michael Tretter wrote:
> > > The PBL has to pass a full description of the SDRAM to OP-TEE to allow
> > > OP-TEE to handle dynamic shared memory in the entire SDRAM. Thus, the
> > > PBL needs to read the full memory configuration.
> > > 
> > > Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
> > > ---
> > >  arch/arm/mach-rockchip/dmc.c | 37 ++++++++++++++++++++++++++++++++++---
> > >  include/mach/rockchip/dmc.h  |  2 ++
> > >  2 files changed, 36 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/arch/arm/mach-rockchip/dmc.c b/arch/arm/mach-rockchip/dmc.c
> > > index 62a7ef8f1e38e989e84f08f6f4a6586be3e85532..260b8be9c7da9e8f83323822eab92a439ef4e2ef 100644
> > > --- a/arch/arm/mach-rockchip/dmc.c
> > > +++ b/arch/arm/mach-rockchip/dmc.c
> > > @@ -171,11 +171,12 @@ resource_size_t rk3568_ram0_size(void)
> > >  #define RK3588_PMUGRF_OS_REG4           0x210
> > >  #define RK3588_PMUGRF_OS_REG5           0x214
> > >  
> > > -resource_size_t rk3588_ram0_size(void)
> > > +size_t rk3588_ram_sizes(phys_addr_t *base, resource_size_t *size, size_t n)
> > 
> > Nit: could be void since you don't check the return value.
> 
> The return value is used in a later patch. There the array size is
> passed in 'n' and the actually used array entries are returned from
> rk3588_ram_sizes().

I could add some error handling in rk3588_ram0_size(), but it's
pointless, since the caller of that function doesn't handle errors, too.

Michael



More information about the barebox mailing list