Skip to content

rockchip: make_fit_atf.py Eliminate pyelftools dependency

Chris Webb u-boot 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 0 repliesNew
  2. v22 patches 0 repliesSuperseded
  3. v12 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- code style: add correct whitespace around multiply operator

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2rockchip: make_fit_atf.py: Eliminate pyelftools dependencyarch/arm/mach-rockchip/make_fit_atf.py+32 -433 replies
2/2rockchip: Remove obsolete references to pyelftoolsboard/rockchip/evb_rk3399/README doc/README.rockchip+0 -102 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAndy YanKever Yang
1/2R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [U-Boot] [PATCH v3 0/2] rockchip: make_fit_atf.py Eliminate pyelftools dependency

Building for rockchip, make_fit_atf.py depends on pyelftools, a non-bundled python module that is not used elsewhere in building u-boot or the kernel.

We only use pyelftools to pull out PT_LOAD segments. ELF is very simple, so doing this manually is easy and spares users the extra dependency. In fact, a straightforward implementation shrinks make_fit_aft.py rather than adding complexity.

Andy Yan's patch

https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip/commit/619f002db864ef8caa30863bde62df5c651a7312

is a prerequisite for this. The new code does not erroneously count GNU_STACK sections and therefore without the above patch, the loadables in the conf section will always be one short, even where GNU_STACK is present.

I have tested this script with python 2 and 3 against all bl31 elf files at

https://github.com/rockchip-linux/rkbin/tree/master/bin/rk33

as well as an rk3399 bl31.elf built locally from the master branch of

https://github.com/ARM-software/arm-trusted-firmware

to which my toolchain added the extra GNU_STACK segment.

In each case, identical *.bin files were produced compared to the pyelftools implementation, and a correct .its configuration (without off-by-one error) was emitted, with and without dtbs supplied to the script.

Changes in v2:
- no exception on a valid but completely empty bl31 ELF file
- restrict documentation updates to the Rockchip docs (!)

Changes in v3:
- code style: add correct whitespace around multiply operator