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;"
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
}
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/;
/ {