mirror of
https://xff.cz/git/u-boot/
synced 2025-09-28 22:11:16 +02:00
x86: qemu: Extract getting memory size to a separate routine
This extracts getting memory size logic in dram_init() to a separate routine qemu_get_low_memory_size(). No functional changes. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Aiden Park <aiden.park@intel.com>
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
int dram_init(void)
|
u32 qemu_get_low_memory_size(void)
|
||||||
{
|
{
|
||||||
u32 ram;
|
u32 ram;
|
||||||
|
|
||||||
@@ -19,7 +19,12 @@ int dram_init(void)
|
|||||||
ram |= ((u32)inb(CMOS_DATA_PORT)) << 6;
|
ram |= ((u32)inb(CMOS_DATA_PORT)) << 6;
|
||||||
ram += 16 * 1024;
|
ram += 16 * 1024;
|
||||||
|
|
||||||
gd->ram_size = ram * 1024;
|
return ram * 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dram_init(void)
|
||||||
|
{
|
||||||
|
gd->ram_size = qemu_get_low_memory_size();
|
||||||
post_code(POST_DRAM);
|
post_code(POST_DRAM);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -37,4 +37,11 @@
|
|||||||
#define PMREGMISC 0x80
|
#define PMREGMISC 0x80
|
||||||
#define PMIOSE (1 << 0)
|
#define PMIOSE (1 << 0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qemu_get_low_memory_size() - Get low memory size
|
||||||
|
*
|
||||||
|
* @return: size of memory below 4GiB
|
||||||
|
*/
|
||||||
|
u32 qemu_get_low_memory_size(void);
|
||||||
|
|
||||||
#endif /* _ARCH_QEMU_H_ */
|
#endif /* _ARCH_QEMU_H_ */
|
||||||
|
Reference in New Issue
Block a user