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

Luca Ceresoli luca at lucaceresoli.net
Mon Apr 15 16:47:36 UTC 2019


Hi,

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

History and status
==================

First non-RFC version. The code is now clean and I consider it OK for
mainline inclusion.

Since RFC v2 the cfg obj is now passed as a binary blob. The code to
compile it in the C form has been removed and replaced by a Python tool to
convert C to bin. The loading has been fixed and cleaned up according to
comments.

TODO: move the PMU IPC code to a mailbox uclass driver.

Description
===========

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.

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
RFCv1: https://lists.denx.de/pipermail/u-boot/2019-February/360450.html
RFCv2: https://lists.denx.de/pipermail/u-boot/2019-March/362464.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                  |  17 +
 arch/arm/mach-zynqmp/Makefile                 |   4 +
 arch/arm/mach-zynqmp/include/mach/sys_proto.h |   4 +
 arch/arm/mach-zynqmp/pm_cfg_obj_convert.py    | 302 ++++++++++++++++++
 arch/arm/mach-zynqmp/pmu_ipc.c                | 112 +++++++
 board/xilinx/zynqmp/Makefile                  |  12 +
 board/xilinx/zynqmp/pm_cfg_obj.S              |  17 +
 board/xilinx/zynqmp/zynqmp.c                  |   8 +
 8 files changed, 476 insertions(+)
 create mode 100755 arch/arm/mach-zynqmp/pm_cfg_obj_convert.py
 create mode 100644 arch/arm/mach-zynqmp/pmu_ipc.c
 create mode 100644 board/xilinx/zynqmp/pm_cfg_obj.S

-- 
2.21.0



More information about the U-Boot mailing list