From: Baikal Electronics Date: Tue, 27 Sep 2022 14:27:18 +0000 (+0300) Subject: Add task for creating bfk3.rom X-Git-Tag: baikal/mips/sdk6.1~20 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=49a4956d9e11ee43513180a0fa9893986ba5e9cb;p=openembedded-baikal.git Add task for creating bfk3.rom --- diff --git a/meta-baikal/recipes-core/images/core-image-minimal.bbappend b/meta-baikal/recipes-core/images/core-image-minimal.bbappend index 3e58b35..113e3e5 100644 --- a/meta-baikal/recipes-core/images/core-image-minimal.bbappend +++ b/meta-baikal/recipes-core/images/core-image-minimal.bbappend @@ -19,4 +19,32 @@ baikal_deploy () { cp -f ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio.lzma ${BAIKAL_IMAGES}/initramfs.lzma } -IMAGE_POSTPROCESS_COMMAND += "baikal_deploy;" +UBOOT_SECTION_END = "786432" +UBOOTENV_SECTION_END = "917504" +LINUX_FDT_SECTION_END = "983040" +FITIMAGE_SECTION_END = "15335424" + +check_size_fitness () { + cur_size=$( wc -c $1 | cut -d' ' -f1) + if [ $cur_size -gt $2 ]; then + bberror "$3 exceeds maximum size." + fi + padding=$( expr $2 - $cur_size ) + dd if=/dev/zero count=1 bs=$padding >> $1 +} + +baikal_build_bootrom () { + cd ${WORKDIR} + cat ${BAIKAL_IMAGES}/${MACHINE}.u-boot.bin > ${MACHINE}.rom + check_size_fitness ${MACHINE}.rom ${UBOOT_SECTION_END} ${MACHINE}.u-boot.bin + cat ${BAIKAL_IMAGES}/${MACHINE}.bin >> ${MACHINE}.rom + check_size_fitness ${MACHINE}.rom ${UBOOTENV_SECTION_END} ${MACHINE}.bin + cat ${BAIKAL_IMAGES}/${MACHINE}.dtb >> ${MACHINE}.rom + check_size_fitness ${MACHINE}.rom ${LINUX_FDT_SECTION_END} ${MACHINE}.dtb + cat ${BAIKAL_IMAGES}/uMulti >> ${MACHINE}.rom + check_size_fitness ${MACHINE}.rom ${FITIMAGE_SECTION_END} uMulti + + cp -f ${MACHINE}.rom -t ${BAIKAL_IMAGES} +} + +IMAGE_POSTPROCESS_COMMAND += "baikal_deploy;baikal_build_bootrom;" diff --git a/meta-baikal/recipes-kernel/linux/linux-umulti.inc b/meta-baikal/recipes-kernel/linux/linux-umulti.inc index 5b850f8..d98f01e 100644 --- a/meta-baikal/recipes-kernel/linux/linux-umulti.inc +++ b/meta-baikal/recipes-kernel/linux/linux-umulti.inc @@ -20,7 +20,7 @@ baikal_do_uinitramfs () { uboot-mkimage -A ${UBOOT_ARCH} -O linux -T ramdisk -C ${BAIKAL_COMP_ALG} \ -a ${UBOOT_RD_LOADADDRESS} -e ${UBOOT_RD_ENTRYPOINT} \ -d "${BAIKAL_IMAGES}/initramfs${BAIKAL_COMP_ALG_EXTENSION}" \ - -n "-" \ + -n "uInitramfs Image for bfk3 board" \ ${BAIKAL_IMAGES}/${MACHINE}.uInitramfs } @@ -28,12 +28,12 @@ baikal_do_uinitrd () { uboot-mkimage -A ${UBOOT_ARCH} -O linux -T ramdisk -C ${BAIKAL_COMP_ALG} \ -a ${UBOOT_RDI_LOADADDRESS} -e ${UBOOT_RDI_ENTRYPOINT} \ -d "${BAIKAL_IMAGES}/initrd${BAIKAL_COMP_ALG_EXTENSION}" \ - -n "+" \ + -n "uInitrd Image for bfk3 board" \ ${BAIKAL_IMAGES}/${MACHINE}.uInitrd } baikal_do_ubootdtb () { - cat << EOF >> ${UBOOT_DTS_FILE} + cat << EOF > ${UBOOT_DTS_FILE} /dts-v1/; / {