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
30 #include "qemu-timer.h"
33 #include "firmware_abi.h"
41 #define DPRINTF(fmt, ...) \
42 do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
44 #define DPRINTF(fmt, ...)
47 #define KERNEL_LOAD_ADDR 0x00404000
48 #define CMDLINE_ADDR 0x003ff000
49 #define INITRD_LOAD_ADDR 0x00300000
50 #define PROM_SIZE_MAX (4 * 1024 * 1024)
51 #define PROM_VADDR 0x000ffd00000ULL
52 #define APB_SPECIAL_BASE 0x1fe00000000ULL
53 #define APB_MEM_BASE 0x1ff00000000ULL
54 #define VGA_BASE (APB_MEM_BASE + 0x400000ULL)
55 #define PROM_FILENAME "openbios-sparc64"
56 #define NVRAM_SIZE 0x2000
58 #define BIOS_CFG_IOPORT 0x510
59 #define FW_CFG_SPARC64_WIDTH (FW_CFG_ARCH_LOCAL + 0x00)
60 #define FW_CFG_SPARC64_HEIGHT (FW_CFG_ARCH_LOCAL + 0x01)
61 #define FW_CFG_SPARC64_DEPTH (FW_CFG_ARCH_LOCAL + 0x02)
65 #define TICK_INT_DIS 0x8000000000000000ULL
66 #define TICK_MAX 0x7fffffffffffffffULL
69 const char * const default_cpu_model
;
72 uint64_t console_serial_base
;
75 int DMA_get_channel_mode (int nchan
)
79 int DMA_read_memory (int nchan
, void *buf
, int pos
, int size
)
83 int DMA_write_memory (int nchan
, void *buf
, int pos
, int size
)
87 void DMA_hold_DREQ (int nchan
) {}
88 void DMA_release_DREQ (int nchan
) {}
89 void DMA_schedule(int nchan
) {}
90 void DMA_init (int high_page_enable
) {}
91 void DMA_register_channel (int nchan
,
92 DMA_transfer_handler transfer_handler
,
97 static int fw_cfg_boot_set(void *opaque
, const char *boot_device
)
99 fw_cfg_add_i16(opaque
, FW_CFG_BOOT_DEVICE
, boot_device
[0]);
103 static int sun4u_NVRAM_set_params (m48t59_t
*nvram
, uint16_t NVRAM_size
,
106 const char *boot_devices
,
107 uint32_t kernel_image
, uint32_t kernel_size
,
109 uint32_t initrd_image
, uint32_t initrd_size
,
110 uint32_t NVRAM_image
,
111 int width
, int height
, int depth
,
112 const uint8_t *macaddr
)
116 uint8_t image
[0x1ff0];
117 struct OpenBIOS_nvpart_v1
*part_header
;
119 memset(image
, '\0', sizeof(image
));
123 // OpenBIOS nvram variables
124 // Variable partition
125 part_header
= (struct OpenBIOS_nvpart_v1
*)&image
[start
];
126 part_header
->signature
= OPENBIOS_PART_SYSTEM
;
127 pstrcpy(part_header
->name
, sizeof(part_header
->name
), "system");
129 end
= start
+ sizeof(struct OpenBIOS_nvpart_v1
);
130 for (i
= 0; i
< nb_prom_envs
; i
++)
131 end
= OpenBIOS_set_var(image
, end
, prom_envs
[i
]);
136 end
= start
+ ((end
- start
+ 15) & ~15);
137 OpenBIOS_finish_partition(part_header
, end
- start
);
141 part_header
= (struct OpenBIOS_nvpart_v1
*)&image
[start
];
142 part_header
->signature
= OPENBIOS_PART_FREE
;
143 pstrcpy(part_header
->name
, sizeof(part_header
->name
), "free");
146 OpenBIOS_finish_partition(part_header
, end
- start
);
148 Sun_init_header((struct Sun_nvram
*)&image
[0x1fd8], macaddr
, 0x80);
150 for (i
= 0; i
< sizeof(image
); i
++)
151 m48t59_write(nvram
, i
, image
[i
]);
155 static unsigned long sun4u_load_kernel(const char *kernel_filename
,
156 const char *initrd_filename
,
157 ram_addr_t RAM_size
, long *initrd_size
)
163 linux_boot
= (kernel_filename
!= NULL
);
167 kernel_size
= load_elf(kernel_filename
, 0, NULL
, NULL
, NULL
);
169 kernel_size
= load_aout(kernel_filename
, KERNEL_LOAD_ADDR
,
170 RAM_size
- KERNEL_LOAD_ADDR
);
172 kernel_size
= load_image_targphys(kernel_filename
,
174 RAM_size
- KERNEL_LOAD_ADDR
);
175 if (kernel_size
< 0) {
176 fprintf(stderr
, "qemu: could not load kernel '%s'\n",
183 if (initrd_filename
) {
184 *initrd_size
= load_image_targphys(initrd_filename
,
186 RAM_size
- INITRD_LOAD_ADDR
);
187 if (*initrd_size
< 0) {
188 fprintf(stderr
, "qemu: could not load initial ram disk '%s'\n",
193 if (*initrd_size
> 0) {
194 for (i
= 0; i
< 64 * TARGET_PAGE_SIZE
; i
+= TARGET_PAGE_SIZE
) {
195 if (ldl_phys(KERNEL_LOAD_ADDR
+ i
) == 0x48647253) { // HdrS
196 stl_phys(KERNEL_LOAD_ADDR
+ i
+ 16, INITRD_LOAD_ADDR
);
197 stl_phys(KERNEL_LOAD_ADDR
+ i
+ 20, *initrd_size
);
206 void pic_info(Monitor
*mon
)
210 void irq_info(Monitor
*mon
)
214 void cpu_check_irqs(CPUState
*env
)
216 uint32_t pil
= env
->pil_in
| (env
->softint
& ~SOFTINT_TIMER
) |
217 ((env
->softint
& SOFTINT_TIMER
) << 14);
219 if (pil
&& (env
->interrupt_index
== 0 ||
220 (env
->interrupt_index
& ~15) == TT_EXTINT
)) {
223 for (i
= 15; i
> 0; i
--) {
224 if (pil
& (1 << i
)) {
225 int old_interrupt
= env
->interrupt_index
;
227 env
->interrupt_index
= TT_EXTINT
| i
;
228 if (old_interrupt
!= env
->interrupt_index
) {
229 DPRINTF("Set CPU IRQ %d\n", i
);
230 cpu_interrupt(env
, CPU_INTERRUPT_HARD
);
235 } else if (!pil
&& (env
->interrupt_index
& ~15) == TT_EXTINT
) {
236 DPRINTF("Reset CPU IRQ %d\n", env
->interrupt_index
& 15);
237 env
->interrupt_index
= 0;
238 cpu_reset_interrupt(env
, CPU_INTERRUPT_HARD
);
242 static void cpu_set_irq(void *opaque
, int irq
, int level
)
244 CPUState
*env
= opaque
;
247 DPRINTF("Raise CPU IRQ %d\n", irq
);
249 env
->pil_in
|= 1 << irq
;
252 DPRINTF("Lower CPU IRQ %d\n", irq
);
253 env
->pil_in
&= ~(1 << irq
);
258 typedef struct ResetData
{
263 static void main_cpu_reset(void *opaque
)
265 ResetData
*s
= (ResetData
*)opaque
;
266 CPUState
*env
= s
->env
;
269 env
->tick_cmpr
= TICK_INT_DIS
| 0;
270 ptimer_set_limit(env
->tick
, TICK_MAX
, 1);
271 ptimer_run(env
->tick
, 1);
272 env
->stick_cmpr
= TICK_INT_DIS
| 0;
273 ptimer_set_limit(env
->stick
, TICK_MAX
, 1);
274 ptimer_run(env
->stick
, 1);
275 env
->hstick_cmpr
= TICK_INT_DIS
| 0;
276 ptimer_set_limit(env
->hstick
, TICK_MAX
, 1);
277 ptimer_run(env
->hstick
, 1);
278 env
->gregs
[1] = 0; // Memory start
279 env
->gregs
[2] = ram_size
; // Memory size
280 env
->gregs
[3] = 0; // Machine description XXX
281 env
->pc
= s
->reset_addr
;
282 env
->npc
= env
->pc
+ 4;
285 static void tick_irq(void *opaque
)
287 CPUState
*env
= opaque
;
289 if (!(env
->tick_cmpr
& TICK_INT_DIS
)) {
290 env
->softint
|= SOFTINT_TIMER
;
291 cpu_interrupt(env
, CPU_INTERRUPT_TIMER
);
295 static void stick_irq(void *opaque
)
297 CPUState
*env
= opaque
;
299 if (!(env
->stick_cmpr
& TICK_INT_DIS
)) {
300 env
->softint
|= SOFTINT_STIMER
;
301 cpu_interrupt(env
, CPU_INTERRUPT_TIMER
);
305 static void hstick_irq(void *opaque
)
307 CPUState
*env
= opaque
;
309 if (!(env
->hstick_cmpr
& TICK_INT_DIS
)) {
310 cpu_interrupt(env
, CPU_INTERRUPT_TIMER
);
314 void cpu_tick_set_count(void *opaque
, uint64_t count
)
316 ptimer_set_count(opaque
, -count
);
319 uint64_t cpu_tick_get_count(void *opaque
)
321 return -ptimer_get_count(opaque
);
324 void cpu_tick_set_limit(void *opaque
, uint64_t limit
)
326 ptimer_set_limit(opaque
, -limit
, 0);
329 static const int ide_iobase
[2] = { 0x1f0, 0x170 };
330 static const int ide_iobase2
[2] = { 0x3f6, 0x376 };
331 static const int ide_irq
[2] = { 14, 15 };
333 static const int serial_io
[MAX_SERIAL_PORTS
] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
334 static const int serial_irq
[MAX_SERIAL_PORTS
] = { 4, 3, 4, 3 };
336 static const int parallel_io
[MAX_PARALLEL_PORTS
] = { 0x378, 0x278, 0x3bc };
337 static const int parallel_irq
[MAX_PARALLEL_PORTS
] = { 7, 7, 7 };
339 static fdctrl_t
*floppy_controller
;
341 static void ebus_mmio_mapfunc(PCIDevice
*pci_dev
, int region_num
,
342 uint32_t addr
, uint32_t size
, int type
)
344 DPRINTF("Mapping region %d registers at %08x\n", region_num
, addr
);
345 switch (region_num
) {
347 isa_mmio_init(addr
, 0x1000000);
350 isa_mmio_init(addr
, 0x800000);
355 /* EBUS (Eight bit bus) bridge */
357 pci_ebus_init(PCIBus
*bus
, int devfn
)
359 pci_create_simple(bus
, devfn
, "ebus");
363 pci_ebus_init1(PCIDevice
*s
)
365 isa_bus_new(&s
->qdev
);
367 pci_config_set_vendor_id(s
->config
, PCI_VENDOR_ID_SUN
);
368 pci_config_set_device_id(s
->config
, PCI_DEVICE_ID_SUN_EBUS
);
369 s
->config
[0x04] = 0x06; // command = bus master, pci mem
370 s
->config
[0x05] = 0x00;
371 s
->config
[0x06] = 0xa0; // status = fast back-to-back, 66MHz, no error
372 s
->config
[0x07] = 0x03; // status = medium devsel
373 s
->config
[0x08] = 0x01; // revision
374 s
->config
[0x09] = 0x00; // programming i/f
375 pci_config_set_class(s
->config
, PCI_CLASS_BRIDGE_OTHER
);
376 s
->config
[0x0D] = 0x0a; // latency_timer
377 s
->config
[PCI_HEADER_TYPE
] = PCI_HEADER_TYPE_NORMAL
; // header_type
379 pci_register_bar(s
, 0, 0x1000000, PCI_ADDRESS_SPACE_MEM
,
381 pci_register_bar(s
, 1, 0x800000, PCI_ADDRESS_SPACE_MEM
,
386 static PCIDeviceInfo ebus_info
= {
388 .qdev
.size
= sizeof(PCIDevice
),
389 .init
= pci_ebus_init1
,
392 static void pci_ebus_register(void)
394 pci_qdev_register(&ebus_info
);
397 device_init(pci_ebus_register
);
399 /* Boot PROM (OpenBIOS) */
400 static void prom_init(target_phys_addr_t addr
, const char *bios_name
)
407 dev
= qdev_create(NULL
, "openprom");
409 s
= sysbus_from_qdev(dev
);
411 sysbus_mmio_map(s
, 0, addr
);
414 if (bios_name
== NULL
) {
415 bios_name
= PROM_FILENAME
;
417 filename
= qemu_find_file(QEMU_FILE_TYPE_BIOS
, bios_name
);
419 ret
= load_elf(filename
, addr
- PROM_VADDR
, NULL
, NULL
, NULL
);
420 if (ret
< 0 || ret
> PROM_SIZE_MAX
) {
421 ret
= load_image_targphys(filename
, addr
, PROM_SIZE_MAX
);
427 if (ret
< 0 || ret
> PROM_SIZE_MAX
) {
428 fprintf(stderr
, "qemu: could not load prom '%s'\n", bios_name
);
433 static int prom_init1(SysBusDevice
*dev
)
435 ram_addr_t prom_offset
;
437 prom_offset
= qemu_ram_alloc(PROM_SIZE_MAX
);
438 sysbus_init_mmio(dev
, PROM_SIZE_MAX
, prom_offset
| IO_MEM_ROM
);
442 static SysBusDeviceInfo prom_info
= {
444 .qdev
.name
= "openprom",
445 .qdev
.size
= sizeof(SysBusDevice
),
446 .qdev
.props
= (Property
[]) {
447 {/* end of property list */}
451 static void prom_register_devices(void)
453 sysbus_register_withprop(&prom_info
);
456 device_init(prom_register_devices
);
459 typedef struct RamDevice
466 static int ram_init1(SysBusDevice
*dev
)
468 ram_addr_t RAM_size
, ram_offset
;
469 RamDevice
*d
= FROM_SYSBUS(RamDevice
, dev
);
473 ram_offset
= qemu_ram_alloc(RAM_size
);
474 sysbus_init_mmio(dev
, RAM_size
, ram_offset
);
478 static void ram_init(target_phys_addr_t addr
, ram_addr_t RAM_size
)
485 dev
= qdev_create(NULL
, "memory");
486 s
= sysbus_from_qdev(dev
);
488 d
= FROM_SYSBUS(RamDevice
, s
);
492 sysbus_mmio_map(s
, 0, addr
);
495 static SysBusDeviceInfo ram_info
= {
497 .qdev
.name
= "memory",
498 .qdev
.size
= sizeof(RamDevice
),
499 .qdev
.props
= (Property
[]) {
500 DEFINE_PROP_UINT64("size", RamDevice
, size
, 0),
501 DEFINE_PROP_END_OF_LIST(),
505 static void ram_register_devices(void)
507 sysbus_register_withprop(&ram_info
);
510 device_init(ram_register_devices
);
512 static CPUState
*cpu_devinit(const char *cpu_model
, const struct hwdef
*hwdef
)
516 ResetData
*reset_info
;
519 cpu_model
= hwdef
->default_cpu_model
;
520 env
= cpu_init(cpu_model
);
522 fprintf(stderr
, "Unable to find Sparc CPU definition\n");
525 bh
= qemu_bh_new(tick_irq
, env
);
526 env
->tick
= ptimer_init(bh
);
527 ptimer_set_period(env
->tick
, 1ULL);
529 bh
= qemu_bh_new(stick_irq
, env
);
530 env
->stick
= ptimer_init(bh
);
531 ptimer_set_period(env
->stick
, 1ULL);
533 bh
= qemu_bh_new(hstick_irq
, env
);
534 env
->hstick
= ptimer_init(bh
);
535 ptimer_set_period(env
->hstick
, 1ULL);
537 reset_info
= qemu_mallocz(sizeof(ResetData
));
538 reset_info
->env
= env
;
539 reset_info
->reset_addr
= hwdef
->prom_addr
+ 0x40ULL
;
540 qemu_register_reset(main_cpu_reset
, reset_info
);
541 main_cpu_reset(reset_info
);
542 // Override warm reset address with cold start address
543 env
->pc
= hwdef
->prom_addr
+ 0x20ULL
;
544 env
->npc
= env
->pc
+ 4;
549 static void sun4uv_init(ram_addr_t RAM_size
,
550 const char *boot_devices
,
551 const char *kernel_filename
, const char *kernel_cmdline
,
552 const char *initrd_filename
, const char *cpu_model
,
553 const struct hwdef
*hwdef
)
558 long initrd_size
, kernel_size
;
559 PCIBus
*pci_bus
, *pci_bus2
, *pci_bus3
;
561 BlockDriverState
*hd
[MAX_IDE_BUS
* MAX_IDE_DEVS
];
562 BlockDriverState
*fd
[MAX_FD
];
567 env
= cpu_devinit(cpu_model
, hwdef
);
570 ram_init(0, RAM_size
);
572 prom_init(hwdef
->prom_addr
, bios_name
);
575 irq
= qemu_allocate_irqs(cpu_set_irq
, env
, MAX_PILS
);
576 pci_bus
= pci_apb_init(APB_SPECIAL_BASE
, APB_MEM_BASE
, irq
, &pci_bus2
,
578 isa_mem_base
= VGA_BASE
;
579 pci_vga_init(pci_bus
, 0, 0);
581 // XXX Should be pci_bus3
582 pci_ebus_init(pci_bus
, -1);
585 if (hwdef
->console_serial_base
) {
586 serial_mm_init(hwdef
->console_serial_base
, 0, NULL
, 115200,
590 for(; i
< MAX_SERIAL_PORTS
; i
++) {
592 serial_init(serial_io
[i
], NULL
/*serial_irq[i]*/, 115200,
597 for(i
= 0; i
< MAX_PARALLEL_PORTS
; i
++) {
598 if (parallel_hds
[i
]) {
599 parallel_init(parallel_io
[i
], NULL
/*parallel_irq[i]*/,
604 for(i
= 0; i
< nb_nics
; i
++)
605 pci_nic_init(&nd_table
[i
], "ne2k_pci", NULL
);
607 if (drive_get_max_bus(IF_IDE
) >= MAX_IDE_BUS
) {
608 fprintf(stderr
, "qemu: too many IDE bus\n");
611 for(i
= 0; i
< MAX_IDE_BUS
* MAX_IDE_DEVS
; i
++) {
612 dinfo
= drive_get(IF_IDE
, i
/ MAX_IDE_DEVS
,
614 hd
[i
] = dinfo
? dinfo
->bdrv
: NULL
;
617 pci_cmd646_ide_init(pci_bus
, hd
, 1);
619 /* FIXME: wire up interrupts. */
620 i8042_init(NULL
/*1*/, NULL
/*12*/, 0x60);
621 for(i
= 0; i
< MAX_FD
; i
++) {
622 dinfo
= drive_get(IF_FLOPPY
, 0, i
);
623 fd
[i
] = dinfo
? dinfo
->bdrv
: NULL
;
625 floppy_controller
= fdctrl_init_isa(6, 2, 0x3f0, fd
);
626 nvram
= m48t59_init(NULL
/*8*/, 0, 0x0074, NVRAM_SIZE
, 59);
629 kernel_size
= sun4u_load_kernel(kernel_filename
, initrd_filename
,
630 ram_size
, &initrd_size
);
632 sun4u_NVRAM_set_params(nvram
, NVRAM_SIZE
, "Sun4u", RAM_size
, boot_devices
,
633 KERNEL_LOAD_ADDR
, kernel_size
,
635 INITRD_LOAD_ADDR
, initrd_size
,
636 /* XXX: need an option to load a NVRAM image */
638 graphic_width
, graphic_height
, graphic_depth
,
639 (uint8_t *)&nd_table
[0].macaddr
);
641 fw_cfg
= fw_cfg_init(BIOS_CFG_IOPORT
, BIOS_CFG_IOPORT
+ 1, 0, 0);
642 fw_cfg_add_i32(fw_cfg
, FW_CFG_ID
, 1);
643 fw_cfg_add_i64(fw_cfg
, FW_CFG_RAM_SIZE
, (uint64_t)ram_size
);
644 fw_cfg_add_i16(fw_cfg
, FW_CFG_MACHINE_ID
, hwdef
->machine_id
);
645 fw_cfg_add_i32(fw_cfg
, FW_CFG_KERNEL_ADDR
, KERNEL_LOAD_ADDR
);
646 fw_cfg_add_i32(fw_cfg
, FW_CFG_KERNEL_SIZE
, kernel_size
);
647 if (kernel_cmdline
) {
648 fw_cfg_add_i32(fw_cfg
, FW_CFG_KERNEL_CMDLINE
, CMDLINE_ADDR
);
649 pstrcpy_targphys(CMDLINE_ADDR
, TARGET_PAGE_SIZE
, kernel_cmdline
);
651 fw_cfg_add_i32(fw_cfg
, FW_CFG_KERNEL_CMDLINE
, 0);
653 fw_cfg_add_i32(fw_cfg
, FW_CFG_INITRD_ADDR
, INITRD_LOAD_ADDR
);
654 fw_cfg_add_i32(fw_cfg
, FW_CFG_INITRD_SIZE
, initrd_size
);
655 fw_cfg_add_i16(fw_cfg
, FW_CFG_BOOT_DEVICE
, boot_devices
[0]);
657 fw_cfg_add_i16(fw_cfg
, FW_CFG_SPARC64_WIDTH
, graphic_width
);
658 fw_cfg_add_i16(fw_cfg
, FW_CFG_SPARC64_HEIGHT
, graphic_height
);
659 fw_cfg_add_i16(fw_cfg
, FW_CFG_SPARC64_DEPTH
, graphic_depth
);
661 qemu_register_boot_set(fw_cfg_boot_set
, fw_cfg
);
670 static const struct hwdef hwdefs
[] = {
671 /* Sun4u generic PC-like machine */
673 .default_cpu_model
= "TI UltraSparc II",
674 .machine_id
= sun4u_id
,
675 .prom_addr
= 0x1fff0000000ULL
,
676 .console_serial_base
= 0,
678 /* Sun4v generic PC-like machine */
680 .default_cpu_model
= "Sun UltraSparc T1",
681 .machine_id
= sun4v_id
,
682 .prom_addr
= 0x1fff0000000ULL
,
683 .console_serial_base
= 0,
685 /* Sun4v generic Niagara machine */
687 .default_cpu_model
= "Sun UltraSparc T1",
688 .machine_id
= niagara_id
,
689 .prom_addr
= 0xfff0000000ULL
,
690 .console_serial_base
= 0xfff0c2c000ULL
,
694 /* Sun4u hardware initialisation */
695 static void sun4u_init(ram_addr_t RAM_size
,
696 const char *boot_devices
,
697 const char *kernel_filename
, const char *kernel_cmdline
,
698 const char *initrd_filename
, const char *cpu_model
)
700 sun4uv_init(RAM_size
, boot_devices
, kernel_filename
,
701 kernel_cmdline
, initrd_filename
, cpu_model
, &hwdefs
[0]);
704 /* Sun4v hardware initialisation */
705 static void sun4v_init(ram_addr_t RAM_size
,
706 const char *boot_devices
,
707 const char *kernel_filename
, const char *kernel_cmdline
,
708 const char *initrd_filename
, const char *cpu_model
)
710 sun4uv_init(RAM_size
, boot_devices
, kernel_filename
,
711 kernel_cmdline
, initrd_filename
, cpu_model
, &hwdefs
[1]);
714 /* Niagara hardware initialisation */
715 static void niagara_init(ram_addr_t RAM_size
,
716 const char *boot_devices
,
717 const char *kernel_filename
, const char *kernel_cmdline
,
718 const char *initrd_filename
, const char *cpu_model
)
720 sun4uv_init(RAM_size
, boot_devices
, kernel_filename
,
721 kernel_cmdline
, initrd_filename
, cpu_model
, &hwdefs
[2]);
724 static QEMUMachine sun4u_machine
= {
726 .desc
= "Sun4u platform",
728 .max_cpus
= 1, // XXX for now
732 static QEMUMachine sun4v_machine
= {
734 .desc
= "Sun4v platform",
736 .max_cpus
= 1, // XXX for now
739 static QEMUMachine niagara_machine
= {
741 .desc
= "Sun4v platform, Niagara",
742 .init
= niagara_init
,
743 .max_cpus
= 1, // XXX for now
746 static void sun4u_machine_init(void)
748 qemu_register_machine(&sun4u_machine
);
749 qemu_register_machine(&sun4v_machine
);
750 qemu_register_machine(&niagara_machine
);
753 machine_init(sun4u_machine_init
);