一、init_sequence内容

init_fnc_t *init_sequence[] = {
cpu_init, /* basic cpu dependent setup */
board_init, /* basic board dependent setup */
interrupt_init, /* set up exceptions */
env_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
dram_init, /* configure available RAM banks */
display_dram_config,
NULL,
};

二、cpu_init(cpu/arm920t/cpu.c)

int cpu_init (void)
{
/*
* setup up stacks if necessary
*/
#ifdef CONFIG_USE_IRQ
IRQ_STACK_START = _armboot_start - CFG_MALLOC_LEN - CFG_GBL_DATA_SIZE - ;
FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
#endif
return ;
}

三、board_init(board/smdk2410/smdk2410.c)

int board_init (void)
{
S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();
S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); /* to reduce PLL lock time, adjust the LOCKTIME register */
clk_power->LOCKTIME = 0xFFFFFF; /* configure MPLL */
clk_power->MPLLCON = ((M_MDIV << ) + (M_PDIV << ) + M_SDIV); /* some delay between MPLL and UPLL */
delay (); /* configure UPLL */
clk_power->UPLLCON = ((U_M_MDIV << ) + (U_M_PDIV << ) + U_M_SDIV); /* some delay between MPLL and UPLL */
delay (); /* set up the I/O ports */
gpio->GPACON = 0x007FFFFF;
gpio->GPBCON = 0x00044555;
gpio->GPBUP = 0x000007FF;
gpio->GPCCON = 0xAAAAAAAA;
gpio->GPCUP = 0x0000FFFF;
gpio->GPDCON = 0xAAAAAAAA;
gpio->GPDUP = 0x0000FFFF;
gpio->GPECON = 0xAAAAAAAA;
gpio->GPEUP = 0x0000FFFF;
gpio->GPFCON = 0x000055AA;
gpio->GPFUP = 0x000000FF;
gpio->GPGCON = 0xFF95FFBA;
gpio->GPGUP = 0x0000FFFF;
gpio->GPHCON = 0x002AFAAA;
gpio->GPHUP = 0x000007FF; /* arch number of SMDK2410-Board */
gd->bd->bi_arch_number = MACH_TYPE_SMDK2410; /* adress of boot parameters */
gd->bd->bi_boot_params = 0x30000100; icache_enable();
dcache_enable(); return ;
}

四、interrupt_init(cpu/arm920t/s3c24x0.c)

int interrupt_init (void)
{
S3C24X0_TIMERS * const timers = S3C24X0_GetBase_TIMERS(); /* use PWM Timer 4 because it has no output */
/* prescaler for Timer 4 is 16 */
timers->TCFG0 = 0x0f00;
if (timer_load_val == )
{
/*
* for 10 ms clock period @ PCLK with 4 bit divider = 1/2
* (default) and prescaler = 16. Should be 10390
* @33.25MHz and 15625 @ 50 MHz
*/
timer_load_val = get_PCLK()/( * * );
}
/* load value for 10 ms timeout */
lastdec = timers->TCNTB4 = timer_load_val;
/* auto load, manual update of Timer 4 */
timers->TCON = (timers->TCON & ~0x0700000) | 0x600000;
/* auto load, start Timer 4 */
timers->TCON = (timers->TCON & ~0x0700000) | 0x500000;
timestamp = ; return ();
}

五、env_init

uboot支持把环境变量放在很多存储器上,例如norflash、nandflash、eeprom等等,不同的方式env_init函数的实现也是不同的,但是env_init函数最终会被start_amboot调用,屏蔽了这些差异。

smdk2410.h中默认选择的是norflash:
include/configs/smdk2410.h
#define CFG_ENV_IS_IN_FLASH 1

(common/Env_flash.c)

#ifdef CFG_ENV_ADDR_REDUND //未被定义

int  env_init(void)
{
#ifdef CONFIG_OMAP2420H4
int flash_probe(void); if(flash_probe() == )
goto bad_flash;
#endif
if (crc32(, env_ptr->data, ENV_SIZE) == env_ptr->crc) {
gd->env_addr = (ulong)&(env_ptr->data);
gd->env_valid = ;
return();
}
#ifdef CONFIG_OMAP2420H4
bad_flash:
#endif
gd->env_addr = (ulong)&default_environment[];
gd->env_valid = ;
return ();
}

六、init_baudrate(lib_arm/board.c)

static int init_baudrate (void)
{
char tmp[]; /* long enough for environment variables */
int i = getenv_r ("baudrate", tmp, sizeof (tmp));
gd->bd->bi_baudrate = gd->baudrate = (i > )
? (int) simple_strtoul (tmp, NULL, )
: CONFIG_BAUDRATE; return ();
}

七、serial_init(cpu/arm920t/s3c24x0/serial.c)

int serial_init (void)
{
serial_setbrg (); return ();
}
void serial_setbrg (void)
{
S3C24X0_UART * const uart = S3C24X0_GetBase_UART(UART_NR);
int i;
unsigned int reg = ; /* value is calculated so : (int)(PCLK/16./baudrate) -1 */
reg = get_PCLK() / ( * gd->baudrate) - ; /* FIFO enable, Tx/Rx FIFO clear */
uart->UFCON = 0x07;
uart->UMCON = 0x0;
/* Normal,No parity,1 stop,8 bit */
uart->ULCON = 0x3;
/*
* tx=level,rx=edge,disable timeout int.,enable rx error int.,
* normal,interrupt or polling
*/
uart->UCON = 0x245;
uart->UBRDIV = reg; #ifdef CONFIG_HWFLOW
uart->UMCON = 0x1; /* RTS up */
#endif
for (i = ; i < ; i++);
}

八、console_init_f(common/console.c)

/* Called before relocation - use serial functions */
int console_init_f (void)
{
gd->have_console = ; #ifdef CONFIG_SILENT_CONSOLE
if (getenv("silent") != NULL)
gd->flags |= GD_FLG_SILENT;
#endif return ();
}

九、display_banner(lib_arm/board.c)

static int display_banner (void)
{
printf ("\n\n%s\n\n", version_string);
debug ("U-Boot code: %08lX -> %08lX BSS: -> %08lX\n",
_armboot_start, _bss_start, _bss_end);
#ifdef CONFIG_MODEM_SUPPORT
debug ("Modem Support enabled\n");
#endif
#ifdef CONFIG_USE_IRQ
debug ("IRQ Stack: %08lx\n", IRQ_STACK_START);
debug ("FIQ Stack: %08lx\n", FIQ_STACK_START);
#endif return ();
}

十、dram_init(board/smdk2410.c)

int dram_init (void)
{
gd->bd->bi_dram[].start = PHYS_SDRAM_1;
gd->bd->bi_dram[].size = PHYS_SDRAM_1_SIZE; return ;
}

十、display_dram_config (lib_arm/board.c)

static int display_dram_config (void)
{
int i; #ifdef DEBUG
puts ("RAM Configuration:\n"); for(i=; i<CONFIG_NR_DRAM_BANKS; i++) {
printf ("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start);
print_size (gd->bd->bi_dram[i].size, "\n");
}
#else
ulong size = ; for (i=; i<CONFIG_NR_DRAM_BANKS; i++) {
size += gd->bd->bi_dram[i].size;
}
puts("DRAM: ");
print_size(size, "\n");
#endif return ();
}

init_sequence所对应的函数的更多相关文章

  1. start_amboot()函数分析

    一.整体流程 start_amboot()函数是执行完start.S汇编文件后第一个C语言函数,完成的功能自然还是初始化的工作 . 1.全局变量指针r8设定,以及全局变量区清零 2.执行一些类初始化函 ...

  2. u-boot-1.1.6第2阶段入口函数start_armboot分析

    学习目标: 1.分析u-boot-1.1.6第2阶段入口函数void start_armboot (void),熟悉该函数所实现的功能 2.为后面能够掌握u-boot-1.1.6如何启动内核过程打下基 ...

  3. Linux学习 :移植U-boot_2016.09到JZ2440开发板

    一.下载源码:ftp://ftp.denx.de/pub/u-boot/ 二.初始化编译: ①新建一个单板: cd board/samsung/ cp smdk2410 smdk2440 -rf   ...

  4. Linux之uboot分析与移植20160601

    说一下uboot分析与移植: 1.下载.建立source insight工程.编译.烧写.如果无运行分析原因 tar xjf u-boot-2012.04.01.tar.bz2 cd u-boot-2 ...

  5. 移植最新u-boot(裁剪和修改默认参数)之韦东山笔记

    1.下载.建立source insight工程.编译.烧写.如果无运行分析原因 tar xjf u-boot-2012.04.01.tar.bz2 cd u-boot-2012.04.01 make ...

  6. uboot源码整体框架

    源码解压以后,我们可以看到以下的文件和文件夹:  cpu 与处理器相关的文件.每个子目录中都包括cpu.c和interrupt.c.start.S.u-boot.lds. cpu.c:初始化CPU.设 ...

  7. 移植u-boot-2012.04.01到JZ2440

    开发环境:Ubuntu 12.04 开发板:JZ2440  256M NandFlash  64M SDRAM 交叉编译器:arm-linux-gcc-4.3.2 u-boot:u-boot-2012 ...

  8. 18.17 U-Boot+内核移植

    18.17.1 移植U-Boot-2012.04.08 1.下载.建立source insight工程.编译.烧写.如果无运行分析原因. $ .tar.bz2 $ cd u-boot- $ make ...

  9. 4412 uboot启动分析

    感谢sea1105, https://blog.csdn.net/sea1105/article/details/52142772 在学习过程中,由于tiny4412资料太过于少,因此参考210的视屏 ...

随机推荐

  1. Plinq-Parallel.ForEach for 性能提升

    https://msdn.microsoft.com/zh-cn/library/dd460720.aspx 本示例显示如何使用 Parallel.ForEach 循环对任何 System.Colle ...

  2. myeclipse building workspace如何禁止及提高myeclipse速度

    大家一定对building workspace时那缓慢的速度给困扰到了吧~ 其实只要把project选项里的 building automatically前的勾去掉,就可以快很多了.. 另外大家一定对 ...

  3. Spring-接口调用

    在Spring框架下实现和调用接口时,不用再代码中创建接口对象.而是依赖容器注入接口的实现对象. 1.创建接口 package service; /** * Created by xumao on 2 ...

  4. 初识jQuery,八字真言“选择元素,对其操作”

    jQuery在我印象中,就是很多类似$(),然后昨天开始接触了,觉得很和谐,获取元素比JavaScript简单很多,有意思. 一.开始学习jQuery,下载jQuery库的文件 http://jque ...

  5. Excel中如何查找并列出所有链接(外部数据链接)?

    在 Excel 中,有时会需要创建外部链接来引用其他工作簿的单元格内容,但是如果想要找出所有链接并且还要将这些外部数据链接列在一个工作簿当中是有点难度的.下面我会介绍一些快捷方法,不仅能够快速帮你找出 ...

  6. Android APK反编译具体解释(附图)

    这段时间在学Android应用开发,在想既然是用Java开发的应该非常好反编译从而得到源码吧,google了一下,确实非常easy,下面是我的实践过程. 在此郑重声明,贴出来的目的不是为了去破解人家的 ...

  7. 服装销售系统数据库课程设计(MVC)

    <数据库课程设计> 名称:Jia服装销售网站 姓名:陈文哲 学号:…… 班级:11软件工程 指导老师:索剑 目录 目录 1 需求分析 3 一:销售部门机构情况 3 二:销售部门的业务活动情 ...

  8. 第一个Android项目——计算器

    第一个Android项目——计算器 效果 开始学Android一两个星期了,学习了一下基本的Activity.简单控件及几个简单布局,打算找个东西来练练手,于是就选择发计算器.关于计算器中用到的四则运 ...

  9. android83 Activity的生命周期,启动模式,返回时传递数据

    #Android四大组件 * Activity * BroadCastReceiver * Service * ContentProvider #Activity生命周期 * oncreate:Act ...

  10. keepalive support-----Programming applications

    TCP Keepalive HOWTO Prev   Next 4. Programming applications This section deals with programming code ...