本文主要说明一下此专栏后续文章的主要内容,基于imx6ul arm32平台,文章主要涉及:

根据上图,自制最小的Bootloader引导内核过程,可以总结Bootloader引导内核需要:
引导linux内核如下:
- ****************************************************
- ************* IMX6UL Bootloader RUN ****************
- ****************************************************
-
- 1.Init io/clock/uart/irq
-
- 2.Start Copy kerner and dtb to ddr
- 2.1 Mount fatfs [ success ]!
- 2.2 List the file in directory
- General file : DTB.
- General file : ZIMAGE.
- 2.3 Open zImage file [success]
- 2.4 Open dtb file [success]
- 2.5 Read kernel file to 0x80800000[success]
- 2.6 Read dtb file to 0x83000000[success]
-
- 3.Starting kernel ...
-
- Booting Linux on physical CPU 0x0
- Linux version 4.1.15-g696dd24-dirty (root@xxzh) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #68 SMP PREEMPT Thu Aug 11 09:45:05 CST 2022
- CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
- CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
- Machine model: Freescale i.MX6 ULL 14x14 EVK Board
- Reserved memory: created CMA memory pool at 0x8c000000, size 320 MiB
- Reserved memory: initialized node linux,cma, compatible id shared-dma-pool
- Memory policy: Data cache writealloc
- PERCPU: Embedded 12 pages/cpu @8bb33000 s16908 r8192 d24052 u49152
- Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
- Kernel command line: console=ttymxc3,115200 imx2-wdt.timeout=120 root=/dev/mmcblk1p2 rootwait rw
- PID hash table entries: 2048 (order: 1, 8192 bytes)
- Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
- Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
- Memory: 180876K/524288K available (6847K kernel code, 377K rwdata, 2316K rodata, 400K init, 422K bss, 15732K reserved, 327680K cma-reserved, 0K highmem)
uboot启动内核如下:
- U-Boot 2016.03-g6f19009 (Aug 11 2022 - 17:29:34 +0800)
-
- CPU: Freescale i.MX6ULL rev1.1 528 MHz (running at 396 MHz)
- CPU: Industrial temperature grade (-40C to 115C) at 45C
- Reset cause: POR
- Board: MYD-Y6ULL 14x14
- DRAM: 512 MiB
- MMC: FSL_SDHC: 0, FSL_SDHC: 1
- *** Warning - bad CRC, using default environment
-
- In: serial
- Out: serial
- Err: serial
- switch to partitions #0, OK
- mmc1(part 0) is current device
- Net: GroundCtrl 20211015 oil_gpio_init
- FEC0
- Error: FEC0 address not set.
-
- Normal Boot
- Hit any key to stop autoboot: 0
- switch to partitions #0, OK
- mmc1(part 0) is current device
- switch to partitions #0, OK
- mmc1(part 0) is current device
- reading boot.scr
- 272 bytes read in 9 ms (29.3 KiB/s)
- Running bootscript from mmc ...
- ## Executing script at 80800000
- reading zImage
- 5511008 bytes read in 138 ms (38.1 MiB/s)
- reading myd-y6ull-emmc.dtb
- 34414 bytes read in 17 ms (1.9 MiB/s)
- Kernel image @ 0x83000000 [ 0x000000 - 0x541760 ]
- ## Flattened Device Tree blob at 84000000
- Booting using the fdt blob at 0x84000000
- Using Device Tree in place at 84000000, end 8400b66d
-
- Starting kernel ...
-
- Booting Linux on physical CPU 0x0
- Linux version 4.1.15-gd778688 (root@xxzh) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #69 SMP PREEMPT Thu Aug 11 17:28:49 CST 2022
- CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
- CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
- Machine model: Freescale i.MX6 ULL 14x14 EVK Board
- Reserved memory: created CMA memory pool at 0x8c000000, size 320 MiB
- Reserved memory: initialized node linux,cma, compatible id shared-dma-pool
- Memory policy: Data cache writealloc
- PERCPU: Embedded 12 pages/cpu @8bb33000 s16908 r8192 d24052 u49152
- Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
- Kernel command line: console=ttymxc3,115200 imx2-wdt.timeout=120 root=/dev/mmcblk1p2 rootwait rw rootfstype=ext4 rootdelay=5 mem=512M