xref: /openbmc/qemu/hw/arm/raspi.c (revision 2e664b45)
11df7d1f9SAndrew Baumann /*
21df7d1f9SAndrew Baumann  * Raspberry Pi emulation (c) 2012 Gregory Estrade
31df7d1f9SAndrew Baumann  * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous
41df7d1f9SAndrew Baumann  *
51df7d1f9SAndrew Baumann  * Rasperry Pi 2 emulation Copyright (c) 2015, Microsoft
61df7d1f9SAndrew Baumann  * Written by Andrew Baumann
71df7d1f9SAndrew Baumann  *
8bade5816SPekka Enberg  * Raspberry Pi 3 emulation Copyright (c) 2018 Zoltán Baldaszti
9bade5816SPekka Enberg  * Upstream code cleanup (c) 2018 Pekka Enberg
10bade5816SPekka Enberg  *
111df7d1f9SAndrew Baumann  * This code is licensed under the GNU GPLv2 and later.
121df7d1f9SAndrew Baumann  */
131df7d1f9SAndrew Baumann 
14c964b660SPeter Maydell #include "qemu/osdep.h"
15ff3dcf28SPeter Maydell #include "qemu/units.h"
16f5bb124eSPhilippe Mathieu-Daudé #include "qemu/cutils.h"
17da34e65cSMarkus Armbruster #include "qapi/error.h"
184771d756SPaolo Bonzini #include "cpu.h"
191df7d1f9SAndrew Baumann #include "hw/arm/bcm2836.h"
20cd6c9977SPhilippe Mathieu-Daudé #include "hw/registerfields.h"
211df7d1f9SAndrew Baumann #include "qemu/error-report.h"
221df7d1f9SAndrew Baumann #include "hw/boards.h"
231df7d1f9SAndrew Baumann #include "hw/loader.h"
2412ec8bd5SPeter Maydell #include "hw/arm/boot.h"
251df7d1f9SAndrew Baumann #include "sysemu/sysemu.h"
261df7d1f9SAndrew Baumann 
271df7d1f9SAndrew Baumann #define SMPBOOT_ADDR    0x300 /* this should leave enough space for ATAGS */
281df7d1f9SAndrew Baumann #define MVBAR_ADDR      0x400 /* secure vectors */
291df7d1f9SAndrew Baumann #define BOARDSETUP_ADDR (MVBAR_ADDR + 0x20) /* board setup code */
30bade5816SPekka Enberg #define FIRMWARE_ADDR_2 0x8000 /* Pi 2 loads kernel.img here by default */
31bade5816SPekka Enberg #define FIRMWARE_ADDR_3 0x80000 /* Pi 3 loads kernel.img here by default */
32ff72cb6bSPeter Maydell #define SPINTABLE_ADDR  0xd8 /* Pi 3 bootloader spintable */
331df7d1f9SAndrew Baumann 
34918c81a5SPhilippe Mathieu-Daudé /* Registered machine type (matches RPi Foundation bootloader and U-Boot) */
35918c81a5SPhilippe Mathieu-Daudé #define MACH_TYPE_BCM2708   3138
361df7d1f9SAndrew Baumann 
371df7d1f9SAndrew Baumann typedef struct RasPiState {
38926dcdf0SPeter Maydell     BCM283XState soc;
391df7d1f9SAndrew Baumann     MemoryRegion ram;
401df7d1f9SAndrew Baumann } RasPiState;
411df7d1f9SAndrew Baumann 
42cd6c9977SPhilippe Mathieu-Daudé /*
43cd6c9977SPhilippe Mathieu-Daudé  * Board revision codes:
44cd6c9977SPhilippe Mathieu-Daudé  * www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/
45cd6c9977SPhilippe Mathieu-Daudé  */
46cd6c9977SPhilippe Mathieu-Daudé FIELD(REV_CODE, REVISION,           0, 4);
47cd6c9977SPhilippe Mathieu-Daudé FIELD(REV_CODE, TYPE,               4, 8);
48cd6c9977SPhilippe Mathieu-Daudé FIELD(REV_CODE, PROCESSOR,         12, 4);
49cd6c9977SPhilippe Mathieu-Daudé FIELD(REV_CODE, MANUFACTURER,      16, 4);
50cd6c9977SPhilippe Mathieu-Daudé FIELD(REV_CODE, MEMORY_SIZE,       20, 3);
51cd6c9977SPhilippe Mathieu-Daudé FIELD(REV_CODE, STYLE,             23, 1);
52cd6c9977SPhilippe Mathieu-Daudé 
53f5bb124eSPhilippe Mathieu-Daudé static uint64_t board_ram_size(uint32_t board_rev)
54f5bb124eSPhilippe Mathieu-Daudé {
55f5bb124eSPhilippe Mathieu-Daudé     assert(FIELD_EX32(board_rev, REV_CODE, STYLE)); /* Only new style */
56f5bb124eSPhilippe Mathieu-Daudé     return 256 * MiB << FIELD_EX32(board_rev, REV_CODE, MEMORY_SIZE);
57f5bb124eSPhilippe Mathieu-Daudé }
58f5bb124eSPhilippe Mathieu-Daudé 
59cd6c9977SPhilippe Mathieu-Daudé static int board_processor_id(uint32_t board_rev)
60cd6c9977SPhilippe Mathieu-Daudé {
61cd6c9977SPhilippe Mathieu-Daudé     assert(FIELD_EX32(board_rev, REV_CODE, STYLE)); /* Only new style */
62cd6c9977SPhilippe Mathieu-Daudé     return FIELD_EX32(board_rev, REV_CODE, PROCESSOR);
63cd6c9977SPhilippe Mathieu-Daudé }
64cd6c9977SPhilippe Mathieu-Daudé 
65cd6c9977SPhilippe Mathieu-Daudé static int board_version(uint32_t board_rev)
66cd6c9977SPhilippe Mathieu-Daudé {
67cd6c9977SPhilippe Mathieu-Daudé     return board_processor_id(board_rev) + 1;
68cd6c9977SPhilippe Mathieu-Daudé }
69cd6c9977SPhilippe Mathieu-Daudé 
70*2e664b45SPhilippe Mathieu-Daudé static const char *board_soc_type(uint32_t board_rev)
71*2e664b45SPhilippe Mathieu-Daudé {
72*2e664b45SPhilippe Mathieu-Daudé     static const char *soc_types[] = {
73*2e664b45SPhilippe Mathieu-Daudé         NULL, TYPE_BCM2836, TYPE_BCM2837,
74*2e664b45SPhilippe Mathieu-Daudé     };
75*2e664b45SPhilippe Mathieu-Daudé     int proc_id = board_processor_id(board_rev);
76*2e664b45SPhilippe Mathieu-Daudé 
77*2e664b45SPhilippe Mathieu-Daudé     if (proc_id >= ARRAY_SIZE(soc_types) || !soc_types[proc_id]) {
78*2e664b45SPhilippe Mathieu-Daudé         error_report("Unsupported processor id '%d' (board revision: 0x%x)",
79*2e664b45SPhilippe Mathieu-Daudé                      proc_id, board_rev);
80*2e664b45SPhilippe Mathieu-Daudé         exit(1);
81*2e664b45SPhilippe Mathieu-Daudé     }
82*2e664b45SPhilippe Mathieu-Daudé     return soc_types[proc_id];
83*2e664b45SPhilippe Mathieu-Daudé }
84*2e664b45SPhilippe Mathieu-Daudé 
851df7d1f9SAndrew Baumann static void write_smpboot(ARMCPU *cpu, const struct arm_boot_info *info)
861df7d1f9SAndrew Baumann {
871df7d1f9SAndrew Baumann     static const uint32_t smpboot[] = {
881df7d1f9SAndrew Baumann         0xe1a0e00f, /*    mov     lr, pc */
891df7d1f9SAndrew Baumann         0xe3a0fe00 + (BOARDSETUP_ADDR >> 4), /* mov pc, BOARDSETUP_ADDR */
901df7d1f9SAndrew Baumann         0xee100fb0, /*    mrc     p15, 0, r0, c0, c0, 5;get core ID */
911df7d1f9SAndrew Baumann         0xe7e10050, /*    ubfx    r0, r0, #0, #2       ;extract LSB */
921df7d1f9SAndrew Baumann         0xe59f5014, /*    ldr     r5, =0x400000CC      ;load mbox base */
931df7d1f9SAndrew Baumann         0xe320f001, /* 1: yield */
941df7d1f9SAndrew Baumann         0xe7953200, /*    ldr     r3, [r5, r0, lsl #4] ;read mbox for our core*/
951df7d1f9SAndrew Baumann         0xe3530000, /*    cmp     r3, #0               ;spin while zero */
961df7d1f9SAndrew Baumann         0x0afffffb, /*    beq     1b */
971df7d1f9SAndrew Baumann         0xe7853200, /*    str     r3, [r5, r0, lsl #4] ;clear mbox */
981df7d1f9SAndrew Baumann         0xe12fff13, /*    bx      r3                   ;jump to target */
991df7d1f9SAndrew Baumann         0x400000cc, /* (constant: mailbox 3 read/clear base) */
1001df7d1f9SAndrew Baumann     };
1011df7d1f9SAndrew Baumann 
1021df7d1f9SAndrew Baumann     /* check that we don't overrun board setup vectors */
1031df7d1f9SAndrew Baumann     QEMU_BUILD_BUG_ON(SMPBOOT_ADDR + sizeof(smpboot) > MVBAR_ADDR);
1041df7d1f9SAndrew Baumann     /* check that board setup address is correctly relocated */
1051df7d1f9SAndrew Baumann     QEMU_BUILD_BUG_ON((BOARDSETUP_ADDR & 0xf) != 0
1061df7d1f9SAndrew Baumann                       || (BOARDSETUP_ADDR >> 4) >= 0x100);
1071df7d1f9SAndrew Baumann 
1080f073693SPhilippe Mathieu-Daudé     rom_add_blob_fixed_as("raspi_smpboot", smpboot, sizeof(smpboot),
1090f073693SPhilippe Mathieu-Daudé                           info->smp_loader_start,
1100f073693SPhilippe Mathieu-Daudé                           arm_boot_address_space(cpu, info));
1111df7d1f9SAndrew Baumann }
1121df7d1f9SAndrew Baumann 
113ff72cb6bSPeter Maydell static void write_smpboot64(ARMCPU *cpu, const struct arm_boot_info *info)
114ff72cb6bSPeter Maydell {
1150f073693SPhilippe Mathieu-Daudé     AddressSpace *as = arm_boot_address_space(cpu, info);
116ff72cb6bSPeter Maydell     /* Unlike the AArch32 version we don't need to call the board setup hook.
117ff72cb6bSPeter Maydell      * The mechanism for doing the spin-table is also entirely different.
118ff72cb6bSPeter Maydell      * We must have four 64-bit fields at absolute addresses
119ff72cb6bSPeter Maydell      * 0xd8, 0xe0, 0xe8, 0xf0 in RAM, which are the flag variables for
120ff72cb6bSPeter Maydell      * our CPUs, and which we must ensure are zero initialized before
121ff72cb6bSPeter Maydell      * the primary CPU goes into the kernel. We put these variables inside
122ff72cb6bSPeter Maydell      * a rom blob, so that the reset for ROM contents zeroes them for us.
123ff72cb6bSPeter Maydell      */
124ff72cb6bSPeter Maydell     static const uint32_t smpboot[] = {
125ff72cb6bSPeter Maydell         0xd2801b05, /*        mov     x5, 0xd8 */
126ff72cb6bSPeter Maydell         0xd53800a6, /*        mrs     x6, mpidr_el1 */
127ff72cb6bSPeter Maydell         0x924004c6, /*        and     x6, x6, #0x3 */
128ff72cb6bSPeter Maydell         0xd503205f, /* spin:  wfe */
129ff72cb6bSPeter Maydell         0xf86678a4, /*        ldr     x4, [x5,x6,lsl #3] */
130ff72cb6bSPeter Maydell         0xb4ffffc4, /*        cbz     x4, spin */
131ff72cb6bSPeter Maydell         0xd2800000, /*        mov     x0, #0x0 */
132ff72cb6bSPeter Maydell         0xd2800001, /*        mov     x1, #0x0 */
133ff72cb6bSPeter Maydell         0xd2800002, /*        mov     x2, #0x0 */
134ff72cb6bSPeter Maydell         0xd2800003, /*        mov     x3, #0x0 */
135ff72cb6bSPeter Maydell         0xd61f0080, /*        br      x4 */
136ff72cb6bSPeter Maydell     };
137ff72cb6bSPeter Maydell 
138ff72cb6bSPeter Maydell     static const uint64_t spintables[] = {
139ff72cb6bSPeter Maydell         0, 0, 0, 0
140ff72cb6bSPeter Maydell     };
141ff72cb6bSPeter Maydell 
1420f073693SPhilippe Mathieu-Daudé     rom_add_blob_fixed_as("raspi_smpboot", smpboot, sizeof(smpboot),
1430f073693SPhilippe Mathieu-Daudé                           info->smp_loader_start, as);
1440f073693SPhilippe Mathieu-Daudé     rom_add_blob_fixed_as("raspi_spintables", spintables, sizeof(spintables),
1450f073693SPhilippe Mathieu-Daudé                           SPINTABLE_ADDR, as);
146ff72cb6bSPeter Maydell }
147ff72cb6bSPeter Maydell 
1481df7d1f9SAndrew Baumann static void write_board_setup(ARMCPU *cpu, const struct arm_boot_info *info)
1491df7d1f9SAndrew Baumann {
1501df7d1f9SAndrew Baumann     arm_write_secure_board_setup_dummy_smc(cpu, info, MVBAR_ADDR);
1511df7d1f9SAndrew Baumann }
1521df7d1f9SAndrew Baumann 
1531df7d1f9SAndrew Baumann static void reset_secondary(ARMCPU *cpu, const struct arm_boot_info *info)
1541df7d1f9SAndrew Baumann {
1551df7d1f9SAndrew Baumann     CPUState *cs = CPU(cpu);
1561df7d1f9SAndrew Baumann     cpu_set_pc(cs, info->smp_loader_start);
1571df7d1f9SAndrew Baumann }
1581df7d1f9SAndrew Baumann 
1591df7d1f9SAndrew Baumann static void setup_boot(MachineState *machine, int version, size_t ram_size)
1601df7d1f9SAndrew Baumann {
1611df7d1f9SAndrew Baumann     static struct arm_boot_info binfo;
1621df7d1f9SAndrew Baumann     int r;
1631df7d1f9SAndrew Baumann 
164918c81a5SPhilippe Mathieu-Daudé     binfo.board_id = MACH_TYPE_BCM2708;
1651df7d1f9SAndrew Baumann     binfo.ram_size = ram_size;
166cc7d44c2SLike Xu     binfo.nb_cpus = machine->smp.cpus;
16701e02f5aSPeter Maydell 
16801e02f5aSPeter Maydell     if (version <= 2) {
16901e02f5aSPeter Maydell         /* The rpi1 and 2 require some custom setup code to run in Secure
17001e02f5aSPeter Maydell          * mode before booting a kernel (to set up the SMC vectors so
17101e02f5aSPeter Maydell          * that we get a no-op SMC; this is used by Linux to call the
17201e02f5aSPeter Maydell          * firmware for some cache maintenance operations.
17301e02f5aSPeter Maydell          * The rpi3 doesn't need this.
17401e02f5aSPeter Maydell          */
1751df7d1f9SAndrew Baumann         binfo.board_setup_addr = BOARDSETUP_ADDR;
1761df7d1f9SAndrew Baumann         binfo.write_board_setup = write_board_setup;
1771df7d1f9SAndrew Baumann         binfo.secure_board_setup = true;
1781df7d1f9SAndrew Baumann         binfo.secure_boot = true;
17901e02f5aSPeter Maydell     }
1801df7d1f9SAndrew Baumann 
181bade5816SPekka Enberg     /* Pi2 and Pi3 requires SMP setup */
182bade5816SPekka Enberg     if (version >= 2) {
1831df7d1f9SAndrew Baumann         binfo.smp_loader_start = SMPBOOT_ADDR;
184ff72cb6bSPeter Maydell         if (version == 2) {
1851df7d1f9SAndrew Baumann             binfo.write_secondary_boot = write_smpboot;
186ff72cb6bSPeter Maydell         } else {
187ff72cb6bSPeter Maydell             binfo.write_secondary_boot = write_smpboot64;
188ff72cb6bSPeter Maydell         }
1891df7d1f9SAndrew Baumann         binfo.secondary_cpu_reset_hook = reset_secondary;
1901df7d1f9SAndrew Baumann     }
1911df7d1f9SAndrew Baumann 
1921df7d1f9SAndrew Baumann     /* If the user specified a "firmware" image (e.g. UEFI), we bypass
1931df7d1f9SAndrew Baumann      * the normal Linux boot process
1941df7d1f9SAndrew Baumann      */
1951df7d1f9SAndrew Baumann     if (machine->firmware) {
196bade5816SPekka Enberg         hwaddr firmware_addr = version == 3 ? FIRMWARE_ADDR_3 : FIRMWARE_ADDR_2;
1971df7d1f9SAndrew Baumann         /* load the firmware image (typically kernel.img) */
198bade5816SPekka Enberg         r = load_image_targphys(machine->firmware, firmware_addr,
199bade5816SPekka Enberg                                 ram_size - firmware_addr);
2001df7d1f9SAndrew Baumann         if (r < 0) {
2011df7d1f9SAndrew Baumann             error_report("Failed to load firmware from %s", machine->firmware);
2021df7d1f9SAndrew Baumann             exit(1);
2031df7d1f9SAndrew Baumann         }
2041df7d1f9SAndrew Baumann 
205bade5816SPekka Enberg         binfo.entry = firmware_addr;
2061df7d1f9SAndrew Baumann         binfo.firmware_loaded = true;
2071df7d1f9SAndrew Baumann     }
2081df7d1f9SAndrew Baumann 
2092744ece8STao Xu     arm_load_kernel(ARM_CPU(first_cpu), machine, &binfo);
2101df7d1f9SAndrew Baumann }
2111df7d1f9SAndrew Baumann 
212cd6c9977SPhilippe Mathieu-Daudé static void raspi_init(MachineState *machine, uint32_t board_rev)
2131df7d1f9SAndrew Baumann {
2141df7d1f9SAndrew Baumann     RasPiState *s = g_new0(RasPiState, 1);
215cd6c9977SPhilippe Mathieu-Daudé     int version = board_version(board_rev);
216f5bb124eSPhilippe Mathieu-Daudé     uint64_t ram_size = board_ram_size(board_rev);
2175e9c2a8dSGrégory ESTRADE     uint32_t vcram_size;
218a55b53a2SAndrew Baumann     DriveInfo *di;
219a55b53a2SAndrew Baumann     BlockBackend *blk;
220a55b53a2SAndrew Baumann     BusState *bus;
221a55b53a2SAndrew Baumann     DeviceState *carddev;
2221df7d1f9SAndrew Baumann 
223f5bb124eSPhilippe Mathieu-Daudé     if (machine->ram_size != ram_size) {
224f5bb124eSPhilippe Mathieu-Daudé         char *size_str = size_to_str(ram_size);
225f5bb124eSPhilippe Mathieu-Daudé         error_report("Invalid RAM size, should be %s", size_str);
226f5bb124eSPhilippe Mathieu-Daudé         g_free(size_str);
227ff3dcf28SPeter Maydell         exit(1);
228ff3dcf28SPeter Maydell     }
229ff3dcf28SPeter Maydell 
230d0313798SPhilippe Mathieu-Daudé     object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc),
231*2e664b45SPhilippe Mathieu-Daudé                             board_soc_type(board_rev), &error_abort, NULL);
2321df7d1f9SAndrew Baumann 
2331df7d1f9SAndrew Baumann     /* Allocate and map RAM */
2341df7d1f9SAndrew Baumann     memory_region_allocate_system_memory(&s->ram, OBJECT(machine), "ram",
2351df7d1f9SAndrew Baumann                                          machine->ram_size);
2361df7d1f9SAndrew Baumann     /* FIXME: Remove when we have custom CPU address space support */
2371df7d1f9SAndrew Baumann     memory_region_add_subregion_overlap(get_system_memory(), 0, &s->ram, 0);
2381df7d1f9SAndrew Baumann 
2391df7d1f9SAndrew Baumann     /* Setup the SOC */
2401df7d1f9SAndrew Baumann     object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(&s->ram),
2411df7d1f9SAndrew Baumann                                    &error_abort);
242bade5816SPekka Enberg     object_property_set_int(OBJECT(&s->soc), board_rev, "board-rev",
243f0afa731SStephen Warren                             &error_abort);
2441df7d1f9SAndrew Baumann     object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_abort);
2451df7d1f9SAndrew Baumann 
246a55b53a2SAndrew Baumann     /* Create and plug in the SD cards */
247a55b53a2SAndrew Baumann     di = drive_get_next(IF_SD);
248a55b53a2SAndrew Baumann     blk = di ? blk_by_legacy_dinfo(di) : NULL;
249a55b53a2SAndrew Baumann     bus = qdev_get_child_bus(DEVICE(&s->soc), "sd-bus");
250a55b53a2SAndrew Baumann     if (bus == NULL) {
251a55b53a2SAndrew Baumann         error_report("No SD bus found in SOC object");
252a55b53a2SAndrew Baumann         exit(1);
253a55b53a2SAndrew Baumann     }
254a55b53a2SAndrew Baumann     carddev = qdev_create(bus, TYPE_SD_CARD);
255a55b53a2SAndrew Baumann     qdev_prop_set_drive(carddev, "drive", blk, &error_fatal);
256a55b53a2SAndrew Baumann     object_property_set_bool(OBJECT(carddev), true, "realized", &error_fatal);
257a55b53a2SAndrew Baumann 
258c5c6c47cSMarc-André Lureau     vcram_size = object_property_get_uint(OBJECT(&s->soc), "vcram-size",
2595e9c2a8dSGrégory ESTRADE                                           &error_abort);
260bade5816SPekka Enberg     setup_boot(machine, version, machine->ram_size - vcram_size);
261bade5816SPekka Enberg }
262bade5816SPekka Enberg 
263bade5816SPekka Enberg static void raspi2_init(MachineState *machine)
264bade5816SPekka Enberg {
265cd6c9977SPhilippe Mathieu-Daudé     raspi_init(machine, 0xa21041);
2661df7d1f9SAndrew Baumann }
2671df7d1f9SAndrew Baumann 
2681df7d1f9SAndrew Baumann static void raspi2_machine_init(MachineClass *mc)
2691df7d1f9SAndrew Baumann {
270fc78a990SPhilippe Mathieu-Daudé     mc->desc = "Raspberry Pi 2B";
2711df7d1f9SAndrew Baumann     mc->init = raspi2_init;
2721df7d1f9SAndrew Baumann     mc->block_default_type = IF_SD;
2731df7d1f9SAndrew Baumann     mc->no_parallel = 1;
2741df7d1f9SAndrew Baumann     mc->no_floppy = 1;
2751df7d1f9SAndrew Baumann     mc->no_cdrom = 1;
276926dcdf0SPeter Maydell     mc->max_cpus = BCM283X_NCPUS;
277926dcdf0SPeter Maydell     mc->min_cpus = BCM283X_NCPUS;
278926dcdf0SPeter Maydell     mc->default_cpus = BCM283X_NCPUS;
2792aee4107SPhilippe Mathieu-Daudé     mc->default_ram_size = 1 * GiB;
2804672cbd7SPeter Maydell     mc->ignore_memory_transaction_failures = true;
2811df7d1f9SAndrew Baumann };
2821df7d1f9SAndrew Baumann DEFINE_MACHINE("raspi2", raspi2_machine_init)
2831c3db49dSPekka Enberg 
2841c3db49dSPekka Enberg #ifdef TARGET_AARCH64
2851c3db49dSPekka Enberg static void raspi3_init(MachineState *machine)
2861c3db49dSPekka Enberg {
287cd6c9977SPhilippe Mathieu-Daudé     raspi_init(machine, 0xa02082);
2881c3db49dSPekka Enberg }
2891c3db49dSPekka Enberg 
2901c3db49dSPekka Enberg static void raspi3_machine_init(MachineClass *mc)
2911c3db49dSPekka Enberg {
292fc78a990SPhilippe Mathieu-Daudé     mc->desc = "Raspberry Pi 3B";
2931c3db49dSPekka Enberg     mc->init = raspi3_init;
2941c3db49dSPekka Enberg     mc->block_default_type = IF_SD;
2951c3db49dSPekka Enberg     mc->no_parallel = 1;
2961c3db49dSPekka Enberg     mc->no_floppy = 1;
2971c3db49dSPekka Enberg     mc->no_cdrom = 1;
298926dcdf0SPeter Maydell     mc->max_cpus = BCM283X_NCPUS;
299926dcdf0SPeter Maydell     mc->min_cpus = BCM283X_NCPUS;
300926dcdf0SPeter Maydell     mc->default_cpus = BCM283X_NCPUS;
3012aee4107SPhilippe Mathieu-Daudé     mc->default_ram_size = 1 * GiB;
3021c3db49dSPekka Enberg }
3031c3db49dSPekka Enberg DEFINE_MACHINE("raspi3", raspi3_machine_init)
3041c3db49dSPekka Enberg #endif
305