[U-Boot] [PATCH] rockchip: make_fit_atf: Use BL31 environ variable for file location
Shyam Saini
shyam at amarulasolutions.com
Mon Apr 22 07:28:44 UTC 2019
Hi Philipp, Emmanuel,
On Sun, Apr 21, 2019 at 10:43 PM Jagan Teki <jagan at amarulasolutions.com> wrote:
>
> On Tue, Feb 5, 2019 at 4:24 PM Emmanuel Vadot <manu at freebsd.org> wrote:
> >
> > Other make_fit script (like imx or sunxi) use the BL31 environment
> > variable to indicate the location of the file.
> > Also do that for rockchip so we don't need to copy the file in the source
> > directory.
> >
> > Signed-off-by: Emmanuel Vadot <manu at freebsd.org>
> > ---
> > arch/arm/mach-rockchip/make_fit_atf.py | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py
> > index d1faff1957..7bf58e3dd1 100755
> > --- a/arch/arm/mach-rockchip/make_fit_atf.py
> > +++ b/arch/arm/mach-rockchip/make_fit_atf.py
> > @@ -194,7 +194,7 @@ def get_bl31_segments_info(bl31_file_name):
> >
> > def main():
> > uboot_elf="./u-boot"
> > - bl31_elf="./bl31.elf"
> > + bl31_elf=os.getenv("BL31", "./bl31.elf")
>
> Have similar change on my repo.
>
> Better through warning for non BL31 like
>
> if "BL31ELF" in os.environ:
> bl31_elf=os.getenv("BL31ELF");
> else:
> sys.exit("ERROR: Please export BL31ELF file, check
> board/rockchip/evb_rk3399/README)
>
> And BL31ELF would be proper env than BL31 since rockchip build would
> require elf and other one has bin, IMHO.
I think solution suggested by Jagan's is more generic and more useful.
It doesn't hard code the path of bl31.elf file, instead it uses global
BL31 environment variable.
If the path is hard coded then buildroot build fails for atleast
rk3399 soc based boards because
in buildroot it is [2] BL31=$(BINARIES_DIR)/bl31.elf, so it looks for
bl31.elf file in binary directory
instead of uboot directory.
We encountered this build failure in recently while adding [1] RK3399
NanoPi M4 support in buildroot.
Could we consider solution suggested by Jagan while we can retain the
variable name BL31 as is.
[1] Buildroot thread
http://lists.busybox.net/pipermail/buildroot/2019-April/248219.html
[2] BL31 buildroot variable
https://git.buildroot.net/buildroot/tree/boot/uboot/uboot.mk#n140
Thanks a lot,
Shyam
More information about the U-Boot
mailing list