Smart210 U-Boot移植 之Readme文件分析 (基于u-boot-2015.07)

我们逐步分析README 里面的内容

Board Initialisation Flow:

   1:  
   2: Board Initialisation Flow:(开发板初始化)
   3: --------------------------
   4:  
   5: This is the intended start-up flow for boards. This should apply for both
   6: SPL and U-Boot proper (i.e. they both follow the same rules). At present SPL
   7: mostly uses a separate code path, but the funtion names and roles of each
   8: function are the same. Some boards or architectures may not conform to this.
   9: At least most ARM boards which use CONFIG_SPL_FRAMEWORK conform to this.
  10:  
  11: Execution starts with start.S with three functions called during init after
  12: that. The purpose and limitations of each is described below.
  13:  
  14: lowlevel_init():
  15:     - purpose: essential init to permit execution to reach board_init_f()
  16:     - no global_data or BSS
  17:     - there is no stack (ARMv7 may have one but it will soon be removed)
  18:     - must not set up SDRAM or use console
  19:     - must only do the bare minimum to allow execution to continue to
  20:         board_init_f()
  21:     - this is almost never needed
  22:     - return normally from this function
  23:  
  24: board_init_f():
  25:     - purpose: set up the machine ready for running board_init_r():
  26:         i.e. SDRAM and serial UART
  27:     - global_data is available
  28:     - stack is in SRAM
  29:     - BSS is not available, so you cannot use global/static variables,
  30:         only stack variables and global_data
  31:  
  32:     Non-SPL-specific notes:
  33:     - dram_init() is called to set up DRAM. If already done in SPL this
  34:         can do nothing
  35:  
  36:     SPL-specific notes:
  37:     - you can override the entire board_init_f() function with your own
  38:         version as needed.
  39:     - preloader_console_init() can be called here in extremis
  40:     - should set up SDRAM, and anything needed to make the UART work
  41:     - these is no need to clear BSS, it will be done by crt0.S
  42:     - must return normally from this function (don't call board_init_r()
  43:         directly)
  44:  
  45: Here the BSS is cleared. For SPL, if CONFIG_SPL_STACK_R is defined, then at
  46: this point the stack and global_data are relocated to below
  47: CONFIG_SPL_STACK_R_ADDR. For non-SPL, U-Boot is relocated to run at the top of
  48: memory.
  49:  
  50: board_init_r():
  51:     - purpose: main execution, common code
  52:     - global_data is available
  53:     - SDRAM is available
  54:     - BSS is available, all static/global variables can be used
  55:     - execution eventually continues to main_loop()
  56:  
  57:     Non-SPL-specific notes:
  58:     - U-Boot is relocated to the top of memory and is now running from
  59:         there.
  60:  
  61:     SPL-specific notes:
  62:     - stack is optionally in SDRAM, if CONFIG_SPL_STACK_R is defined and
  63:         CONFIG_SPL_STACK_R_ADDR points into SDRAM
  64:     - preloader_console_init() can be called here - typically this is
  65:         done by defining CONFIG_SPL_BOARD_INIT and then supplying a
  66:         spl_board_init() function containing this call
  67:     - loads U-Boot or (in falcon mode) Linux
  68:  

这段话的意思就是开发板初始化必须初始化的三个初始化函数:

lowlevel_init();board_init_f();board_init_r();

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值