[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 53/86] mips:mips_fulong2e: drop RAM size fixup
From: |
Igor Mammedov |
Subject: |
[PATCH 53/86] mips:mips_fulong2e: drop RAM size fixup |
Date: |
Tue, 31 Dec 2019 14:03:37 +0100 |
If user provided non-sense RAM size, board will complain and
continue running with max RAM size supported.
Also RAM is going to be allocated by generic code, so it won't be
possible for board to fix things up for user.
Make it error message and exit to force user fix CLI,
instead of accepting non-sense CLI values.
Signed-off-by: Igor Mammedov <address@hidden>
---
hw/mips/mips_fulong2e.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 9eaa6e2..4a5e5b4 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -296,7 +296,6 @@ static void mips_fulong2e_init(MachineState *machine)
MemoryRegion *address_space_mem = get_system_memory();
MemoryRegion *ram = g_new(MemoryRegion, 1);
MemoryRegion *bios = g_new(MemoryRegion, 1);
- ram_addr_t ram_size = machine->ram_size;
long bios_size;
uint8_t *spd_data;
Error *err = NULL;
@@ -315,10 +314,14 @@ static void mips_fulong2e_init(MachineState *machine)
qemu_register_reset(main_cpu_reset, cpu);
/* TODO: support more than 256M RAM as highmem */
- ram_size = 256 * MiB;
+ if (machine->ram_size != 256 * MiB) {
+ error_report("Invalid RAM size, should be %ld", 256 * MiB);
+ exit(EXIT_FAILURE);
+ }
/* allocate RAM */
- memory_region_allocate_system_memory(ram, NULL, "fulong2e.ram", ram_size);
+ memory_region_allocate_system_memory(ram, NULL, "fulong2e.ram",
+ machine->ram_size);
memory_region_init_ram(bios, NULL, "fulong2e.bios", BIOS_SIZE,
&error_fatal);
memory_region_set_readonly(bios, true);
@@ -332,7 +335,7 @@ static void mips_fulong2e_init(MachineState *machine)
*/
if (kernel_filename) {
- loaderparams.ram_size = ram_size;
+ loaderparams.ram_size = machine->ram_size;
loaderparams.kernel_filename = kernel_filename;
loaderparams.kernel_cmdline = kernel_cmdline;
loaderparams.initrd_filename = initrd_filename;
@@ -378,7 +381,7 @@ static void mips_fulong2e_init(MachineState *machine)
}
/* Populate SPD eeprom data */
- spd_data = spd_data_generate(DDR, ram_size, &err);
+ spd_data = spd_data_generate(DDR, machine->ram_size, &err);
if (err) {
warn_report_err(err);
}
--
2.7.4
- [PATCH 36/86] arm:xilinx_zynq: drop RAM size fixup, (continued)
- [PATCH 36/86] arm:xilinx_zynq: drop RAM size fixup, Igor Mammedov, 2019/12/31
- [PATCH 43/86] hppa: drop RAM size fixup, Igor Mammedov, 2019/12/31
- [PATCH 34/86] arm:vexpress: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 39/86] arm:xlnx-zcu102: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 46/86] x86:pc: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 45/86] x86:microvm: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 48/86] lm32:milkymist: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 54/86] mips:mips_fulong2e: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 40/86] s390x:s390-virtio-ccw: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 53/86] mips:mips_fulong2e: drop RAM size fixup,
Igor Mammedov <=
- [PATCH 47/86] lm32:lm32_boards: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 55/86] mips:mips_jazz: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 52/86] mips:boston-cube: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 59/86] ppc:e500: drop RAM size fixup, Igor Mammedov, 2019/12/31
- [PATCH 51/86] m68k:next-cube: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 56/86] mips:mips_malta: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 63/86] ppc:pnv: use memdev for RAM, Igor Mammedov, 2019/12/31