hw/arm/raspi: Allow creating any Raspberry Pi machine
Subsystems (3)
v2 cover hw/arm/raspi: Allow creating any Raspberry Pi machine
Full rewrite of v1 [1], addressing Zoltan & Peter suggestion.
Introduce a generic 'raspi' machine, which takes a 'model' and 'revision' properties, and any memory size. The 'board_rev' register is filled appropriately.
Before, merge raspi4b.c within raspi.c (more is planned here with the MPCore refactor [2]).
Regards,
Phil.
[1] https://lore.kernel.org/qemu-devel/[email protected]/
[2] https://lore.kernel.org/qemu-devel/[email protected]/
Philippe Mathieu-Daudé (12):
hw/arm/raspi: Access SoC parent object using BCM283X_BASE() macro hw/arm/raspi: Merge model 4B with other models hw/arm/raspi: Unify RASPI_MACHINE types
hw/arm/raspi: Pass board_rev as argument to raspi_base_machine_init() hw/arm/raspi: Consider processor id in types[] array hw/arm/raspi: Consider network interface for B models hw/arm/raspi: Check ramsize is within chipset aperture hw/arm/raspi: Introduce generic Raspberry Pi machine hw/arm/raspi: Have the generic machine take a 'revision' property hw/arm/raspi: List models creatable by the generic 'raspi' machine hw/arm/raspi: Deprecate old raspiX machine names hw/arm/raspi: Support more models
docs/about/deprecated.rst | 13 + include/hw/arm/raspi_platform.h | 5 +- hw/arm/raspi.c | 383 ++++++++++++++++++++++-- hw/arm/raspi4b.c | 136 --------- tests/qtest/bcm2835-dma-test.c | 2 +- tests/qtest/bcm2835-i2c-test.c | 2 +- tests/qtest/boot-serial-test.c | 3 +- hw/arm/meson.build | 2 +- tests/functional/test_aarch64_raspi3.py | 5 +- tests/functional/test_aarch64_raspi4.py | 4 +- tests/functional/test_arm_raspi2.py | 4 +- 11 files changed, 385 insertions(+), 174 deletions(-) delete mode 100644 hw/arm/raspi4b.c
Signature · 1 line
2.47.1
PATCH v2 1/12 hw/arm/raspi: Access SoC parent object using BCM283X_BASE() macro
We shouldn't access a QOM parent object directly.
Use the appropriate type-cast macro.
--- hw/arm/raspi.c | 2 +- hw/arm/raspi4b.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
hw/arm/raspi.c +1 -1
@@ -312,7 +312,7 @@ void raspi_machine_init(MachineState *machine)object_initialize_child (OBJECT (machine),"soc" , soc,board_soc_type (mc->board_rev)); -raspi_base_machine_init (machine, &soc->parent_obj); +raspi_base_machine_init (machine,BCM283X_BASE (soc)); } void raspi_machine_class_common_init(MachineClass *mc,
hw/arm/raspi4b.c +1 -1
@@ -104,7 +104,7 @@ static void raspi4b_machine_init(MachineState *machine)object_initialize_child (OBJECT (machine),"soc" , soc,board_soc_type (mc->board_rev)); -raspi_base_machine_init (machine, &soc->parent_obj); +raspi_base_machine_init (machine,BCM283X_BASE (soc)); }static void raspi4b_machine_class_init (ObjectClass *oc,void *data)
Signature · 1 line
2.47.1
Re: [PATCH v2 01/12] hw/arm/raspi: Access SoC parent object using BCM283X_BASE() macro
Quoted 9 lines · Philippe Mathieu-Daudé
We shouldn't access a QOM parent object directly.
Use the appropriate type-cast macro.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/arm/raspi.c | 2 +- hw/arm/raspi4b.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
thanks
-- PMM
PATCH v2 2/12 hw/arm/raspi: Merge model 4B with other models
In reply to Philippe Mathieu-DaudéExcept we alter the device tree blob, the 4B
is just another raspi model.
--- hw/arm/raspi.c | 114 ++++++++++++++++++++++++++++++++++++- hw/arm/raspi4b.c | 136 --------------------------------------------- hw/arm/meson.build | 2 +- 3 files changed, 114 insertions(+), 138 deletions(-) delete mode 100644 hw/arm/raspi4b.c
hw/arm/raspi.c +113 -1
@@ -8,6 +8,10 @@* Raspberry Pi 3 emulation Copyright (c) 2018 Zoltán Baldaszti * Upstream code cleanup (c) 2018 Pekka Enberg * +* Raspberry Pi 4 emulation Copyright (C) 2022 Ovchinnikov Vitalii +* +* SPDX-License-Identifier: GPL-2.0-or-later +* * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */
@@ -16,20 +20,27 @@#include "qemu/units.h" #include "qemu/cutils.h" #include "qapi/error.h" +#include "qapi/visitor.h" #include "hw/arm/boot.h" #include "hw/arm/bcm2836.h" #include "hw/arm/bcm2838.h" #include "hw/arm/raspi_platform.h" +#include "hw/display/bcm2835_fb.h" #include "hw/registerfields.h" #include "qemu/error-report.h" #include "hw/boards.h" #include "hw/loader.h" #include "hw/arm/boot.h" #include "qom/object.h" +#include "system/device_tree.h" +#include <libfdt.h> #define TYPE_RASPI_MACHINE MACHINE_TYPE_NAME("raspi-common") OBJECT_DECLARE_SIMPLE_TYPE(RaspiMachineState, RASPI_MACHINE) +#define TYPE_RASPI4B_MACHINE MACHINE_TYPE_NAME("raspi4b") +OBJECT_DECLARE_SIMPLE_TYPE(Raspi4bMachineState, RASPI4B_MACHINE) +#define SMPBOOT_ADDR 0x300/* this should leave enough space for ATAGS */ #define MVBAR_ADDR 0x400/* secure vectors */ #define BOARDSETUP_ADDR (MVBAR_ADDR + 0x20)/* board setup code */
@@ -44,6 +55,11 @@ struct RaspiMachineState {BCM283XState soc; }; +struct Raspi4bMachineState { +RaspiBaseMachineState parent_obj; +BCM2838State soc; +}; +/* * Board revision codes: * www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/
@@ -301,6 +317,83 @@ void raspi_base_machine_init(MachineState *machine, boot_ram_size); } +#ifdef TARGET_AARCH64 +/* +* Add second memory region if board RAM amount exceeds VC base address +* (see https://datasheets.raspberrypi.com/bcm2711/bcm2711-peripherals.pdf +* 1.2 Address Map) +*/ +static int raspi4_add_memory_node (void *fdt,hwaddr mem_base,hwaddr mem_len) +{ +int ret; +uint32_t acells, scells; +char *nodename =g_strdup_printf ("/memory@%" PRIx64, mem_base); + + acells =qemu_fdt_getprop_cell (fdt,"/" ,"#address-cells" , +NULL , &error_fatal); + scells =qemu_fdt_getprop_cell (fdt,"/" ,"#size-cells" , +NULL , &error_fatal); +if (acells ==0 || scells ==0 ) { +fprintf (stderr,"dtb file invalid (#address-cells or #size-cells 0)\n" ); + ret =-1 ; + }else { +qemu_fdt_add_subnode (fdt, nodename); +qemu_fdt_setprop_string (fdt, nodename,"device_type" ,"memory" ); + ret =qemu_fdt_setprop_sized_cells (fdt, nodename,"reg" , + acells, mem_base, + scells, mem_len); + } + +g_free (nodename); +return ret; +} + +static void raspi4_modify_dtb (const struct arm_boot_info *info,void *fdt) +{ +uint64_t ram_size; + +/* Temporarily disable following devices until they are implemented */ +const char *nodes_to_remove[] = { +"brcm,bcm2711-pcie" , +"brcm,bcm2711-rng200" , +"brcm,bcm2711-thermal" , +"brcm,bcm2711-genet-v5" , + }; + +for (int i =0 ; i <ARRAY_SIZE (nodes_to_remove); i++) { +const char *dev_str = nodes_to_remove[i]; + +int offset =fdt_node_offset_by_compatible (fdt,-1 , dev_str); +if (offset >=0 ) { +if (!fdt_nop_node (fdt, offset)) { +warn_report ("bcm2711 dtc: %s has been disabled!" , dev_str); + } + } + } + + ram_size =board_ram_size (info->board_id); + +if (info->ram_size >UPPER_RAM_BASE ) { +raspi4_add_memory_node (fdt,UPPER_RAM_BASE , ram_size -UPPER_RAM_BASE ); + } +} + +static void raspi4b_machine_init (MachineState *machine) +{ +Raspi4bMachineState *s =RASPI4B_MACHINE (machine); +RaspiBaseMachineState *s_base =RASPI_BASE_MACHINE (machine); +RaspiBaseMachineClass *mc =RASPI_BASE_MACHINE_GET_CLASS (machine); +BCM2838State *soc = &s->soc; + + s_base->binfo.modify_dtb = raspi4_modify_dtb; + s_base->binfo.board_id = mc->board_rev; + +object_initialize_child (OBJECT (machine),"soc" , soc, +board_soc_type (mc->board_rev)); +raspi_base_machine_init (machine,BCM283X_BASE (soc)); +} +#endif /* TARGET_AARCH64 */ +void raspi_machine_init (MachineState *machine) {RaspiMachineState *s =RASPI_MACHINE (machine);
@@ -382,6 +475,20 @@ static void raspi3b_machine_class_init(ObjectClass *oc, void *data) rmc->board_rev =0xa02082 ;raspi_machine_class_init (mc, rmc->board_rev); }; + +static void raspi4b_machine_class_init (ObjectClass *oc,void *data) +{ +MachineClass *mc =MACHINE_CLASS (oc); +RaspiBaseMachineClass *rmc =RASPI_BASE_MACHINE_CLASS (oc); + +#if HOST_LONG_BITS ==32 + rmc->board_rev =0xa03111 ;/* Revision 1.1, 1 Gb RAM */ +#else + rmc->board_rev =0xb03115 ;/* Revision 1.5, 2 Gb RAM */ +#endif +raspi_machine_class_common_init (mc, rmc->board_rev); + mc->init = raspi4b_machine_init; +}#endif /* TARGET_AARCH64 */ static const TypeInfo raspi_machine_types[] = {
@@ -406,7 +513,12 @@ static const TypeInfo raspi_machine_types[] = { .name = MACHINE_TYPE_NAME("raspi3b"), .parent = TYPE_RASPI_MACHINE, .class_init = raspi3b_machine_class_init, -#endif + }, { + .name = MACHINE_TYPE_NAME("raspi4"), + .parent = TYPE_RASPI_BASE_MACHINE, + .instance_size = sizeof(Raspi4bMachineState), + .class_init = raspi4b_machine_class_init, +#endif /* TARGET_AARCH64 */ }, { .name = TYPE_RASPI_MACHINE, .parent = TYPE_RASPI_BASE_MACHINE,
hw/arm/raspi4b.c deleted +0 -136
136 lines not on this page · raw message
hw/arm/meson.build +1 -1
@@ -27,7 +27,7 @@ arm_ss.add(when: 'CONFIG_ALLWINNER_A10', if_true: files('allwinner-a10.c', 'cubi arm_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3.c', 'orangepi.c')) arm_ss.add(when: 'CONFIG_ALLWINNER_R40', if_true: files('allwinner-r40.c', 'bananapi_m2u.c')) arm_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2836.c', 'raspi.c')) -arm_ss.add(when: ['CONFIG_RASPI', 'TARGET_AARCH64'], if_true: files('bcm2838.c', 'raspi4b.c')) +arm_ss.add(when: ['CONFIG_RASPI', 'TARGET_AARCH64'], if_true: files('bcm2838.c')) arm_ss.add(when: 'CONFIG_STM32F100_SOC', if_true: files('stm32f100_soc.c')) arm_ss.add(when: 'CONFIG_STM32F205_SOC', if_true: files('stm32f205_soc.c')) arm_ss.add(when: 'CONFIG_STM32F405_SOC', if_true: files('stm32f405_soc.c'))
Signature · 1 line
2.47.1
Re: [PATCH v2 02/12] hw/arm/raspi: Merge model 4B with other models
Quoted 11 lines · Philippe Mathieu-Daudé
Except we alter the device tree blob, the 4B
is just another raspi model.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/arm/raspi.c | 114 ++++++++++++++++++++++++++++++++++++- hw/arm/raspi4b.c | 136 --------------------------------------------- hw/arm/meson.build | 2 +- 3 files changed, 114 insertions(+), 138 deletions(-) delete mode 100644 hw/arm/raspi4b.c
thanks
-- PMM
PATCH v2 3/12 hw/arm/raspi: Unify RASPI_MACHINE types
In reply to Philippe Mathieu-DaudéMerge Raspi4bMachineState within RaspiMachineState by using an unnamed union.
--- hw/arm/raspi.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-)
hw/arm/raspi.c +7 -14
@@ -38,9 +38,6 @@#define TYPE_RASPI_MACHINE MACHINE_TYPE_NAME("raspi-common") OBJECT_DECLARE_SIMPLE_TYPE(RaspiMachineState, RASPI_MACHINE) -#define TYPE_RASPI4B_MACHINE MACHINE_TYPE_NAME("raspi4b") -OBJECT_DECLARE_SIMPLE_TYPE(Raspi4bMachineState, RASPI4B_MACHINE) -#define SMPBOOT_ADDR 0x300/* this should leave enough space for ATAGS */ #define MVBAR_ADDR 0x400/* secure vectors */ #define BOARDSETUP_ADDR (MVBAR_ADDR + 0x20)/* board setup code */
@@ -49,15 +46,12 @@ OBJECT_DECLARE_SIMPLE_TYPE(Raspi4bMachineState, RASPI4B_MACHINE)#define SPINTABLE_ADDR 0xd8/* Pi 3 bootloader spintable */ struct RaspiMachineState { -/*< private >*/ RaspiBaseMachineState parent_obj; -/*< public >*/ -BCM283XState soc; -}; -struct Raspi4bMachineState { -RaspiBaseMachineState parent_obj; -BCM2838State soc; +union { +BCM283XState soc; +BCM2838State soc4; + }; };/*
@@ -380,10 +374,10 @@ static void raspi4_modify_dtb(const struct arm_boot_info *info, void *fdt)static void raspi4b_machine_init (MachineState *machine) { -Raspi4bMachineState *s =RASPI4B_MACHINE (machine); +RaspiMachineState *s =RASPI_MACHINE (machine);RaspiBaseMachineState *s_base =RASPI_BASE_MACHINE (machine);RaspiBaseMachineClass *mc =RASPI_BASE_MACHINE_GET_CLASS (machine); -BCM2838State *soc = &s->soc; +BCM2838State *soc = &s->soc4; s_base->binfo.modify_dtb = raspi4_modify_dtb; s_base->binfo.board_id = mc->board_rev;
@@ -515,8 +509,7 @@ static const TypeInfo raspi_machine_types[] = { .class_init = raspi3b_machine_class_init, }, { .name = MACHINE_TYPE_NAME("raspi4"), - .parent = TYPE_RASPI_BASE_MACHINE, - .instance_size = sizeof(Raspi4bMachineState), + .parent = TYPE_RASPI_MACHINE, .class_init = raspi4b_machine_class_init,#endif /* TARGET_AARCH64 */ }, {
Signature · 1 line
2.47.1
Re: [PATCH v2 03/12] hw/arm/raspi: Unify RASPI_MACHINE types
Quoted 30 lines · Philippe Mathieu-Daudé
Merge Raspi4bMachineState within RaspiMachineState by using an unnamed union.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/arm/raspi.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-)hw/arm/raspi.c +0
-5@@ -38,9 +38,6 @@#define TYPE_RASPI_MACHINE MACHINE_TYPE_NAME("raspi-common") OBJECT_DECLARE_SIMPLE_TYPE(RaspiMachineState, RASPI_MACHINE) -#define TYPE_RASPI4B_MACHINE MACHINE_TYPE_NAME("raspi4b") -OBJECT_DECLARE_SIMPLE_TYPE(Raspi4bMachineState, RASPI4B_MACHINE) -#define SMPBOOT_ADDR 0x300/* this should leave enough space for ATAGS */ #define MVBAR_ADDR 0x400/* secure vectors */ #define BOARDSETUP_ADDR (MVBAR_ADDR + 0x20)/* board setup code */ @@ -49,15 +46,12 @@ OBJECT_DECLARE_SIMPLE_TYPE(Raspi4bMachineState, RASPI4B_MACHINE)#define SPINTABLE_ADDR 0xd8/* Pi 3 bootloader spintable */ struct RaspiMachineState { -/*< private >*/ RaspiBaseMachineState parent_obj; -/*< public >*/
hw/arm/raspi.c OBJECT_DECLARE_SIMPLE_TYPE(Raspi4bMachineState, RASPI4B_MACHINE) · line 54
Quoted 10 lines
hw/arm/raspi.c +4
-5-BCM283XState soc; -}; -struct Raspi4bMachineState { -RaspiBaseMachineState parent_obj; -BCM2838State soc; +union { +BCM283XState soc; +BCM2838State soc4; + };
Do we have any other examples of using a union like this? I think it's exactly because the components are different for raspi4b that it has its own machine state struct.
thanks
-- PMM
PATCH v2 4/12 hw/arm/raspi: Pass board_rev as argument to raspi_base_machine_init()
In reply to Philippe Mathieu-DaudéSince callers already have reference to the RaspiBaseMachineClass, directly pass 'board_rev' as argument to raspi_base_machine_init().
--- include/hw/arm/raspi_platform.h | 2 +- hw/arm/raspi.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-)
include/hw/arm/raspi_platform.h +1 -1
@@ -58,7 +58,7 @@ void raspi_machine_init(MachineState *machine);typedef struct BCM283XBaseState BCM283XBaseState ;void raspi_base_machine_init (MachineState *machine, -BCM283XBaseState *soc); +BCM283XBaseState *soc,const uint32_t board_rev);void raspi_machine_class_common_init (MachineClass *mc,uint32_t board_rev);
hw/arm/raspi.c +3 -5
@@ -254,10 +254,8 @@ static void setup_boot(MachineState *machine, ARMCPU *cpu, }void raspi_base_machine_init (MachineState *machine, -BCM283XBaseState *soc) +BCM283XBaseState *soc,const uint32_t board_rev) { -RaspiBaseMachineClass *mc =RASPI_BASE_MACHINE_GET_CLASS (machine); -uint32_t board_rev = mc->board_rev;uint64_t ram_size =board_ram_size (board_rev);uint32_t vcram_base, vcram_size;size_t boot_ram_size;
@@ -384,7 +382,7 @@ static void raspi4b_machine_init(MachineState *machine)object_initialize_child (OBJECT (machine),"soc" , soc,board_soc_type (mc->board_rev)); - raspi_base_machine_init(machine, BCM283X_BASE(soc)); + raspi_base_machine_init(machine, BCM283X_BASE(soc), mc->board_rev); }#endif /* TARGET_AARCH64 */
@@ -399,7 +397,7 @@ void raspi_machine_init(MachineState *machine)object_initialize_child (OBJECT (machine),"soc" , soc,board_soc_type (mc->board_rev)); -raspi_base_machine_init (machine,BCM283X_BASE (soc)); +raspi_base_machine_init (machine,BCM283X_BASE (soc), mc->board_rev); } void raspi_machine_class_common_init(MachineClass *mc,
Signature · 1 line
2.47.1
PATCH v2 5/12 hw/arm/raspi: Consider processor id in types[] array
In reply to Philippe Mathieu-DaudéExpand the current type2model array to include the processor id.
Since the BCM2838 is indistinctly used as BCM2711 (within the Linux community), add it as alias in RaspiProcessorId.
--- hw/arm/raspi.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-)
hw/arm/raspi.c +27 -6
@@ -70,6 +70,7 @@ typedef enum RaspiProcessorId {PROCESSOR_ID_BCM2836 =1 ,PROCESSOR_ID_BCM2837 =2 ,PROCESSOR_ID_BCM2838 =3 , +PROCESSOR_ID_BCM2711 =3 , } RaspiProcessorId; static const struct {
@@ -82,6 +83,30 @@ static const struct { [PROCESSOR_ID_BCM2838] = {TYPE_BCM2838, BCM283X_NCPUS}, }; +static const struct { +RaspiProcessorId proc_id; +const char *model; +} types[] = { + {PROCESSOR_ID_BCM2835 ,"A" }, + {PROCESSOR_ID_BCM2835 ,"B" }, + {PROCESSOR_ID_BCM2835 ,"A+" }, + {PROCESSOR_ID_BCM2835 ,"B+" }, + {PROCESSOR_ID_BCM2836 ,"2B" }, + { }, + {PROCESSOR_ID_BCM2835 ,"CM1" }, + { }, + {PROCESSOR_ID_BCM2837 ,"3B" }, + {PROCESSOR_ID_BCM2835 ,"Zero" }, + {PROCESSOR_ID_BCM2837 ,"CM3" }, + { }, + {PROCESSOR_ID_BCM2835 ,"ZeroW" }, + {PROCESSOR_ID_BCM2837 ,"3B+" }, + {PROCESSOR_ID_BCM2837 ,"3A+" }, + { }, + {PROCESSOR_ID_BCM2837 ,"CM3+" }, + {PROCESSOR_ID_BCM2711 ,"4B" }, +}; +uint64_t board_ram_size (uint32_t board_rev) {assert (FIELD_EX32 (board_rev,REV_CODE ,STYLE ));/* Only new style */
@@ -110,16 +135,12 @@ static int cores_count(uint32_t board_rev)static const char *board_type (uint32_t board_rev) { -static const char *types[] = { -"A" ,"B" ,"A+" ,"B+" ,"2B" ,"Alpha" ,"CM1" ,NULL ,"3B" ,"Zero" , -"CM3" ,NULL ,"Zero W" ,"3B+" ,"3A+" ,NULL ,"CM3+" ,"4B" , - };assert (FIELD_EX32 (board_rev,REV_CODE ,STYLE ));/* Only new style */ int bt =FIELD_EX32 (board_rev,REV_CODE ,TYPE ); -if (bt >=ARRAY_SIZE (types) || !types[bt]) { +if (bt >=ARRAY_SIZE (types) || !types[bt].model) {return "Unknown" ; } -return types[bt]; +return types[bt].model; }static void write_smpboot (ARMCPU *cpu,const struct arm_boot_info *info)
Signature · 1 line
2.47.1
Re: [PATCH v2 05/12] hw/arm/raspi: Consider processor id in types[] array
Quoted 5 lines · Philippe Mathieu-Daudé
Expand the current type2model array to include the processor id.
Since the BCM2838 is indistinctly used as BCM2711 (within the Linux community), add it as alias in RaspiProcessorId.
Can you explain this in more detail? Presumably the hardware itself has whatever ID it has...
Quoted 1 line
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
-- PMM
PATCH v2 6/12 hw/arm/raspi: Consider network interface for B models
In reply to Philippe Mathieu-DaudéRaspberry Pi 'B' models have an ethernet chipset (the LAN9512). Since we don't yet model it, add a /* TODO */ comment.
--- hw/arm/raspi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
hw/arm/raspi.c +14 -0
@@ -143,6 +143,16 @@ static const char *board_type(uint32_t board_rev)return types[bt].model; } +static bool is_model_b (uint32_t board_rev) +{ +return !!strchr (board_type (board_rev),'B' ); +} + +static bool has_enet (uint32_t board_rev) +{ +return is_model_b (board_rev); +} +static void write_smpboot (ARMCPU *cpu,const struct arm_boot_info *info) {static const ARMInsnFixup smpboot[] = {
@@ -304,6 +314,10 @@ void raspi_base_machine_init(MachineState *machine, machine->kernel_cmdline, &error_abort);qdev_realize (DEVICE (soc),NULL , &error_fatal); +if (has_enet (board_rev)) { +/* TODO: model LAN9512 and wire over USB2 */ + } +/* Create and plug in the SD cards */ di =drive_get (IF_SD ,0 ,0 ); blk = di ?blk_by_legacy_dinfo (di) :NULL ;
Signature · 1 line
2.47.1
Re: [PATCH v2 06/12] hw/arm/raspi: Consider network interface for B models
Quoted 31 lines · Philippe Mathieu-Daudé
Raspberry Pi 'B' models have an ethernet chipset (the LAN9512). Since we don't yet model it, add a /* TODO */ comment.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/arm/raspi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)hw/arm/raspi.c +10
-0@@ -143,6 +143,16 @@ static const char *board_type(uint32_t board_rev)return types[bt].model; } +static bool is_model_b (uint32_t board_rev) +{ +return !!strchr (board_type (board_rev),'B' ); +} + +static bool has_enet (uint32_t board_rev) +{ +return is_model_b (board_rev); +} +static void write_smpboot (ARMCPU *cpu,const struct arm_boot_info *info) {static const ARMInsnFixup smpboot[] = {
hw/arm/raspi.c void raspi_base_machine_init(MachineState *machine, · line 320
Quoted 7 lines
hw/arm/raspi.c +4
-0@@ -304,6 +314,10 @@ void raspi_base_machine_init(MachineState *machine, machine->kernel_cmdline, &error_abort);qdev_realize (DEVICE (soc),NULL , &error_fatal); +if (has_enet (board_rev)) { +/* TODO: model LAN9512 and wire over USB2 */ + } +
Why bother, if we don't do anything anyway? We can say in the TODO comment
/* TODO: "B" models have a LAN9512 on the USB bus */
thanks
-- PMM
PATCH v2 7/12 hw/arm/raspi: Check ramsize is within chipset aperture
In reply to Philippe Mathieu-DaudéAdd the 'max_ramsize' field to the soc_property[] array, corresponding to the maximum DRAM size a SoC can map.
--- hw/arm/raspi.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
hw/arm/raspi.c +17 -4
@@ -76,11 +76,12 @@ typedef enum RaspiProcessorId {static const struct {const char *type;int cores_count; +uint64_t max_ramsize; } soc_property[] = { - [PROCESSOR_ID_BCM2835 ] = {TYPE_BCM2835 ,1 }, - [PROCESSOR_ID_BCM2836 ] = {TYPE_BCM2836 ,BCM283X_NCPUS }, - [PROCESSOR_ID_BCM2837 ] = {TYPE_BCM2837 ,BCM283X_NCPUS }, - [PROCESSOR_ID_BCM2838 ] = {TYPE_BCM2838 ,BCM283X_NCPUS }, + [PROCESSOR_ID_BCM2835 ] = {TYPE_BCM2835 ,1 ,512 * MiB}, + [PROCESSOR_ID_BCM2836 ] = {TYPE_BCM2836 ,BCM283X_NCPUS ,1 * GiB}, + [PROCESSOR_ID_BCM2837 ] = {TYPE_BCM2837 ,BCM283X_NCPUS ,1 * GiB}, + [PROCESSOR_ID_BCM2838 ] = {TYPE_BCM2838 ,BCM283X_NCPUS ,8 * GiB}, }; static const struct {
@@ -133,6 +134,11 @@ static int cores_count(uint32_t board_rev)return soc_property[board_processor_id (board_rev)].cores_count; } +static uint64_t ramsize_max (uint32_t board_rev) +{ +return soc_property[board_processor_id (board_rev)].max_ramsize; +} +static const char *board_type (uint32_t board_rev) {assert (FIELD_EX32 (board_rev,REV_CODE ,STYLE ));/* Only new style */
@@ -294,6 +300,7 @@ void raspi_base_machine_init(MachineState *machine,BlockBackend *blk;BusState *bus;DeviceState *carddev; +uint64_t max_ramsize;if (machine->ram_size != ram_size) {char *size_str =size_to_str (ram_size);
@@ -301,6 +308,12 @@ void raspi_base_machine_init(MachineState *machine,g_free (size_str);exit (1 ); } + max_ramsize =ramsize_max (board_rev); +if (ram_size > max_ramsize) { + g_autofree char *max_ramsize_str = size_to_str(max_ramsize); +error_report ("At most %s of RAM can be used" , max_ramsize_str); +exit (1 ); + }/* FIXME: Remove when we have custom CPU address space support */ memory_region_add_subregion_overlap(get_system_memory(), 0,
Signature · 1 line
2.47.1
Re: [PATCH v2 07/12] hw/arm/raspi: Check ramsize is within chipset aperture
Quoted 51 lines · Philippe Mathieu-Daudé
Add the '
max_ramsize' field to the soc_property[] array, corresponding to the maximum DRAM size a SoC can map.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/arm/raspi.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)hw/arm/raspi.c +11
-4@@ -76,11 +76,12 @@ typedef enum RaspiProcessorId {static const struct {const char *type;int cores_count; +uint64_t max_ramsize; } soc_property[] = { - [PROCESSOR_ID_BCM2835 ] = {TYPE_BCM2835 ,1 }, - [PROCESSOR_ID_BCM2836 ] = {TYPE_BCM2836 ,BCM283X_NCPUS }, - [PROCESSOR_ID_BCM2837 ] = {TYPE_BCM2837 ,BCM283X_NCPUS }, - [PROCESSOR_ID_BCM2838 ] = {TYPE_BCM2838 ,BCM283X_NCPUS }, + [PROCESSOR_ID_BCM2835 ] = {TYPE_BCM2835 ,1 ,512 * MiB}, + [PROCESSOR_ID_BCM2836 ] = {TYPE_BCM2836 ,BCM283X_NCPUS ,1 * GiB}, + [PROCESSOR_ID_BCM2837 ] = {TYPE_BCM2837 ,BCM283X_NCPUS ,1 * GiB}, + [PROCESSOR_ID_BCM2838 ] = {TYPE_BCM2838 ,BCM283X_NCPUS ,8 * GiB}, }; static const struct {@@ -133,6 +134,11 @@ static int cores_count(uint32_t board_rev)return soc_property[board_processor_id (board_rev)].cores_count; } +static uint64_t ramsize_max (uint32_t board_rev) +{ +return soc_property[board_processor_id (board_rev)].max_ramsize; +} +static const char *board_type (uint32_t board_rev) {assert (FIELD_EX32 (board_rev,REV_CODE ,STYLE ));/* Only new style */ @@ -294,6 +300,7 @@ void raspi_base_machine_init(MachineState *machine,BlockBackend *blk;BusState *bus;DeviceState *carddev; +uint64_t max_ramsize;if (machine->ram_size != ram_size) {char *size_str =size_to_str (ram_size);
hw/arm/raspi.c void raspi_base_machine_init(MachineState *machine, · line 315
Quoted 8 lines
hw/arm/raspi.c +5
-0@@ -301,6 +308,12 @@ void raspi_base_machine_init(MachineState *machine,g_free (size_str);exit (1 ); } + max_ramsize =ramsize_max (board_rev); +if (ram_size > max_ramsize) { + g_autofree char *max_ramsize_str = size_to_str(max_ramsize); +error_report ("At most %s of RAM can be used" , max_ramsize_str); +exit (1 );
Indent error?
hw/arm/raspi.c void raspi_base_machine_init(MachineState *machine, · line 316
Quoted 1 line
hw/arm/raspi.c +1
-0+ }
Otherwise
thanks
-- PMM
PATCH v2 8/12 hw/arm/raspi: Introduce generic Raspberry Pi machine
In reply to Philippe Mathieu-DaudéThe generic 'raspi' machine takes a 'model' argument and create the machine associated with the model, with the RAM size requested (or default to the minimum of 256MB if not precised).
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2797
--- include/hw/arm/raspi_platform.h | 3 +- hw/arm/raspi.c | 127 ++++++++++++++++++++++++++++---- 2 files changed, 115 insertions(+), 15 deletions(-)
include/hw/arm/raspi_platform.h +2 -1
@@ -41,7 +41,8 @@ OBJECT_DECLARE_TYPE(RaspiBaseMachineState, RaspiBaseMachineClass,struct RaspiBaseMachineState {/*< private >*/ MachineState parent_obj; -/*< public >*/ + +uint32_t board_rev;struct arm_boot_info binfo; };
hw/arm/raspi.c +113 -14
145 lines not on this page · raw message
Signature · 1 line
2.47.1
PATCH v2 9/12 hw/arm/raspi: Have the generic machine take a 'revision' property
In reply to Philippe Mathieu-DaudéAdd a property to specify the board revision. This allows to create a Raspberry Pi 2B with BCM2836 SoC (rev 1.0 and 1.1) or BCM2837 (rev 1.2 up to 1.5).
--- hw/arm/raspi.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
hw/arm/raspi.c +39 -0
@@ -491,6 +491,10 @@ static void raspi_update_board_rev(RaspiBaseMachineState *s) model_index =FIELD_EX32 (s->board_rev,REV_CODE ,TYPE ); proc = types[model_index].proc_id; +if (model_index ==4 &&FIELD_EX32 (s->board_rev,REV_CODE ,REVISION ) >1 ) { +/* 2B rev 1.0 and 1.1 have BCM2836, 1.2+ have BCM2837 */ + proc =PROCESSOR_ID_BCM2837 ; + } s->board_rev =FIELD_DP32 (s->board_rev,REV_CODE ,PROCESSOR , proc); ms->smp.max_cpus = soc_property[proc].cores_count;
@@ -517,6 +521,35 @@ static char *raspi_get_machine_model(Object *obj, Error **errp)return g_strdup (types[FIELD_EX32 (s->board_rev,REV_CODE ,TYPE )].model); } +static void raspi_set_machine_rev (Object *obj,const char *value,Error **errp) +{ +RaspiBaseMachineState *s; +int rev; + +if (strlen (value) !=3 || value[0 ] !='1' || value[1 ] !='.' ) { +error_setg (errp,"Invalid revision" ); +return ; + } + rev = value[2 ] -'0' ; +if (rev <0 || rev >5 ) { +error_setg (errp,"Invalid revision" ); +return ; + } + + s =RASPI_BASE_MACHINE (obj); + s->board_rev =FIELD_DP32 (s->board_rev,REV_CODE ,REVISION , rev); + +return raspi_update_board_rev (s); +} + +static char *raspi_get_machine_rev (Object *obj,Error **errp) +{ +RaspiBaseMachineState *s =RASPI_BASE_MACHINE (obj); + +return g_strdup_printf ("1.%u" , +FIELD_EX32 (s->board_rev,REV_CODE ,REVISION )); +} +static void raspi_generic_machine_class_init (ObjectClass *oc,void *data) {MachineClass *mc =MACHINE_CLASS (oc);
@@ -540,6 +573,12 @@ static void raspi_generic_machine_class_init(ObjectClass *oc, void *data) raspi_get_machine_model, raspi_set_machine_model);object_class_property_set_description (oc,"model" ,"Set machine model." ); +object_class_property_add_str (oc,"revision" , + raspi_get_machine_rev, + raspi_set_machine_rev); +object_class_property_set_description (oc,"revision" , +"Set machine revision. " +"Valid values are 1.0 to 1.5" ); };
Signature · 1 line
2.47.1
PATCH v2 10/12 hw/arm/raspi: List models creatable by the generic 'raspi' machine
In reply to Philippe Mathieu-DaudéAll the following models can be created (with different RAM size):
$ qemu-system-aarch64 -M raspi qemu-system-aarch64: Missing model, try -M raspi,model=help $ qemu-system-aarch64 -M raspi,model=help Available models (processor): - A (BCM2835) - B (BCM2835) - A+ (BCM2835) - B+ (BCM2835) - 2B (BCM2836) - CM1 (BCM2835) - 3B (BCM2837) - Zero (BCM2835) - CM3 (BCM2837) - ZeroW (BCM2835) - 3B+ (BCM2837) - 3A+ (BCM2837) - CM3+ (BCM2837) - 4B (BCM2838)
--- hw/arm/raspi.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-)
hw/arm/raspi.c +27 -1
@@ -445,7 +445,7 @@ static void raspi_generic_machine_init(MachineState *ms)uint64_t max_ramsize;if (!board_rev) { -error_report ("Missing model" ); +error_report ("Missing model, try -M raspi,model=help" );exit (1 ); }
@@ -500,8 +500,33 @@ static void raspi_update_board_rev(RaspiBaseMachineState *s) ms->smp.max_cpus = soc_property[proc].cores_count; } +static void raspi_list_machine_models (void ) +{ +printf ("Available models (processor):\n" ); + +for (unsigned i =0 ; i <ARRAY_SIZE (types); i++) { +const char *soc_type; + +if (!types[i].model) { +continue ; + } + + soc_type = soc_property[types[i].proc_id].type; +if (!soc_type) { +continue ; + } +printf ("- %-10s (BCM%s)\n" , + types[i].model, + soc_property[types[i].proc_id].type +3 ); + } +} +static void raspi_set_machine_model (Object *obj,const char *value,Error **errp) { +if (!strcmp (value,"help" )) { +raspi_list_machine_models (); +exit (0 ); + }for (unsigned i =0 ; i <ARRAY_SIZE (types); i++) {if (types[i].model && !strcmp (value, types[i].model)) {RaspiBaseMachineState *s =RASPI_BASE_MACHINE (obj);
@@ -512,6 +537,7 @@ static void raspi_set_machine_model(Object *obj, const char *value, Error **errp } }error_setg (errp,"Invalid model" ); +error_append_hint (errp,"Use model=help to list models.\n" ); }static char *raspi_get_machine_model (Object *obj,Error **errp)
Signature · 1 line
2.47.1
PATCH v2 11/12 hw/arm/raspi: Deprecate old raspiX machine names
In reply to Philippe Mathieu-DaudéAll previous raspi machines can be created using the generic machine. Deprecate the old names to maintain a single one. Update the tests.
---
QOM HMP introspection test fails because without the 'model' argument set, no machine is created...
$ qemu-system-aarch64 -M raspi qemu-system-aarch64: Missing model, try -M raspi,model=help --- docs/about/deprecated.rst | 13 +++++++++++++ hw/arm/raspi.c | 5 +++++ tests/qtest/bcm2835-dma-test.c | 2 +- tests/qtest/bcm2835-i2c-test.c | 2 +- tests/qtest/boot-serial-test.c | 3 ++- tests/functional/test_aarch64_raspi3.py | 5 ++--- tests/functional/test_aarch64_raspi4.py | 4 ++-- tests/functional/test_arm_raspi2.py | 4 ++-- 8 files changed, 28 insertions(+), 10 deletions(-)
docs/about/deprecated.rst +13 -0
@@ -257,6 +257,19 @@ Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma Both ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` were added for little endian CPUs. Big endian support is not tested. +ARM ``raspi0``, ``raspi1ap``, ``raspi2b``, ``raspi3ap``, ``raspi3b`` and ``raspi4b`` machines (since 10.0) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +The Raspberry Pi machines have been unified under the generic ``raspi`` machine, +which takes the model as argument. + + - `raspi0`` is now an alias for ``raspi,model=Zero`` + - `raspi1ap`` is now an alias for ``raspi,model=1A+`` + - `raspi2b`` is now an alias for ``raspi,model=2B`` + - `raspi3ap`` is now an alias for ``raspi,model=3A+`` + - `raspi3b`` is now an alias for ``raspi,model=3B`` + - `raspi4b`` is now an alias for ``raspi,model=4B`` + Backend options ---------------
hw/arm/raspi.c +5 -0
@@ -637,6 +637,7 @@ static void raspi0_machine_class_init(ObjectClass *oc, void *data) rmc->board_rev =0x920092 ;/* Revision 1.2 */ raspi_machine_class_init (mc, rmc->board_rev); + mc->deprecation_reason ="-M raspi,model=Zero" ; };static void raspi1ap_machine_class_init (ObjectClass *oc,void *data)
@@ -646,6 +647,7 @@ static void raspi1ap_machine_class_init(ObjectClass *oc, void *data) rmc->board_rev =0x900021 ;/* Revision 1.1 */ raspi_machine_class_init (mc, rmc->board_rev); + mc->deprecation_reason ="-M raspi,model=A+ (-m 512m)" ; };static void raspi2b_machine_class_init (ObjectClass *oc,void *data)
@@ -655,6 +657,7 @@ static void raspi2b_machine_class_init(ObjectClass *oc, void *data) rmc->board_rev =0xa21041 ;raspi_machine_class_init (mc, rmc->board_rev); + mc->deprecation_reason ="-M raspi,model=2B -m 1g" ; };#ifdef TARGET_AARCH64
@@ -665,6 +668,7 @@ static void raspi3ap_machine_class_init(ObjectClass *oc, void *data) rmc->board_rev =0x9020e0 ;/* Revision 1.0 */ raspi_machine_class_init (mc, rmc->board_rev); + mc->deprecation_reason ="-M raspi,model=3A+ -m 512m" ; };static void raspi3b_machine_class_init (ObjectClass *oc,void *data)
@@ -674,6 +678,7 @@ static void raspi3b_machine_class_init(ObjectClass *oc, void *data) rmc->board_rev =0xa02082 ;raspi_machine_class_init (mc, rmc->board_rev); + mc->deprecation_reason ="-M raspi,model=3B -m 1g" ; };static void raspi4b_machine_class_init (ObjectClass *oc,void *data)
tests/qtest/bcm2835-dma-test.c +1 -1
@@ -111,7 +111,7 @@ int main(int argc, char **argv)g_test_init (&argc, &argv,NULL );qtest_add_func ("/bcm2835/dma/test_interrupts" , bcm2835_dma_test_interrupts); -qtest_start ("-machine raspi3b" ); +qtest_start ("-machine raspi,model=3B -m 1g" ); ret =g_test_run ();qtest_end ();return ret;
tests/qtest/bcm2835-i2c-test.c +1 -1
@@ -104,7 +104,7 @@ int main(int argc, char **argv) }/* Run I2C tests with TMP105 slaves on all three buses */ -qtest_start ("-M raspi3b " +qtest_start ("-M raspi,model=3B -m 1g " "-device tmp105,address=0x50,bus=i2c-bus.0 " "-device tmp105,address=0x50,bus=i2c-bus.1 " "-device tmp105,address=0x50,bus=i2c-bus.2" );
tests/qtest/boot-serial-test.c +2 -1
@@ -188,7 +188,8 @@ static const testdef_t tests[] = { sizeof(kernel_pls3adsp1800), kernel_pls3adsp1800 }, {"microblazeel" ,"petalogix-ml605" ,"" ,"TT" , sizeof(kernel_plml605), kernel_plml605 }, - { "arm", "raspi2b", "", "TT", sizeof(bios_raspi2), 0, bios_raspi2 }, + { "arm", "raspi,model=2B -m 1g", "", "TT", + sizeof(bios_raspi2), 0, bios_raspi2 }, { "aarch64", "virt", "-cpu max", "TT", sizeof(kernel_aarch64), kernel_aarch64 }, { "arm", "microbit", "", "T", sizeof(kernel_nrf51), kernel_nrf51 },
tests/functional/test_aarch64_raspi3.py +2 -3
@@ -21,10 +21,9 @@ def test_aarch64_raspi3_atf(self): efi_name = 'RPI_EFI.fd' efi_fd = self.archive_extract(self.ASSET_RPI3_UEFI, member=efi_name) - self.set_machine('raspi3b') + self.set_machine('raspi,model=3B -m 1g') self.vm.set_console(console_index=1) - self.vm.add_args('-cpu', 'cortex-a53', - '-nodefaults', + self.vm.add_args('-nodefaults', '-device', f'loader,file={efi_fd},force-raw=true') self.vm.launch() self.wait_for_console_pattern('version UEFI Firmware v1.15')
tests/functional/test_aarch64_raspi4.py +2 -2
@@ -34,7 +34,7 @@ def test_arm_raspi4(self): dtb_path = self.archive_extract(self.ASSET_KERNEL_20190215, member='boot/bcm2711-rpi-4-b.dtb') - self.set_machine('raspi4b') + self.set_machine('raspi,model=4B -m 1g') self.vm.set_console() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + 'earlycon=pl011,mmio32,0xfe201000 ' +
@@ -64,7 +64,7 @@ def test_arm_raspi4_initrd(self): member='boot/bcm2711-rpi-4-b.dtb') initrd_path = self.uncompress(self.ASSET_INITRD) - self.set_machine('raspi4b') + self.set_machine('raspi,model=4B -m 1g') self.vm.set_console() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + 'earlycon=pl011,mmio32,0xfe201000 ' +
tests/functional/test_arm_raspi2.py +2 -2
@@ -39,7 +39,7 @@ def do_test_arm_raspi2(self, uart_id): dtb_path = self.archive_extract(self.ASSET_KERNEL_20190215, member='boot/bcm2709-rpi-2-b.dtb') - self.set_machine('raspi2b') + self.set_machine('raspi,model=2B -m 1g') self.vm.set_console() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + serial_kernel_cmdline[uart_id] +
@@ -65,7 +65,7 @@ def test_arm_raspi2_initrd(self): member='boot/bcm2709-rpi-2-b.dtb') initrd_path = self.uncompress(self.ASSET_INITRD) - self.set_machine('raspi2b') + self.set_machine('raspi,model=2B -m 1g') self.vm.set_console() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + 'earlycon=pl011,0x3f201000 console=ttyAMA0 '
Signature · 1 line
2.47.1
Re: [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names
Quoted 17 lines · Philippe Mathieu-Daudé
All previous raspi machines can be created using the generic machine. Deprecate the old names to maintain a single one. Update the tests.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>docs/about/deprecated.rst +2
-0@@ -257,6 +257,19 @@ Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma Both ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` were added for little endian CPUs. Big endian support is not tested. +ARM ``raspi0``, ``raspi1ap``, ``raspi2b``, ``raspi3ap``, ``raspi3b`` and ``raspi4b`` machines (since 10.0) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
docs/about/deprecated.rst Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma · line 271
Quoted 10 lines
docs/about/deprecated.rst +10
-0+ +The Raspberry Pi machines have been unified under the generic ``raspi`` machine, +which takes the model as argument. + + - `raspi0`` is now an alias for ``raspi,model=Zero`` + - `raspi1ap`` is now an alias for ``raspi,model=1A+`` + - `raspi2b`` is now an alias for ``raspi,model=2B`` + - `raspi3ap`` is now an alias for ``raspi,model=3A+`` + - `raspi3b`` is now an alias for ``raspi,model=3B`` + - `raspi4b`` is now an alias for ``raspi,model=4B``
This is not how we typically handle "we have a bunch of different devboards in one family". What's wrong with the existing set of machine names?
Can we implement "support more than just the fixed amount of RAM" by making '-m 2G' work, without changing the machine names at all, please?
thanks
-- PMM
Re: [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names
Quoted 16 lines · Peter Maydell
Quoted 15 lines · Philippe Mathieu-Daudé
All previous raspi machines can be created using the generic machine. Deprecate the old names to maintain a single one. Update the tests.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>docs/about/deprecated.rst +0
-0@@ -257,6 +257,19 @@ Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma Both ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` were added for little endian CPUs. Big endian support is not tested.
Quoted 16 lines
docs/about/deprecated.rst Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma · line 271
Quoted 12 lines
docs/about/deprecated.rst +12
-0+ARM ``raspi0``, ``raspi1ap``, ``raspi2b``, ``raspi3ap``, ``raspi3b`` and ``raspi4b`` machines (since 10.0) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +The Raspberry Pi machines have been unified under the generic ``raspi`` machine, +which takes the model as argument. + + - `raspi0`` is now an alias for ``raspi,model=Zero`` + - `raspi1ap`` is now an alias for ``raspi,model=1A+`` + - `raspi2b`` is now an alias for ``raspi,model=2B`` + - `raspi3ap`` is now an alias for ``raspi,model=3A+`` + - `raspi3b`` is now an alias for ``raspi,model=3B`` + - `raspi4b`` is now an alias for ``raspi,model=4B``This is not how we typically handle "we have a bunch of different devboards in one family". What's wrong with the existing set of machine names?
Zoltan and you don't want to add more machine names, then you don't want a generic machine. This is very confusing.
See previous patch:
$ qemu-system-aarch64 -M raspi,model=help Available models (processor): - A (BCM2835) - B (BCM2835) - A+ (BCM2835) - B+ (BCM2835) - CM1 (BCM2835) - Zero (BCM2835) - ZeroW (BCM2835) - 2B (BCM2836) - 3B (BCM2837) - CM3 (BCM2837) - 3B+ (BCM2837) - 3A+ (BCM2837) - CM3+ (BCM2837) - 4B (BCM2838)
Can we or not add the other raspi models?
Quoted 3 lines
Can we implement "support more than just the fixed amount of RAM" by making '-m 2G' work, without changing the machine names at all, please?
We surely can if we find developers motivated to do the work.
Regards,
Phil.
Re: [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names
Quoted 34 lines · Philippe Mathieu-Daudé
Quoted 16 lines · Peter Maydell
Quoted 15 lines · Philippe Mathieu-Daudé
All previous raspi machines can be created using the generic machine. Deprecate the old names to maintain a single one. Update the tests.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>docs/about/deprecated.rst +0
-0@@ -257,6 +257,19 @@ Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma Both ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` were added for little endian CPUs. Big endian support is not tested.Quoted 16 lines
docs/about/deprecated.rst Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma · line 271
Quoted 12 lines
docs/about/deprecated.rst +12
-0+ARM ``raspi0``, ``raspi1ap``, ``raspi2b``, ``raspi3ap``, ``raspi3b`` and ``raspi4b`` machines (since 10.0) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +The Raspberry Pi machines have been unified under the generic ``raspi`` machine, +which takes the model as argument. + + - `raspi0`` is now an alias for ``raspi,model=Zero`` + - `raspi1ap`` is now an alias for ``raspi,model=1A+`` + - `raspi2b`` is now an alias for ``raspi,model=2B`` + - `raspi3ap`` is now an alias for ``raspi,model=3A+`` + - `raspi3b`` is now an alias for ``raspi,model=3B`` + - `raspi4b`` is now an alias for ``raspi,model=4B``This is not how we typically handle "we have a bunch of different devboards in one family". What's wrong with the existing set of machine names?
Quoted 2 lines
Zoltan and you don't want to add more machine names, then you don't want a generic machine. This is very confusing.
IMHO we can have distinct machines for each model, but *NOT* have further machines for each RAM size within a model.
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names
Quoted 35 lines · Daniel P. Berrangé
Quoted 34 lines · Philippe Mathieu-Daudé
Quoted 32 lines · Peter Maydell
Quoted 17 lines · Philippe Mathieu-Daudé
All previous raspi machines can be created using the generic machine. Deprecate the old names to maintain a single one. Update the tests.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>docs/about/deprecated.rst +2
-0@@ -257,6 +257,19 @@ Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma Both ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` were added for little endian CPUs. Big endian support is not tested. +ARM ``raspi0``, ``raspi1ap``, ``raspi2b``, ``raspi3ap``, ``raspi3b`` and ``raspi4b`` machines (since 10.0) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''docs/about/deprecated.rst Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma · line 271
Quoted 10 lines
docs/about/deprecated.rst +10
-0+ +The Raspberry Pi machines have been unified under the generic ``raspi`` machine, +which takes the model as argument. + + - `raspi0`` is now an alias for ``raspi,model=Zero`` + - `raspi1ap`` is now an alias for ``raspi,model=1A+`` + - `raspi2b`` is now an alias for ``raspi,model=2B`` + - `raspi3ap`` is now an alias for ``raspi,model=3A+`` + - `raspi3b`` is now an alias for ``raspi,model=3B`` + - `raspi4b`` is now an alias for ``raspi,model=4B``This is not how we typically handle "we have a bunch of different devboards in one family". What's wrong with the existing set of machine names?
Quoted 6 lines
Quoted 2 lines
Zoltan and you don't want to add more machine names, then you don't want a generic machine. This is very confusing.
IMHO we can have distinct machines for each model, but *NOT* have further machines for each RAM size within a model.
Got it. Unfortunately I spent more than my hobbyist time credit doing this, so if I find the motivation to revisit, it'll be later.
Still, having machine memory size depending on the host config was a bad design choice IMHO, as we test different setup depending on the host being used, so not really a "reproducible" setup.
Re: [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names
Quoted 43 lines · Philippe Mathieu-Daudé
Quoted 35 lines · Daniel P. Berrangé
Quoted 34 lines · Philippe Mathieu-Daudé
Quoted 32 lines · Peter Maydell
Quoted 17 lines · Philippe Mathieu-Daudé
All previous raspi machines can be created using the generic machine. Deprecate the old names to maintain a single one. Update the tests.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>docs/about/deprecated.rst +2
-0@@ -257,6 +257,19 @@ Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma Both ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` were added for little endian CPUs. Big endian support is not tested. +ARM ``raspi0``, ``raspi1ap``, ``raspi2b``, ``raspi3ap``, ``raspi3b`` and ``raspi4b`` machines (since 10.0) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''docs/about/deprecated.rst Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma · line 271
Quoted 10 lines
docs/about/deprecated.rst +10
-0+ +The Raspberry Pi machines have been unified under the generic ``raspi`` machine, +which takes the model as argument. + + - `raspi0`` is now an alias for ``raspi,model=Zero`` + - `raspi1ap`` is now an alias for ``raspi,model=1A+`` + - `raspi2b`` is now an alias for ``raspi,model=2B`` + - `raspi3ap`` is now an alias for ``raspi,model=3A+`` + - `raspi3b`` is now an alias for ``raspi,model=3B`` + - `raspi4b`` is now an alias for ``raspi,model=4B``This is not how we typically handle "we have a bunch of different devboards in one family". What's wrong with the existing set of machine names?
Quoted 6 lines
Quoted 2 lines
Zoltan and you don't want to add more machine names, then you don't want a generic machine. This is very confusing.
IMHO we can have distinct machines for each model, but *NOT* have further machines for each RAM size within a model.
Quoted 6 lines
Got it. Unfortunately I spent more than my hobbyist time credit doing this, so if I find the motivation to revisit, it'll be later.
Still, having machine memory size depending on the host config was a bad design choice IMHO, as we test different setup depending on the host being used, so not really a "reproducible" setup.
Yeah that one is a bit ugly. IMHO it would be valid to just leave it defaulted to 2GB and ensure we get a nice error message on 32-bit hosts, letting users override RAM size if they desire. Or its just another reason to kill 32-bit hosts
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names
In reply to Daniel P. BerrangéQuoted 36 lines · Daniel P. Berrangé
Quoted 34 lines · Philippe Mathieu-Daudé
Quoted 32 lines · Peter Maydell
Quoted 17 lines · Philippe Mathieu-Daudé
All previous raspi machines can be created using the generic machine. Deprecate the old names to maintain a single one. Update the tests.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>docs/about/deprecated.rst +2
-0@@ -257,6 +257,19 @@ Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma Both ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` were added for little endian CPUs. Big endian support is not tested. +ARM ``raspi0``, ``raspi1ap``, ``raspi2b``, ``raspi3ap``, ``raspi3b`` and ``raspi4b`` machines (since 10.0) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''docs/about/deprecated.rst Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma · line 271
Quoted 10 lines
docs/about/deprecated.rst +10
-0+ +The Raspberry Pi machines have been unified under the generic ``raspi`` machine, +which takes the model as argument. + + - `raspi0`` is now an alias for ``raspi,model=Zero`` + - `raspi1ap`` is now an alias for ``raspi,model=1A+`` + - `raspi2b`` is now an alias for ``raspi,model=2B`` + - `raspi3ap`` is now an alias for ``raspi,model=3A+`` + - `raspi3b`` is now an alias for ``raspi,model=3B`` + - `raspi4b`` is now an alias for ``raspi,model=4B``This is not how we typically handle "we have a bunch of different devboards in one family". What's wrong with the existing set of machine names?
Quoted 6 lines
Quoted 2 lines
Zoltan and you don't want to add more machine names, then you don't want a generic machine. This is very confusing.
IMHO we can have distinct machines for each model, but *NOT* have further machines for each RAM size within a model.
Yes, this was what I was intending to suggest. Apologies if I was confusing with what I said the previous time round.
thanks
-- PMM
Re: [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names
Quoted 40 lines · Peter Maydell
Quoted 39 lines · Daniel P. Berrangé
Quoted 36 lines · Philippe Mathieu-Daudé
Quoted 16 lines · Peter Maydell
Quoted 15 lines · Philippe Mathieu-Daudé
All previous raspi machines can be created using the generic machine. Deprecate the old names to maintain a single one. Update the tests.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>docs/about/deprecated.rst +0
-0@@ -257,6 +257,19 @@ Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma Both ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` were added for little endian CPUs. Big endian support is not tested.Quoted 16 lines
docs/about/deprecated.rst Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma · line 271
Quoted 12 lines
docs/about/deprecated.rst +12
-0+ARM ``raspi0``, ``raspi1ap``, ``raspi2b``, ``raspi3ap``, ``raspi3b`` and ``raspi4b`` machines (since 10.0) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +The Raspberry Pi machines have been unified under the generic ``raspi`` machine, +which takes the model as argument. + + - `raspi0`` is now an alias for ``raspi,model=Zero`` + - `raspi1ap`` is now an alias for ``raspi,model=1A+`` + - `raspi2b`` is now an alias for ``raspi,model=2B`` + - `raspi3ap`` is now an alias for ``raspi,model=3A+`` + - `raspi3b`` is now an alias for ``raspi,model=3B`` + - `raspi4b`` is now an alias for ``raspi,model=4B``This is not how we typically handle "we have a bunch of different devboards in one family". What's wrong with the existing set of machine names?
Zoltan and you don't want to add more machine names, then you don't want a generic machine. This is very confusing.
Quoted 6 lines
Quoted 3 lines
IMHO we can have distinct machines for each model, but *NOT* have further machines for each RAM size within a model.
Yes, this was what I was intending to suggest. Apologies if I was confusing with what I said the previous time round.
OK, let's see if we understand each other correctly as developer, before explaining to users, taking the 4B model as example.
The 4B come in 4 physical variants, depending on the amount of
DRAM: 1G, 2G, 4G and 8G.
We can not allocate 2G on 32-bit hosts, so to have a reproducible guest behavior on 32/64-bit hosts, it makes sense to takes the model with 1G of DRAM as default for the 'raspi4b' machine.
If an user specify -m 2G ... 8G, we can adapt the 'board_rev' register to expose the corresponding amount of ram. Now, how / where to tell the users 1/ the default is 1G, and 2/ they can use 2/4/8G?
Re: [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names
Quoted 13 lines · Philippe Mathieu-Daudé
Quoted 7 lines · Peter Maydell
Quoted 3 lines · Daniel P. Berrangé
IMHO we can have distinct machines for each model, but *NOT* have further machines for each RAM size within a model.
Yes, this was what I was intending to suggest. Apologies if I was confusing with what I said the previous time round.
OK, let's see if we understand each other correctly as developer, before explaining to users, taking the 4B model as example.
Quoted 6 lines
The 4B come in 4 physical variants, depending on the amount of
DRAM: 1G, 2G, 4G and 8G.We can not allocate 2G on 32-bit hosts, so to have a reproducible guest behavior on 32/64-bit hosts, it makes sense to takes the model with 1G of DRAM as default for the 'raspi4b' machine.
At the moment we create the 1GB version on 32-bit hosts and the 2GB version on 64-bit hosts. I dunno that that's ideal, but I think it's probably best not to change that at this point.
Quoted 4 lines
If an user specify -m 2G ... 8G, we can adapt the '
board_rev' register to expose the corresponding amount of ram. Now, how / where to tell the users 1/ the default is 1G, and 2/ they can use 2/4/8G?
In the documentation: docs/system/arm/raspi.rst .
-- PMM
Re: [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names
Quoted 17 lines · Peter Maydell
Quoted 16 lines · Philippe Mathieu-Daudé
Quoted 7 lines · Peter Maydell
Quoted 3 lines · Daniel P. Berrangé
IMHO we can have distinct machines for each model, but *NOT* have further machines for each RAM size within a model.
Yes, this was what I was intending to suggest. Apologies if I was confusing with what I said the previous time round.
OK, let's see if we understand each other correctly as developer, before explaining to users, taking the 4B model as example.
The 4B come in 4 physical variants, depending on the amount of
DRAM: 1G, 2G, 4G and 8G.
Quoted 7 lines
Quoted 3 lines
We can not allocate 2G on 32-bit hosts, so to have a reproducible guest behavior on 32/64-bit hosts, it makes sense to takes the model with 1G of DRAM as default for the 'raspi4b' machine.
At the moment we create the 1GB version on 32-bit hosts and the 2GB version on 64-bit hosts. I dunno that that's ideal, but I think it's probably best not to change that at this point.
Well this is annoying in my "unify qemu-system-{arm/aarch64}" effort, but not a blocker.
Quoted 6 lines
Quoted 4 lines
If an user specify -m 2G ... 8G, we can adapt the '
board_rev' register to expose the corresponding amount of ram. Now, how / where to tell the users 1/ the default is 1G, and 2/ they can use 2/4/8G?In the documentation:
docs/system/arm/raspi.rst.
OK.
Back to this series, please tell me if patches 1-7 aren't useful or if you prefer them in a separate series:
hw/arm/raspi: Access SoC parent object using BCM283X_BASE() macro hw/arm/raspi: Merge model 4B with other models hw/arm/raspi: Unify RASPI_MACHINE types
hw/arm/raspi: Pass board_rev as argument to raspi_base_machine_init() hw/arm/raspi: Consider processor id in types[] array hw/arm/raspi: Consider network interface for B models hw/arm/raspi: Check ramsize is within chipset aperture
Thanks,
Phil.
Re: [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names
In reply to Philippe Mathieu-DaudéQuoted 38 lines · Philippe Mathieu-Daudé
Quoted 28 lines · Peter Maydell
Quoted 27 lines · Philippe Mathieu-Daudé
All previous raspi machines can be created using the generic machine. Deprecate the old names to maintain a single one. Update the tests.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>docs/about/deprecated.rst +0
-0@@ -257,6 +257,19 @@ Big-Endian variants of MicroBlaze ``petalogix-ml605``and ``xlnx-zynqmp-pmu`` ma
Both ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` were added for little
endian
CPUs. Big endian support is not tested.+ARM ``raspi0``, ``raspi1ap``, ``raspi2b``, ``raspi3ap``, ``raspi3b`` and
``raspi4b`` machines (since 10.0) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''docs/about/deprecated.rst +2
-0+ +The Raspberry Pi machines have been unified under the generic ``raspi``machine,
docs/about/deprecated.rst +4
-0+which takes the model as argument. + + - `raspi0`` is now an alias for ``raspi,model=Zero`` + - `raspi1ap`` is now an alias for ``raspi,model=1A+``Quoted 8 lines
docs/about/deprecated.rst Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma · line 271
Quoted 4 lines
docs/about/deprecated.rst +4
-0+ - `raspi2b`` is now an alias for ``raspi,model=2B`` + - `raspi3ap`` is now an alias for ``raspi,model=3A+`` + - `raspi3b`` is now an alias for ``raspi,model=3B`` + - `raspi4b`` is now an alias for ``raspi,model=4B``This is not how we typically handle "we have a bunch of different devboards in one family". What's wrong with the existing set of machine names?
Quoted 2 lines
Zoltan and you don't want to add more machine names, then you don't want a generic machine. This is very confusing.
I said either rastpi4b,revision=1.4 or -machine raspi4b -memory 4g would be better IMHO. Peter perefers -memory which is also fine with me. I just don't think adding more machine names where only RAM size is different would be better than using -memory for that as usual.
Regards,
BALATON Zoltan
Quoted 32 lines
See previous patch:
$ qemu-system-aarch64 -M raspi,model=help Available models (processor): - A (BCM2835) - B (BCM2835) - A+ (BCM2835) - B+ (BCM2835) - CM1 (BCM2835) - Zero (BCM2835) - ZeroW (BCM2835) - 2B (BCM2836) - 3B (BCM2837) - CM3 (BCM2837) - 3B+ (BCM2837) - 3A+ (BCM2837) - CM3+ (BCM2837) - 4B (BCM2838)Can we or not add the other raspi models?
Quoted 3 lines
Can we implement "support more than just the fixed amount of RAM" by making '-m 2G' work, without changing the machine names at all, please?
We surely can if we find developers motivated to do the work.
Regards,
Phil.
Re: [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names
Quoted 40 lines · BALATON Zoltan
Quoted 39 lines · Philippe Mathieu-Daudé
Quoted 37 lines · Peter Maydell
Quoted 23 lines · Philippe Mathieu-Daudé
All previous raspi machines can be created using the generic machine. Deprecate the old names to maintain a single one. Update the tests.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>docs/about/deprecated.rst +0
-0@@ -257,6 +257,19 @@ Big-Endian variants of MicroBlaze``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma
Both ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` were added
for little endian
CPUs. Big endian support is not tested.+ARM ``raspi0``, ``raspi1ap``, ``raspi2b``, ``raspi3ap``,
``raspi3b`` and ``raspi4b`` machines (since 10.0) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''docs/about/deprecated.rst +2
-0+ +The Raspberry Pi machines have been unified under the generic``raspi`` machine,
docs/about/deprecated.rst Big-Endian variants of MicroBlaze ``petalogix-ml605`` and ``xlnx-zynqmp-pmu`` ma · line 271
Quoted 8 lines
docs/about/deprecated.rst +8
-0+which takes the model as argument. + + - `raspi0`` is now an alias for ``raspi,model=Zero`` + - `raspi1ap`` is now an alias for ``raspi,model=1A+`` + - `raspi2b`` is now an alias for ``raspi,model=2B`` + - `raspi3ap`` is now an alias for ``raspi,model=3A+`` + - `raspi3b`` is now an alias for ``raspi,model=3B`` + - `raspi4b`` is now an alias for ``raspi,model=4B``This is not how we typically handle "we have a bunch of different devboards in one family". What's wrong with the existing set of machine names?
Quoted 7 lines
Quoted 2 lines
Zoltan and you don't want to add more machine names, then you don't want a generic machine. This is very confusing.
I said either rastpi4b,revision=1.4 or -machine raspi4b -memory 4g would be better IMHO. Peter perefers -memory which is also fine with me. I just don't think adding more machine names where only RAM size is different would be better than using -memory for that as usual.
I'm the annoying root cause of this as I had filed this:
https://gitlab.com/qemu-project/qemu/-/issues/2797#note_2326724893
Which was really a question around providing more memory options, I'm happy seeing a lot of thought has gone into my simple question/request, but it's unclear reading this thread where things concluded.
Is there a chance these are in a branch that one could build
against to get consensus on some of this style vs substance stuff? I get it that it's tricky and do generally think that one could restrict armhf vs arm64 to having 64-bit support in the (hypervisor) OS.
I was wanting to tweak some disk images before imaging a bunch
of nvme for use and saw using kvm/qemu as a straightforward path to doing that on my laptop (x86_64) before firing up a bunch of compute modules etc.
- Jared
[i'm not subscribed to the qemu-dev list, so I expect mailman will hold/bounce me]
Signature · 2 lines
Jared Mauch | pgp key available via finger from [email protected] clue++; | http://puck.nether.net/~jared/ My statements are only mine.
PATCH v2 12/12 hw/arm/raspi: Support more models
In reply to Philippe Mathieu-DaudéAllow to create the following machines:
- Zero2W
- 400
- CM4 and CM4S
Fill the arrays with the BCM2712-based machines (raspi5), but since we don't model the SoC, these machines can't be created (and aren't listed in the 'help' output).
List taken from:
https://github.com/raspberrypi/documentation/blob/9b126446a5/documentation/asciidoc/computers/raspberry-pi/revision-codes.adoc
--- hw/arm/raspi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
hw/arm/raspi.c +13 -0
@@ -71,6 +71,7 @@ typedef enum RaspiProcessorId {PROCESSOR_ID_BCM2837 =2 ,PROCESSOR_ID_BCM2838 =3 ,PROCESSOR_ID_BCM2711 =3 , +PROCESSOR_ID_BCM2712 =4 , } RaspiProcessorId; static const struct {
@@ -82,6 +83,7 @@ static const struct { [PROCESSOR_ID_BCM2836] = {TYPE_BCM2836, BCM283X_NCPUS, 1 * GiB}, [PROCESSOR_ID_BCM2837] = {TYPE_BCM2837, BCM283X_NCPUS, 1 * GiB}, [PROCESSOR_ID_BCM2838] = {TYPE_BCM2838, BCM283X_NCPUS, 8 * GiB}, + [PROCESSOR_ID_BCM2712] = {NULL, BCM283X_NCPUS, 16 * GiB}, }; static const struct {
@@ -106,6 +108,17 @@ static const struct { { }, {PROCESSOR_ID_BCM2837, "CM3+"}, {PROCESSOR_ID_BCM2711, "4B"}, + {PROCESSOR_ID_BCM2837, "Zero2W"}, + {PROCESSOR_ID_BCM2711, "400"}, + + {PROCESSOR_ID_BCM2711, "CM4"}, + {PROCESSOR_ID_BCM2711, "CM4S"}, + { }, + {PROCESSOR_ID_BCM2712, "5"}, + {PROCESSOR_ID_BCM2712, "CM5"}, + {PROCESSOR_ID_BCM2712, "500"}, + {PROCESSOR_ID_BCM2712, "CM5lite"}, + { }, };uint64_t board_ram_size (uint32_t board_rev)
Signature · 1 line
2.47.1