【Tiny4412】Tiny4412烧写uboot脚本分析
发布日期:2021-06-29 20:47:22 浏览次数:3 分类:技术文章

本文共 2324 字,大约阅读时间需要 7 分钟。

00. 目录

文章目录

01. sd_fusing.sh脚本分析

## Copyright (C) 2011 Samsung Electronics Co., Ltd.#              http://www.samsung.com/## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License version 2 as# published by the Free Software Foundation.######################################./sd_fusing.sh /dev/sdb#-z 判断参数是否为空if [ -z $1 ]then    echo "usage: ./sd_fusing.sh 
" exit 0fi#-b 判断传递的第一个参数是否为块设备if [ -b $1 ]then echo "$1 reader is identified."else echo "$1 is NOT identified." exit 0fi#####################################
#basename /dev/sdb ---> sdbBDEV_NAME=`basename $1`#获取磁盘的大小BDEV_SIZE=`cat /sys/block/${
BDEV_NAME}/size`#表示没有插入SD卡if [ ${BDEV_SIZE} -le 0 ]; then echo "Error: NO media found in card reader." exit 1fi#SD卡的大小不能超过32000000if [ ${BDEV_SIZE} -gt 32000000 ]; then echo "Error: Block device size (${BDEV_SIZE}) is too large" exit 1fi##################################### check files#u-boot.bin的文件E4412_UBOOT=../../u-boot.bin#工具MKBL2=../mkbl2#判断u-boot.bin是否存在if [ ! -f ${E4412_UBOOT} ]; then echo "Error: u-boot.bin NOT found, please build it & try again." exit -1fi#判断mkbl2工具是否存在if [ ! -f ${MKBL2} ]; then echo "Error: can not find host tool - mkbl2, stop." exit -1fi#生成bl2#
${MKBL2} ${E4412_UBOOT} bl2.bin 14336##################################### fusing imagessigned_bl1_position=1bl2_position=17uboot_position=49tzsw_position=705#烧写bl1#
echo "---------------------------------------"echo "BL1 fusing"#dsync表示同步dd iflag=dsync oflag=dsync if=./E4412_N.bl1.bin of=$1 seek=$signed_bl1_position#烧写bl2#
echo "---------------------------------------"echo "BL2 fusing"#dsync表示同步dd iflag=dsync oflag=dsync if=./bl2.bin of=$1 seek=$bl2_position#烧写uboot#
echo "---------------------------------------"echo "u-boot fusing"dd iflag=dsync oflag=dsync if=${E4412_UBOOT} of=$1 seek=$uboot_position#烧写信任区域#
echo "---------------------------------------"echo "TrustZone S/W fusing"dd iflag=dsync oflag=dsync if=./E4412_tzsw.bin of=$1 seek=$tzsw_position#同步#
sync#####################################
echo "---------------------------------------"echo "U-boot image is fused successfully."echo "Eject SD card and insert it again."

02. 附录

sd_fusing.sh在uboot目录中。

转载地址:https://dengjin.blog.csdn.net/article/details/106554542 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:【Tiny4412】设置Uboot提示符和关闭MMU
下一篇:【Tiny4412】Tiny4412编译和烧写uboot

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2024年04月15日 20时58分31秒