[U-Boot] [PATCH v4 0/2] arm64: zynqmp: pass a PMUFW config object

Luca Ceresoli luca at lucaceresoli.net
Wed May 15 08:56:17 UTC 2019


Hi,

this v4 has several small improvements over v3, addressing all the comments
received. No major changes.

This patchset aims at solving a long-standing issue in the ZynqMP users
community: loading a PMU firmware configuration object when U-Boot SPL is
used.

The Platform Management Unit (PMU) needs a configuration object (cfg obj)
to know how to operate the SoC. When using the "Xilinx workflow", the
Xilinx FSBL (First Stage Bootloader) has the SPL role. FSBL has a built-in
cfg obj and passes it to the PMUFW at runtime before jumping to U-Boot
proper.

This is just not implemented in the U-Boot code. The best workaround for
U-Boot SPL users is to patch [0] the PMUFW itself to have the cfg obj
built-in and self-load it. This approach has some drawbacks: among others,
it forces to use a different PMUFW binary for each hardware and hardware
configuation. It also makes it impossible to change the configuration after
boot.

The first patch fills the gap by allowing U-Boot SPL to load the cfg
obj firmware at runtime. It adds a Kconfig string option to point to
the cfg obj in the form of a binary blob. If the option is non-empty,
code is enabled to link that file in U-Boot SPL and send the
configuration to PMUFW.

Patch 2 adds a tool to convert the cfg obj C file (as produced by the
Xilinx XSDK proprietary tool) in a binary blob suitable for
loading. As suggested by Mike Looijmans it has been implemented as a
Python script to make it easily usable.

These patches are tested on the UltraZed EV board, on u-boot/master and
microblaze/master, using the defconfig I submitted a few days ago [1].

Future work on this topic include moving the PMU IPC code to a mailbox
uclass driver and adding a command in U-Boot proper to load a config object
blob (e.g. from a file based on a script).

Many thanks to Michal Simek for his many suggestions on how to improve
this work.

[0] https://github.com/topic-embedded-products/meta-topic/blob/master/recipes-bsp/pmu-firmware/pmu-firmware/0001-Load-XPm_ConfigObject-at-boot.patch
[1] https://lists.denx.de/pipermail/u-boot/2019-May/368957.html
RFCv1: https://lists.denx.de/pipermail/u-boot/2019-February/360450.html
RFCv2: https://lists.denx.de/pipermail/u-boot/2019-March/362464.html
v3: https://lists.denx.de/pipermail/u-boot/2019-April/365410.html

Luca

Luca Ceresoli (2):
  arm64: zynqmp: spl: install a PMU firmware config object at runtime
  arm64: zynqmp: add tool to convert PMU config object .c to binary

 arch/arm/mach-zynqmp/Kconfig                  |  18 ++
 arch/arm/mach-zynqmp/Makefile                 |   4 +
 arch/arm/mach-zynqmp/include/mach/sys_proto.h |   2 +
 arch/arm/mach-zynqmp/pmu_ipc.c                | 112 +++++++
 board/xilinx/zynqmp/Makefile                  |   5 +
 board/xilinx/zynqmp/pm_cfg_obj.S              |  17 +
 board/xilinx/zynqmp/pm_cfg_obj.h              |   9 +
 board/xilinx/zynqmp/zynqmp.c                  |   9 +
 tools/zynqmp_pm_cfg_obj_convert.py            | 302 ++++++++++++++++++
 9 files changed, 478 insertions(+)
 create mode 100644 arch/arm/mach-zynqmp/pmu_ipc.c
 create mode 100644 board/xilinx/zynqmp/pm_cfg_obj.S
 create mode 100644 board/xilinx/zynqmp/pm_cfg_obj.h
 create mode 100755 tools/zynqmp_pm_cfg_obj_convert.py

-- 
2.21.0



More information about the U-Boot mailing list