Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| u-boot_boot_sequence [2019/12/27 17:51] – [common/board_f.c] rpjday | u-boot_boot_sequence [2019/12/28 08:33] (current) – [1.] rpjday | ||
|---|---|---|---|
| Line 19: | Line 19: | ||
| ===== arch/ | ===== arch/ | ||
| - | ==== 1. ==== | + | ==== Prologue |
| < | < | ||
| Line 25: | Line 25: | ||
| * start-up where a C runtime environment is needed. Its entry point | * start-up where a C runtime environment is needed. Its entry point | ||
| * is _main and is branched into from the target' | * is _main and is branched into from the target' | ||
| - | * | + | </ |
| - | * _main execution sequence is: | + | |
| - | * | + | ==== 1. ==== |
| + | |||
| + | < | ||
| * 1. Set up initial environment for calling board_init_f(). | * 1. Set up initial environment for calling board_init_f(). | ||
| | | ||
| Line 212: | Line 214: | ||
| </ | </ | ||
| - | ===== common/ | + | ===== common/ |
| - | + | ||
| - | ==== initr_dm() [C] ==== | + | |
| - | ==== board_init() [A,B] ==== | + | |
| - | + | ||
| - | ==== board_early_init_r() (not for Zynq) ==== | + | |
| - | + | ||
| - | ==== arch_early_init_r() [A] ==== | + | |
| - | + | ||
| - | * arch/ | + | |
| - | * arch/ | + | |
| < | < | ||
| - | #if defined(CONFIG_ARCH_EARLY_INIT_R) | + | void board_init_r(gd_t *new_gd, ulong dest_addr) |
| - | int arch_early_init_r(void) | + | |
| - | { | + | |
| - | #if (defined(CONFIG_FPGA) && !defined(CONFIG_SPL_BUILD)) || \ | + | |
| - | (defined(CONFIG_SPL_FPGA_SUPPORT) && defined(CONFIG_SPL_BUILD)) | + | |
| - | int cpu_id = cpu_desc_id(); | + | |
| - | + | ||
| - | if (cpu_id < 0) | + | |
| - | return 0; | + | |
| - | + | ||
| - | fpga.size = zynq_fpga_descs[cpu_id].fpga_size; | + | |
| - | fpga.name = zynq_fpga_descs[cpu_id].devicename; | + | |
| - | fpga_init(); | + | |
| - | fpga_add(fpga_xilinx, | + | |
| - | #endif | + | |
| - | return 0; | + | |
| - | } | + | |
| - | #endif | + | |
| - | </ | + | |
| - | + | ||
| - | ==== initr_mmc() [C] ==== | + | |
| - | + | ||
| - | < | + | |
| - | #ifdef CONFIG_MMC | + | |
| - | static int initr_mmc(void) | + | |
| - | { | + | |
| - | puts(" | + | |
| - | mmc_initialize(gd-> | + | |
| - | return 0; | + | |
| - | } | + | |
| - | #endif | + | |
| - | </ | + | |
| - | + | ||
| - | ==== initr_env() [C] ==== | + | |
| - | + | ||
| - | < | + | |
| - | static int initr_env(void) | + | |
| - | { | + | |
| - | /* initialize environment */ | + | |
| - | if (should_load_env()) | + | |
| - | env_relocate(); | + | |
| - | else | + | |
| - | set_default_env(NULL, 0); | + | |
| - | #ifdef CONFIG_OF_CONTROL | + | |
| - | env_set_hex(" | + | |
| - | (unsigned long)map_to_sysmem(gd-> | + | |
| - | #endif | + | |
| - | + | ||
| - | /* Initialize from environment */ | + | |
| - | load_addr = env_get_ulong(" | + | |
| - | + | ||
| - | return 0; | + | |
| - | } | + | |
| - | </ | + | |
| - | + | ||
| - | ==== show_board_info() [C] ==== | + | |
| - | + | ||
| - | From '' | + | |
| - | + | ||
| - | < | + | |
| - | int __weak checkboard(void) | + | |
| - | { | + | |
| - | return 0; | + | |
| - | } | + | |
| - | + | ||
| - | /* | + | |
| - | * If the root node of the DTB has a " | + | |
| - | * Then call checkboard(). | + | |
| - | */ | + | |
| - | int __weak show_board_info(void) | + | |
| - | { | + | |
| - | #ifdef CONFIG_OF_CONTROL | + | |
| - | DECLARE_GLOBAL_DATA_PTR; | + | |
| - | const char *model; | + | |
| - | + | ||
| - | model = fdt_getprop(gd-> | + | |
| - | + | ||
| - | if (model) | + | |
| - | printf(" | + | |
| - | #endif | + | |
| - | + | ||
| - | return checkboard(); | + | |
| - | } | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | For '' | + | |
| - | + | ||
| - | < | + | |
| - | int checkboard(void) | + | |
| - | { | + | |
| - | puts(" | + | |
| - | return 0; | + | |
| - | } | + | |
| - | </ | + | |
| - | + | ||
| - | ==== arch_misc_init() ==== | + | |
| - | + | ||
| - | Some arches and boards, not Zynq. | + | |
| - | + | ||
| - | < | + | |
| - | #ifdef CONFIG_ARCH_MISC_INIT | + | |
| - | arch_misc_init, | + | |
| - | #endif | + | |
| - | </ | + | |
| - | + | ||
| - | ==== misc_init_r() ==== | + | |
| - | + | ||
| - | < | + | |
| - | #ifdef CONFIG_MISC_INIT_R | + | |
| - | misc_init_r, | + | |
| - | #endif | + | |
| - | </ | + | |
| - | + | ||
| - | ==== initr_enable_interrupts() ==== | + | |
| - | + | ||
| - | < | + | |
| - | #ifdef CONFIG_ARM | + | |
| - | static int initr_enable_interrupts(void) | + | |
| - | { | + | |
| - | enable_interrupts(); | + | |
| - | return 0; | + | |
| - | } | + | |
| - | #endif | + | |
| - | </ | + | |
| - | + | ||
| - | From '' | + | |
| - | + | ||
| - | < | + | |
| - | int interrupt_init (void) | + | |
| { | { | ||
| /* | /* | ||
| - | | + | |
| + | * here. | ||
| + | * TODO(sjg@chromium.org): | ||
| + | * dropping the new_gd parameter. | ||
| */ | */ | ||
| - | IRQ_STACK_START_IN = gd-> | + | #if CONFIG_IS_ENABLED(X86_64) |
| + | arch_setup_gd(new_gd); | ||
| + | #endif | ||
| - | return 0; | + | #ifdef CONFIG_NEEDS_MANUAL_RELOC |
| - | } | + | int i; |
| - | + | ||
| - | void enable_interrupts (void) | + | |
| - | { | + | |
| - | | + | |
| - | } | + | |
| - | int disable_interrupts (void) | + | |
| - | { | + | |
| - | return 0; | + | |
| - | } | + | |
| - | </ | + | |
| - | + | ||
| - | ==== initr_ethaddr() [C] ==== | + | |
| - | + | ||
| - | < | + | |
| - | #ifdef CONFIG_CMD_NET | + | |
| - | initr_ethaddr, | + | |
| #endif | #endif | ||
| - | </ | ||
| - | < | + | #if !defined(CONFIG_X86) && !defined(CONFIG_ARM) && !defined(CONFIG_ARM64) |
| - | #ifdef CONFIG_CMD_NET | + | |
| - | static int initr_ethaddr(void) | + | |
| - | { | + | |
| - | bd_t *bd = gd-> | + | |
| - | + | ||
| - | /* kept around for legacy kernels only ... ignore the next section */ | + | |
| - | eth_env_get_enetaddr(" | + | |
| - | #ifdef CONFIG_HAS_ETH1 | + | |
| - | | + | |
| #endif | #endif | ||
| - | #ifdef CONFIG_HAS_ETH2 | + | gd->flags &= ~GD_FLG_LOG_READY; |
| - | eth_env_get_enetaddr(" | + | |
| - | #endif | + | |
| - | #ifdef CONFIG_HAS_ETH3 | + | |
| - | eth_env_get_enetaddr(" | + | |
| - | #endif | + | |
| - | #ifdef CONFIG_HAS_ETH4 | + | |
| - | eth_env_get_enetaddr(" | + | |
| - | #endif | + | |
| - | #ifdef CONFIG_HAS_ETH5 | + | |
| - | eth_env_get_enetaddr(" | + | |
| - | #endif | + | |
| - | return 0; | + | |
| - | } | + | |
| - | #endif /* CONFIG_CMD_NET */ | + | |
| - | </ | + | |
| - | ==== board_late_init() [B] ==== | + | #ifdef CONFIG_NEEDS_MANUAL_RELOC |
| - | + | for (i = 0; i < ARRAY_SIZE(init_sequence_r); i++) | |
| - | (Defined in board/ | + | init_sequence_r[i] += gd->reloc_off; |
| - | + | ||
| - | <code> | + | |
| - | #ifdef CONFIG_BOARD_LATE_INIT | + | |
| - | board_late_init, | + | |
| #endif | #endif | ||
| - | </ | ||
| - | ==== initr_net() ==== | + | if (initcall_run_list(init_sequence_r)) |
| + | hang(); | ||
| - | < | + | /* NOTREACHED - run_main_loop() does not return */ |
| - | #ifdef CONFIG_CMD_NET | + | |
| - | static int initr_net(void) | + | |
| - | { | + | |
| - | | + | |
| - | eth_initialize(); | + | |
| - | #if defined(CONFIG_RESET_PHY_R) | + | |
| - | debug(" | + | |
| - | reset_phy(); | + | |
| - | #endif | + | |
| - | return 0; | + | |
| - | } | + | |
| - | #endif | + | |
| </ | </ | ||
| - | |||