aboutsummaryrefslogtreecommitdiff
path: root/boot/uboot/uboot.mk
diff options
context:
space:
mode:
authorGravatar Brandon Maier <brandon.maier@rockwellcollins.com>2020-06-26 10:59:56 -0500
committerGravatar Yann E. MORIN <yann.morin.1998@free.fr>2020-06-27 19:23:18 +0200
commit16a522b5e0e983d42f602d4fadb2934409b83374 (patch)
treeeeb6d684d0264b724c38995dbeb80fd9d629c22d /boot/uboot/uboot.mk
parent408bc354a9c14b3940938cfb7a3e3eefa81641a5 (diff)
downloadbuildroot-16a522b5e0e983d42f602d4fadb2934409b83374.tar.gz
buildroot-16a522b5e0e983d42f602d4fadb2934409b83374.tar.bz2
uboot: zynqmp: Support loading a PMU config
Before now, U-Boot SPL could only load the Platform Management Unit (PMU) by patching the board-specific pm_cfg_obj.c file into the generic PMU firmware, but that then requires generating a new PMU firmware for every board configuration. To fix that, Luca Ceresoli added support to U-Boot to load the pm_cfg_obj[1]. Like the PMU firmware, we need a way to pass the PMU cfg to U-Boot during build. U-Boot only accepts the binary format of the cfg, so we must convert the source file with the tool provided with U-Boot. [1] https://lucaceresoli.net/zynqmp-uboot-spl-pmufw-cfg-load/ Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Diffstat (limited to 'boot/uboot/uboot.mk')
-rw-r--r--boot/uboot/uboot.mk17
1 files changed, 17 insertions, 0 deletions
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 71689207e3..8a09969de1 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -360,6 +360,22 @@ define UBOOT_ZYNQMP_KCONFIG_PMUFW
$(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"$(UBOOT_ZYNQMP_PMUFW_PATH)")
endef
+UBOOT_ZYNQMP_PM_CFG = $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PM_CFG))
+ifneq ($(UBOOT_ZYNQMP_PM_CFG),)
+UBOOT_ZYNQMP_PM_CFG_BIN = $(UBOOT_DIR)/pm_cfg_obj.bin
+define UBOOT_ZYNQMP_KCONFIG_PM_CFG
+ $(call KCONFIG_SET_OPT,CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE,"$(UBOOT_ZYNQMP_PM_CFG_BIN)", \
+ $(@D)/.config)
+endef
+
+define UBOOT_ZYNQMP_PM_CFG_CONVERT
+ $(UBOOT_DIR)/tools/zynqmp_pm_cfg_obj_convert.py \
+ "$(UBOOT_ZYNQMP_PM_CFG)" \
+ "$(UBOOT_ZYNQMP_PM_CFG_BIN)"
+endef
+UBOOT_PRE_BUILD_HOOKS += UBOOT_ZYNQMP_PM_CFG_CONVERT
+endif
+
UBOOT_ZYNQMP_PSU_INIT = $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE))
UBOOT_ZYNQMP_PSU_INIT_PATH = $(shell readlink -f $(UBOOT_ZYNQMP_PSU_INIT))
@@ -422,6 +438,7 @@ endif
define UBOOT_KCONFIG_FIXUP_CMDS
$(UBOOT_ZYNQMP_KCONFIG_PMUFW)
+ $(UBOOT_ZYNQMP_KCONFIG_PM_CFG)
$(UBOOT_ZYNQMP_KCONFIG_PSU_INIT)
endef