2 * QEMU Sun4u/Sun4v System Emulator
4 * Copyright (c) 2005 Fabrice Bellard
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31 #include "qemu-timer.h"
34 #include "firmware_abi.h"
45 #define CPUIRQ_DPRINTF(fmt, ...) \
46 do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
48 #define CPUIRQ_DPRINTF(fmt, ...)
52 #define EBUS_DPRINTF(fmt, ...) \
53 do { printf("EBUS: " fmt , ## __VA_ARGS__); } while (0)
55 #define EBUS_DPRINTF(fmt, ...)
58 #define KERNEL_LOAD_ADDR 0x00404000
59 #define CMDLINE_ADDR 0x003ff000
60 #define INITRD_LOAD_ADDR 0x00300000
61 #define PROM_SIZE_MAX (4 * 1024 * 1024)
62 #define PROM_VADDR 0x000ffd00000ULL
63 #define APB_SPECIAL_BASE 0x1fe00000000ULL
64 #define APB_MEM_BASE 0x1ff00000000ULL
65 #define VGA_BASE (APB_MEM_BASE + 0x400000ULL)
66 #define PROM_FILENAME "openbios-sparc64"
67 #define NVRAM_SIZE 0x2000
69 #define BIOS_CFG_IOPORT 0x510
70 #define FW_CFG_SPARC64_WIDTH (FW_CFG_ARCH_LOCAL + 0x00)
71 #define FW_CFG_SPARC64_HEIGHT (FW_CFG_ARCH_LOCAL + 0x01)
72 #define FW_CFG_SPARC64_DEPTH (FW_CFG_ARCH_LOCAL + 0x02)
76 #define TICK_MAX 0x7fffffffffffffffULL
79 const char * const default_cpu_model
;
82 uint64_t console_serial_base
;
85 int DMA_get_channel_mode (int nchan
)
89 int DMA_read_memory (int nchan
, void *buf
, int pos
, int size
)
93 int DMA_write_memory (int nchan
, void *buf
, int pos
, int size
)
97 void DMA_hold_DREQ (int nchan
) {}
98 void DMA_release_DREQ (int nchan
) {}
99 void DMA_schedule(int nchan
) {}
100 void DMA_init (int high_page_enable
) {}
101 void DMA_register_channel (int nchan
,
102 DMA_transfer_handler transfer_handler
,
107 static int fw_cfg_boot_set(void *opaque
, const char *boot_device
)
109 fw_cfg_add_i16(opaque
, FW_CFG_BOOT_DEVICE
, boot_device
[0]);
113 static int sun4u_NVRAM_set_params (m48t59_t
*nvram
, uint16_t NVRAM_size
,
116 const char *boot_devices
,
117 uint32_t kernel_image
, uint32_t kernel_size
,
119 uint32_t initrd_image
, uint32_t initrd_size
,
120 uint32_t NVRAM_image
,
121 int width
, int height
, int depth
,
122 const uint8_t *macaddr
)
126 uint8_t image
[0x1ff0];
127 struct OpenBIOS_nvpart_v1
*part_header
;
129 memset(image
, '\0', sizeof(image
));
133 // OpenBIOS nvram variables
134 // Variable partition
135 part_header
= (struct OpenBIOS_nvpart_v1
*)&image
[start
];
136 part_header
->signature
= OPENBIOS_PART_SYSTEM
;
137 pstrcpy(part_header
->name
, sizeof(part_header
->name
), "system");
139 end
= start
+ sizeof(struct OpenBIOS_nvpart_v1
);
140 for (i
= 0; i
< nb_prom_envs
; i
++)
141 end
= OpenBIOS_set_var(image
, end
, prom_envs
[i
]);
146 end
= start
+ ((end
- start
+ 15) & ~15);
147 OpenBIOS_finish_partition(part_header
, end
- start
);
151 part_header
= (struct OpenBIOS_nvpart_v1
*)&image
[start
];
152 part_header
->signature
= OPENBIOS_PART_FREE
;
153 pstrcpy(part_header
->name
, sizeof(part_header
->name
), "free");
156 OpenBIOS_finish_partition(part_header
, end
- start
);
158 Sun_init_header((struct Sun_nvram
*)&image
[0x1fd8], macaddr
, 0x80);
160 for (i
= 0; i
< sizeof(image
); i
++)
161 m48t59_write(nvram
, i
, image
[i
]);
165 static unsigned long sun4u_load_kernel(const char *kernel_filename
,
166 const char *initrd_filename
,
167 ram_addr_t RAM_size
, long *initrd_size
)
173 linux_boot
= (kernel_filename
!= NULL
);
184 kernel_size
= load_elf(kernel_filename
, 0, NULL
, NULL
, NULL
,
187 kernel_size
= load_aout(kernel_filename
, KERNEL_LOAD_ADDR
,
188 RAM_size
- KERNEL_LOAD_ADDR
, bswap_needed
,
191 kernel_size
= load_image_targphys(kernel_filename
,
193 RAM_size
- KERNEL_LOAD_ADDR
);
194 if (kernel_size
< 0) {
195 fprintf(stderr
, "qemu: could not load kernel '%s'\n",
202 if (initrd_filename
) {
203 *initrd_size
= load_image_targphys(initrd_filename
,
205 RAM_size
- INITRD_LOAD_ADDR
);
206 if (*initrd_size
< 0) {
207 fprintf(stderr
, "qemu: could not load initial ram disk '%s'\n",
212 if (*initrd_size
> 0) {
213 for (i
= 0; i
< 64 * TARGET_PAGE_SIZE
; i
+= TARGET_PAGE_SIZE
) {
214 if (ldl_phys(KERNEL_LOAD_ADDR
+ i
) == 0x48647253) { // HdrS
215 stl_phys(KERNEL_LOAD_ADDR
+ i
+ 16, INITRD_LOAD_ADDR
);
216 stl_phys(KERNEL_LOAD_ADDR
+ i
+ 20, *initrd_size
);
225 void pic_info(Monitor
*mon
)
229 void irq_info(Monitor
*mon
)
233 void cpu_check_irqs(CPUState
*env
)
235 uint32_t pil
= env
->pil_in
| (env
->softint
& ~SOFTINT_TIMER
) |
236 ((env
->softint
& SOFTINT_TIMER
) << 14);
238 if (pil
&& (env
->interrupt_index
== 0 ||
239 (env
->interrupt_index
& ~15) == TT_EXTINT
)) {
242 for (i
= 15; i
> 0; i
--) {
243 if (pil
& (1 << i
)) {
244 int old_interrupt
= env
->interrupt_index
;
246 env
->interrupt_index
= TT_EXTINT
| i
;
247 if (old_interrupt
!= env
->interrupt_index
) {
248 CPUIRQ_DPRINTF("Set CPU IRQ %d\n", i
);
249 cpu_interrupt(env
, CPU_INTERRUPT_HARD
);
254 } else if (!pil
&& (env
->interrupt_index
& ~15) == TT_EXTINT
) {
255 CPUIRQ_DPRINTF("Reset CPU IRQ %d\n", env
->interrupt_index
& 15);
256 env
->interrupt_index
= 0;
257 cpu_reset_interrupt(env
, CPU_INTERRUPT_HARD
);
261 static void cpu_set_irq(void *opaque
, int irq
, int level
)
263 CPUState
*env
= opaque
;
266 CPUIRQ_DPRINTF("Raise CPU IRQ %d\n", irq
);
268 env
->pil_in
|= 1 << irq
;
271 CPUIRQ_DPRINTF("Lower CPU IRQ %d\n", irq
);
272 env
->pil_in
&= ~(1 << irq
);
277 typedef struct ResetData
{
282 static void main_cpu_reset(void *opaque
)
284 ResetData
*s
= (ResetData
*)opaque
;
285 CPUState
*env
= s
->env
;
286 static unsigned int nr_resets
;
289 env
->tick_cmpr
= TICK_INT_DIS
| 0;
290 ptimer_set_limit(env
->tick
, TICK_MAX
, 1);
291 ptimer_run(env
->tick
, 1);
292 env
->stick_cmpr
= TICK_INT_DIS
| 0;
293 ptimer_set_limit(env
->stick
, TICK_MAX
, 1);
294 ptimer_run(env
->stick
, 1);
295 env
->hstick_cmpr
= TICK_INT_DIS
| 0;
296 ptimer_set_limit(env
->hstick
, TICK_MAX
, 1);
297 ptimer_run(env
->hstick
, 1);
298 env
->gregs
[1] = 0; // Memory start
299 env
->gregs
[2] = ram_size
; // Memory size
300 env
->gregs
[3] = 0; // Machine description XXX
301 if (nr_resets
++ == 0) {
303 env
->pc
= s
->prom_addr
+ 0x20ULL
;
305 env
->pc
= s
->prom_addr
+ 0x40ULL
;
307 env
->npc
= env
->pc
+ 4;
310 static void tick_irq(void *opaque
)
312 CPUState
*env
= opaque
;
314 if (!(env
->tick_cmpr
& TICK_INT_DIS
)) {
315 env
->softint
|= SOFTINT_TIMER
;
316 cpu_interrupt(env
, CPU_INTERRUPT_TIMER
);
320 static void stick_irq(void *opaque
)
322 CPUState
*env
= opaque
;
324 if (!(env
->stick_cmpr
& TICK_INT_DIS
)) {
325 env
->softint
|= SOFTINT_STIMER
;
326 cpu_interrupt(env
, CPU_INTERRUPT_TIMER
);
330 static void hstick_irq(void *opaque
)
332 CPUState
*env
= opaque
;
334 if (!(env
->hstick_cmpr
& TICK_INT_DIS
)) {
335 cpu_interrupt(env
, CPU_INTERRUPT_TIMER
);
339 void cpu_tick_set_count(void *opaque
, uint64_t count
)
341 ptimer_set_count(opaque
, -count
);
344 uint64_t cpu_tick_get_count(void *opaque
)
346 return -ptimer_get_count(opaque
);
349 void cpu_tick_set_limit(void *opaque
, uint64_t limit
)
351 ptimer_set_limit(opaque
, -limit
, 0);
354 static void ebus_mmio_mapfunc(PCIDevice
*pci_dev
, int region_num
,
355 pcibus_t addr
, pcibus_t size
, int type
)
357 EBUS_DPRINTF("Mapping region %d registers at %" FMT_PCIBUS
"\n",
359 switch (region_num
) {
361 isa_mmio_init(addr
, 0x1000000);
364 isa_mmio_init(addr
, 0x800000);
369 static void dummy_isa_irq_handler(void *opaque
, int n
, int level
)
373 /* EBUS (Eight bit bus) bridge */
375 pci_ebus_init(PCIBus
*bus
, int devfn
)
379 pci_create_simple(bus
, devfn
, "ebus");
380 isa_irq
= qemu_allocate_irqs(dummy_isa_irq_handler
, NULL
, 16);
381 isa_bus_irqs(isa_irq
);
385 pci_ebus_init1(PCIDevice
*s
)
387 isa_bus_new(&s
->qdev
);
389 pci_config_set_vendor_id(s
->config
, PCI_VENDOR_ID_SUN
);
390 pci_config_set_device_id(s
->config
, PCI_DEVICE_ID_SUN_EBUS
);
391 s
->config
[0x04] = 0x06; // command = bus master, pci mem
392 s
->config
[0x05] = 0x00;
393 s
->config
[0x06] = 0xa0; // status = fast back-to-back, 66MHz, no error
394 s
->config
[0x07] = 0x03; // status = medium devsel
395 s
->config
[0x08] = 0x01; // revision
396 s
->config
[0x09] = 0x00; // programming i/f
397 pci_config_set_class(s
->config
, PCI_CLASS_BRIDGE_OTHER
);
398 s
->config
[0x0D] = 0x0a; // latency_timer
399 s
->config
[PCI_HEADER_TYPE
] = PCI_HEADER_TYPE_NORMAL
; // header_type
401 pci_register_bar(s
, 0, 0x1000000, PCI_BASE_ADDRESS_SPACE_MEMORY
,
403 pci_register_bar(s
, 1, 0x800000, PCI_BASE_ADDRESS_SPACE_MEMORY
,
408 static PCIDeviceInfo ebus_info
= {
410 .qdev
.size
= sizeof(PCIDevice
),
411 .init
= pci_ebus_init1
,
414 static void pci_ebus_register(void)
416 pci_qdev_register(&ebus_info
);
419 device_init(pci_ebus_register
);
421 /* Boot PROM (OpenBIOS) */
422 static void prom_init(target_phys_addr_t addr
, const char *bios_name
)
429 dev
= qdev_create(NULL
, "openprom");
430 qdev_init_nofail(dev
);
431 s
= sysbus_from_qdev(dev
);
433 sysbus_mmio_map(s
, 0, addr
);
436 if (bios_name
== NULL
) {
437 bios_name
= PROM_FILENAME
;
439 filename
= qemu_find_file(QEMU_FILE_TYPE_BIOS
, bios_name
);
441 ret
= load_elf(filename
, addr
- PROM_VADDR
, NULL
, NULL
, NULL
,
443 if (ret
< 0 || ret
> PROM_SIZE_MAX
) {
444 ret
= load_image_targphys(filename
, addr
, PROM_SIZE_MAX
);
450 if (ret
< 0 || ret
> PROM_SIZE_MAX
) {
451 fprintf(stderr
, "qemu: could not load prom '%s'\n", bios_name
);
456 static int prom_init1(SysBusDevice
*dev
)
458 ram_addr_t prom_offset
;
460 prom_offset
= qemu_ram_alloc(PROM_SIZE_MAX
);
461 sysbus_init_mmio(dev
, PROM_SIZE_MAX
, prom_offset
| IO_MEM_ROM
);
465 static SysBusDeviceInfo prom_info
= {
467 .qdev
.name
= "openprom",
468 .qdev
.size
= sizeof(SysBusDevice
),
469 .qdev
.props
= (Property
[]) {
470 {/* end of property list */}
474 static void prom_register_devices(void)
476 sysbus_register_withprop(&prom_info
);
479 device_init(prom_register_devices
);
482 typedef struct RamDevice
489 static int ram_init1(SysBusDevice
*dev
)
491 ram_addr_t RAM_size
, ram_offset
;
492 RamDevice
*d
= FROM_SYSBUS(RamDevice
, dev
);
496 ram_offset
= qemu_ram_alloc(RAM_size
);
497 sysbus_init_mmio(dev
, RAM_size
, ram_offset
);
501 static void ram_init(target_phys_addr_t addr
, ram_addr_t RAM_size
)
508 dev
= qdev_create(NULL
, "memory");
509 s
= sysbus_from_qdev(dev
);
511 d
= FROM_SYSBUS(RamDevice
, s
);
513 qdev_init_nofail(dev
);
515 sysbus_mmio_map(s
, 0, addr
);
518 static SysBusDeviceInfo ram_info
= {
520 .qdev
.name
= "memory",
521 .qdev
.size
= sizeof(RamDevice
),
522 .qdev
.props
= (Property
[]) {
523 DEFINE_PROP_UINT64("size", RamDevice
, size
, 0),
524 DEFINE_PROP_END_OF_LIST(),
528 static void ram_register_devices(void)
530 sysbus_register_withprop(&ram_info
);
533 device_init(ram_register_devices
);
535 static CPUState
*cpu_devinit(const char *cpu_model
, const struct hwdef
*hwdef
)
539 ResetData
*reset_info
;
542 cpu_model
= hwdef
->default_cpu_model
;
543 env
= cpu_init(cpu_model
);
545 fprintf(stderr
, "Unable to find Sparc CPU definition\n");
548 bh
= qemu_bh_new(tick_irq
, env
);
549 env
->tick
= ptimer_init(bh
);
550 ptimer_set_period(env
->tick
, 1ULL);
552 bh
= qemu_bh_new(stick_irq
, env
);
553 env
->stick
= ptimer_init(bh
);
554 ptimer_set_period(env
->stick
, 1ULL);
556 bh
= qemu_bh_new(hstick_irq
, env
);
557 env
->hstick
= ptimer_init(bh
);
558 ptimer_set_period(env
->hstick
, 1ULL);
560 reset_info
= qemu_mallocz(sizeof(ResetData
));
561 reset_info
->env
= env
;
562 reset_info
->prom_addr
= hwdef
->prom_addr
;
563 qemu_register_reset(main_cpu_reset
, reset_info
);
568 static void sun4uv_init(ram_addr_t RAM_size
,
569 const char *boot_devices
,
570 const char *kernel_filename
, const char *kernel_cmdline
,
571 const char *initrd_filename
, const char *cpu_model
,
572 const struct hwdef
*hwdef
)
577 long initrd_size
, kernel_size
;
578 PCIBus
*pci_bus
, *pci_bus2
, *pci_bus3
;
580 DriveInfo
*hd
[MAX_IDE_BUS
* MAX_IDE_DEVS
];
581 DriveInfo
*fd
[MAX_FD
];
585 env
= cpu_devinit(cpu_model
, hwdef
);
588 ram_init(0, RAM_size
);
590 prom_init(hwdef
->prom_addr
, bios_name
);
593 irq
= qemu_allocate_irqs(cpu_set_irq
, env
, MAX_PILS
);
594 pci_bus
= pci_apb_init(APB_SPECIAL_BASE
, APB_MEM_BASE
, irq
, &pci_bus2
,
596 isa_mem_base
= VGA_BASE
;
597 pci_vga_init(pci_bus
, 0, 0);
599 // XXX Should be pci_bus3
600 pci_ebus_init(pci_bus
, -1);
603 if (hwdef
->console_serial_base
) {
604 serial_mm_init(hwdef
->console_serial_base
, 0, NULL
, 115200,
608 for(; i
< MAX_SERIAL_PORTS
; i
++) {
610 serial_isa_init(i
, serial_hds
[i
]);
614 for(i
= 0; i
< MAX_PARALLEL_PORTS
; i
++) {
615 if (parallel_hds
[i
]) {
616 parallel_init(i
, parallel_hds
[i
]);
620 for(i
= 0; i
< nb_nics
; i
++)
621 pci_nic_init_nofail(&nd_table
[i
], "ne2k_pci", NULL
);
623 if (drive_get_max_bus(IF_IDE
) >= MAX_IDE_BUS
) {
624 fprintf(stderr
, "qemu: too many IDE bus\n");
627 for(i
= 0; i
< MAX_IDE_BUS
* MAX_IDE_DEVS
; i
++) {
628 hd
[i
] = drive_get(IF_IDE
, i
/ MAX_IDE_DEVS
,
632 pci_cmd646_ide_init(pci_bus
, hd
, 1);
634 isa_create_simple("i8042");
635 for(i
= 0; i
< MAX_FD
; i
++) {
636 fd
[i
] = drive_get(IF_FLOPPY
, 0, i
);
639 nvram
= m48t59_init_isa(0x0074, NVRAM_SIZE
, 59);
642 kernel_size
= sun4u_load_kernel(kernel_filename
, initrd_filename
,
643 ram_size
, &initrd_size
);
645 sun4u_NVRAM_set_params(nvram
, NVRAM_SIZE
, "Sun4u", RAM_size
, boot_devices
,
646 KERNEL_LOAD_ADDR
, kernel_size
,
648 INITRD_LOAD_ADDR
, initrd_size
,
649 /* XXX: need an option to load a NVRAM image */
651 graphic_width
, graphic_height
, graphic_depth
,
652 (uint8_t *)&nd_table
[0].macaddr
);
654 fw_cfg
= fw_cfg_init(BIOS_CFG_IOPORT
, BIOS_CFG_IOPORT
+ 1, 0, 0);
655 fw_cfg_add_i32(fw_cfg
, FW_CFG_ID
, 1);
656 fw_cfg_add_i64(fw_cfg
, FW_CFG_RAM_SIZE
, (uint64_t)ram_size
);
657 fw_cfg_add_i16(fw_cfg
, FW_CFG_MACHINE_ID
, hwdef
->machine_id
);
658 fw_cfg_add_i32(fw_cfg
, FW_CFG_KERNEL_ADDR
, KERNEL_LOAD_ADDR
);
659 fw_cfg_add_i32(fw_cfg
, FW_CFG_KERNEL_SIZE
, kernel_size
);
660 if (kernel_cmdline
) {
661 fw_cfg_add_i32(fw_cfg
, FW_CFG_KERNEL_CMDLINE
, CMDLINE_ADDR
);
662 pstrcpy_targphys("cmdline", CMDLINE_ADDR
, TARGET_PAGE_SIZE
, kernel_cmdline
);
663 fw_cfg_add_bytes(fw_cfg
, FW_CFG_CMDLINE_DATA
,
664 (uint8_t*)strdup(kernel_cmdline
),
665 strlen(kernel_cmdline
) + 1);
667 fw_cfg_add_i32(fw_cfg
, FW_CFG_KERNEL_CMDLINE
, 0);
669 fw_cfg_add_i32(fw_cfg
, FW_CFG_INITRD_ADDR
, INITRD_LOAD_ADDR
);
670 fw_cfg_add_i32(fw_cfg
, FW_CFG_INITRD_SIZE
, initrd_size
);
671 fw_cfg_add_i16(fw_cfg
, FW_CFG_BOOT_DEVICE
, boot_devices
[0]);
673 fw_cfg_add_i16(fw_cfg
, FW_CFG_SPARC64_WIDTH
, graphic_width
);
674 fw_cfg_add_i16(fw_cfg
, FW_CFG_SPARC64_HEIGHT
, graphic_height
);
675 fw_cfg_add_i16(fw_cfg
, FW_CFG_SPARC64_DEPTH
, graphic_depth
);
677 qemu_register_boot_set(fw_cfg_boot_set
, fw_cfg
);
686 static const struct hwdef hwdefs
[] = {
687 /* Sun4u generic PC-like machine */
689 .default_cpu_model
= "TI UltraSparc II",
690 .machine_id
= sun4u_id
,
691 .prom_addr
= 0x1fff0000000ULL
,
692 .console_serial_base
= 0,
694 /* Sun4v generic PC-like machine */
696 .default_cpu_model
= "Sun UltraSparc T1",
697 .machine_id
= sun4v_id
,
698 .prom_addr
= 0x1fff0000000ULL
,
699 .console_serial_base
= 0,
701 /* Sun4v generic Niagara machine */
703 .default_cpu_model
= "Sun UltraSparc T1",
704 .machine_id
= niagara_id
,
705 .prom_addr
= 0xfff0000000ULL
,
706 .console_serial_base
= 0xfff0c2c000ULL
,
710 /* Sun4u hardware initialisation */
711 static void sun4u_init(ram_addr_t RAM_size
,
712 const char *boot_devices
,
713 const char *kernel_filename
, const char *kernel_cmdline
,
714 const char *initrd_filename
, const char *cpu_model
)
716 sun4uv_init(RAM_size
, boot_devices
, kernel_filename
,
717 kernel_cmdline
, initrd_filename
, cpu_model
, &hwdefs
[0]);
720 /* Sun4v hardware initialisation */
721 static void sun4v_init(ram_addr_t RAM_size
,
722 const char *boot_devices
,
723 const char *kernel_filename
, const char *kernel_cmdline
,
724 const char *initrd_filename
, const char *cpu_model
)
726 sun4uv_init(RAM_size
, boot_devices
, kernel_filename
,
727 kernel_cmdline
, initrd_filename
, cpu_model
, &hwdefs
[1]);
730 /* Niagara hardware initialisation */
731 static void niagara_init(ram_addr_t RAM_size
,
732 const char *boot_devices
,
733 const char *kernel_filename
, const char *kernel_cmdline
,
734 const char *initrd_filename
, const char *cpu_model
)
736 sun4uv_init(RAM_size
, boot_devices
, kernel_filename
,
737 kernel_cmdline
, initrd_filename
, cpu_model
, &hwdefs
[2]);
740 static QEMUMachine sun4u_machine
= {
742 .desc
= "Sun4u platform",
744 .max_cpus
= 1, // XXX for now
748 static QEMUMachine sun4v_machine
= {
750 .desc
= "Sun4v platform",
752 .max_cpus
= 1, // XXX for now
755 static QEMUMachine niagara_machine
= {
757 .desc
= "Sun4v platform, Niagara",
758 .init
= niagara_init
,
759 .max_cpus
= 1, // XXX for now
762 static void sun4u_machine_init(void)
764 qemu_register_machine(&sun4u_machine
);
765 qemu_register_machine(&sun4v_machine
);
766 qemu_register_machine(&niagara_machine
);
769 machine_init(sun4u_machine_init
);