This feature requires U-Boot >= 2018.07.
+config BR2_TARGET_UBOOT_ZYNQMP_PM_CFG
+ string "PMU configuration location"
+ depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
+ help
+ Location of a PMU configuration file.
+
+ If not empty, Buildroot will convert the PMU configuration
+ file into a loadable blob and pass it to U-Boot. The blob gets
+ embedded into the U-Boot SPL and is used to configure the PMU
+ during board initialization.
+
+ Unlike the PMU firmware, the PMU configuration file is unique
+ to each board configuration. A PMU configuration file can be
+ generated by building your Xilinx SDK BSP. It can be found in
+ the BSP source, for example at
+ ./psu_cortexa53_0/libsrc/xilpm_v2_4/src/pm_cfg_obj.c
+
+ Leave this option empty if your PMU firmware has a hard-coded
+ configuration object or you are loading it by any other means.
+
+ This feature requires U-Boot >= v2019.10.
+
config BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE
string "Custom psu_init_gpl file"
depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
$(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))
define UBOOT_KCONFIG_FIXUP_CMDS
$(UBOOT_ZYNQMP_KCONFIG_PMUFW)
+ $(UBOOT_ZYNQMP_KCONFIG_PM_CFG)
$(UBOOT_ZYNQMP_KCONFIG_PSU_INIT)
endef