1 FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
3 SRC_URI:append:rcar-gen3 = " file://0001-rcar_gen3-plat-Do-not-panic-on-unrecognized-boards.patch"
5 # It is believed the eMMC configuration below makes the result AGL
6 # reference hardware specific, mark it as such when building with
7 # MACHINE=agl-refhw-h3 to potentially flag this in an incorrectly
9 COMPATIBLE_MACHINE:agl-refhw-h3 = "agl-refhw-h3"
11 # There are hardware issues in using hyperflash. arm-trusted-firmware, optee and
12 # u-boot have to be stored into eMMC by using serial donwload.
13 EMMC_BOOT_OPTION = "RCAR_SA6_TYPE=1"
15 # RCAR_DRAM_MEMRANK must be set, since in case of RCAR_DRAM_LPDDR4_MEMCONF=1
16 # ddr_rank_judge is called. But for RCAR_DRAM_MEMRANK=0 it can determine values
17 # only for Salvator XS and Starter Kit Pre.
19 # RCAR_DRAM_MEMRANK=2 is set because for ATF from BSP v4.7.0:
21 # https://github.com/renesas-rcar/arm-trusted-firmware/tree/af9f429a48b438e314289f17947ad5d8036f398e
23 # _board_judge returns hardcoded 'brd = 8; /* 8Gbit/2rank */' by default.
25 DDR_8G_OPTION = "RCAR_DRAM_LPDDR4_MEMCONF=1 RCAR_DRAM_MEMRANK=2"
27 # AGL reference hardware numbered 100 or above has 16Gbit/1rank DRAM
28 # and please flash the firmware built with the following options.
29 DDR_8G_1RANK_OPTION = "RCAR_DRAM_LPDDR4_MEMCONF=1 RCAR_DRAM_MEMRANK=1"
31 ATFW_OPT:agl-refhw-h3 = "LSI=H3 RCAR_DRAM_SPLIT=1 ${EMMC_BOOT_OPTION} ${DDR_8G_OPTION}"
34 # Handle building as extra firmware with MACHINE=h3ulcb
37 # Build options for building as extra firmware when MACHINE=h3ulcb, based on H3[4x2g]
38 H3ULCB[agl-refhw-4x2g] = "LSI=H3 RCAR_DRAM_SPLIT=1 ${EMMC_BOOT_OPTION} ${DDR_8G_OPTION}"
39 H3ULCB[agl-refhw-4x2g-1rank] = "LSI=H3 RCAR_DRAM_SPLIT=1 ${EMMC_BOOT_OPTION} ${DDR_8G_1RANK_OPTION}"
41 python __anonymous() {
42 # If building for MACHINE=agl-refhw-h3, the predefined default
43 # extra configurations in the base recipe are not interesting
44 # to us, as there is no compatible hardware.
45 if d.getVar("MACHINE") == "agl-refhw-h3":
46 d.delVarFlag("H3", "2x2g")
47 d.delVarFlag("H3", "4x2g")
50 # Also build the extra 1rank firmware when MACHINE=agl-refhw-h3
51 H3[4x2g-1rank] = "LSI=H3 RCAR_DRAM_SPLIT=1 ${EMMC_BOOT_OPTION} ${DDR_8G_1RANK_OPTION}"
53 # Boot Normal World in EL2: this define configures ATF (SPSR register) to boot
55 EXTRA_OEMAKE += " RCAR_BL33_EXECUTION_EL=1"
58 # Need to prepend the compile tasks with a distclean that actually cleans
59 # out all the platform specific files like the new rcar_layout_tool output,
60 # otherwise they do not get rebuilt and board builds can get the wrong
61 # version of e.g. cert_headers_sa6. This needs to be addressed with
65 do_compile:prepend() {
66 oe_runmake distclean PLAT=${PLATFORM} MBEDTLS_COMMON_MK=1 ${ATFW_OPT}
69 do_ipl_opt_compile:prepend() {
70 oe_runmake distclean PLAT=${PLATFORM} MBEDTLS_COMMON_MK=1 ${ATFW_OPT}
73 do_extra_ipl_opt_refhw_fixup() {
74 # Rename agl-refhw-h3 firmware files to drop h3ulcb-
75 for f in ${DEPLOYDIR}/*-h3ulcb-agl-refhw-4x2g*; do
76 n=`basename $f | sed 's/h3ulcb-//'`
77 mv -f $f ${DEPLOYDIR}/$n
81 EXTRA_IPL_OPT_POSTFUNCS = ""
82 EXTRA_IPL_OPT_POSTFUNCS_h3ulcb = "do_extra_ipl_opt_refhw_fixup"
83 do_extra_ipl_opt[postfuncs] += "${EXTRA_IPL_OPT_POSTFUNCS}"