当前位置:网站首页>Start of u-boot_ Armboot analysis (II)
Start of u-boot_ Armboot analysis (II)
2022-06-12 23:45:00 【Cheap sword】
- This article mainly analyzes
init_sequenceInitialization function in
board_init
int board_init(void)
{
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_DRIVER_SMC911X
smc9115_pre_init();
#endif
#ifdef CONFIG_DRIVER_DM9000
dm9000_pre_init();
#endif
gd->bd->bi_arch_number = MACH_TYPE;
gd->bd->bi_boot_params = (PHYS_SDRAM_1+0x100);
return 0;
}
- It only defines
CONFIG_DRIVER_DM9000, Therefore, the main work focuses on dm9000 On the network card device dm9000_pre_initThe function is mainly for the network card GPIO And port configurationgd->bd->bi_arch_numberMachine code , Is the unique identifier for configuring the development board . The main function of machine code is to uboot and Linux Comparison and adaptation between kernels .uboot This machine code will be passed to the kernel as part of the parameter when the kernel is started , Only when they are the same can they be started normallygd->bd->bi_boot_paramsExpress uboot to Linux The memory address of the parameter passed during kernel startup , The address defined here is0x30000100
interrupt_init
int interrupt_init(void)
{
S5PC11X_TIMERS *const timers = S5PC11X_GetBase_TIMERS();
/* use PWM Timer 4 because it has no output */
/* prescaler for Timer 4 is 16 */
timers->TCFG0 = 0x0f00;
if (timer_load_val == 0) {
/* * for 10 ms clock period @ PCLK with 4 bit divider = 1/2 * (default) and prescaler = 16. Should be 10390 * @33.25MHz and @ 66 MHz */
timer_load_val = get_PCLK() / (16 * 100);
}
/* load value for 10 ms timeout */
lastdec = timers->TCNTB4 = timer_load_val;
/* auto load, manual update of Timer 4 */
timers->TCON = (timers->TCON & ~0x00700000) | TCON_4_AUTO | TCON_4_UPDATE;
/* auto load, start Timer 4 */
timers->TCON = (timers->TCON & ~0x00700000) | TCON_4_AUTO | COUNT_4_ON;
timestamp = 0;
return (0);
}
- Function to initialize timer
env_init
- Initialize environment variables
- This function can be found in many places , Respectively in
env_xxx.cIn file . Checked , This development board uses env_init Function inenv_movi.cin - This function is only for the in memory env Initialization and determination are made (
gd->env_valid), Currently, there is no environment variable from SD Card to DDR Repositioning in , Therefore, the current environment variable cannot be used - start_armboot Function is executing
env_relocateAfter that, the environment variables are changed from SD In the card DDR Repositioning in . Only when environment variables are needed after relocation can you start from DDR To get in , Before relocation, you can only use environment variables from SD Read from the card
init_baudrate
static int init_baudrate (void)
{
char tmp[64]; /* long enough for environment variables */
int i = getenv_r ("baudrate", tmp, sizeof (tmp));
gd->bd->bi_baudrate = gd->baudrate = (i > 0)
? (int) simple_strtoul (tmp, NULL, 10)
: CONFIG_BAUDRATE;
return (0);
}
- This function sets the baud rate of the serial port
- First, get the... In the environment variable
baudratevalue , If it works , Then use this value as an environment variable to record ingd->bd->bi_baudrateandgd->baudratein , Otherwise useCONFIG_BAUDRATEDefined value
console_init_f
- Perform the first stage initialization of the console
- Just right
gd->have_consoleThe assignment is 1
dram_init
int dram_init(void)
{
DECLARE_GLOBAL_DATA_PTR;
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
#if defined(PHYS_SDRAM_2)
gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
#endif
#if defined(PHYS_SDRAM_3)
gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE;
#endif
return 0;
}
- Yes DDR Initialize the software
- Tell the software DDR Starting address and length of
display_dram_config
- Print ram Configuration information
- stay uboot Using the command line of
bdinfoYou can print it out gd->bd All hardware related global variable values recorded in , You can get DDR Configuration information
边栏推荐
- 36 krypton's debut | "osogena" won nearly ten million angel rounds of financing. The original DLR scientists of German Aerospace Research and development system modeling and simulation CAE software PA
- It is meaningful to define genus, and D can use it to explain semantics
- 利率降低导致债券价格上涨
- SAP 业务技术平台(BTP) 上的 Business Rules Service 使用介绍
- CST learning: four element array design of circular patch antenna (II) array formation and combination results
- Preparing for the Blue Bridge Cup Day11__ Basic operation of serial port communication
- QT actual combat case (38) -- using qpprocess class to realize the function of starting process
- Actual combat | UI automation test framework design and pageobject transformation
- Talent Weekly - 5
- Basic operations of dict and set
猜你喜欢

CV—BaseLine总结(从AlexNet到SENet的发展历程)

Leetcode 2164. Sort odd and even subscripts separately (yes, once)

2202 resume making

MySQL row to column, column to row, multiple columns to one row, one row to multiple columns

2022 questions d'examen pour le personnel de gestion de la sécurité de l'unit é de gestion des produits chimiques dangereux et examen de simulation en ligne

Talent Weekly - 5

Develop a web office suite from scratch (5): mouse hover over text

2022年电工(初级)操作证考试题库及在线模拟考试

妙才周刊 - 5

Alien Skin Exposure X7调色滤镜插件,RAW后期处理工具
随机推荐
[kubernetes guide ⑤] label quick start
Initial experience of Huawei cloud Conference [Huawei cloud to jianzhiyuan]
cookie
How to use Huawei cloud disaster tolerance solution to replace disaster recovery all-in-one machine
OSM地图本地发布-如何生成各省市矢量地图
Redis realizes SMS verification code login
So, what is the difference between e.target and e.currenttarget?
利率降低导致债券价格上涨
How to publish OSM maps locally and customize the mapping
2022年R2移动式压力容器充装考试题及在线模拟考试
leaflet如何加载10万条数据
Actual combat | inductance element positioning -- detailed explanation of Halcon and opencv implementation (with source code)
leaflet中如何优雅的解决百度、高德地图的偏移问题
scala中的隐式转换和隐式参数讲解与实践
[leetcode] understanding and usage of map[key]+
Redis实现短信验证码登录
M_8:设计消息队列存储消息数据的 MySQL 表格
Detr (detection with transformers) learning notes
Mgr and greatsql resource summary
Enterprise wechat H5_ Authentication, H5 application web page authorization login to obtain identity