## Build options
BR2_CCACHE=y
BR2_CCACHE_DIR="$(HOME)/.buildroot-ccache-saxon_default"

## Target options
BR2_riscv=y
#ifdef RV32
BR2_RISCV_32=y
#endif
#ifdef RV64
BR2_RISCV_64=y
#endif

## Instruction Set Extensions
BR2_riscv_custom=y
BR2_RISCV_ISA_RVM=y
BR2_RISCV_ISA_RVA=y
BR2_RISCV_ISA_RVC=RVC
#ifdef FPU
BR2_RISCV_ISA_RVF=y
BR2_RISCV_ISA_RVD=y
#endif
#ifdef RV32
BR2_RISCV_ABI_ILP32=y
#endif
#ifdef RV64
BR2_RISCV_ABI_LP64=y
#endif


## Patches
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_NAXRISCV_SIM_PATH)/patches"

## GCC
BR2_GCC_VERSION_15_X=y

## System
BR2_TARGET_GENERIC_GETTY=y
BR2_TARGET_GENERIC_GETTY_PORT="console"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_NAXRISCV_SIM_PATH)/boards/naxriscv_sim/linux/linux.dts"

## OpenSBI
BR2_TARGET_OPENSBI=y
BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.8.1"
BR2_TARGET_OPENSBI_PLAT="generic"
BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG=y
BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG=y
BR2_TARGET_OPENSBI_LINUX_PAYLOAD=y
BR2_TARGET_OPENSBI_ADDITIONAL_VARIABLES="BUILD_INFO=y DEBUG=1 FW_PIC=y PLATFORM=generic FW_TEXT_START=0x80000000 FW_JUMP_ADDR=0x80400000 FW_JUMP_FDT_ADDR=0x80F80000 FW_FDT_PATH=$(BINARIES_DIR)/linux.dtb"

## Filesystem
BR2_TARGET_ROOTFS_CPIO=y

## Kernel (litex-rebase branch)
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_GIT=n
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/SpinalHDL/linux.git"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="dev"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_NAXRISCV_SIM_PATH)/boards/naxriscv_sim/linux/linux.config"
BR2_LINUX_KERNEL_IMAGE=y

## Rootfs customisation
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_NAXRISCV_SIM_PATH)/boards/naxriscv_sim/linux/rootfs_overlay"

## Extra packages
BR2_PACKAGE_DHRYSTONE=y
BR2_PACKAGE_MICROPYTHON=y

#ifdef RVH
BR2_PACKAGE_KVMTOOL=y
BR2_PACKAGE_KVM_UNIT_TESTS=y
#endif
