mbox series

[U-Boot,00/13] binman: Support run-time access to binman image positions

Message ID 20171114015506.25673-1-sjg@chromium.org
Headers show
Series binman: Support run-time access to binman image positions | expand

Message

Simon Glass Nov. 14, 2017, 1:54 a.m. UTC
Binman construct images consisting of multiple binary files. These files
sometimes need to know (at run timme) where their peers are located. For
example, SPL may want to know where U-Boot is located in the image, so
that it can jump to U-Boot correctly on boot.

This series implements this, allowing binaries within the image to become
aware of each other without any significant run-time overhead.

It can be used for:
   - SPL jumping to the correct location for U-Boot
   - SPL finding an FPGA image to program
   - U-Boot locating some configuration data (e.g. serial #) in the image

A way to handle this with binman was requested by Marek Vasut some weeks
ago.

As a demonstration, this converts Tegra to use binman to find U-Boot from
within SPL.


Simon Glass (13):
  binman: Add a function to read ELF symbols
  binman: Add support for including spl/u-boot-spl.dtb
  binman: Add support for including spl/u-boot-spl-nodtb.bin
  binman: Drop a stale comment about the 'board' feature
  binman: Add tests binaries with binman symbols
  binman: Adjust size of test SPL binary
  binman: Support enabling debug in tests
  binman: Support accessing binman tables at run time
  binman: arm: Include the binman symbol table
  binman: Add binman symbol support to SPL
  binman: Add binman support to spl_ram.c
  binman: Add documentation for the symbol feature
  binman: tegra: Convert to use binman

 Makefile                                     |   6 ++
 arch/arm/config.mk                           |   6 +-
 arch/arm/cpu/u-boot-spl.lds                  |   7 ++
 arch/arm/dts/tegra-u-boot.dtsi               |  40 +++++++++
 arch/arm/dts/tegra114-u-boot.dtsi            |   3 +
 arch/arm/dts/tegra124-nyan-big-u-boot.dtsi   |   2 +
 arch/arm/dts/tegra124-u-boot.dtsi            |   3 +
 arch/arm/dts/tegra20-u-boot.dtsi             |  11 +--
 arch/arm/dts/tegra210-u-boot.dtsi            |   3 +
 arch/arm/dts/tegra30-u-boot.dtsi             |   3 +
 arch/arm/mach-tegra/Kconfig                  |   1 +
 common/spl/spl.c                             |  16 +++-
 common/spl/spl_ram.c                         |  19 +++-
 include/binman_sym.h                         |  80 +++++++++++++++++
 include/spl.h                                |  11 +++
 tools/binman/README                          |  32 ++++++-
 tools/binman/binman.py                       |  11 ++-
 tools/binman/control.py                      |   3 +
 tools/binman/elf.py                          | 129 +++++++++++++++++++++++++++
 tools/binman/elf_test.py                     | 122 +++++++++++++++++++++++++
 tools/binman/etype/entry.py                  |   8 ++
 tools/binman/etype/u_boot_spl.py             |   6 ++
 tools/binman/etype/u_boot_spl_bss_pad.py     |   7 +-
 tools/binman/etype/u_boot_spl_dtb.py         |  17 ++++
 tools/binman/etype/u_boot_spl_nodtb.py       |  17 ++++
 tools/binman/etype/u_boot_with_ucode_ptr.py  |   9 +-
 tools/binman/ftest.py                        |  68 +++++++++++---
 tools/binman/image.py                        |  79 +++++++++++++++-
 tools/binman/image_test.py                   |  46 ++++++++++
 tools/binman/test/21_image_pad.dts           |   2 +-
 tools/binman/test/24_sorted.dts              |   4 +-
 tools/binman/test/28_pack_4gb_outside.dts    |   4 +-
 tools/binman/test/29_x86-rom.dts             |   6 +-
 tools/binman/test/51_u_boot_spl_dtb.dts      |  13 +++
 tools/binman/test/52_u_boot_spl_nodtb.dts    |  11 +++
 tools/binman/test/53_symbols.dts             |  20 +++++
 tools/binman/test/Makefile                   |  18 +++-
 tools/binman/test/bss_data.c                 |   2 +-
 tools/binman/test/u_boot_binman_syms         | Bin 0 -> 4921 bytes
 tools/binman/test/u_boot_binman_syms.c       |  14 +++
 tools/binman/test/u_boot_binman_syms.lds     |  30 +++++++
 tools/binman/test/u_boot_binman_syms_bad     | Bin 0 -> 4890 bytes
 tools/binman/test/u_boot_binman_syms_bad.c   |   1 +
 tools/binman/test/u_boot_binman_syms_bad.lds |  29 ++++++
 tools/binman/test/u_boot_binman_syms_size    | Bin 0 -> 4825 bytes
 tools/binman/test/u_boot_binman_syms_size.c  |  12 +++
 tools/binman/test/u_boot_ucode_ptr.c         |   2 +-
 47 files changed, 880 insertions(+), 53 deletions(-)
 create mode 100644 arch/arm/dts/tegra-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra114-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra124-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra210-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra30-u-boot.dtsi
 create mode 100644 include/binman_sym.h
 create mode 100644 tools/binman/elf.py
 create mode 100644 tools/binman/elf_test.py
 create mode 100644 tools/binman/etype/u_boot_spl_dtb.py
 create mode 100644 tools/binman/etype/u_boot_spl_nodtb.py
 create mode 100644 tools/binman/image_test.py
 create mode 100644 tools/binman/test/51_u_boot_spl_dtb.dts
 create mode 100644 tools/binman/test/52_u_boot_spl_nodtb.dts
 create mode 100644 tools/binman/test/53_symbols.dts
 create mode 100755 tools/binman/test/u_boot_binman_syms
 create mode 100644 tools/binman/test/u_boot_binman_syms.c
 create mode 100644 tools/binman/test/u_boot_binman_syms.lds
 create mode 100755 tools/binman/test/u_boot_binman_syms_bad
 create mode 120000 tools/binman/test/u_boot_binman_syms_bad.c
 create mode 100644 tools/binman/test/u_boot_binman_syms_bad.lds
 create mode 100755 tools/binman/test/u_boot_binman_syms_size
 create mode 100644 tools/binman/test/u_boot_binman_syms_size.c

Comments

Simon Glass Nov. 25, 2017, 10:34 p.m. UTC | #1
Hi,

On 13 November 2017 at 18:54, Simon Glass <sjg@chromium.org> wrote:
> Binman construct images consisting of multiple binary files. These files
> sometimes need to know (at run timme) where their peers are located. For
> example, SPL may want to know where U-Boot is located in the image, so
> that it can jump to U-Boot correctly on boot.
>
> This series implements this, allowing binaries within the image to become
> aware of each other without any significant run-time overhead.
>
> It can be used for:
>    - SPL jumping to the correct location for U-Boot
>    - SPL finding an FPGA image to program
>    - U-Boot locating some configuration data (e.g. serial #) in the image
>
> A way to handle this with binman was requested by Marek Vasut some weeks
> ago.
>
> As a demonstration, this converts Tegra to use binman to find U-Boot from
> within SPL.

Are there any more comments on this please? I plan to tidy up the
Tegra comments and send v2.

Regards,
Simon