summaryrefslogtreecommitdiff
path: root/hw/sun4u.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-22 07:07:34 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-22 07:07:34 +0000
commitc7ba218da1639a054b5ca1c259530305562fa571 (patch)
treecaf7b557b77356b875bd46dfb42efa7e328b1de6 /hw/sun4u.c
parentd406647966365b4ea505ef290825b257c678e764 (diff)
downloadqemu-c7ba218da1639a054b5ca1c259530305562fa571.tar.gz
qemu-c7ba218da1639a054b5ca1c259530305562fa571.tar.bz2
qemu-c7ba218da1639a054b5ca1c259530305562fa571.zip
Add T1 and T2 CPUs, add a Sun4v machine
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4923 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/sun4u.c')
-rw-r--r--hw/sun4u.c59
1 files changed, 51 insertions, 8 deletions
diff --git a/hw/sun4u.c b/hw/sun4u.c
index e8280dd7ab..36d6946f87 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -1,5 +1,5 @@
/*
- * QEMU Sun4u System Emulator
+ * QEMU Sun4u/Sun4v System Emulator
*
* Copyright (c) 2005 Fabrice Bellard
*
@@ -45,6 +45,10 @@
#define NVRAM_SIZE 0x2000
#define MAX_IDE_BUS 2
+struct hwdef {
+ const char * const default_cpu_model;
+};
+
int DMA_get_channel_mode (int nchan)
{
return 0;
@@ -245,11 +249,11 @@ static const int parallel_irq[MAX_PARALLEL_PORTS] = { 7, 7, 7 };
static fdctrl_t *floppy_controller;
-/* Sun4u hardware initialisation */
-static void sun4u_init(ram_addr_t RAM_size, int vga_ram_size,
- const char *boot_devices, DisplayState *ds,
- const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename, const char *cpu_model)
+static void sun4uv_init(ram_addr_t RAM_size, int vga_ram_size,
+ const char *boot_devices, DisplayState *ds,
+ const char *kernel_filename, const char *kernel_cmdline,
+ const char *initrd_filename, const char *cpu_model,
+ const struct hwdef *hwdef)
{
CPUState *env;
char buf[1024];
@@ -267,8 +271,9 @@ static void sun4u_init(ram_addr_t RAM_size, int vga_ram_size,
linux_boot = (kernel_filename != NULL);
/* init CPUs */
- if (cpu_model == NULL)
- cpu_model = "TI UltraSparc II";
+ if (!cpu_model)
+ cpu_model = hwdef->default_cpu_model;
+
env = cpu_init(cpu_model);
if (!env) {
fprintf(stderr, "Unable to find Sparc CPU definition\n");
@@ -409,9 +414,47 @@ static void sun4u_init(ram_addr_t RAM_size, int vga_ram_size,
}
+static const struct hwdef hwdefs[] = {
+ /* Sun4u generic PC-like machine */
+ {
+ .default_cpu_model = "TI UltraSparc II",
+ },
+ /* Sun4v generic PC-like machine */
+ {
+ .default_cpu_model = "Sun UltraSparc T1",
+ },
+};
+
+/* Sun4u hardware initialisation */
+static void sun4u_init(ram_addr_t RAM_size, int vga_ram_size,
+ const char *boot_devices, DisplayState *ds,
+ const char *kernel_filename, const char *kernel_cmdline,
+ const char *initrd_filename, const char *cpu_model)
+{
+ sun4uv_init(RAM_size, vga_ram_size, boot_devices, ds, kernel_filename,
+ kernel_cmdline, initrd_filename, cpu_model, &hwdefs[0]);
+}
+
+/* Sun4v hardware initialisation */
+static void sun4v_init(ram_addr_t RAM_size, int vga_ram_size,
+ const char *boot_devices, DisplayState *ds,
+ const char *kernel_filename, const char *kernel_cmdline,
+ const char *initrd_filename, const char *cpu_model)
+{
+ sun4uv_init(RAM_size, vga_ram_size, boot_devices, ds, kernel_filename,
+ kernel_cmdline, initrd_filename, cpu_model, &hwdefs[1]);
+}
+
QEMUMachine sun4u_machine = {
"sun4u",
"Sun4u platform",
sun4u_init,
PROM_SIZE_MAX + VGA_RAM_SIZE,
};
+
+QEMUMachine sun4v_machine = {
+ "sun4v",
+ "Sun4v platform",
+ sun4v_init,
+ PROM_SIZE_MAX + VGA_RAM_SIZE,
+};