# SPDX-License-Identifier: GPL-2.0-only

menu "SoCFPGA Features"
	depends on ARCH_SOCFPGA

config ARCH_SOCFPGA_CYCLONE5
	bool
	select CPU_V7
	select ARM_SMP_TWD
	select OFDEVICE if !ARCH_SOCFPGA_XLOAD
	select OFTREE if !ARCH_SOCFPGA_XLOAD
	select GPIOLIB if !ARCH_SOCFPGA_XLOAD

config ARCH_SOCFPGA_ARRIA10
	bool
	select CPU_V7
	select ARM_SMP_TWD
	select RESET_CONTROLLER
	select OFDEVICE
	select OFTREE
	select MCI_DW_PBL

config ARCH_SOCFPGA_AGILEX5
	bool
	select CPU_V8
	select RESET_CONTROLLER
	select RESET_SIMPLE
	select OFDEVICE
	select OFTREE
	select FIRMWARE_AGILEX5_ATF
	select ARM_ATF
	select ARM_SMCCC
	select GPIOLIB

if 32BIT

comment "Cyclone V boards"

config MACH_SOCFPGA_ALTERA_SOCDK
	select ARCH_SOCFPGA_CYCLONE5
	bool "Altera SoCFPGA Development Kit"

config MACH_SOCFPGA_EBV_SOCRATES
	select ARCH_SOCFPGA_CYCLONE5
	bool "EBV Socrates"

config MACH_SOCFPGA_ENCLUSTRA_SA2
	select ARCH_SOCFPGA_CYCLONE5
	bool "Enclustra SA2"

config MACH_SOCFPGA_ENCLUSTRA_SA2_SI5338
	depends on MACH_SOCFPGA_ENCLUSTRA_SA2
	bool "Configure the SI5338 clock generator on ST1 baseboard"

config MACH_SOCFPGA_TERASIC_DE0_NANO_SOC
	select ARCH_SOCFPGA_CYCLONE5
	bool "Terasic DE0-NANO-SoC aka Atlas"

config MACH_SOCFPGA_TERASIC_DE10_NANO
	select ARCH_SOCFPGA_CYCLONE5
	bool "Terasic DE10-NANO"

config MACH_SOCFPGA_TERASIC_SOCKIT
	select ARCH_SOCFPGA_CYCLONE5
	bool "Terasic SoCKit"

comment "Arria 10 boards"

config MACH_SOCFPGA_ENCLUSTRA_AA1
	select ARCH_SOCFPGA_ARRIA10
	bool "Enclustra AA1"

config MACH_SOCFPGA_REFLEX_ACHILLES
	select ARCH_SOCFPGA_ARRIA10
	bool "Reflex Achilles"

endif

if 64BIT

comment "Agilex 5 boards"

menuconfig MACH_SOCFPGA_ARROW_AXE5_EAGLE
	bool "Arrow AXE5 Eagle"
	select ARCH_SOCFPGA_AGILEX5

config MACH_SOCFPGA_ARROW_AXE5_EAGLE_XLOAD
	bool "Build Arrow AXE5 Eagle FSBL without piggy data"
	depends on MACH_SOCFPGA_ARROW_AXE5_EAGLE
	select SOCFPGA_AGILEX5_XLOAD
	select SPI_CADENCE_QUADSPI_PBL
	help
	  This option reduces the binary size of the FSBL and makes it
	  independent of the enabled features of the SSBL, but requires SSBL
	  xload support.

config MACH_SOCFPGA_ARROW_AXE5_EAGLE_XLOAD_ADDR
	prompt "Start address of the Arrow AXE5 SSBL on flash"
	hex
	default 0x01000000
	help
	  barebox tries to load an SSBL from this address in the QSPI flash.

	  Keep this address in sync with your QSPI image configuration.

config MACH_SOCFPGA_ARROW_AXE5_EAGLE_XLOAD_SIZE
	prompt "Maximum size of the Arrow AXE5 SSBL on flash"
	hex
	default 0x00400000
	help
	  The maximum size of the SSBL in the QSPI flash.

	  Keep this size in sync with your QSPI image configuration.

endif

comment "board features"

config ARCH_SOCFPGA_XLOAD
	bool
	depends on ARCH_SOCFPGA_CYCLONE5
	prompt "Build SoCFPGA preloader image"

config SOCFPGA_AGILEX5_XLOAD
	bool
	depends on ARCH_SOCFPGA_AGILEX5
	prompt "Support SSBL xloading on Agilex 5"
	help
	  On Agilex 5, the FSBL binary is limited to a size of ~256k. Enable
	  XLOAD support to load the SSBL from a separate medium and allow
	  larger bootloader images.

	  Note that the SSBL loading has to be configured in the board code.

endmenu
