mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-18 06:58:54 +00: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:
parent
d2860c0088
commit
f4c0030074
2 changed files with 14 additions and 2 deletions
|
@ -9,7 +9,7 @@
|
|||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
int dram_init(void)
|
||||
u32 qemu_get_low_memory_size(void)
|
||||
{
|
||||
u32 ram;
|
||||
|
||||
|
@ -19,7 +19,12 @@ int dram_init(void)
|
|||
ram |= ((u32)inb(CMOS_DATA_PORT)) << 6;
|
||||
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);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -37,4 +37,11 @@
|
|||
#define PMREGMISC 0x80
|
||||
#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_ */
|
||||
|
|
Loading…
Add table
Reference in a new issue