当前位置:网站首页>Uboot migration
Uboot migration
2022-07-03 22:00:00 【kayshi2018】
1 Information
Download all versions :https://ftp.denx.de/pub/u-boot/
edition :u-boot-2014.01
2 U-boot effect
- Set the system clock , Turn off interrupt , Set up svc32 Pattern , Initialize hardware
- Code redefinition (uboot Oneself )
- Configure parameters for the kernel
- Redefine the kernel code
- Do kernel startup
3 Uboot The specific structure of
1: Analysis home directory makefile perhaps Compile directly to see the effect
Compile link process :
- To configure - Use the public version of the default similar board configuration make smdk2410_config
- compile sudo make
stay uboot Next make A link file will be generated u-boot.lds
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text : // The following shows that the code segment is start.o
{
*(.__image_copy_start)
arch/arm/cpu/arm920t/start.o (.text*)
*(.text*)
}
. = ALIGN(4);
.rodata : {
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
. = ALIGN(4);
.data : {
*(.data*)
}
. = ALIGN(4);
. = .;
. = ALIGN(4);
.u_boot_list : {
KEEP(*(SORT(.u_boot_list*)));
}
. = ALIGN(4);
.image_copy_end :
{
*(.__image_copy_end)
}
.rel_dyn_start :
{
*(.__rel_dyn_start)
}
.rel.dyn : {
*(.rel*)
}
.rel_dyn_end :
{
*(.__rel_dyn_end)
}
_end = .;
. = ALIGN(4096);
.mmutable : {
*(.mmutable)
}
.bss_start __rel_dyn_start (OVERLAY) : {
KEEP(*(.__bss_start));
__bss_base = .;
}
.bss __bss_base (OVERLAY) : {
*(.bss*)
. = ALIGN(4);
__bss_limit = .;
}
.bss_end __bss_limit (OVERLAY) : {
KEEP(*(.__bss_end));
}
.dynsym _end : {
*(.dynsym) }
.dynbss : {
*(.dynbss) }
.dynstr : {
*(.dynstr*) }
.dynamic : {
*(.dynamic*) }
.plt : {
*(.plt*) }
.interp : {
*(.interp*) }
.gnu : {
*(.gnu*) }
.ARM.exidx : {
*(.ARM.exidx*) }
.gnu.linkonce.armexidx : {
*(.gnu.linkonce.armexidx.*) }
}
From the above we can get ,uboot The file placed in the starting position of the code segment is start.S,0 The address is stored start_code
The boot process start_code -> Configure the door dog , interrupt , The clock -> Get into mian function
#include <asm-offsets.h>
#include <common.h>
#include <config.h>
/* ************************************************************************* * * Jump vector table as in table 3.1 in [1] * ************************************************************************* */
.globl _start
_start: b start_code // The first startup code
ldr pc, _undefined_instruction
ldr pc, _software_interrupt
ldr pc, _prefetch_abort
ldr pc, _data_abort
ldr pc, _not_used
ldr pc, _irq
ldr pc, _fiq
_undefined_instruction: .word undefined_instruction
_software_interrupt: .word software_interrupt
_prefetch_abort: .word prefetch_abort
_data_abort: .word data_abort
_not_used: .word not_used
_irq: .word irq
_fiq: .word fiq
.balignl 16,0xdeadbeef
...
...
/* * the actual start code */
start_code
/* * set the cpu to SVC32 mode */
mrs r0, cpsr
bic r0, r0, #0x1f
orr r0, r0, #0xd3
msr cpsr, r0
#if defined(CONFIG_AT91RM9200DK) || defined(CONFIG_AT91RM9200EK)
/* * relocate exception table */
ldr r0, =_start
ldr r1, =0x0
mov r2, #16
copyex:
subs r2, r2, #1
ldr r3, [r0], #4
str r3, [r1], #4
bne copyex
#endif
#ifdef CONFIG_S3C24X0
/* turn off the watchdog */
# if defined(CONFIG_S3C2400)
# define pWTCON 0x15300000
# define INTMSK 0x14400008 /* Interrupt-Controller base addresses */
# define CLKDIVN 0x14800014 /* clock divisor register */
#else
# define pWTCON 0x53000000
# define INTMSK 0x4A000008 /* Interrupt-Controller base addresses */
# define INTSUBMSK 0x4A00001C
# define CLKDIVN 0x4C000014 /* clock divisor register */
# endif
ldr r0, =pWTCON
mov r1, #0x0
str r1, [r0]
/* * mask all IRQs by setting all bits in the INTMR - default */
mov r1, #0xffffffff
ldr r0, =INTMSK
str r1, [r0]
# if defined(CONFIG_S3C2410)
ldr r1, =0x3ff
ldr r0, =INTSUBMSK
str r1, [r0]
# endif
/* FCLK:HCLK:PCLK = 1:2:4 */
/* default FCLK is 120 MHz ! */
ldr r0, =CLKDIVN
mov r1, #3
str r1, [r0]
#endif /* CONFIG_S3C24X0 */
/* * we do sys-critical inits only at reboot, * not when booting from ram! */
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
bl cpu_init_crit
#endif
bl _main
/*------------------------------------------------------------------------------*/
4 Conduct Uboot Transplantation and mode of
边栏推荐
- Global and Chinese market of wall mounted kiosks 2022-2028: Research Report on technology, participants, trends, market size and share
- gslb(global server load balance)技术的一点理解
- Global and Chinese market of recycled yarn 2022-2028: Research Report on technology, participants, trends, market size and share
- Nacos common configuration
- Exclusive interview with the person in charge of openkruise: to what extent has cloud native application automation developed now?
- Yiwen teaches you how to choose your own NFT trading market
- The 14th five year plan and investment feasibility study report of China's industry university research cooperation Ⓧ 2022 ~ 2028
- Monkey/ auto traverse test, integrate screen recording requirements
- Blue Bridge Cup Guoxin Changtian MCU -- program download (III)
- What if the Flink SQL client exits and the table is emptied?
猜你喜欢

2022 electrician (elementary) examination questions and electrician (elementary) registration examination
![[secretly kill little partner pytorch20 days] - [day3] - [example of text data modeling process]](/img/55/309c9d52e503405b289bcfc4912be9.jpg)
[secretly kill little partner pytorch20 days] - [day3] - [example of text data modeling process]

Blue Bridge Cup Guoxin Changtian single chip microcomputer -- software environment (II)

Yyds dry inventory hcie security Day12: concept of supplementary package filtering and security policy

Exclusive interview with the person in charge of openkruise: to what extent has cloud native application automation developed now?

What should the future of the Internet be like when Silicon Valley employees flee the big factory and rush to Web3| Footprint Analytics

Notes on MySQL related knowledge points (startup, index)

TiDB 之 TiCDC6.0 初体验

Covariance

Blue Bridge Cup Guoxin Changtian single chip microcomputer -- led lamp module (V)
随机推荐
Supply and demand situation and market scale calculation report of China's portable energy storage power PES industry Ⓛ 2022 ~ 2028
Dynamic research and future planning analysis report of China's urban water supply industry Ⓝ 2022 ~ 2028
MySQL - index
Global and Chinese market of telematics boxes 2022-2028: Research Report on technology, participants, trends, market size and share
Compréhension de la technologie gslb (Global Server load balance)
国泰君安证券开户是安全可靠的么?怎么开国泰君安证券账户
[dynamic planning] counting garlic customers: the log of garlic King (the longest increasing public subsequence)
Electronic tube: Literature Research on basic characteristics of 6j1
flink sql-client 退出,表就会被清空怎么办?
Notes on MySQL related knowledge points (startup, index)
Is it safe and reliable to open an account and register for stock speculation? Is there any risk?
请教大家一个问题,用人用过flink sql的异步io关联MySQL中的维表吗?我按照官网设置了各种
The White House held an open source security summit, attended by many technology giants
十大券商开户注册安全靠谱吗?有没有风险的?
鹏城杯 WEB_WP
Idea shortcut word operation
常用sql集合
Blue Bridge Cup Guoxin Changtian single chip microcomputer -- led lamp module (V)
The 14th five year plan for the construction of Chinese Enterprise Universities and the feasibility study report on investment Ⓓ 2022 ~ 2028
Preliminary analysis of smart microwave radar module