Forlinx Posted Saturday at 02:07 AM Report Share Posted Saturday at 02:07 AM Introduction to the U-Boot boot process U-Boot Boot Process Stage 1 Main process Partial Hardware Initialization -> Load Full U-Boot into RAM -> Jump to Stage 2 Entry for Execution. Files Used Mainly in Stage 1 (Non-Open Source Scenario): start.S (Hardware Initialization, watchdog, interrupts, clock configurations) lowlevel_init.S (RAM (DDR) initialization, U-Boot code loading, stack setup, BSS clearing, jump to U-Boot Stage 2 U-Boot Boot Process Stage 2 Stage 2 involves further hardware initialization by U-Boot, configuring command line parameters and environment variables, and transitioning to the kernel. The main documents used are: board.c file: Typically, our own files are located in the board/forlinx/ directory. main.c file: Located in the common directory Main function Some of the more important initialisation functions are as follows: 1.''setup_mon_len'' function: Set the ''gd'' structure's ''mon_len'' member variable, representing the length of the entire code; 2.''initf_malloc'' function: Sets the ''gd '' structure's member variables related to ''malloc''; 3.''board_early_init_f''function; 4.To initialize the IO configuration of the serial port, defined in the board/freescale/mx6ull_toto/mx6ull_toto.cfile; 5.''timer_init'' function: Initialize the kernel timer to provide clock ticks for U-Boot, defined in the ''arch/arm/imxcommon/timer.c''file; 6.''get_clocks'' function: Retrieve the clock for the SD card peripheral (sdhc_clk), defined in the arch/arm/imxcommon/speed.c file; 7.''init_baud_rate'' function: Initialize the baud rate, defined in the ''common/board_f.c'' file. 8.''serial_init'' function: Initialize serial communication settings, defined in the''drivers/serial/serial.c''file; 9.''console_init_f'' function: Initialize the console, defined in the ''common/console.c'' file; 10.''display_options'' function: Print U-Boot version information and compilation details, defined in the lib/display_options.c file; 11.''print_cpuinfo'' function: To display CPU information and the main clock frequency, defined in the arch/arm/imx-common/cpu.c file; 12.''show_board_info'' function: Print development board information, defined in the common/board _ info.c file; 13.''init_func_i2c'' function: To initialize I2C; 14.''announce_dram_init'' function: This function is simple, it outputs the string "DRAM:"; 15.''dram_init'' function: Doesn't actually initialize DDR but rather sets the value of gd->ram_size. Current U-boot startup print information U-Boot SPL 2021.01-gd1345267-dirty (Jul 08 2023 - 08:00:49 +0800) SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.1--w2022.07-am62x (Terrifi') am625_init: board_init_f done(counter=1) SPL initial stack usage: 13768 bytes i2c_write: error waiting for data ACK (status=0x116) i2c_write: error waiting for data ACK (status=0x116) Auth Success! normal mode am625_init: spl_boot_device: devstat = 0x1843 bootmedia = 0x9 bootindex = 0 Trying to boot from MMC1 am625_init: spl_boot_device: devstat = 0x1843 bootmedia = 0x9 bootindex = 0 Loading Environment from MMC... MMC: block number 0x3500 exceeds max(0x2000) *** Warning - !read failed, using default environment am625_init: spl_boot_device: devstat = 0x1843 bootmedia = 0x9 bootindex = 0 am625_init: spl_boot_device: devstat = 0x1843 bootmedia = 0x9 bootindex = 0 init_env from device 9 not supported! Starting ATF on ARM64 core... NOTICE: BL31: v2.5(release):v0.6-6-gd489c56b NOTICE: BL31: Built : 15:08:18, Jun 26 2023 U-Boot SPL 2021.01-gd1345267-dirty (Jul 08 2023 - 08:00:56 +0800) SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.1--w2022.07-am62x (Terrifi') am625_init: board_init_f done am625_init: spl_boot_device: devstat = 0x1843 bootmedia = 0x9 bootindex = 0 Trying to boot from MMC1 am625_init: spl_boot_device: devstat = 0x1843 bootmedia = 0x9 bootindex = 0 U-Boot 2021.01-gd1345267-dirty (Jul 08 2023 - 08:00:56 +0800) SoC: AM62X SR1.0 Model: Forlinx OK62xx-C board DRAM: 2 GiB MMC: mmc@fa10000: 0, mmc@fa00000: 1 Loading Environment from MMC... OK In: serial@2800000 Out: serial@2800000 Err: serial@2800000 52334 bytes read in 5 ms (10 MiB/s) Saving Environment to MMC... Writing to MMC(0)... OK Net: eth0: ethernet@8000000 Autoboot in 1 seconds switch to partitions #0, OK mmc0(part 0) is current device SD/MMC found on device 0 Failed to load 'boot.scr' Failed to load 'uEnv.txt' MMC: no card present 20208128 bytes read in 111 ms (173.6 MiB/s) 52334 bytes read in 5 ms (10 MiB/s) 4595 bytes read in 5 ms (897.5 KiB/s) ## Flattened Device Tree blob at 88000000 Booting using the fdt blob at 0x88000000 Loading Device Tree to 000000008fef0000, end 000000008fffffff ... OK U-boot shortens 2 seconds of boot time by disabling USB and Ethernet via defconfig.Modify the autoboot.c file to hardcode bootdelay=0, reducing it by 1 second. diff --git a/common/autoboot.c b/common/autoboot.c index e628baff..685779b6 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -328,10 +328,11 @@ const char *bootdelay_process(void) int bootdelay; bootcount_inc(); - +/* s = env_get("bootdelay"); bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY; - +*/ +bootdelay = 0; if (IS_ENABLED(CONFIG_OF_CONTROL)) bootdelay = fdtdec_get_config_int(gd->fdt_blob, "bootdelay", bootdelay); Comment out the function that reads uEnv.txt file. Remove useless printed information. Cropped Log 16:33:00:290 U-Boot SPL 2021.01-gd1345267-dirty (Jul 25 2023 - 16:14:18 +0800) 16:33:00:303 SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.1--w2022.07-am62x (Terrifi') 16:33:00:351 am625_init: board_init_f done(counter=1) 16:33:00:351 SPL initial stack usage: 13768 bytes 16:33:01:527 i2c_write: error waiting for data ACK (status=0x116) 16:33:01:527 i2c_write: error waiting for data ACK (status=0x116) 16:33:01:527 Auth Success! 16:33:01:544 normal mode 16:33:01:544 am625_init: spl_boot_device: devstat = 0x1843 bootmedia = 0x9 bootindex = 0 16:33:01:544 Trying to boot from MMC1 16:33:01:729 Loading Environment from MMC... MMC: block number 0x3500 exceeds max(0x2000) 16:33:01:749 *** Warning - !read failed, using default environment 16:33:01:749 16:33:01:776 am625_init: spl_boot_device: devstat = 0x1843 bootmedia = 0x9 bootindex = 0 16:33:01:795 am625_init: spl_boot_device: devstat = 0x1843 bootmedia = 0x9 bootindex = 0 16:33:01:795 init_env from device 9 not supported! 16:33:01:795 Starting ATF on ARM64 core... 16:33:01:795 16:33:01:812 NOTICE: BL31: v2.5(release):v0.6-6-gd489c56b 16:33:01:812 NOTICE: BL31: Built : 15:08:18, Jun 26 2023 16:33:02:990 16:33:02:997 U-Boot SPL 2021.01-gd1345267-dirty (Jul 25 2023 - 16:14:43 +0800) 16:33:02:997 SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.1--w2022.07-am62x (Terrifi') 16:33:02:997 am625_init: board_init_f done 16:33:03:022 am625_init: spl_boot_device: devstat = 0x1843 bootmedia = 0x9 bootindex = 0 16:33:03:022 Trying to boot from MMC1 16:33:04:507 16:33:04:507 16:33:04:507 U-Boot 2021.01-gd1345267-dirty (Jul 25 2023 - 16:14:43 +0800) 16:33:04:507 16:33:04:507 SoC: AM62X SR1.0 16:33:04:508 Model: Forlinx OK62xx-C board 16:33:04:530 DRAM: 1 GiB 16:33:04:593 MMC: mmc@fa10000: 0, mmc@fa00000: 1 16:33:04:640 Loading Environment from MMC... OK 16:33:04:640 In: serial@2800000 16:33:04:640 Out: serial@2800000 16:33:04:640 Err: serial@2800000 16:33:04:654 51701 bytes read in 6 ms (8.2 MiB/s) 16:33:04:654 using kernel dtb display control 16:33:04:685 Saving Environment to MMC... Writing to MMC(0)... OK 16:33:04:701 Net: eth0: ethernet@8000000 16:33:04:701 Autoboot in 0 seconds 16:33:04:748 switch to partitions #0, OK 16:33:04:748 mmc0(part 0) is current device 16:33:04:795 SD/MMC found on device 0 16:33:05:104 3229642 bytes read in 141 ms (21.8 MiB/s) 16:33:05:228 20075008 bytes read in 111 ms (172.5 MiB/s) 16:33:05:228 51701 bytes read in 6 ms (8.2 MiB/s) 16:33:05:244 4575 bytes read in 5 ms (893.6 KiB/s) 16:33:05:285 ## Flattened Device Tree blob at 88000000 16:33:05:285 Booting using the fdt blob at 0x88000000 16:33:05:306 Loading Device Tree to 000000008fef0000, end 000000008fffffff ... OK 16:33:05:306 16:33:05:306 Starting kernel ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.