[PATCH 33/40] test: cedit: use allocated address for reading file

Sughosh Ganu sughosh.ganu at linaro.org
Wed Jul 31 09:25:59 CEST 2024


On Mon, 29 Jul 2024 at 20:58, Simon Glass <sjg at chromium.org> wrote:
>
> Hi Sughosh,
>
> On Mon, 29 Jul 2024 at 02:53, Sughosh Ganu <sughosh.ganu at linaro.org> wrote:
> >
> > On Fri, 26 Jul 2024 at 05:02, Simon Glass <sjg at chromium.org> wrote:
> > >
> > > Hi Sughosh,
> > >
> > > On Wed, 24 Jul 2024 at 00:05, Sughosh Ganu <sughosh.ganu at linaro.org> wrote:
> > > >
> > > > Instead of a randomly selected address, use an LMB allocated one for
> > > > reading the file into memory. With the LMB map now being persistent
> > > > and global, the address used for reading the file might be already
> > > > allocated as non-overwritable, resulting in a failure. Get a valid
> > > > address from LMB and then read the file to that address.
> > > >
> > > > Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> > > > ---
> > > > Changes since rfc: None
> > > >
> > > >  test/boot/cedit.c | 6 +++++-
> > > >  1 file changed, 5 insertions(+), 1 deletion(-)
> > > >
> > >
> > > No, we should not start putting lmb into tests like this.
> >
> > The test fails if the address is not allocated through an lmb api.
> > Although I can check why.
>
> Neither am I, but you did put the tcg in the same region so perhaps
> that is an issue?

I now remember the issue. The cedit_fdt() function uses a random
address(0x1000) and tries to load the settings.dtb file to the
address. The load command uses the lmb_alloc_addr() API function to
reserve and use this address for loading the file. This worked earlier
because of the local nature of the lmb memory map. But it does not
work anymore, as this clashes with some existing reservation resulting
in the test failure.  So this change is very much needed.

-sughosh

>
> Sandbox is designed so that low memory regions can be used in tests. I
> pointed you to the memory-map docs.
>
> Regards,
> SImon


More information about the U-Boot mailing list