xref: /qemu/hw/sh4/r2d.c (revision fa1d36df7466ebbef0331b79d0ce3c5e140695c9)
10d78f544Sths /*
20d78f544Sths  * Renesas SH7751R R2D-PLUS emulation
30d78f544Sths  *
40d78f544Sths  * Copyright (c) 2007 Magnus Damm
5b319feb7Saurel32  * Copyright (c) 2008 Paul Mundt
60d78f544Sths  *
70d78f544Sths  * Permission is hereby granted, free of charge, to any person obtaining a copy
80d78f544Sths  * of this software and associated documentation files (the "Software"), to deal
90d78f544Sths  * in the Software without restriction, including without limitation the rights
100d78f544Sths  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
110d78f544Sths  * copies of the Software, and to permit persons to whom the Software is
120d78f544Sths  * furnished to do so, subject to the following conditions:
130d78f544Sths  *
140d78f544Sths  * The above copyright notice and this permission notice shall be included in
150d78f544Sths  * all copies or substantial portions of the Software.
160d78f544Sths  *
170d78f544Sths  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
180d78f544Sths  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
190d78f544Sths  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
200d78f544Sths  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
210d78f544Sths  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
220d78f544Sths  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
230d78f544Sths  * THE SOFTWARE.
240d78f544Sths  */
250d78f544Sths 
2683c9f4caSPaolo Bonzini #include "hw/sysbus.h"
2783c9f4caSPaolo Bonzini #include "hw/hw.h"
280d09e41aSPaolo Bonzini #include "hw/sh4/sh.h"
29bd2be150SPeter Maydell #include "hw/devices.h"
309c17d615SPaolo Bonzini #include "sysemu/sysemu.h"
3183c9f4caSPaolo Bonzini #include "hw/boards.h"
3283c9f4caSPaolo Bonzini #include "hw/pci/pci.h"
331422e32dSPaolo Bonzini #include "net/net.h"
3447b43a1fSPaolo Bonzini #include "sh7750_regs.h"
3583c9f4caSPaolo Bonzini #include "hw/ide.h"
3683c9f4caSPaolo Bonzini #include "hw/loader.h"
3783c9f4caSPaolo Bonzini #include "hw/usb.h"
380d09e41aSPaolo Bonzini #include "hw/block/flash.h"
39*fa1d36dfSMarkus Armbruster #include "sysemu/block-backend.h"
409c17d615SPaolo Bonzini #include "sysemu/blockdev.h"
41022c62cbSPaolo Bonzini #include "exec/address-spaces.h"
4256839a19SAurelien Jarno 
4356839a19SAurelien Jarno #define FLASH_BASE 0x00000000
4456839a19SAurelien Jarno #define FLASH_SIZE 0x02000000
450d78f544Sths 
460d78f544Sths #define SDRAM_BASE 0x0c000000 /* Physical location of SDRAM: Area 3 */
470d78f544Sths #define SDRAM_SIZE 0x04000000
480d78f544Sths 
49ffd39257Sblueswir1 #define SM501_VRAM_SIZE 0x800000
50ffd39257Sblueswir1 
5173f19035SAurelien Jarno #define BOOT_PARAMS_OFFSET 0x0010000
52e8afa065Saurel32 /* CONFIG_BOOT_LINK_OFFSET of Linux kernel */
5373f19035SAurelien Jarno #define LINUX_LOAD_OFFSET  0x0800000
5473f19035SAurelien Jarno #define INITRD_LOAD_OFFSET 0x1800000
55e8afa065Saurel32 
56d47ede60Sbalrog #define PA_IRLMSK	0x00
57b319feb7Saurel32 #define PA_POWOFF	0x30
58b319feb7Saurel32 #define PA_VERREG	0x32
59b319feb7Saurel32 #define PA_OUTPORT	0x36
60b319feb7Saurel32 
61b319feb7Saurel32 typedef struct {
62b319feb7Saurel32     uint16_t bcr;
63d47ede60Sbalrog     uint16_t irlmsk;
64b319feb7Saurel32     uint16_t irlmon;
65b319feb7Saurel32     uint16_t cfctl;
66b319feb7Saurel32     uint16_t cfpow;
67b319feb7Saurel32     uint16_t dispctl;
68b319feb7Saurel32     uint16_t sdmpow;
69b319feb7Saurel32     uint16_t rtcce;
70b319feb7Saurel32     uint16_t pcicd;
71b319feb7Saurel32     uint16_t voyagerrts;
72b319feb7Saurel32     uint16_t cfrst;
73b319feb7Saurel32     uint16_t admrts;
74b319feb7Saurel32     uint16_t extrst;
75b319feb7Saurel32     uint16_t cfcdintclr;
76b319feb7Saurel32     uint16_t keyctlclr;
77b319feb7Saurel32     uint16_t pad0;
78b319feb7Saurel32     uint16_t pad1;
79b319feb7Saurel32     uint16_t verreg;
80b319feb7Saurel32     uint16_t inport;
81b319feb7Saurel32     uint16_t outport;
82b319feb7Saurel32     uint16_t bverreg;
83d47ede60Sbalrog 
84d47ede60Sbalrog /* output pin */
85d47ede60Sbalrog     qemu_irq irl;
865dea2efbSAvi Kivity     MemoryRegion iomem;
87c227f099SAnthony Liguori } r2d_fpga_t;
88b319feb7Saurel32 
89d47ede60Sbalrog enum r2d_fpga_irq {
90d47ede60Sbalrog     PCI_INTD, CF_IDE, CF_CD, PCI_INTC, SM501, KEY, RTC_A, RTC_T,
91d47ede60Sbalrog     SDCARD, PCI_INTA, PCI_INTB, EXT, TP,
92d47ede60Sbalrog     NR_IRQS
93d47ede60Sbalrog };
94d47ede60Sbalrog 
95d47ede60Sbalrog static const struct { short irl; uint16_t msk; } irqtab[NR_IRQS] = {
96d47ede60Sbalrog     [CF_IDE]	= {  1, 1<<9 },
97d47ede60Sbalrog     [CF_CD]	= {  2, 1<<8 },
98d47ede60Sbalrog     [PCI_INTA]	= {  9, 1<<14 },
99d47ede60Sbalrog     [PCI_INTB]	= { 10, 1<<13 },
100d47ede60Sbalrog     [PCI_INTC]	= {  3, 1<<12 },
101d47ede60Sbalrog     [PCI_INTD]	= {  0, 1<<11 },
102d47ede60Sbalrog     [SM501]	= {  4, 1<<10 },
103d47ede60Sbalrog     [KEY]	= {  5, 1<<6 },
104d47ede60Sbalrog     [RTC_A]	= {  6, 1<<5 },
105d47ede60Sbalrog     [RTC_T]	= {  7, 1<<4 },
106d47ede60Sbalrog     [SDCARD]	= {  8, 1<<7 },
107d47ede60Sbalrog     [EXT]	= { 11, 1<<0 },
108d47ede60Sbalrog     [TP]	= { 12, 1<<15 },
109d47ede60Sbalrog };
110d47ede60Sbalrog 
111c227f099SAnthony Liguori static void update_irl(r2d_fpga_t *fpga)
112d47ede60Sbalrog {
113d47ede60Sbalrog     int i, irl = 15;
114d47ede60Sbalrog     for (i = 0; i < NR_IRQS; i++)
115d47ede60Sbalrog         if (fpga->irlmon & fpga->irlmsk & irqtab[i].msk)
116d47ede60Sbalrog             if (irqtab[i].irl < irl)
117d47ede60Sbalrog                 irl = irqtab[i].irl;
118d47ede60Sbalrog     qemu_set_irq(fpga->irl, irl ^ 15);
119d47ede60Sbalrog }
120d47ede60Sbalrog 
121d47ede60Sbalrog static void r2d_fpga_irq_set(void *opaque, int n, int level)
122d47ede60Sbalrog {
123c227f099SAnthony Liguori     r2d_fpga_t *fpga = opaque;
124d47ede60Sbalrog     if (level)
125d47ede60Sbalrog         fpga->irlmon |= irqtab[n].msk;
126d47ede60Sbalrog     else
127d47ede60Sbalrog         fpga->irlmon &= ~irqtab[n].msk;
128d47ede60Sbalrog     update_irl(fpga);
129d47ede60Sbalrog }
130d47ede60Sbalrog 
131a8170e5eSAvi Kivity static uint32_t r2d_fpga_read(void *opaque, hwaddr addr)
132b319feb7Saurel32 {
133c227f099SAnthony Liguori     r2d_fpga_t *s = opaque;
134b319feb7Saurel32 
135b319feb7Saurel32     switch (addr) {
136d47ede60Sbalrog     case PA_IRLMSK:
137d47ede60Sbalrog         return s->irlmsk;
138b319feb7Saurel32     case PA_OUTPORT:
139b319feb7Saurel32 	return s->outport;
140b319feb7Saurel32     case PA_POWOFF:
14137cc0b44SAurelien Jarno 	return 0x00;
142b319feb7Saurel32     case PA_VERREG:
143b319feb7Saurel32 	return 0x10;
144b319feb7Saurel32     }
145b319feb7Saurel32 
146b319feb7Saurel32     return 0;
147b319feb7Saurel32 }
148b319feb7Saurel32 
149b319feb7Saurel32 static void
150a8170e5eSAvi Kivity r2d_fpga_write(void *opaque, hwaddr addr, uint32_t value)
151b319feb7Saurel32 {
152c227f099SAnthony Liguori     r2d_fpga_t *s = opaque;
153b319feb7Saurel32 
154b319feb7Saurel32     switch (addr) {
155d47ede60Sbalrog     case PA_IRLMSK:
156d47ede60Sbalrog         s->irlmsk = value;
157d47ede60Sbalrog         update_irl(s);
158d47ede60Sbalrog 	break;
159b319feb7Saurel32     case PA_OUTPORT:
160b319feb7Saurel32 	s->outport = value;
161b319feb7Saurel32 	break;
162b319feb7Saurel32     case PA_POWOFF:
16337cc0b44SAurelien Jarno         if (value & 1) {
16437cc0b44SAurelien Jarno             qemu_system_shutdown_request();
16537cc0b44SAurelien Jarno         }
166b319feb7Saurel32         break;
167b319feb7Saurel32     case PA_VERREG:
168b319feb7Saurel32 	/* Discard writes */
169b319feb7Saurel32 	break;
170b319feb7Saurel32     }
171b319feb7Saurel32 }
172b319feb7Saurel32 
1735dea2efbSAvi Kivity static const MemoryRegionOps r2d_fpga_ops = {
1745dea2efbSAvi Kivity     .old_mmio = {
1755dea2efbSAvi Kivity         .read = { r2d_fpga_read, r2d_fpga_read, NULL, },
1765dea2efbSAvi Kivity         .write = { r2d_fpga_write, r2d_fpga_write, NULL, },
1775dea2efbSAvi Kivity     },
1785dea2efbSAvi Kivity     .endianness = DEVICE_NATIVE_ENDIAN,
179b319feb7Saurel32 };
180b319feb7Saurel32 
1815dea2efbSAvi Kivity static qemu_irq *r2d_fpga_init(MemoryRegion *sysmem,
182a8170e5eSAvi Kivity                                hwaddr base, qemu_irq irl)
183b319feb7Saurel32 {
184c227f099SAnthony Liguori     r2d_fpga_t *s;
185b319feb7Saurel32 
1867267c094SAnthony Liguori     s = g_malloc0(sizeof(r2d_fpga_t));
187d47ede60Sbalrog 
188d47ede60Sbalrog     s->irl = irl;
189b319feb7Saurel32 
1902c9b15caSPaolo Bonzini     memory_region_init_io(&s->iomem, NULL, &r2d_fpga_ops, s, "r2d-fpga", 0x40);
1915dea2efbSAvi Kivity     memory_region_add_subregion(sysmem, base, &s->iomem);
192d47ede60Sbalrog     return qemu_allocate_irqs(r2d_fpga_irq_set, s, NR_IRQS);
193b319feb7Saurel32 }
194b319feb7Saurel32 
1954f6493ffSAurelien Jarno typedef struct ResetData {
196868bac81SAndreas Färber     SuperHCPU *cpu;
1974f6493ffSAurelien Jarno     uint32_t vector;
1984f6493ffSAurelien Jarno } ResetData;
1994f6493ffSAurelien Jarno 
2004f6493ffSAurelien Jarno static void main_cpu_reset(void *opaque)
2014f6493ffSAurelien Jarno {
2024f6493ffSAurelien Jarno     ResetData *s = (ResetData *)opaque;
203868bac81SAndreas Färber     CPUSH4State *env = &s->cpu->env;
2044f6493ffSAurelien Jarno 
205868bac81SAndreas Färber     cpu_reset(CPU(s->cpu));
2064f6493ffSAurelien Jarno     env->pc = s->vector;
2074f6493ffSAurelien Jarno }
2084f6493ffSAurelien Jarno 
209541dc0d4SStefan Weil static struct QEMU_PACKED
21073f19035SAurelien Jarno {
21173f19035SAurelien Jarno     int mount_root_rdonly;
21273f19035SAurelien Jarno     int ramdisk_flags;
21373f19035SAurelien Jarno     int orig_root_dev;
21473f19035SAurelien Jarno     int loader_type;
21573f19035SAurelien Jarno     int initrd_start;
21673f19035SAurelien Jarno     int initrd_size;
21773f19035SAurelien Jarno 
21873f19035SAurelien Jarno     char pad[232];
21973f19035SAurelien Jarno 
22073f19035SAurelien Jarno     char kernel_cmdline[256];
22173f19035SAurelien Jarno } boot_params;
22273f19035SAurelien Jarno 
2233ef96221SMarcel Apfelbaum static void r2d_init(MachineState *machine)
2240d78f544Sths {
2253ef96221SMarcel Apfelbaum     const char *cpu_model = machine->cpu_model;
2263ef96221SMarcel Apfelbaum     const char *kernel_filename = machine->kernel_filename;
2273ef96221SMarcel Apfelbaum     const char *kernel_cmdline = machine->kernel_cmdline;
2283ef96221SMarcel Apfelbaum     const char *initrd_filename = machine->initrd_filename;
229fd2f410bSAndreas Färber     SuperHCPU *cpu;
2300b7ade1dSAndreas Färber     CPUSH4State *env;
2314f6493ffSAurelien Jarno     ResetData *reset_info;
2320d78f544Sths     struct SH7750State *s;
2335dea2efbSAvi Kivity     MemoryRegion *sdram = g_new(MemoryRegion, 1);
234d47ede60Sbalrog     qemu_irq *irq;
235751c6a17SGerd Hoffmann     DriveInfo *dinfo;
236c2f01775Sbalrog     int i;
2378c106233SBenoît Canet     DeviceState *dev;
2388c106233SBenoît Canet     SysBusDevice *busdev;
23927a9d2eaSRichard Henderson     MemoryRegion *address_space_mem = get_system_memory();
24029b358f9SDavid Gibson     PCIBus *pci_bus;
2410d78f544Sths 
242fd2f410bSAndreas Färber     if (cpu_model == NULL) {
2430fd3ca30Saurel32         cpu_model = "SH7751R";
244fd2f410bSAndreas Färber     }
245aaed909aSbellard 
246fd2f410bSAndreas Färber     cpu = cpu_sh4_init(cpu_model);
247fd2f410bSAndreas Färber     if (cpu == NULL) {
248aaed909aSbellard         fprintf(stderr, "Unable to find CPU definition\n");
249aaed909aSbellard         exit(1);
250aaed909aSbellard     }
251fd2f410bSAndreas Färber     env = &cpu->env;
252fd2f410bSAndreas Färber 
2537267c094SAnthony Liguori     reset_info = g_malloc0(sizeof(ResetData));
254868bac81SAndreas Färber     reset_info->cpu = cpu;
2554f6493ffSAurelien Jarno     reset_info->vector = env->pc;
2564f6493ffSAurelien Jarno     qemu_register_reset(main_cpu_reset, reset_info);
2570d78f544Sths 
2580d78f544Sths     /* Allocate memory space */
25949946538SHu Tao     memory_region_init_ram(sdram, NULL, "r2d.sdram", SDRAM_SIZE, &error_abort);
260c5705a77SAvi Kivity     vmstate_register_ram_global(sdram);
2615dea2efbSAvi Kivity     memory_region_add_subregion(address_space_mem, SDRAM_BASE, sdram);
2620d78f544Sths     /* Register peripherals */
2632f493feeSAndreas Färber     s = sh7750_init(cpu, address_space_mem);
2645dea2efbSAvi Kivity     irq = r2d_fpga_init(address_space_mem, 0x04000000, sh7750_irl(s));
2658c106233SBenoît Canet 
2668c106233SBenoît Canet     dev = qdev_create(NULL, "sh_pci");
2671356b98dSAndreas Färber     busdev = SYS_BUS_DEVICE(dev);
2688c106233SBenoît Canet     qdev_init_nofail(dev);
26929b358f9SDavid Gibson     pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci"));
2708c106233SBenoît Canet     sysbus_mmio_map(busdev, 0, P4ADDR(0x1e200000));
2718c106233SBenoît Canet     sysbus_mmio_map(busdev, 1, A7ADDR(0x1e200000));
2728c106233SBenoît Canet     sysbus_connect_irq(busdev, 0, irq[PCI_INTA]);
2738c106233SBenoît Canet     sysbus_connect_irq(busdev, 1, irq[PCI_INTB]);
2748c106233SBenoît Canet     sysbus_connect_irq(busdev, 2, irq[PCI_INTC]);
2758c106233SBenoît Canet     sysbus_connect_irq(busdev, 3, irq[PCI_INTD]);
276d47ede60Sbalrog 
27727a9d2eaSRichard Henderson     sm501_init(address_space_mem, 0x10000000, SM501_VRAM_SIZE,
27827a9d2eaSRichard Henderson                irq[SM501], serial_hds[2]);
279a4a771c0Sbalrog 
280a4a771c0Sbalrog     /* onboard CF (True IDE mode, Master only). */
281612b2bd0SAurelien Jarno     dinfo = drive_get(IF_IDE, 0, 0);
2826b2578d6SAndreas Färber     dev = qdev_create(NULL, "mmio-ide");
2836b2578d6SAndreas Färber     busdev = SYS_BUS_DEVICE(dev);
2846b2578d6SAndreas Färber     sysbus_connect_irq(busdev, 0, irq[CF_IDE]);
2856b2578d6SAndreas Färber     qdev_prop_set_uint32(dev, "shift", 1);
2866b2578d6SAndreas Färber     qdev_init_nofail(dev);
2876b2578d6SAndreas Färber     sysbus_mmio_map(busdev, 0, 0x14001000);
2886b2578d6SAndreas Färber     sysbus_mmio_map(busdev, 1, 0x1400080c);
2896b2578d6SAndreas Färber     mmio_ide_init_drives(dev, dinfo, NULL);
290a4a771c0Sbalrog 
29156839a19SAurelien Jarno     /* onboard flash memory */
29245e7e4bcSAurelien Jarno     dinfo = drive_get(IF_PFLASH, 0, 0);
293cfe5f011SAvi Kivity     pflash_cfi02_register(0x0, NULL, "r2d.flash", FLASH_SIZE,
294*fa1d36dfSMarkus Armbruster                           dinfo ? blk_bs(blk_by_legacy_dinfo(dinfo)) : NULL,
295*fa1d36dfSMarkus Armbruster                           (16 * 1024), FLASH_SIZE >> 16,
29656839a19SAurelien Jarno                           1, 4, 0x0000, 0x0000, 0x0000, 0x0000,
29701e0451aSAnthony Liguori                           0x555, 0x2aa, 0);
29856839a19SAurelien Jarno 
299c2f01775Sbalrog     /* NIC: rtl8139 on-board, and 2 slots. */
300ab2da564Saurel32     for (i = 0; i < nb_nics; i++)
30129b358f9SDavid Gibson         pci_nic_init_nofail(&nd_table[i], pci_bus,
30229b358f9SDavid Gibson                             "rtl8139", i==0 ? "2" : NULL);
303c2f01775Sbalrog 
3049caa3ec1SAurelien Jarno     /* USB keyboard */
3059caa3ec1SAurelien Jarno     usbdevice_create("keyboard");
3069caa3ec1SAurelien Jarno 
3070d78f544Sths     /* Todo: register on board registers */
30873f19035SAurelien Jarno     memset(&boot_params, 0, sizeof(boot_params));
30973f19035SAurelien Jarno 
310e8afa065Saurel32     if (kernel_filename) {
3110d78f544Sths         int kernel_size;
3120d78f544Sths 
313e8afa065Saurel32         kernel_size = load_image_targphys(kernel_filename,
314e8afa065Saurel32                                           SDRAM_BASE + LINUX_LOAD_OFFSET,
31573f19035SAurelien Jarno                                           INITRD_LOAD_OFFSET - LINUX_LOAD_OFFSET);
3160d78f544Sths         if (kernel_size < 0) {
3170d78f544Sths           fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename);
3180d78f544Sths           exit(1);
3190d78f544Sths         }
32073f19035SAurelien Jarno 
32173f19035SAurelien Jarno         /* initialization which should be done by firmware */
322ab1da857SEdgar E. Iglesias         stl_phys(&address_space_memory, SH7750_BCR1, 1<<3); /* cs3 SDRAM */
3235ce5944dSEdgar E. Iglesias         stw_phys(&address_space_memory, SH7750_BCR2, 3<<(3*2)); /* cs3 32bit */
3244f6493ffSAurelien Jarno         reset_info->vector = (SDRAM_BASE + LINUX_LOAD_OFFSET) | 0xa0000000; /* Start from P2 area */
3250d78f544Sths     }
32673f19035SAurelien Jarno 
32773f19035SAurelien Jarno     if (initrd_filename) {
32873f19035SAurelien Jarno         int initrd_size;
32973f19035SAurelien Jarno 
33073f19035SAurelien Jarno         initrd_size = load_image_targphys(initrd_filename,
33173f19035SAurelien Jarno                                           SDRAM_BASE + INITRD_LOAD_OFFSET,
33273f19035SAurelien Jarno                                           SDRAM_SIZE - INITRD_LOAD_OFFSET);
33373f19035SAurelien Jarno 
33473f19035SAurelien Jarno         if (initrd_size < 0) {
33573f19035SAurelien Jarno           fprintf(stderr, "qemu: could not load initrd '%s'\n", initrd_filename);
33673f19035SAurelien Jarno           exit(1);
33773f19035SAurelien Jarno         }
33873f19035SAurelien Jarno 
33973f19035SAurelien Jarno         /* initialization which should be done by firmware */
34073f19035SAurelien Jarno         boot_params.loader_type = 1;
34173f19035SAurelien Jarno         boot_params.initrd_start = INITRD_LOAD_OFFSET;
34273f19035SAurelien Jarno         boot_params.initrd_size = initrd_size;
34373f19035SAurelien Jarno     }
34473f19035SAurelien Jarno 
34573f19035SAurelien Jarno     if (kernel_cmdline) {
3469310b9beSJim Meyering         /* I see no evidence that this .kernel_cmdline buffer requires
3479310b9beSJim Meyering            NUL-termination, so using strncpy should be ok. */
34873f19035SAurelien Jarno         strncpy(boot_params.kernel_cmdline, kernel_cmdline,
34973f19035SAurelien Jarno                 sizeof(boot_params.kernel_cmdline));
35073f19035SAurelien Jarno     }
35173f19035SAurelien Jarno 
35273f19035SAurelien Jarno     rom_add_blob_fixed("boot_params", &boot_params, sizeof(boot_params),
35373f19035SAurelien Jarno                        SDRAM_BASE + BOOT_PARAMS_OFFSET);
3540d78f544Sths }
3550d78f544Sths 
356f80f9ec9SAnthony Liguori static QEMUMachine r2d_machine = {
3574b32e168Saliguori     .name = "r2d",
3584b32e168Saliguori     .desc = "r2d-plus board",
3594b32e168Saliguori     .init = r2d_init,
3600d78f544Sths };
361f80f9ec9SAnthony Liguori 
362f80f9ec9SAnthony Liguori static void r2d_machine_init(void)
363f80f9ec9SAnthony Liguori {
364f80f9ec9SAnthony Liguori     qemu_register_machine(&r2d_machine);
365f80f9ec9SAnthony Liguori }
366f80f9ec9SAnthony Liguori 
367f80f9ec9SAnthony Liguori machine_init(r2d_machine_init);
368