1 // SPDX-License-Identifier: GPL-2.0-or-later
5 #include <linux/fcntl.h>
6 #include <linux/memblock.h>
9 #include <asm/bootinfo.h>
16 u32 memsize
, highmemsize
;
18 void __init
prom_init_memory(void)
20 memblock_add(0x0, (memsize
<< 20));
22 #ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG
26 bit
= fls(memsize
+ highmemsize
);
27 if (bit
!= ffs(memsize
+ highmemsize
))
32 /* set cpu window3 to map CPU to DDR: 2G -> 2G */
33 LOONGSON_ADDRWIN_CPUTODDR(ADDRWIN_WIN3
, 0x80000000ul
,
34 0x80000000ul
, (1 << bit
));
37 #endif /* !CONFIG_CPU_SUPPORTS_ADDRWINCFG */
41 memblock_add(LOONGSON_HIGHMEM_START
, highmemsize
<< 20);
42 #endif /* !CONFIG_64BIT */