博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
tiny4412 --uboot移植(2) 点灯
阅读量:4561 次
发布时间:2019-06-08

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

开发环境:win10 64位 + VMware12 + Ubuntu14.04 32位

工具链:linaro提供的gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi

要移植的u-boot版本:u-boot-2016-11

Tiny4412开发板硬件版本为

  底板:  Tiny4412SDK 1312B

  核心板:Tiny4412 - 1306

 

在上一节中我们为tiny4412开发板添加相应目录文件,并且可以顺利编译通过生成.bin文件。接下来我们通过点亮tiny4412核心板上的LED灯开始调试u-boot。

代码,原理都与裸板相同,就不多做介绍。

 

1、直接将其添加进 arch/arm/cpu/armv7/start.S 

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S

index 7eee54b..387f2ac 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -60,7 +60,7 @@ switch_to_hypervisor_ret:
orrne r0, r0, #0x13 @ set SVC mode
orr r0, r0, #0xc0 @ disable FIQ and IRQ
msr cpsr,r0
/*
* Setup vector:
* (OMAP4 spl TEXT_BASE is not 32 byte aligned.
@@ -84,7 +84,7 @@ switch_to_hypervisor_ret:
bl cpu_init_crit
#endif
#endif

// bl_main 之前加,在cpu_init 之后

+ bl light_led
bl _main
/*-----------------------------------------------------------------------------
@@ -293,3 +293,13 @@ ENTRY(cpu_init_crit)
b lowlevel_init @ go setup pll,mux,memory
ENDPROC(cpu_init_crit)
#endif

//最后面加

+ .globl light_led
+light_led:
+ ldr r0,=0x110002E0
+ ldr r1,=0x00001111
+ str r1,[r0]
+
+ ldr r0,=0x110002E4
+ mov r1,#0xF0
+ str r1,[r0]
+ mov pc,lr

 

2、将sd_fuse 文件夹复制到根目录下,其中包括exynos4412启动所需的二进制固件:E4412_N.bl1.bin、E4412_tzsw.bin 、sd_fuse.c、fast_fuse.sh、sd_fusing.sh

只需要修改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.#####################################if [ -z $1 ]then    echo "usage: ./sd_fusing.sh 
" exit 0fiif [ -b $1 ]then echo "$1 reader is identified."else echo "$1 is NOT identified." exit 0fi#####################################
BDEV_NAME=`basename $1`BDEV_SIZE=`cat /sys/block/${BDEV_NAME}/size` if [ ${BDEV_SIZE} -le 0 ]; then echo "Error: NO media found in card reader." exit 1fi if [ ${BDEV_SIZE} -gt 32000000 ]; then echo "Error: Block device size (${BDEV_SIZE}) is too large" exit 1fi##################################### check files##################################### fusing imagessigned_bl1_position=1bl2_position=17uboot_position=49tzsw_position=705#
echo "---------------------------------------"echo "BL1 fusing"dd iflag=dsync oflag=dsync if=./E4412_N.bl1.bin of=$1 seek=$signed_bl1_position#
echo "---------------------------------------"echo "tiny4412-spl.bin fusing"dd iflag=dsync oflag=dsync if=./tiny4412-spl.bin of=$1 seek=$bl2_position #
#echo "---------------------------------------"#echo "u-boot fusing"#dd iflag=dsync oflag=dsync if=E4412UBOOTof=1 seek=$uboot_position#
#echo "---------------------------------------"#echo "TrustZone S/W fusing"#dd iflag=dsync oflag=dsync if=./E4412_tzsw.bin of=1seek=tzsw_position#
sync#####################################
echo "---------------------------------------"echo "U-boot image is fused successfully."echo "Eject SD card and insert it again."

 

3、u-boot根目录下添加编译脚本文件build-tiny4412.sh

1 echo "****clean****"  2 make clean  3   4 echo "----config tiny4412----"  5 make ARCH=arm tiny4412_defconfig  6   7 echo "----building----"  8 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

 

在完成前两部后,在根目录执行build-tiny4412.sh ,正常会在spl下生成tiny4412-spl.bin。这就是通过board/samsung/tiny4412/tools/mktiny4412spl.h生成的bl2。然后把tiny4412-spl.bin拷入sd_fuse ,用sd_fusing.sh 烧入SD卡即可。

 

转载于:https://www.cnblogs.com/chu-yi/p/10384330.html

你可能感兴趣的文章
HDU 5374 Tetris (2015年多校比赛第7场)
查看>>
《Android源代码设计模式解析与实战》读书笔记(二十二)
查看>>
Javascript
查看>>
百度之星初赛A hdu6112
查看>>
Nginx 503错误总结
查看>>
如何允许WebGL从本地载入资源
查看>>
gcc编译器局部变量在栈中的内存分配
查看>>
mapreduce中控制mapper的数量
查看>>
java海量数据处理(千万级别)(2)-海量数据FTP下载
查看>>
50个Android开发技巧(24 处理ListView数据为空的情况)
查看>>
2018-3-17-湖南多校第二场
查看>>
cocos2d CC_PROPERTY
查看>>
[原]Failed connect to mirrors.cloud.aliyuncs.com:80; Connection refused
查看>>
AOP:使用命令模式实现AOP
查看>>
算法:希尔排序(Shell Sort)
查看>>
Page Object 设计模式介绍
查看>>
全局变量报错:UnboundLocalError: local variable 'l' referenced before assignment
查看>>
面向对象(五)
查看>>
android平台下使用点九PNG技术
查看>>
Python学习3,列表
查看>>