@@ -44,12 +44,17 @@ static void prusa_mini_init(MachineState *machine)
44
44
45
45
dev = qdev_new (TYPE_STM32F407_SOC );
46
46
qdev_prop_set_string (dev , "cpu-type" , ARM_CPU_TYPE_NAME ("cortex-m4" ));
47
+ qdev_prop_set_uint32 (dev ,"sram-size" , machine -> ram_size );
47
48
sysbus_realize (SYS_BUS_DEVICE (dev ), & error_fatal );
48
49
STM32F407State * SOC = STM32F407_SOC (dev );
49
50
// We (ab)use the kernel command line to piggyback custom arguments into QEMU.
50
51
// Parse those now.
51
52
arghelper_setargs (machine -> kernel_cmdline );
52
-
53
+ int default_flash_size = FLASH_SIZE ;
54
+ if (arghelper_is_arg ("4x_flash" ))
55
+ {
56
+ default_flash_size <<=2 ; // quadruple the flash size for debug code.
57
+ }
53
58
if (arghelper_is_arg ("appendix" )) {
54
59
SOC -> gpio [GPIO_A ].idr_mask |= 0x2000 ;
55
60
}
@@ -71,13 +76,13 @@ static void prusa_mini_init(MachineState *machine)
71
76
load_image_targphys (machine -> kernel_filename ,0x20000 - 64 ,get_image_size (machine -> kernel_filename ));
72
77
armv7m_load_kernel (ARM_CPU (first_cpu ),
73
78
BOOTLOADER_IMAGE ,
74
- FLASH_SIZE );
79
+ default_flash_size );
75
80
}
76
81
else // Raw bin or ELF file, load directly.
77
82
{
78
83
armv7m_load_kernel (ARM_CPU (first_cpu ),
79
84
machine -> kernel_filename ,
80
- FLASH_SIZE );
85
+ default_flash_size );
81
86
}
82
87
}
83
88
@@ -314,25 +319,17 @@ static void prusa_mini_init(MachineState *machine)
314
319
315
320
static void prusa_mini_machine_init (MachineClass * mc )
316
321
{
317
- mc -> desc = "Prusa Mini Board " ;
322
+ mc -> desc = "Prusa Mini" ;
318
323
mc -> init = prusa_mini_init ;
324
+ mc -> default_ram_size = F407_SRAM_SIZE ;
319
325
}
320
326
321
327
DEFINE_MACHINE ("prusa-mini" , prusa_mini_machine_init )
322
328
323
-
324
- // TODO - remove this at some point in the future...
325
-
326
- static void buddy_init (MachineState * machine )
327
- {
328
- error_setg (& error_fatal , "-machine prusabuddy has been deprecated. Please use -machine prusa-mini instead.\n" );
329
- };
330
-
331
-
332
329
static void buddy_machine_init (MachineClass * mc )
333
330
{
334
- mc -> desc = "Prusa Mini Board (Deprecated) " ;
335
- mc -> init = buddy_init ;
331
+ mc -> desc = "Prusa Mini Board" ;
332
+ mc -> deprecation_reason = "prusabuddy has been deprecated because it's a board, not a machine. Use -machine prusa-mini instead" ;
336
333
}
337
334
338
335
DEFINE_MACHINE ("prusabuddy" , buddy_machine_init )
0 commit comments