On Thu, Feb 06, 2025 at 02:27:28PM -0700, Simon Glass wrote:
> Hi Raymond,
> 
> On Wed, 5 Feb 2025 at 08:35, Raymond Mao <raymond....@linaro.org> wrote:
> >
> > Hi Simon,
> >
> > On Tue, 4 Feb 2025 at 20:57, Simon Glass <s...@chromium.org> wrote:
> > >
> > > Where the bloblist is located in internal memory and TF-A's BL31 blob
> > > removes access to this memory, the best option seems to be to relocate
> > > the bloblist just before running TF-A.
> > >
> > > Add an option to select this behaviour and provide a relocation address.
> > >
> > > Signed-off-by: Simon Glass <s...@chromium.org>
> > > ---
> > >
> > >  common/Kconfig    | 20 ++++++++++++++++++++
> > >  common/bloblist.c | 15 ++++++++++++++-
> > >  common/spl/spl.c  |  9 +++++++++
> > >  3 files changed, 43 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/common/Kconfig b/common/Kconfig
> > > index 0e8c44f3f74..962e7fd76eb 100644
> > > --- a/common/Kconfig
> > > +++ b/common/Kconfig
> > > @@ -1125,6 +1125,26 @@ config SPL_BLOBLIST_ALLOC
> > >
> > >  endchoice
> > >
> > > +config SPL_BLOBLIST_RELOC
> > > +       bool "Relocate the bloblist before existing SPL"
> > > +       depends on BLOBLIST_FIXED
> > > +       help
> > > +         Some platforms locate the bloblist in SRAM in SPL. In some 
> > > cases,
> > > +         the TF-A BL31 blob removes access to SRAM, e.g. with Rockchip 
> > > RK3399.
> > > +
> > > +         Enable this option to make U-Boot copy the bloblist from SRAM 
> > > to SDRAM
> > > +         before leaving SPL.
> > > +
> > > +config SPL_BLOBLIST_RELOC_ADDR
> > > +       hex "Relocate the bloblist before existing SPL"
> > > +       depends on SPL_BLOBLIST_RELOC
> > > +       default BLOBLIST_ADDR
> > > +       help
> > > +         Sets the address to which the bloblist is relocated at the end 
> > > of SPL.
> > > +         U-Boot proper uses this address when it starts up. Note that 
> > > U-Boot
> > > +         always relocates the bloblist again as part of its own 
> > > relocation
> > > +         process.
> > > +
> > >  endif # SPL_BLOBLIST
> > >
> >
> > I think the relocation you mentioned is a board-specific behaviour and
> > should not be part of common/Kconfig if only a few boards use them.
> 
> Where do you suggest this code should go?

What we need is a generic way to pass the bloblist we allocated in one
stage to the next, without saying "Ah, it's a fixed address". Then we
should just normally have each stage have a bloblist in a safe location,
as needed.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to