[libcpu] fix No memory higher than 1 GB is mapped

This commit is contained in:
zhujiale 2024-11-15 18:56:52 +08:00 committed by Meco Man
parent 96da7abd3e
commit 44515624e2
1 changed files with 2 additions and 2 deletions

View File

@ -237,14 +237,14 @@ void rt_hw_common_setup(void)
/* To virtual address */ /* To virtual address */
fdt_ptr = (void *)(fdt_ptr - pv_off); fdt_ptr = (void *)(fdt_ptr - pv_off);
#ifdef KERNEL_VADDR_START
if ((rt_ubase_t)fdt_ptr + fdt_size - KERNEL_VADDR_START > SIZE_GB) if ((rt_ubase_t)fdt_ptr + fdt_size - KERNEL_VADDR_START > SIZE_GB)
{ {
fdt_ptr = rt_ioremap_early(fdt_ptr + pv_off, fdt_size); fdt_ptr = rt_ioremap_early(fdt_ptr + pv_off, fdt_size);
RT_ASSERT(fdt_ptr != RT_NULL); RT_ASSERT(fdt_ptr != RT_NULL);
} }
#endif
rt_memmove((void *)(fdt_start - pv_off), fdt_ptr, fdt_size); rt_memmove((void *)(fdt_start - pv_off), fdt_ptr, fdt_size);
fdt_ptr = (void *)fdt_start - pv_off; fdt_ptr = (void *)fdt_start - pv_off;