uboot下init_sequence_r函数集

 
common/board_r.c
/*
 * Over time we hope to remove these functions with code fragments and
 * stub funtcions, and instead call the relevant function directly.
 *
 * We also hope to remove most of the driver-related init and do it if/when
 * the driver is later used.
 *
 * TODO: perhaps reset the watchdog in the initcall function after each call?
 */
static init_fnc_t init_sequence_r[] = {
 initr_trace,
 initr_reloc,
 /* TODO: could x86/PPC have this also perhaps? */
#ifdef CONFIG_ARM
 initr_caches,
 /* Note: For Freescale LS2 SoCs, new MMU table is created in DDR.
  *  A temporary mapping of IFC high region is since removed,
  *  so environmental variables in NOR flash is not availble
  *  until board_init() is called below to remap IFC to high
  *  region.
  */
#endif
 initr_reloc_global_data,
#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
 initr_unlock_ram_in_cache,
#endif
 initr_barrier,
 initr_malloc,
 initr_console_record,
#ifdef CONFIG_SYS_NONCACHED_MEMORY
 initr_noncached,
#endif
 bootstage_relocate,
#ifdef CONFIG_DM
 initr_dm,
#endif
 initr_bootstage,
#if defined(CONFIG_ARM) || defined(CONFIG_NDS32)
 board_init, /* Setup chipselects */
#endif
 /*
  * TODO: printing of the clock inforamtion of the board is now
  * implemented as part of bdinfo command. Currently only support for
  * davinci SOC's is added. Remove this check once all the board
  * implement this.
  */
#ifdef CONFIG_CLOCKS
 set_cpu_clk_info, /* Setup clock information */
#endif
#ifdef CONFIG_EFI_LOADER
 efi_memory_init,
#endif
 stdio_init_tables,
 initr_serial,
 initr_announce,
 INIT_FUNC_WATCHDOG_RESET
#ifdef CONFIG_NEEDS_MANUAL_RELOC
 initr_manual_reloc_cmdtable,
#endif
#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_MIPS)
 initr_trap,
#endif
#ifdef CONFIG_ADDR_MAP
 initr_addr_map,
#endif
#if defined(CONFIG_BOARD_EARLY_INIT_R)
 board_early_init_r,
#endif
 INIT_FUNC_WATCHDOG_RESET
#ifdef CONFIG_LOGBUFFER
 initr_logbuffer,
#endif
#ifdef CONFIG_POST
 initr_post_backlog,
#endif
 INIT_FUNC_WATCHDOG_RESET
#ifdef CONFIG_SYS_DELAYED_ICACHE
 initr_icache_enable,
#endif
#if defined(CONFIG_PCI) && defined(CONFIG_SYS_EARLY_PCI_INIT)
 /*
  * Do early PCI configuration _before_ the flash gets initialised,
  * because PCU ressources are crucial for flash access on some boards.
  */
 initr_pci,
#endif
#ifdef CONFIG_ARCH_EARLY_INIT_R
 arch_early_init_r,
#endif
 power_init_board,
#ifdef CONFIG_MTD_NOR_FLASH
 initr_flash,
#endif
 INIT_FUNC_WATCHDOG_RESET
#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86) || \
 defined(CONFIG_SPARC)
 /* initialize higher level parts of CPU like time base and timers */
 cpu_init_r,
#endif
#ifdef CONFIG_PPC
 initr_spi,
#endif
#ifdef CONFIG_CMD_NAND
 initr_nand,
#endif
#ifdef CONFIG_CMD_ONENAND
 initr_onenand,
#endif
#ifdef CONFIG_GENERIC_MMC
 initr_mmc,
#endif
#ifdef CONFIG_HAS_DATAFLASH
 initr_dataflash,
#endif
 initr_env,
#ifdef CONFIG_SYS_BOOTPARAMS_LEN
 initr_malloc_bootparams,
#endif
 INIT_FUNC_WATCHDOG_RESET
 initr_secondary_cpu,
#if defined(CONFIG_ID_EEPROM) || defined(CONFIG_SYS_I2C_MAC_OFFSET)
 mac_read_from_eeprom,
#endif
 INIT_FUNC_WATCHDOG_RESET
#if defined(CONFIG_PCI) && !defined(CONFIG_SYS_EARLY_PCI_INIT)
 /*
  * Do pci configuration
  */
 initr_pci,
#endif
 stdio_add_devices,
 initr_jumptable,
#ifdef CONFIG_API
 initr_api,
#endif
 console_init_r,  /* fully init console as a device */
#ifdef CONFIG_DISPLAY_BOARDINFO_LATE
 show_board_info,
#endif
#ifdef CONFIG_ARCH_MISC_INIT
 arch_misc_init,  /* miscellaneous arch-dependent init */
#endif
#ifdef CONFIG_MISC_INIT_R
 misc_init_r,  /* miscellaneous platform-dependent init */
#endif
 INIT_FUNC_WATCHDOG_RESET
#ifdef CONFIG_CMD_KGDB
 initr_kgdb,
#endif
 interrupt_init,
#if defined(CONFIG_ARM) || defined(CONFIG_AVR32)
 initr_enable_interrupts,
#endif
#if defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32) || defined(CONFIG_M68K)
 timer_init,  /* initialize timer */
#endif
#if defined(CONFIG_LED_STATUS)
 initr_status_led,
#endif
 /* PPC has a udelay(20) here dating from 2002. Why? */
#ifdef CONFIG_CMD_NET
 initr_ethaddr,
#endif
#ifdef CONFIG_BOARD_LATE_INIT
 board_late_init,
#endif
#if defined(CONFIG_CMD_AMBAPP)
 ambapp_init_reloc,
#if defined(CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP)
 initr_ambapp_print,
#endif
#endif
#if defined(CONFIG_SCSI) && !defined(CONFIG_DM_SCSI)
 INIT_FUNC_WATCHDOG_RESET
 initr_scsi,
#endif
#ifdef CONFIG_BITBANGMII
 initr_bbmii,
#endif
#ifdef CONFIG_CMD_NET
 INIT_FUNC_WATCHDOG_RESET
 initr_net,
#endif
#ifdef CONFIG_POST
 initr_post,
#endif
#if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_CMD_IDE)
 initr_pcmcia,
#endif
#if defined(CONFIG_CMD_IDE)
 initr_ide,
#endif
#ifdef CONFIG_LAST_STAGE_INIT
 INIT_FUNC_WATCHDOG_RESET
 /*
  * Some parts can be only initialized if all others (like
  * Interrupts) are up and running (i.e. the PC-style ISA
  * keyboard).
  */
 last_stage_init,
#endif
#ifdef CONFIG_CMD_BEDBUG
 INIT_FUNC_WATCHDOG_RESET
 initr_bedbug,
#endif
#if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER)
 initr_mem,
#endif
#ifdef CONFIG_PS2KBD
 initr_kbd,
#endif
#if defined(CONFIG_SPARC)
 prom_init,
#endif
 run_main_loop,
};
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、付费专栏及课程。

余额充值