summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/atf
diff options
context:
space:
mode:
authorChunrong Guo <chunrong.guo@nxp.com>2019-03-21 10:39:59 +0800
committerChunrong Guo <chunrong.guo@nxp.com>2019-03-21 10:39:59 +0800
commitf115fc33ff7e9b925a3b70717d6694bb7811d653 (patch)
treeba54b5e71f208deea0411c6cd719010b8daf8cd5 /recipes-bsp/atf
parentb4cecfc99678bb1e3f3824b9a6be8b86ef9d9a03 (diff)
downloadmeta-freescale-f115fc33ff7e9b925a3b70717d6694bb7811d653.tar.gz
atf: Reorganize
*Add FUSE DISTRO_FEATURES *Add chassistype and ddrphyopt *Install srk.pri and srk.pub Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
Diffstat (limited to 'recipes-bsp/atf')
-rw-r--r--recipes-bsp/atf/atf_git.bb92
1 files changed, 67 insertions, 25 deletions
diff --git a/recipes-bsp/atf/atf_git.bb b/recipes-bsp/atf/atf_git.bb
index 45bd376c..883b7eaf 100644
--- a/recipes-bsp/atf/atf_git.bb
+++ b/recipes-bsp/atf/atf_git.bb
@@ -29,21 +29,27 @@ LDFLAGS[unexport] = "1"
29AS[unexport] = "1" 29AS[unexport] = "1"
30LD[unexport] = "1" 30LD[unexport] = "1"
31 31
32# set secure option
33# fuseopt ?= "FUSE_PROV=1 FUSE_FILE=$(CONFIG_SEC_FUSE_FILE)"
34
35BOOTTYPE ?= "nor nand qspi flexspi_nor sd emmc" 32BOOTTYPE ?= "nor nand qspi flexspi_nor sd emmc"
36BUILD_SECURE = "${@bb.utils.contains('COMBINED_FEATURES', 'secure', 'true', 'false', d)}" 33BUILD_SECURE = "${@bb.utils.contains('DISTRO_FEATURES', 'secure', 'true', 'false', d)}"
37BUILD_OPTEE = "${@bb.utils.contains('COMBINED_FEATURES', 'optee', 'true', 'false', d)}" 34BUILD_OPTEE = "${@bb.utils.contains('DISTRO_FEATURES', 'optee', 'true', 'false', d)}"
35BUILD_FUSE = "${@bb.utils.contains('DISTRO_FEATURES', 'fuse', 'true', 'false', d)}"
38 36
39uboot_boot_sec ?= "${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa-secure-boot" 37uboot_boot_sec ?= "${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa-secure-boot"
40uboot_boot ?= "${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa" 38uboot_boot ?= "${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa"
41rcw ?= "" 39rcw ?= ""
42rcw_ls1012afrwy = "_default" 40rcw_ls1012afrwy = "_default"
43rcw_ls1012ardb = "_default" 41rcw_ls1012ardb = "_default"
44rcwsec ?= "" 42rcwsec ?= "_sben"
45rcwsec_ls1012afrwy = "_sben" 43
46rcwsec_ls1012ardb = "_sben" 44chassistype ?= "ls2088_1088"
45chassistype_ls1012ardb = "ls104x_1012"
46chassistype_ls1012afrwy = "ls104x_1012"
47chassistype_ls1043ardb = "ls104x_1012"
48chassistype_ls1046ardb = "ls104x_1012"
49
50ddrphyopt ?= ""
51ddrphyopt_lx2160ardb = "fip_ddr_sec"
52
47do_configure[noexec] = "1" 53do_configure[noexec] = "1"
48 54
49do_compile() { 55do_compile() {
@@ -51,14 +57,23 @@ do_compile() {
51 install -d ${S}/include/tools_share/openssl 57 install -d ${S}/include/tools_share/openssl
52 cp -r ${RECIPE_SYSROOT}/usr/include/openssl/* ${S}/include/tools_share/openssl 58 cp -r ${RECIPE_SYSROOT}/usr/include/openssl/* ${S}/include/tools_share/openssl
53 ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/gen_keys 1024 59 ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/gen_keys 1024
60
61 if [ "${BUILD_FUSE}" = "true" ]; then
62 ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/gen_fusescr ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/input_files/gen_fusescr/${chassistype}/input_fuse_file
63 fuseopt="fip_fuse FUSE_PROG=1 FUSE_PROV_FILE=fuse_scr.bin"
64 fi
54 if [ "${BUILD_SECURE}" = "true" ]; then 65 if [ "${BUILD_SECURE}" = "true" ]; then
55 secureopt="TRUSTED_BOARD_BOOT=1 $ddrphyopt CST_DIR=${RECIPE_SYSROOT_NATIVE}/usr/bin/cst" 66 secureopt="TRUSTED_BOARD_BOOT=1 ${ddrphyopt} CST_DIR=${RECIPE_SYSROOT_NATIVE}/usr/bin/cst"
56 secext="_sec" 67 secext="_sec"
57 bl33="${uboot_boot_sec}" 68 bl33="${uboot_boot_sec}"
58 rcwsec="${rcwsec}" 69 if [ ${chassistype} = ls104x_1012 ]; then
70 rcwtemp="${rcwsec}"
71 else
72 rcwtemp="${rcw}"
73 fi
59 else 74 else
60 bl33="${uboot_boot}" 75 bl33="${uboot_boot}"
61 rcwsec="${rcw}" 76 rcwtemp="${rcw}"
62 fi 77 fi
63 78
64 if [ "${BUILD_OPTEE}" = "true" ]; then 79 if [ "${BUILD_OPTEE}" = "true" ]; then
@@ -70,39 +85,47 @@ do_compile() {
70 for d in ${BOOTTYPE}; do 85 for d in ${BOOTTYPE}; do
71 case $d in 86 case $d in
72 nor) 87 nor)
73 rcwimg="${RCWNOR}${rcwsec}.bin" 88 rcwimg="${RCWNOR}${rcwtemp}.bin"
74 uefiboot="${UEFI_NORBOOT}" 89 uefiboot="${UEFI_NORBOOT}"
75 ;; 90 ;;
76 nand) 91 nand)
77 rcwimg="${RCWNAND}${rcwsec}.bin" 92 rcwimg="${RCWNAND}${rcwtemp}.bin"
78 ;; 93 ;;
79 qspi) 94 qspi)
80 rcwimg="${RCWQSPI}${rcwsec}.bin" 95 rcwimg="${RCWQSPI}${rcwtemp}.bin"
81 ;; 96 ;;
82 sd) 97 sd)
83 rcwimg="${RCWSD}${rcwsec}.bin" 98 rcwimg="${RCWSD}${rcwtemp}.bin"
84 ;; 99 ;;
85 flexspi_nor) 100 flexspi_nor)
86 rcwimg="${RCWXSPI}${rcwsec}.bin" 101 rcwimg="${RCWXSPI}${rcwtemp}.bin"
87 uefiboot="${UEFI_XSPIBOOT}" 102 uefiboot="${UEFI_XSPIBOOT}"
88 ;; 103 ;;
89 esac 104 esac
90 105
91 if [ -f "${DEPLOY_DIR_IMAGE}/rcw/${PLATFORM}/${rcwimg}" ]; then 106 if [ -f "${DEPLOY_DIR_IMAGE}/rcw/${PLATFORM}/${rcwimg}" ]; then
107 oe_runmake V=1 -C ${S} realclean
108 oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${PLATFORM}/${rcwimg} BL33=${bl33} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt}
109 cp -r ${S}/build/${PLATFORM}/release/bl2_${d}*.pbl ${S}
110 cp -r ${S}/build/${PLATFORM}/release/fip.bin ${S}
111 if [ "${BUILD_FUSE}" = "true" ]; then
112 cp -f ${S}/build/${PLATFORM}/release/fuse_fip.bin ${S}
113 fi
114
92 if [ ${MACHINE} = ls1012afrwy ]; then 115 if [ ${MACHINE} = ls1012afrwy ]; then
93 oe_runmake V=1 -C ${S} realclean 116 oe_runmake V=1 -C ${S} realclean
94 oe_runmake V=1 -C ${S} all fip pbl PLAT=ls1012afrwy_512mb BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${PLATFORM}/${rcwimg} BL33=${bl33} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt} 117 oe_runmake V=1 -C ${S} all fip pbl PLAT=ls1012afrwy_512mb BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${PLATFORM}/${rcwimg} BL33=${bl33} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt}
95 cp -r ${S}/build/ls1012afrwy_512mb/release/bl2_qspi.pbl ${S}/bl2_${d}_512mb.pbl 118 cp -r ${S}/build/ls1012afrwy_512mb/release/bl2_qspi${secext}.pbl ${S}/bl2_${d}${secext}_512mb.pbl
96 cp -r ${S}/build/ls1012afrwy_512mb/release/fip.bin ${S}/fip_512mb.bin 119 cp -r ${S}/build/ls1012afrwy_512mb/release/fip.bin ${S}/fip_512mb.bin
120 if [ "${BUILD_FUSE}" = "true" ]; then
121 cp -r ${S}/build/ls1012afrwy_512mb/release/fuse_fip.bin ${S}/fuse_fip_512mb.bin
122 fi
97 fi 123 fi
98 if [ -n "${uefiboot}" ]; then 124 if [ -n "${uefiboot}" ]; then
99 oe_runmake V=1 -C ${S} realclean 125 oe_runmake V=1 -C ${S} realclean
100 oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${PLATFORM}/${rcwimg} BL33=${DEPLOY_DIR_IMAGE}/uefi/${PLATFORM}/${uefiboot} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt} 126 oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${PLATFORM}/${rcwimg} BL33=${DEPLOY_DIR_IMAGE}/uefi/${PLATFORM}/${uefiboot} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt}
101 cp -r ${S}/build/${PLATFORM}/release/fip.bin ${S}/fip_uefi.bin 127 cp -r ${S}/build/${PLATFORM}/release/fip.bin ${S}/fip_uefi.bin
102 fi 128 fi
103 oe_runmake V=1 -C ${S} realclean
104 oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${PLATFORM}/${rcwimg} BL33=${bl33} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt}
105 cp -r ${S}/build/${PLATFORM}/release/bl2_${d}*.pbl ${S}
106 fi 129 fi
107 rcwimg="" 130 rcwimg=""
108 uefiboot="" 131 uefiboot=""
@@ -111,13 +134,20 @@ do_compile() {
111 134
112do_install() { 135do_install() {
113 install -d ${D}/boot/atf 136 install -d ${D}/boot/atf
114 if [ "${BUILD_SECURE}" = "y" ]; then 137 cp -r ${S}/srk.pri ${D}/boot/atf
138 cp -r ${S}/srk.pub ${D}/boot/atf
139 if [ "${BUILD_SECURE}" = "true" ]; then
115 secext="_sec" 140 secext="_sec"
116 fi 141 fi
117 if [ -f "${S}/fip_uefi.bin" ]; then 142 if [ -f "${S}/fip_uefi.bin" ]; then
118 cp -r ${S}/fip_uefi.bin ${D}/boot/atf/fip_uefi.bin 143 cp -r ${S}/fip_uefi.bin ${D}/boot/atf/fip_uefi.bin
119 fi 144 fi
120 cp -r ${S}/build/${PLATFORM}/release/fip.bin ${D}/boot/atf/fip.bin 145 if [ -f "${S}/fuse_fip.bin" ]; then
146 cp -r ${S}/fuse_fip.bin ${D}/boot/atf/fuse_fip.bin
147 fi
148 if [ -f "${S}/fip.bin" ]; then
149 cp -r ${S}/fip.bin ${D}/boot/atf/fip.bin
150 fi
121 for d in ${BOOTTYPE}; do 151 for d in ${BOOTTYPE}; do
122 if [ -e ${S}/bl2_${d}${secext}.pbl ]; then 152 if [ -e ${S}/bl2_${d}${secext}.pbl ]; then
123 cp -r ${S}/bl2_${d}${secext}.pbl ${D}/boot/atf/bl2_${d}${secext}.pbl 153 cp -r ${S}/bl2_${d}${secext}.pbl ${D}/boot/atf/bl2_${d}${secext}.pbl
@@ -125,16 +155,25 @@ do_install() {
125 done 155 done
126 if [ ${MACHINE} = ls1012afrwy ]; then 156 if [ ${MACHINE} = ls1012afrwy ]; then
127 cp -r ${S}/fip_512mb.bin ${D}/boot/atf/fip_512mb.bin 157 cp -r ${S}/fip_512mb.bin ${D}/boot/atf/fip_512mb.bin
128 cp -r ${S}/bl2_qspi_512mb.pbl ${D}/boot/atf/fip_512mb.bin 158 cp -r ${S}/bl2_qspi${secext}_512mb.pbl ${D}/boot/atf/bl2_qspi${secext}_512mb.pbl
159 if [ -f "${S}/fuse_fip_512mb.bin" ]; then
160 cp -r ${S}/fuse_fip_512mb.bin ${D}/boot/atf/fuse_fip_512mb.bin
161 fi
129 fi 162 fi
130 chown -R root:root ${D} 163 chown -R root:root ${D}
131} 164}
132 165
133do_deploy() { 166do_deploy() {
134 install -d ${DEPLOYDIR}/atf 167 install -d ${DEPLOYDIR}/atf
135 if [ "${BUILD_SECURE}" = "y" ]; then 168 cp -r ${D}/boot/atf/srk.pri ${DEPLOYDIR}/atf
169 cp -r ${D}/boot/atf/srk.pub ${DEPLOYDIR}/atf
170 if [ "${BUILD_SECURE}" = "true" ]; then
136 secext="_sec" 171 secext="_sec"
137 fi 172 fi
173
174 if [ -f "${S}/fuse_fip.bin" ]; then
175 cp -r ${D}/boot/atf/fuse_fip.bin ${DEPLOYDIR}/atf/fuse_fip${secext}.bin
176 fi
138 177
139 if [ -e ${D}/boot/atf/fip_uefi.bin ]; then 178 if [ -e ${D}/boot/atf/fip_uefi.bin ]; then
140 cp -r ${D}/boot/atf/fip_uefi.bin ${DEPLOYDIR}/atf/fip_uefi.bin 179 cp -r ${D}/boot/atf/fip_uefi.bin ${DEPLOYDIR}/atf/fip_uefi.bin
@@ -146,8 +185,11 @@ do_deploy() {
146 fi 185 fi
147 done 186 done
148 if [ ${MACHINE} = ls1012afrwy ]; then 187 if [ ${MACHINE} = ls1012afrwy ]; then
149 cp -r ${S}/bl2_qspi_512mb.pbl ${DEPLOYDIR}/atf/ 188 cp -r ${S}/bl2_qspi${secext}_512mb.pbl ${DEPLOYDIR}/atf/
150 cp -r ${S}/fip_512mb.bin ${DEPLOYDIR}/atf/fip_uboot${secext}_512mb.bin 189 cp -r ${S}/fip_512mb.bin ${DEPLOYDIR}/atf/fip_uboot${secext}_512mb.bin
190 if [ -f "${S}/fuse_fip_512mb.bin" ]; then
191 cp -r ${S}/fuse_fip_512mb.bin ${D}/boot/atf/fuse_fip_512mb${secext}.bin
192 fi
151 fi 193 fi
152} 194}
153addtask deploy after do_install 195addtask deploy after do_install