一 s5p4418 支持SD/TF卡离线烧录

来源:互联网 发布:mac mysql 图形化界面 编辑:程序博客网 时间:2024/05/04 18:28

为了支持该功能,需要两个工具sd_fdisk和u-boot-head-tool。

sd_fdisk功能是对TF卡分区,u-boot-head-tool则是修改编译生成的u-boot以适合s5p4418硬件启动的要求。

两个工具的下载地址是http://download.csdn.net/detail/u010406724/8362055,


另外还需要一个脚本,来使用这两个工具sd_fusing.sh,具体的代码如下:

## Copyright (C) 2010 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.#####################################reader_type1="/dev/sdj"#如果是使用的新卡(或者没有烧写过s5p4418程序的卡),那么需要把disk_tf_enable设置为1(默认值),执行完成后再设置为0,除非更换卡才再次设置为1,否则请保持为0,避免顺坏tf卡中原有的数据disk_tf_enable=0 if [ -z $1 ]then    echo "usage: ./sd_fusing.sh <SD Reader's device file>"    exit 0fiif [ $disk_tf_enable = 1 ]thenif [ $1 = $reader_type1 ]thenpartition1="$1"'1'partition2="$1"'2'partition3="$1"'3'partition4="$1"'4'fiif [ -b $1 ]thenecho "$1 reader is identified."elseecho "$1 is NOT identified."exit 0fi##################################### make partitionecho "make sd card partition"echo "./sd_fdisk $1" ./sd_fdisk $1 dd iflag=dsync oflag=dsync if=sd_mbr.dat of=$1 rm sd_mbr.dat##################################### formatumount $partition1 2> /dev/nullumount $partition2 2> /dev/nullumount $partition3 2> /dev/nullumount $partition4 2> /dev/nullecho "mkfs.vfat -F 32 $partition1"sudo mkfs.vfat -F 32 $partition1#echo "mkfs.ext2 $partition2"#mkfs.ext2 $partition2  #echo "mkfs.ext2 $partition3"#mkfs.ext2 $partition3  #echo "mkfs.ext2 $partition4"#mkfs.ext2 $partition4  #mount $partition1fi#####################################<BL1 fusing>bl1_position=1uboot_position=64echo "2ndboot fusing"dd iflag=dsync oflag=dsync if=2ndboot.bin of=$1 seek=$bl1_position./u-boot-head-tool #对u-boot进行加头处理#####################################<u-boot fusing>echo "u-boot fusing"dd iflag=dsync oflag=dsync if=u-boot-tmp.bin of=$1 seek=$uboot_positionrm u-boot-tmp.bin#####################################<Message Display>echo "U-boot image is fused successfully."


另外当然还需要u-boot.bin和2ndboot两个文件了,这两个文件也都会在官方的系统文件中提供了。

在执行脚本之前需要确保文件如下图所示:


另外需要注意脚本中的一个变量

disk_tf_enable=0

只有在使用新卡或者没有烧写过4418程序的卡时设置为1,其他都设置为0,免得因为格式化顺坏tf卡。




0 0