• start

    arch/arm/cpu/armv7/start.S
36 .globl _start
37 _start: b reset 136 reset:
137 bl save_boot_params
138 /*
139 * set the cpu to SVC32 mode
140 */
141 mrs r0, cpsr
142 bic r0, r0, #0x1f
143 orr r0, r0, #0xd3
144 msr cpsr,r0 206 call_board_init_f:
207 ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
208 bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
209 ldr r0,=0x00000000
210 bl board_init_f // ----> 前置初始化 SPL 321 #ifndef CONFIG_SYS_ICACHE_OFF
322 mcr p15, 0, r0, c7, c5, 0 @ invalidate icache
323 mcr p15, 0, r0, c7, c10, 4 @ DSB
324 mcr p15, 0, r0, c7, c5, 4 @ ISB
325 #endif
326 ldr r0, _board_init_r_ofs
327 adr r1, _start
328 add lr, r0, r1
329 add lr, lr, r9
330 /* setup parameters for board_init_r */
331 mov r0, r5 /* gd_t */
332 mov r1, r6 /* dest_addr */
333 /* jump to it ... */
334 mov pc, lr
335
336 _board_init_r_ofs:
337 .word board_init_r - _start // 后置初始化, u-boot.img
  • board_init_f

    264 void board_init_f(ulong bootflag)
265 {
// ... ...
281 for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
282 if ((*init_fnc_ptr)() != 0) {
283 hang ();
284 }
285 }
// ... .. 235 init_fnc_t *init_sequence[] = {
236 #if defined(CONFIG_ARCH_CPU_INIT)
237 arch_cpu_init, /* basic arch cpu dependent setup */
238 #endif
239 #if defined(CONFIG_BOARD_EARLY_INIT_F)
240 board_early_init_f,
241 #endif
242 timer_init, /* initialize timer */
243 #ifdef CONFIG_FSL_ESDHC
244 get_clocks,
245 #endif
246 env_init, /* initialize environment */
247 init_baudrate, /* initialze baudrate settings */
248 serial_init, /* serial communications setup */
249 console_init_f, /* stage 1 init of console */
250 display_banner, /* say that we are here */
251 #if defined(CONFIG_DISPLAY_CPUINFO)
252 print_cpuinfo, /* display cpu info (and speed) */
253 #endif
254 #if defined(CONFIG_DISPLAY_BOARDINFO)
255 checkboard, /* display board info */
256 #endif
257 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
258 init_func_i2c,
259 #endif
260 dram_init, /* configure available RAM banks */
261 NULL,
262 }; // board/aplex/ecm_5410.c
98 int dram_init(void)
99 {
100 gd->ram_size = PHYS_DRAM_1_SIZE;
101
102 return 0;
103 }
  • board_init_r

    // arch/arm/lib/board.c
443 void board_init_r(gd_t *id, ulong dest_addr)
444 {
// ... ...
464 board_init(); /* Setup chipselects */ // i2c, pinmux gpmc init
// ... ...
523 #if defined(CONFIG_CMD_NAND)
524 puts("NAND : ");
525 nand_init(); /* go init the NAND */
526 #endif
// ... ... // drivers/mtd/nand/ti81xx_nand.c
864 int board_nand_init(struct nand_chip *nand)
865 {
867 cs = 0;
876 while (cs < GPMC_MAX_CS) {
877 /* Check if NAND type is set */
878 if ((readl(&gpmc_cfg->cs[cs].config1) & 0xC00) == 0x800) {
879 /* Found it!! */
880 #ifdef NAND_DEBUG
881 printf("Searching for NAND device @ GPMC CS:%1d\n", cs);
882 #endif
883 break;
884 }
885 cs++;
886 }
887 if (cs >= GPMC_MAX_CS) {
888 printf("NAND: Unable to find NAND settings in "
889 "GPMC Configuration - quitting\n");
890 return -ENODEV;
891 }
892
893 nand->IO_ADDR_R = (void __iomem *)&gpmc_cfg->cs[cs].nand_dat;
894 nand->IO_ADDR_W = (void __iomem *)&gpmc_cfg->cs[cs].nand_cmd;
895
896 nand->cmd_ctrl = ti81xx_nand_hwcontrol;
897 nand->options = NAND_NO_PADDING | NAND_CACHEPRG | NAND_NO_AUTOINCR;
898 /* If we are 16 bit dev, our gpmc config tells us that */
899 if ((readl(&gpmc_cfg->cs[cs].config1) & 0x3000) == 0x1000) {
900 nand->options |= NAND_BUSWIDTH_16;
901 }
902
903 nand->chip_delay = 100;
904
905 /* required in case of BCH */
906 elm_init();
907
908 /* BCH info that will be correct for SPL or overridden otherwise. */
909 nand->priv = &bch_priv;
910
911 #ifndef CONFIG_SPL_BUILD
912 /* For undocumented reasons we need to currently keep our environment
913 * in 1-bit ECC so we configure ourself thusly. */
914 nand_curr_device = 0;
915 ti81xx_nand_switch_ecc(NAND_ECC_HW, 0);
916 #else
917 /* The NAND chip present requires that we have written data in with
918 * at least 4-bit ECC so we configure outself for that in SPL.
919 */
920 nand->ecc.mode = NAND_ECC_HW_SYNDROME;
921 nand->ecc.layout = &hw_bch8_nand_oob;
922 nand->ecc.size = CONFIG_SYS_NAND_ECCSIZE;
923 nand->ecc.bytes = CONFIG_SYS_NAND_ECCBYTES;
924 nand->ecc.steps = CONFIG_SYS_NAND_ECCSTEPS;
925 nand->ecc.total = CONFIG_SYS_NAND_ECCTOTAL;
926 nand->ecc.hwctl = ti81xx_enable_ecc_bch;
927 nand->ecc.correct = ti81xx_correct_data_bch;
928 nand->ecc.calculate = ti81xx_calculate_ecc_bch;
929
930 if (nand->options & NAND_BUSWIDTH_16)
931 nand->read_buf = nand_read_buf16;
932 else
933 nand->read_buf = nand_read_buf;
934 nand->dev_ready = ti81xx_spl_dev_ready;
935
936 ti81xx_hwecc_init_bch(nand, NAND_ECC_READ);
937 #endif
938
939 return 0;
940 }

u-boot2011.09 启动流程记录的更多相关文章

  1. 记录Linux启动流程的工具bootchart

    /*********************************************************************  * Author  : Samson  * Date   ...

  2. 【转】linux-系统启动流程详解

    第二十章.启动流程.模块管理与 Loader 最近升级日期:2009/09/14 1. Linux 的启动流程分析 1.1 启动流程一览 1.2 BIOS, boot loader 与 kernel ...

  3. linux启动流程梳理【转】

    接触linux系统运维已经好几年了,常常被问到linux系统启动流程问题,刚好今天有空来梳理下这个过程:一般来说,所有的操作系统的启动流程基本就是: 总的来说,linux系统启动流程可以简单总结为以下 ...

  4. 番外:你真的了解 Oracle 的启动流程吗?

    番外系列说明:该系列所有文章都将作为独立篇章进行知识点讲解,是对其他系列博文进行的补充说明,来自于博客园AskScuti. 主题:关于数据库启动流程的三个阶段 内容预览:本篇涉及数据库启动的三个阶段分 ...

  5. Spring Boot启动流程详解(一)

    环境 本文基于Spring Boot版本1.3.3, 使用了spring-boot-starter-web. 配置完成后,编写了代码如下: @SpringBootApplication public ...

  6. 嵌入式Linux驱动学习之路(五)u-boot启动流程分析

    这里说的u-boot启动流程,值得是从上电开机执行u-boot,到u-boot,到u-boot加载操作系统的过程.这一过程可以分为两个过程,各个阶段的功能如下. 第一阶段的功能: 硬件设备初始化. 加 ...

  7. CentOS6 启动流程图文解剖

    我们在使用Linux操作系统的时候,我们只需按下电源键,等待,然后输入账户和密码就可以使用Linux操作系统了.那么在按下电源到输入账号和密码之前,操作系统都做了些什么?下面就来讲述在这段时间发生的动 ...

  8. centos启动流程[转]

    启动流程概览 在硬件驱动成功后,Kernel 会主动呼叫 init 程序,而 init 会取得 run-level 资讯: init 运行 /etc/rc.d/rc.sysinit 文件来准备软件运行 ...

  9. linux内核启动流程[转]

    启动流程一览 既然启动是很严肃的一件事,那我们就来了解一下整个启动的过程吧! 好让大家比较容易发现启动过程里面可能会发生问题的地方,以及出现问题后的解决之道! 不过,由於启动的过程中,那个启动管理程序 ...

随机推荐

  1. JQuery九大选择器

    九大选择器都是用来查找元素节点的.JQuery给我提供了九中类型的选择器. 1. 基本选择器  基本选择器是JQuery最常用的选择器,也是最简单的选择器,它通过元素id.class和标签名来查找DO ...

  2. 用SQL语句将远程SQL Server数据库中表数据导入到本地数据库相应的表中

    一.方法一 访问不同电脑上的数据库(远程访问,只好联好网就一样),如果经常访问或数据量较大,建议用链接服务器方法. 1.创建链接服务器 exec sp_addlinkedserver ‘srv_lnk ...

  3. 神经网络写诗(charRNN)

    https://github.com/chenyuntc/pytorch-book 基于pytorch ,许多有趣的小应用.感谢作者! 作者的代码写得非常清晰,配置方法也很明确,只需要按照提示,安装依 ...

  4. centos 安装pecl

    一.更新yum源,安装php7 CentOS/RHEL 7.x: 1 rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-lates ...

  5. 浏览器中beforeunload的使用

    打开一些慢的网站的时候只见浏览器在不停转圈,但是页面还停留在当前页面的,有些网站的效果是你点击链接要跳到另一个页面的时候,在当前页面弹出一个框提示“正在加载中....”, 用到了浏览器的beforeu ...

  6. Spring、SpringMVC和Springboot的区别(网摘)

    spring boot就是一个大框架里面包含了许许多多的东西,其中spring就是最核心的内容之一,当然就包含spring mvc. spring mvc 是只是spring 处理web层请求的一个模 ...

  7. Java 的 I/O 类库的基本架构

    Java 的 I/O 类库的基本架构 I/O 问题是任何编程语言都无法回避的问题,可以说 I/O 问题是整个人机交互的核心问题,因为 I/O 是机器获取和交换信息的主要渠道.在当今这个数据大爆炸时代, ...

  8. HR必备基础能力之人性

    https://www.jianshu.com/p/bbb858431c81 人力资源管理-从新手到入门(正文) 第一章 必备基础能力 第三节 人性 人力资源管理者(HR)日常工作中面对的主要对象是人 ...

  9. [Windows Azure] How to Deploy a Database to Windows Azure

    How to Deploy a Database to Windows Azure There are several different ways you can move an on-premis ...

  10. (原创)发布一个C++版本的ORM库SmartDB(一)

    先简单说说ORM的优点: 提高开发效率,减少重复劳动,只和业务实体打交道,由业务实体自动生成sql语句,不用手写sql语句. 简单易用, 可维护性好. 隔离数据源,使得我们更换数据源时不用修改代码. ...