962f84ebd5bbad896d64101d0ca6aa63943d1917
[AGL/meta-agl-refhw.git] / meta-agl-refhw-gen3 / recipes-bsp / arm-trusted-firmware / arm-trusted-firmware_%.bbappend
1 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
2
3 # Apply the patch AGL applies for all rcar3 in meta-agl-bsp when
4 # building the standalone agl-refhw-h3 machine.
5 SRC_URI_append_agl-refhw-h3 = " file://0001-Boot-Normal-World-in-EL2.patch"
6
7 # It is believed the eMMC configuration below makes the result AGL
8 # reference hardware specific, mark it as such when building with
9 # MACHINE=agl-refhw-h3 to potentially flag this in an incorrectly
10 # configured build.
11 COMPATIBLE_MACHINE_agl-refhw-h3 = "agl-refhw-h3"
12
13 # There are hardware issues in using hyperflash. arm-trusted-firmware, optee and
14 # u-boot have to be stored into eMMC by using serial donwload.
15 EMMC_BOOT_OPTION = "RCAR_SA6_TYPE=1"
16
17 # RCAR_DRAM_MEMRANK must be set, since in case of RCAR_DRAM_LPDDR4_MEMCONF=1
18 # ddr_rank_judge is called. But for RCAR_DRAM_MEMRANK=0 it can determine values
19 # only for Salvator XS and Starter Kit Pre.
20 #
21 # RCAR_DRAM_MEMRANK=2 is set because for ATF from BSP v4.7.0:
22 #
23 # https://github.com/renesas-rcar/arm-trusted-firmware/tree/af9f429a48b438e314289f17947ad5d8036f398e
24 #
25 # _board_judge returns hardcoded 'brd = 8;  /*  8Gbit/2rank */' by default.
26 #
27 DDR_8G_OPTION = "RCAR_DRAM_LPDDR4_MEMCONF=1 RCAR_DRAM_MEMRANK=2"
28
29 ATFW_OPT_agl-refhw-h3 = "LSI=H3 RCAR_DRAM_SPLIT=1 ${EMMC_BOOT_OPTION} ${DDR_8G_OPTION}"
30
31 #
32 # Handle building as extra firmware with MACHINE=h3ulcb
33 #
34
35 # Build options for building as extra firmware when MACHINE=h3ulcb, based on H3[4x2g]
36 H3ULCB[agl-refhw-4x2g] = "LSI=H3 RCAR_DRAM_SPLIT=1 ${EMMC_BOOT_OPTION} ${DDR_8G_OPTION}"
37
38 #
39 # Need to prepend the compile tasks with a distclean that actually cleans
40 # out all the platform specific files like the new rcar_layout_tool output,
41 # otherwise they do not get rebuilt and board builds can get the wrong
42 # version of e.g. cert_headers_sa6.  This needs to be addressed with
43 # upstream.
44 #
45
46 do_compile_prepend() {
47     oe_runmake distclean PLAT=${PLATFORM} MBEDTLS_COMMON_MK=1 ${ATFW_OPT}
48 }
49
50 do_ipl_opt_compile_prepend() {
51     oe_runmake distclean PLAT=${PLATFORM} MBEDTLS_COMMON_MK=1 ${ATFW_OPT}
52 }
53
54 do_extra_ipl_opt_refhw_fixup() {
55     # Rename agl-refhw-h3 firmware files to drop h3ulcb-
56     for f in ${DEPLOYDIR}/*-h3ulcb-agl-refhw-4x2g*; do
57         n=`basename $f | sed 's/h3ulcb-//'`
58         mv -f $f ${DEPLOYDIR}/$n
59     done
60 }
61
62 EXTRA_IPL_OPT_POSTFUNCS = ""
63 EXTRA_IPL_OPT_POSTFUNCS_h3ulcb = "do_extra_ipl_opt_refhw_fixup"
64 do_extra_ipl_opt[postfuncs] += "${EXTRA_IPL_OPT_POSTFUNCS}"