## Loading kernel from FIT Image at 08000000 ...
Using 'config_0x775E@1' configuration
Verifying Hash Integrity ... OK
Trying 'kernel@1' kernel subimage
Description: Linux kernel
Created: 2022-08-06 10:42:14 UTC
Type: Kernel Image
Compression: gzip compressed
Data Start: 0x080001e8
Data Size: 4049224 Bytes = 3.9 MiB
Architecture: ARM
OS: Linux
Load Address: 0x00008000
Entry Point: 0x00008000
Hash algo: crc32
Hash value: 5716757b
Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at 08000000 ...
Using 'config_0x775E@1' configuration
Trying 'fdt_775E@1' fdt subimage
Description: 775E device tree
Created: 2022-08-06 10:42:14 UTC
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x083fd9fc
Data Size: 11375 Bytes = 11.1 KiB
Architecture: ARM
Hash algo: crc32
Hash value: 2eda7b23
Verifying Hash Integrity ... crc32+ OK
Booting using the fdt blob at 0x83fd9fc
Uncompressing Kernel Image ... OK
ERROR: Failed to allocate 0x5c6f bytes below 0x17ffffff.
Failed using fdt_high value for Device TreeFDT creation failed! hanging...### ERROR ### Please RESET the board ###
解决办法:
通过搜索错误代码,定位到时u-boot的lbm模块出了问题:
lbm:Logical memory blocks.
lbm使用全局的gd->bd->bi_dram[0].start和gd->bd->bi_dram[0].size作为自己内存池管理
common/board_f.c
static int setup_dram_config(void)
{
/* Ram is board specific, so move it to board code ... */
dram_init_banksize();
return 0;
}
board/platform/board.c 中增加如下代码:
void dram_init_banksize(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1_BASE;
gd->bd->bi_dram[0].size = gd->ram_size;
}
common/bootm.c
#ifdef CONFIG_LMB
static void boot_start_lmb(bootm_headers_t *images)
{
ulong mem_start;
phys_size_t mem_size;
lmb_init(&images->lmb);
mem_start = getenv_bootm_low();
mem_size = getenv_bootm_size();
lmb_add(&images->lmb, (phys_addr_t)mem_start, mem_size);
arch_lmb_reserve(&images->lmb);
board_lmb_reserve(&images->lmb);
}
#else
#define lmb_reserve(lmb, base, size)
static inline void boot_start_lmb(bootm_headers_t *images) { }
#endif
u-boot/arch/arm/lib/bootm.c
void arch_lmb_reserve(struct lmb *lmb)
{
ulong sp;
/*
* Booting a (Linux) kernel image
*
* Allocate space for command line and board info - the
* address should be as high as possible within the reach of
* the kernel (see CONFIG_SYS_BOOTMAPSZ settings), but in unused
* memory, which means far enough below the current stack
* pointer.
*/
sp = get_sp();
debug("## Current stack ends at 0x%08lx ", sp);
/* adjust sp by 4K to be safe */
sp -= 4096;
lmb_reserve(lmb, sp,
gd->bd->bi_dram[0].start + gd->bd->bi_dram[0].size - sp);
}