Uboot 下board_init_f调用函数集合

 
前面我们讨论了board_init_f调用的调用时机,此函数主要是对init_sequence_f中的函数进行回调。

common/board_f.c

static const init_fnc_t init_sequence_f[] = { #ifdef CONFIG_SANDBOX  setup_ram_buf, #endif

 setup_mon_len,

#ifdef CONFIG_OF_CONTROL  fdtdec_setup, #endif

#ifdef CONFIG_TRACE  trace_early_init, #endif

 initf_malloc,  initf_console_record,

#if defined(CONFIG_X86) && defined(CONFIG_HAVE_FSP)  x86_fsp_init, #endif

 arch_cpu_init,  /* basic arch cpu dependent setup */  mach_cpu_init,  /* SoC/machine dependent CPU setup */  initf_dm,  arch_cpu_init_dm,  mark_bootstage,  /* need timer, go after init dm */

#if defined(CONFIG_BOARD_EARLY_INIT_F)  board_early_init_f, #endif

 /* TODO: can any of this go into arch_cpu_init()? */ #if defined(CONFIG_PPC) && !defined(CONFIG_8xx_CPUCLK_DEFAULT)  get_clocks,  /* get CPU and bus clocks (etc.) */ #if defined(CONFIG_TQM8xxL) && !defined(CONFIG_TQM866M) \   && !defined(CONFIG_TQM885D)  adjust_sdram_tbs_8xx, #endif

 /* TODO: can we rename this to timer_init()? */  init_timebase,

#endif

#if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || \   defined(CONFIG_BLACKFIN) || defined(CONFIG_NDS32) || \   defined(CONFIG_SH) || defined(CONFIG_SPARC)  timer_init,  /* initialize timer */ #endif

#if defined(CONFIG_BOARD_POSTCLK_INIT)  board_postclk_init, #endif

#if defined(CONFIG_SYS_FSL_CLK) || defined(CONFIG_M68K)  get_clocks, #endif

 env_init,  /* initialize environment */

#if defined(CONFIG_8xx_CPUCLK_DEFAULT)  /* get CPU and bus clocks according to the environment variable */  get_clocks_866,  /* adjust sdram refresh rate according to the new clock */  sdram_adjust_866,  init_timebase, #endif

 init_baud_rate,  /* initialze baudrate settings */  serial_init,  /* serial communications setup */  console_init_f,  /* stage 1 init of console */

#ifdef CONFIG_SANDBOX  sandbox_early_getopt_check, #endif

 display_options, /* say that we are here */  display_text_info, /* show debugging info if required */

#if defined(CONFIG_MPC8260)  prt_8260_rsr,  prt_8260_clks, #endif /* CONFIG_MPC8260 */

#if defined(CONFIG_MPC83xx)  prt_83xx_rsr, #endif

#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SH)  checkcpu, #endif

#if defined(CONFIG_DISPLAY_CPUINFO)  print_cpuinfo,  /* display cpu info (and speed) */ #endif

#if defined(CONFIG_DISPLAY_BOARDINFO)  show_board_info, #endif

 INIT_FUNC_WATCHDOG_INIT

#if defined(CONFIG_MISC_INIT_F)  misc_init_f, #endif

 INIT_FUNC_WATCHDOG_RESET

#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)  init_func_i2c, #endif

#if defined(CONFIG_HARD_SPI)  init_func_spi, #endif

 announce_dram_init,

 /* TODO: unify all these dram functions? */ #if defined(CONFIG_ARM) || defined(CONFIG_X86) || defined(CONFIG_NDS32) || \   defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32) || \   defined(CONFIG_SH)  dram_init,  /* configure available RAM banks */ #endif

#if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_M68K)  init_func_ram, #endif

#ifdef CONFIG_POST  post_init_f, #endif

 INIT_FUNC_WATCHDOG_RESET

#if defined(CONFIG_SYS_DRAM_TEST)  testdram, #endif /* CONFIG_SYS_DRAM_TEST */

 INIT_FUNC_WATCHDOG_RESET

#ifdef CONFIG_POST  init_post, #endif

 INIT_FUNC_WATCHDOG_RESET

 /*   * Now that we have DRAM mapped and working, we can   * relocate the code and continue running from DRAM.   *   * Reserve memory at end of RAM for (top down in that order):   *  - area that won't get touched by U-Boot and Linux (optional)   *  - kernel log buffer   *  - protected RAM   *  - LCD framebuffer   *  - monitor code   *  - board info struct   */  setup_dest_addr,

#if defined(CONFIG_BLACKFIN) || defined(CONFIG_XTENSA)  /* Blackfin u-boot monitor should be on top of the ram */  reserve_uboot, #endif

#if defined(CONFIG_SPARC)  reserve_prom, #endif

#if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR)  reserve_logbuffer, #endif

#ifdef CONFIG_PRAM  reserve_pram, #endif

 reserve_round_4k,

#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) && \   defined(CONFIG_ARM)  reserve_mmu, #endif

#ifdef CONFIG_DM_VIDEO  reserve_video, #else # ifdef CONFIG_LCD   reserve_lcd, # endif

  /* TODO: Why the dependency on CONFIG_8xx? */ # if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \    !defined(CONFIG_ARM) && !defined(CONFIG_X86) && \    !defined(CONFIG_BLACKFIN) && !defined(CONFIG_M68K)   reserve_legacy_video, # endif #endif /* CONFIG_DM_VIDEO */

 reserve_trace,

#if !defined(CONFIG_BLACKFIN) && !defined(CONFIG_XTENSA)  reserve_uboot, #endif

#ifndef CONFIG_SPL_BUILD  reserve_malloc,  reserve_board, #endif

 setup_machine,  reserve_global_data,  reserve_fdt,  reserve_arch,  reserve_stacks,  setup_dram_config,  show_dram_config,

#if defined(CONFIG_M68K) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \  defined(CONFIG_SH)  setup_board_part1, #endif

#if defined(CONFIG_PPC) || defined(CONFIG_M68K)  INIT_FUNC_WATCHDOG_RESET  setup_board_part2, #endif

 display_new_sp,

#ifdef CONFIG_SYS_EXTBDINFO  setup_board_extra, #endif

 INIT_FUNC_WATCHDOG_RESET  reloc_fdt,  setup_reloc,

#if defined(CONFIG_X86) || defined(CONFIG_ARC)  copy_uboot_to_ram,  do_elf_reloc_fixups,  clear_bss, #endif

#if defined(CONFIG_XTENSA)  clear_bss, #endif

#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) && \   !CONFIG_IS_ENABLED(X86_64)  jump_to_copy, #endif

 NULL, }; 我们稍后对这些函数详细的分析。

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
uboot是一种常用的开源引导加载程序,用于嵌入式系统的引导启动。其中,board_init_r和board_init_f是uboot中的两个重要函数。 board_init_r函数是在uboot启动过程中执行的第一个函数。它负责执行一系列的初始化工作,例如初始化系统时钟、设置内存映射等。此函数被用于配置和初始化各个硬件模块,包括中断控制器、串口控制器、定时器等,以确保系统正常运行。该函数还读取并解析配置文件,加载设备树等操作,为后续的引导加载准备好必要的条件。 board_init_f函数是在board_init_r函数之后调用的。它用于进一步初始化系统,并执行一些与硬件相关的操作。例如,该函数可能会初始化网络接口、USB接口、存储设备等,并设置系统的默认环境变量。此外,board_init_f函数还负责将uboot的控制权交给操作系统的引导加载程序,从而完成uboot的使命。 通过调用board_init_r和board_init_f函数,uboot能够在系统启动时完成各种硬件的初始化和配置工作。这两个函数是uboot启动过程中的重要环节,确保系统能够顺利地加载操作系统并运行。同时,它们也为开发者提供了扩展uboot的接口,可以在这两个函数中添加自定义的初始化代码,以满足系统特定的需求。 总结来说,board_init_r和board_init_f是uboot中两个重要的函数,用于初始化和配置嵌入式系统的硬件,并为操作系统的加载做好准备。它们是uboot启动过程中不可或缺的一部分,保证系统的正常启动和运行。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值