DM3730 uboot 分析
记录下启动log
Texas Instruments X-Loader 1.42 BSP-dm37x-2.4-2 for dm3730logic (2013-06-18 15:59:36)
DRAM: 256MB (MT29C4G48MAZAPAKQ5)
Starting U-boot on MMC
Reading boot sector
454540 bytes read from MMC to 80400000U-Boot 2011.06 BSP-dm37x-2.4-2 (Jun 18 2013 - 15:35:26)OMAP3630/3730-GP ES2.1, CPU-OPP2, L3-200MHz, Max CPU Clock 1 Ghz
Logic DM37x/OMAP35x reference board + LPDDR/NAND
I2C: ready
DRAM: 256 MiB
Board: DM37xx SOM LV
NOR: no flash device detected
NAND: 512 MiB
NAND: Internal to NAND ECC selected
*** Warning - bad CRC or ECC error, using default environmentFound '28' display panel
In: serial
Out: serial
Err: serial
Product ID data cached to: 40200000
at88_send_packet:82 NACK idx 3
at88_send_packet:82 NACK idx 3
at88_send_packet:82 NACK idx 3
at88_send_packet:82 NACK idx 3
at88_send_packet:82 NACK idx 3
at88_send_packet:82 NACK idx 3
Die ID #74ae00229ff84000013c124c1700c017
OTG_SYSCONFIG: 00001008 - needs to be 00002001ID data ROM : Gen 1
Part Number : L3-5000518
Model Name : SOMDM3730-PHI02-0301R-A
Serial Number: 2520M01457
LAN ethaddr : 00:08:ee:10:92:adData (writethrough) Cache is ON
Net: smc911x-0=================================== NOTICE ===================================
The U-Boot environment was not found. If the display is not set properly
linux will not have video support.Valid display options are:2 == LQ121S1DG31 TFT SVGA (12.1) Sharp3 == LQ036Q1DA01 TFT QVGA (3.6) Sharp w/ASIC5 == LQ064D343 TFT VGA (6.4) Sharp7 == LQ10D368 TFT VGA (10.4) Sharp15 == LQ043T1DG01 TFT WQVGA (4.3) Sharp28 == LQ043T1DG28 TFT WQVGA (4.3) Sharp (DEFAULT)vga[-16 OR -24] LCD VGA 640x480svga[-16 OR -24] LCD SVGA 800x600xga[-16 OR -24] LCD XGA 1024x768720p[-16 OR -24] LCD 720P 1280x720sxga[-16 OR -24] LCD SXGA 1280x1024uxga[-16 OR -24] LCD UXGA 1600x1200Default `display` environment variable is now being set to: 28At the U-Boot prompt type commands: `setenv display <num>`, then type
`saveenv` to save the environment to NAND flash. This will avoid seeing
this notice on future boots
=================================== NOTICE ===================================Hit any key to stop autoboot: 3 2 1 0 == Checking mmc1 for alternate boot script boot.scr ==
mmc1 is available
reading boot.scr129 bytes read== Found script on mmc 1, starting ==
## Executing script at 80ff0000
## Resetting to default environment
kernel_location: mmc , rootfs_location: mmc , rootfs_type: ramdisk== Loading kernel file uImage to 0x81000000 ==
mmc1 is available
reading uImage3977032 bytes read== Loading rootfs file rootfs.ext2.gz.uboot to 0x82000000 ==
reading rootfs.ext2.gz.uboot28842095 bytes read== Kernel bootargs ==
nand-ecc=chip console=ttyO0,115200n8 display=28 ignore_loglevel early_printk no_console_suspend mtdparts=omap2-nand.0:512k(x-loader),1664k(u-boot),384k(u-boot-env),5m(kernel),20m(ramdisk),-(fs) root=/dev/ram rw ramdisk_size=128000bootm 0x81000000 0x82000000## Booting kernel from Legacy Image at 81000000 ...Image Name: Linux-3.0.0-BSP-dm37x-2.4-2Image Type: ARM Linux Kernel Image (uncompressed)Data Size: 3976968 Bytes = 3.8 MiBLoad Address: 80008000Entry Point: 80008000Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 82000000 ...Image Name: uboot ext2 ramdisk rootfsImage Type: ARM Linux RAMDisk Image (gzip compressed)Data Size: 28842031 Bytes = 27.5 MiBLoad Address: 00000000Entry Point: 00000000Verifying Checksum ... OKLoading Kernel Image ... OK
OKStarting kernel ...
代码过程
连接脚本 arch/arm/cpu/armv7/u-boot.lds
再看arch/arm/cpu/armv7/start.S 最后调用 arch/arm/lib/board.c的board_init_f().
该函数中,首先调用arch/arm/lib/board.c: init_sequence序列初始化,初始化gpmc/arch_cpu/timer/clk/env/serial/bandrate/console/display/print/board_info/i2c/dram等
init_fnc_t *init_sequence[] = {
#if defined(CONFIG_ARCH_CPU_INIT)arch_cpu_init, /* basic arch cpu dependent setup */
#endif
#if defined(CONFIG_BOARD_EARLY_INIT_F)board_early_init_f,
#endiftimer_init, /* initialize timer */
#ifdef CONFIG_FSL_ESDHCget_clocks,
#endifenv_init, /* initialize environment */init_baudrate, /* initialze baudrate settings */serial_init, /* serial communications setup */console_init_f, /* stage 1 init of console */display_banner, /* say that we are here */
#if defined(CONFIG_DISPLAY_CPUINFO)print_cpuinfo, /* display cpu info (and speed) */
#endif
#if defined(CONFIG_DISPLAY_BOARDINFO)checkboard, /* display board info */
#endif
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)init_func_i2c,
#endifdram_init, /* configure available RAM banks */NULL,
};
然后保存ram_size 到gd,初始化gb->fb_base 等gb信息
最后调用relocate_code----》start.S里实现
为什么要relocate_code?
1.由x-loade可知,其将uboot前的部分代码(比如16k)拷贝到内部RAM的基地址,然后直接跳转到这个地址执行,但是一般的,uboot总是大于16K的,也就是说内部RAM不能完整执行uboot,需要把剩下的uboot搬移到外部RAM的高端地址执行。kernel是在DDR低地址执行的,为避免kernel与uboot地址重叠,需要把uboot搬移到DDR的高端地址执行。
2.某些uboot是从Nor等启动的,需要拷贝到DDR中才能完整执行。
参考[uboot] uboot relocation介绍_Andy_0755的博客-CSDN博客
uboot 跳转入ram执行代码分析(重映射分析)-erlei_2013-ChinaUnix博客
start.S中relocate_code段的如下代码,实现uboot的重定位,跳转到RAM中继续执行uboot
jump_2_ram:
ldr r0, _board_init_r_ofs
adr r1, _start
add lr, r0, r1
add lr, lr, r9
/* setup parameters for board_init_r */
mov r0, r5 /* gd_t */
mov r1, r6 /* dest_addr */
/* jump to it ... */
mov pc, lr
_start表示uboot.bin的绝对开始地址,_board_init_r_ofs是uboot.bin编译过程中生成的全部符号表board_init_r的地址,由此可以得出board_init_r与——start的偏移地址。
R9存储拷贝uboot到RAM中的地址,在根据函数的偏移地址,可以得出board_init_r函数在RAM中的地址,直接跳转到这个地址,即直接执行了board_init_r()函数。
该函数在arch/arm/lib/board.c中,
该函数继续初始化一些总线与外设,然后进入main_loop() ; 这里面执行bootm启动命令,从Nand等加载uImage执行内核启动。
DM3730 uboot 分析相关推荐
- u-boot分析之编译体验(零)
目录 u-boot分析之编译体验 1. 嵌入式系统与pc系统的启动对比概述 2.如何应用补丁文件生成uboot.bin文件,步骤: 3. uboot里要实现的功能 3.1 uboot最终目的是启动内核 ...
- u-boot分析(四)---设置异常向量表|设置SVC模式
u-boot分析(四) 通过前三篇的分析,我们对u-boot已经有了整体的认识和掌握,但是我们仍然对于其部分硬件是如何初始化的不太清楚,所以接下来几篇博文我将会对我们在http://www.cnblo ...
- u-boot分析(八)----串口初始化
u-boot分析(八) 上篇博文我们按照210的启动流程,分析到了内存初始化,今天我们继续按照u-boot的启动流程对串口的初始化进行分析. 今天我们会用到的文档: 1. 2440芯片手 ...
- U-BOOT分析(二)之顶层Makefile文件(1)
U-BOOT分析(二)之顶层Makefile文件(1) U-BOOT版本 u-boot版本: u-boot-2021.01.tar.bz2 Makefile && make简介 ...
- U-Boot移植教程之一:U-Boot分析与启动过程
内容来自 韦东山<嵌入式Linux应用开发完全手册> 一.Bootloader的引出 当系统上电时,并不是直接进入Linux系统的,而是需要先执行一段程序来把单片机的硬件外围初始化好,比如 ...
- u-boot分析之两阶段代码分析(三)
目录 u-boot(三)启动文件 1,概述 2,uboot第一阶段代码分析: 汇编 2,uboot第二阶段代码分析 C:_start_armboot C:main_loop u-boot(三)启动文件 ...
- u-boot分析之命令实现(四)
目录 u-boot(四)命令实现 分析run_command 小结 自定义一个命令 代码 makefile u-boot(四)命令实现 命令是如何实现的? 输入命令 执行函数,根据命令去寻找函数 所以 ...
- u-boot分析之内核启动(五)
目录 u-boot(五)内核启动 概述 分区空间 内核文件格式 内核复制跳转 内核启动 机器ID 启动参数 (起始tag)setup_start_tag 内存设置 根文件系统,启动程序,串口设备 (结 ...
- u-boot分析之makefile分析(二)
目录 u-boot(二)makefile 引入 目录结构(1.1.6) 配置文件 目标 配置具体的单板 编译阶段 过程 链接入口 配置链接地址 附录 附录A:mkconfig解析 附录B 链接脚本 u ...
最新文章
- Lua保留指定小数位数
- Debian和CentOS主流系统按包含文件名称搜索软件包
- git 挽救忘记提交到哪个分支的代码
- 看完这篇文章,跟面试官扯皮就没问题了
- 常见的一些功能测试用例
- 7-zip来解压大于4G以上打包文件
- Quartz+log4net实现控制台程序定时运行,并且记录日志
- 绑定图片路径处理img 或asp:image
- Html5 h5页面输入框失去焦点页面底部白板问题
- Python监控屏幕并截图保存
- Mysql三种备份,mysqdump,xtrabackup工具,基于lvm-snapshot快照备份等。
- 安装VMware时,出现 安装程序无法继续 Microsoft Runtime DLL 安装程序未能完成安装 您无权输入许可证密钥,请使用系统管理员账户重试 VMware15.5.x 安装问题处理
- Android Studio 下载ndk
- 打印日历Java代码实现
- linux怎么取消光盘,怎样取消ubuntu官方光盘
- 渗透之——触发Easy File Sharing Web Server 7.2 HEAD缓冲区溢出的Python脚本
- 生命,因追逐梦想而精彩
- Dunnett-t 检验~新复极差法检验
- Intellij IDEA代码后缀补全
- element Carousel 走马灯 一次轮播3张图片(整理)