AM335x uboot spl分析

本文深入分析了AM335x芯片从ROM到U-Boot SPL的启动流程,包括SPL的基本功能、初始化步骤以及代码分析,如UART、时钟锁定、SDRAM初始化等。通过对SPL的makefile、链接脚本和关键代码段的解读,揭示了SPL如何加载并传递控制权给U-Boot主程序。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

AM335x uboot spl分析

 

芯片到uboot启动流程

    ROM → SPL→ uboot.img

 

简介

    在335x 中ROM code是第一级的bootlader。mpu上电后将会自动执行这里的代码,完成部分初始化和引导第二级的bootlader,第二级的bootlader引导第三级bootader,在ti官方上对于第二级和第三级的bootlader由uboot提供。

 

SPL

    To unify all existing implementations for a secondary program loader (SPL) and to allow simply adding of new implementations this generic SPL framework has been created. With this framework almost all source files for a board can be reused. No code duplication or symlinking is necessary anymore.

    1> Basic ARM initialization

    2> UART console initialization

    3> Clocks and DPLL locking (minimal)

    4> SDRAM initialization

    5> Mux (minimal)

    6> BootDevice initialization(based on where we are booting from.MMC1/MMC2/Nand/Onenand)

    7> Bootloading real u-boot from the BootDevice and passing control to it.

     

uboot spl源代码分析

   

一、makefile分析

    打开spl文件夹只有一个makefile 可见spl都是复用uboot原先的代码。

    主要涉及的代码文件为u-boot-2011.09-psp04.06.00.03/arch/arm/cpu/armv7

                     u-boot-2011.09-psp04.06.00.03/arch/arm/lib

                     u-boot-2011.09-psp04.06.00.03/drivers

    LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-spl.lds

    这个为链接脚本

 

二、u-boot-spl.lds

 

Sram 0x402F0400

Sdram 0x80000000

 

.bss

.TEXT (arch/arm/cpu/armv7/start.o)

 

.rodata

 

.data

 

__start 为程序开始

__image_copy_end

_end

 

三、代码解析

    __start 为程序开始 (arch/arm/cpu/armv7/start.S)

    .globl _start  这是在定义

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值