#@TYPE: Machine
#@NAME: Solid-Run LX2160A-CEx7
#@SOC: LSCH3
#@DESCRIPTION: Machine configuration for running LX2160A-CEx7 in 64-bit mode

require conf/machine/include/qoriq-arm64.inc
require conf/machine/include/arm/arch-arm64.inc

MACHINEOVERRIDES =. "fsl-lsch3:lx2160a:"

MACHINE_FEATURES += "optee"

KERNEL_CLASSES  = " kernel-fitimage "
KERNEL_IMAGETYPES = "fitImage"

DTB_LOAD = "0x90000000"
UBOOT_ENTRYPOINT = "0x80080000"

UBOOT_CONFIG ??= "tfa"
UBOOT_CONFIG[tfa] = "lx2160acex7_tfa_defconfig,,u-boot-dtb.bin"

KERNEL_DEVICETREE_BASENAME ?= "fsl-lx2160a-cex7.dtb"
KERNEL_DEVICETREE ?= "freescale/${KERNEL_DEVICETREE_BASENAME}"
KERNEL_DEFCONFIG ?= "defconfig"

SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1 115200;ttyAMA0"
SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"

#SERDES=8_5_2 # 8x10g
#SERDES=13_5_2 # dual 100g
#SERDES=20_5_2 # dual 40g
SERDES ?= "8_5_2"
SPEED ?= "2000_700_3200"

RCWAUTO ?= "${SERDES}/${SPEED}"
BOOTTYPE="auto"

EXTRA_IMAGEDEPENDS += "management-complex mc-utils rcw ls2-phy ddr-phy qoriq-atf inphi"
USE_VT = "0"

PREFERRED_PROVIDER_u-boot-default-script = "u-boot-script-qoriq"
PREFERRED_PROVIDER_virtual/kernel = "linux-fslc-qoriq"
PREFERRED_VERSION_linux-qoriq = "5.4%"
PREFERRED_VERSION_u-boot-qoriq = "2019.10%"
PREFERRED_VERSION_qoriq-atf = "1.5%"

IMAGE_FSTYPES += "wic"
WKS_FILE = "lx2160acex7.wks.in"
WKS_FILE_DEPENDS:append = "\
    ${PREFERRED_PROVIDER_u-boot-default-script} \
"
IMAGE_BOOT_FILES ?= "${KERNEL_IMAGETYPE} ${KERNEL_DEVICETREE_BASENAME} boot.scr-${MACHINE};boot.scr"
