blob: e1e387a8e72fd8b79395581d3e67ed94ed3ce3fc [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001inherit deploy externalsrc
2
3LICENSE = "MediaTekProprietary"
4MTK_SRC = "${TOPDIR}/../src/bsp/preloader"
5LIC_FILES_CHKSUM = "file://${MTK_SRC}/README;md5=661d538ca8a7b4b17d03d6e90e384ffa"
6PRELOADER_OUT = "${WORKDIR}/out"
7CROSS_COMPILE = "${TARGET_PREFIX}"
8EXTERNALSRC = "${MTK_SRC}"
9EXTERNALSRC_BUILD = "${MTK_SRC}"
10PACKAGE_ARCH = "${MACHINE_ARCH}"
11PRELOADER_BINARY = "preloader_${PRELOADER_PROJECT}.bin"
12PRELOADER_IMAGE = "preloader.img"
13PRELOADER_NOR_IMAGE = "preloader_nor.img"
14
15do_compile () {
16 oe_runmake MTK_PROJECT=${PRELOADER_PROJECT} \
17 PRELOADER_OUT=${PRELOADER_OUT} \
18 CROSS_COMPILE=${CROSS_COMPILE} \
19 PRELOADER_BINARY=${PRELOADER_BINARY} \
20 PRELOADER_PROJECT=${PRELOADER_PROJECT}
21 python ${MTK_SRC}/tools/gen-preloader-img.py \
22 ${PRELOADER_OUT}/bin/${PRELOADER_BINARY} \
23 ${PRELOADER_OUT}/bin/${PRELOADER_IMAGE}
24 python ${MTK_SRC}/tools/gen-sf-preloader-img.py \
25 ${PRELOADER_OUT}/bin/${PRELOADER_BINARY} \
26 ${PRELOADER_OUT}/bin/${PRELOADER_NOR_IMAGE}
27}
28
29
30do_buildclean () {
31 oe_runmake MTK_PROJECT=${PRELOADER_PROJECT} \
32 PRELOADER_OUT=${PRELOADER_OUT} \
33 CROSS_COMPILE=${CROSS_COMPILE} \
34 PRELOADER_BINARY=${PRELOADER_BINARY} \
35 PRELOADER_PROJECT=${PRELOADER_PROJECT} clean
36}
37
38do_deploy () {
39 install -d ${DEPLOYDIR}
40 install ${PRELOADER_OUT}/bin/${PRELOADER_BINARY} ${DEPLOYDIR}/${PRELOADER_BINARY}
41 ln -nfs ${PRELOADER_BINARY} ${DEPLOYDIR}/preloader.bin
42 install ${PRELOADER_OUT}/bin/${PRELOADER_IMAGE} ${DEPLOYDIR}/${PRELOADER_IMAGE}
43 install ${PRELOADER_OUT}/bin/${PRELOADER_NOR_IMAGE} ${DEPLOYDIR}/${PRELOADER_NOR_IMAGE}
44}
45
46addtask deploy before do_build after do_compile