comment "xilinx-embeddedsw needs a bare metal toolchain for tuple microblazeel-buildroot-elf"
	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH != "microblazeel-buildroot-elf"
	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH != "microblazeel-buildroot-elf riscv32-buildroot-elf"
	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT

menuconfig BR2_TARGET_XILINX_EMBEDDEDSW
	bool "xilinx-embeddedsw"
	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT
	help
	  Build boot firmware applications from source for Xilinx
	  boards. Users can mix and match applications to be built
	  by xilinx-embeddedsw and applications to be copied by
	  xilinx-prebuilt. If a xilinx-embeddedsw application is
	  selected, it will be built and installed from the Xilinx
	  embeddedsw repo, and it will not be copied from the
	  xilinx-prebuilt repo.

	  Applications can be found on the Xilinx embeddedsw repo:
	  https://github.com/Xilinx/embeddedsw/tree/master/lib/sw_apps

if BR2_TARGET_XILINX_EMBEDDEDSW

config BR2_TARGET_XILINX_EMBEDDEDSW_VERSION
	string "xilinx-embeddedsw version"
	default "xilinx_v2026.1"
	help
	  Release version of Xilinx/embeddedsw.
	  Must be xilinx_v2023.1 or newer.

config BR2_TARGET_XILINX_EMBEDDEDSW_VERSAL2_ASUFW
	bool "versal2 asufw"
	depends on BR2_cortex_a78
	help
	  Build versal2 asufw application from Xilinx/embeddedsw
	  repo.

	  https://github.com/Xilinx/embeddedsw/tree/master/lib/sw_apps/asufw
	  Version must be xilinx_v2025.2 or newer.

config BR2_TARGET_XILINX_EMBEDDEDSW_VERSAL2_PLM
	bool "versal2 plm"
	depends on BR2_cortex_a78
	help
	  Build versal2 plm application from Xilinx/embeddedsw repo.
	  If selected, the xilinx-prebuilt package will not install
	  the plm.elf since it will come from the xilinx-embeddedsw
	  package.

	  https://github.com/Xilinx/embeddedsw/tree/master/lib/sw_apps/versal_plm
	  Version must be xilinx_v2025.2 or newer.

config BR2_TARGET_XILINX_EMBEDDEDSW_VERSAL_PLM
	bool "versal plm"
	depends on BR2_cortex_a72
	help
	  Build versal plm application from Xilinx/embeddedsw repo.
	  If selected, the xilinx-prebuilt package will not install
	  the plm.elf since it will come from the xilinx-embeddedsw
	  package.

	  https://github.com/Xilinx/embeddedsw/tree/master/lib/sw_apps/versal_plm

config BR2_TARGET_XILINX_EMBEDDEDSW_VERSAL_PSMFW
	bool "versal psmfw"
	depends on BR2_cortex_a72
	help
	  Build versal psmfw application from Xilinx/embeddedsw repo.
	  If selected, the xilinx-prebuilt package will not install
	  the psmfw.elf since it will come from the xilinx-embeddedsw
	  package.

	  https://github.com/Xilinx/embeddedsw/tree/master/lib/sw_apps/versal_psmfw

config BR2_TARGET_XILINX_EMBEDDEDSW_ZYNQMP_PMUFW
	bool "zynqmp pmufw"
	depends on BR2_cortex_a53
	help
	  Build zynqmp pmufw application from Xilinx/embeddedsw repo.
	  If selected, the xilinx-prebuilt package will not install
	  the pmufw.elf since it will come from the xilinx-embeddedsw
	  package.

	  https://github.com/Xilinx/embeddedsw/tree/master/lib/sw_apps/zynqmp_pmufw

config BR2_TARGET_XILINX_EMBEDDEDSW_ZYNQMP_PMUFW_USER_CFLAGS
	string "xilinx-embeddedsw optional zynqmp_pmufw user cflags"
	depends on BR2_TARGET_XILINX_EMBEDDEDSW_ZYNQMP_PMUFW
	help
	  Add optional cflags when building xilinx zynqmp_pmufw.

	  Example cflag options can be found here:
	  https://github.com/Xilinx/embeddedsw/blob/master/lib/sw_apps/zynqmp_pmufw/src/xpfw_config.h

endif # BR2_TARGET_XILINX_EMBEDDEDSW
