AM335x启动流程(BootRom-MLO-Uboot)超详细源码分析

AM335x启动流程(BootRom-MLO-Uboot)超详细源码分析写的⾮常好,收藏学习
参考⽂件:
1,AM335x ARM Cortex-A8 Microprocessors (MPUs) Technical Reference Manual.pdf;
2,am3359.pdf;
1,am335x的cpu上电后,会跳到哪个地址去执⾏?
答:
芯⽚到uboot启动流程 :ROM → MLO(SPL)→ uboot.img
AM335x 中bootloader被分成了 3 个部分:
小哥小第⼀级 bootloader:引导加载程序,板⼦上电后会⾃动执⾏这些代码,如选择哪种⽅式启动(NAND,SDcard,UART。。。),然后跳转转到第⼆级 bootloader。这些代码应该是存放在 176KB 的 ROM 中。
第⼆级 bootloader:MLO(SPL),⽤以硬件初始化:关闭看门狗,关闭中断,设置 CPU 时钟频率、速度等操作。然后会跳转到第三级bootloader。MLO⽂件应该会被映射到 64 KB的 Internal SRAM 中。
第三级 bootloader:uboot.img,C代码的⼊⼝。
其中第⼀级 bootloader 是板⼦固化的,第⼆级和第三级是通过编译 uboot 所得的。
哈尔滨体育学院学报2,第⼆级 bootloader:MLO(SPL)做了哪些事情?MLO(SPL)内存分布如下:
SPL内存重映射:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36< PATH : /arch/arm/cpu/armv7/omap-common/u-boot-spl.lds > MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
LENGTH = CONFIG_SPL_MAX_SIZE }
MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \        LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
.text      :
{
__start = .;
arch/arm/cpu/armv7/start.o    (.text)
*(.text*)
} >.sram
. = ALIGN(4);
.rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
. = ALIGN(4);
里斯本战略
.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
. = ALIGN(4);
__image_copy_end = .;
_end = .;
.bss :
{
. = ALIGN(4);
__bss_start = .;
*(.bss*)
. = ALIGN(4);
__bss_end__ = .;
} >.sdram
}
1 2 3<PATH : /include/configs/am335x_evm.h>
#define CONFIG_SPL_TEXT_BASE        0x402F0400 #define CONFIG_SPL_MAX_SIZE    (46 * 1024)
4 5 6 7#define CONFIG_SPL_STACK        LOW_LEVEL_SRAM_STACK
#define CONFIG_SPL_BSS_START_ADDR  0x80000000
范世康
#define CONFIG_SPL_BSS_MAX_SIZE    0x80000    /* 512 KB */ <span ><strong></strong> </span>
@1@ 保存启动参数 bl    save_boot_params
1 2 3 4 5 6 7<PATH : /arch/arm/cpu/armv7/start.S> /*
* the actual reset code
*/
reset:
bl  save_boot_params
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24<PATH : /arch/arm/cpu/armv7/omap-common/lowlevel_init.S> .global save_boot_params
save_boot_params:
/*
* See if the rom code passed pointer is valid:
* It is not valid if it is not in non-secure SRAM
* This may happen if you are booting with the help of
* debugger
*/
ldr    r2, =NON_SECURE_SRAM_START
cmp r2, r0
bgt 1f
ldr r2, =NON_SECURE_SRAM_END
cmp r2, r0
blt 1f
/*
* store the boot params passed from rom code or saved
* and passed by SPL
*/
cmp r0, #0
beq 1f
ldr r1, =boot_params
str r0, [r1]
1 2 3 4 5 6 7 8/*《PATH: /arch/arm/include/asm/arch-ti81xx/omap.h》
* Non-secure SRAM Addresses
* Non-secure RAM starts at 0x40300000 for GP devices. But we keep SRAM_BASE  * at 0x40304000(EMU base) so that our code works for both EMU and GP
*/
#define NON_SECURE_SRAM_START  0x40304000
#define NON_SECURE_SRAM_END 0x4030E000
#define LOW_LEVEL_SRAM_STACK    0x4030B7FC
问题:这些参数是保存在哪⾥的?⼤概有哪些参数?
答:
萧伯纳
这些参数保存的内存地址为 64 KB 的 OCM RAM 中:
注:Dowloaded Image 区域:是⽤来保存 MLO(SPL) ⽂件的,其最⼤可达到 109 KB
学习网

本文发布于:2024-09-25 14:36:16,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/445719.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:参数   关闭   保存   代码   应该   启动   内存
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议