aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-05 19:44:02 +0000
committerj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-05 19:44:02 +0000
commit94fc95cdb2e91826bd6a4c98cea4f4d9fa0fffb1 (patch)
treec423a9cdeacbc5258ff8bb81764728d73fc0afc8 /hw
parent7a2d6d9650ed16b2cdb0b4876fe9efce7ef8ea6d (diff)
New -cpu options: choose CPU model for emulated target.
Only relevant on PowerPC targets, for now. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2468 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/integratorcp.c4
-rw-r--r--hw/mips_malta.c2
-rw-r--r--hw/mips_r4k.c2
-rw-r--r--hw/pc.c6
-rw-r--r--hw/ppc_chrp.c59
-rw-r--r--hw/ppc_prep.c21
-rw-r--r--hw/realview.c2
-rw-r--r--hw/shix.c2
-rw-r--r--hw/sun4m.c2
-rw-r--r--hw/sun4u.c2
-rw-r--r--hw/versatilepb.c4
11 files changed, 53 insertions, 53 deletions
diff --git a/hw/integratorcp.c b/hw/integratorcp.c
index 4e5f4ac9f7..fd1675b40b 100644
--- a/hw/integratorcp.c
+++ b/hw/integratorcp.c
@@ -516,7 +516,7 @@ static void integratorcp_init(int ram_size, int vga_ram_size, int boot_device,
static void integratorcp926_init(int ram_size, int vga_ram_size,
int boot_device, DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename, const char *cpu_model)
{
integratorcp_init(ram_size, vga_ram_size, boot_device, ds, fd_filename,
snapshot, kernel_filename, kernel_cmdline,
@@ -526,7 +526,7 @@ static void integratorcp926_init(int ram_size, int vga_ram_size,
static void integratorcp1026_init(int ram_size, int vga_ram_size,
int boot_device, DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename, const char *cpu_model)
{
integratorcp_init(ram_size, vga_ram_size, boot_device, ds, fd_filename,
snapshot, kernel_filename, kernel_cmdline,
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index 8d77b78003..d137658fbd 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -615,7 +615,7 @@ static
void mips_malta_init (int ram_size, int vga_ram_size, int boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename, const char *cpu_model)
{
char buf[1024];
unsigned long bios_offset;
diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
index b6054fd517..91d8021dda 100644
--- a/hw/mips_r4k.c
+++ b/hw/mips_r4k.c
@@ -130,7 +130,7 @@ static
void mips_r4k_init (int ram_size, int vga_ram_size, int boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename, const char *cpu_model)
{
char buf[1024];
unsigned long bios_offset;
diff --git a/hw/pc.c b/hw/pc.c
index 0560ff1f92..ba9c2d9473 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -758,7 +758,8 @@ static void pc_init_pci(int ram_size, int vga_ram_size, int boot_device,
int snapshot,
const char *kernel_filename,
const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename,
+ const char *cpu_model)
{
pc_init1(ram_size, vga_ram_size, boot_device,
ds, fd_filename, snapshot,
@@ -771,7 +772,8 @@ static void pc_init_isa(int ram_size, int vga_ram_size, int boot_device,
int snapshot,
const char *kernel_filename,
const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename,
+ const char *cpu_model)
{
pc_init1(ram_size, vga_ram_size, boot_device,
ds, fd_filename, snapshot,
diff --git a/hw/ppc_chrp.c b/hw/ppc_chrp.c
index 1e0fd2e9da..937be150ce 100644
--- a/hw/ppc_chrp.c
+++ b/hw/ppc_chrp.c
@@ -292,13 +292,14 @@ void pmac_format_nvram_partition(uint8_t *buf, int len)
}
/* PowerPC CHRP hardware initialisation */
-static void ppc_chrp_init(int ram_size, int vga_ram_size, int boot_device,
- DisplayState *ds, const char **fd_filename,
- int snapshot,
- const char *kernel_filename,
- const char *kernel_cmdline,
- const char *initrd_filename,
- int is_heathrow)
+static void ppc_chrp_init (int ram_size, int vga_ram_size, int boot_device,
+ DisplayState *ds, const char **fd_filename,
+ int snapshot,
+ const char *kernel_filename,
+ const char *kernel_cmdline,
+ const char *initrd_filename,
+ const char *cpu_model,
+ int is_heathrow)
{
CPUState *env;
char buf[1024];
@@ -320,22 +321,16 @@ static void ppc_chrp_init(int ram_size, int vga_ram_size, int boot_device,
env = cpu_init();
register_savevm("cpu", 0, 3, cpu_save, cpu_load, env);
- /* Register CPU as a 74x/75x */
+ /* Default CPU is a generic 74x/75x */
+ if (cpu_model == NULL)
+ cpu_model = "750";
/* XXX: CPU model (or PVR) should be provided on command line */
// ppc_find_by_name("750gx", &def); // Linux boot OK
// ppc_find_by_name("750fx", &def); // Linux boot OK
/* Linux does not boot on 750cxe (and probably other 750cx based)
* because it assumes it has 8 IBAT & DBAT pairs as it only have 4.
*/
- // ppc_find_by_name("750cxe", &def);
- // ppc_find_by_name("750p", &def);
- // ppc_find_by_name("740p", &def);
- ppc_find_by_name("750", &def);
- // ppc_find_by_name("740", &def);
- // ppc_find_by_name("G3", &def);
- // ppc_find_by_name("604r", &def);
- // ppc_find_by_name("604e", &def);
- // ppc_find_by_name("604", &def);
+ ppc_find_by_name(cpu_model, &def);
if (def == NULL) {
cpu_abort(env, "Unable to find PowerPC CPU definition\n");
}
@@ -525,30 +520,32 @@ static void ppc_chrp_init(int ram_size, int vga_ram_size, int boot_device,
register_ioport_write(0x0F00, 4, 1, &PPC_debug_write, NULL);
}
-static void ppc_core99_init(int ram_size, int vga_ram_size, int boot_device,
- DisplayState *ds, const char **fd_filename,
- int snapshot,
- const char *kernel_filename,
- const char *kernel_cmdline,
- const char *initrd_filename)
+static void ppc_core99_init (int ram_size, int vga_ram_size, int boot_device,
+ DisplayState *ds, const char **fd_filename,
+ int snapshot,
+ const char *kernel_filename,
+ const char *kernel_cmdline,
+ const char *initrd_filename,
+ const char *cpu_model)
{
ppc_chrp_init(ram_size, vga_ram_size, boot_device,
ds, fd_filename, snapshot,
kernel_filename, kernel_cmdline,
- initrd_filename, 0);
+ initrd_filename, cpu_model, 0);
}
-static void ppc_heathrow_init(int ram_size, int vga_ram_size, int boot_device,
- DisplayState *ds, const char **fd_filename,
- int snapshot,
- const char *kernel_filename,
- const char *kernel_cmdline,
- const char *initrd_filename)
+static void ppc_heathrow_init (int ram_size, int vga_ram_size, int boot_device,
+ DisplayState *ds, const char **fd_filename,
+ int snapshot,
+ const char *kernel_filename,
+ const char *kernel_cmdline,
+ const char *initrd_filename,
+ const char *cpu_model)
{
ppc_chrp_init(ram_size, vga_ram_size, boot_device,
ds, fd_filename, snapshot,
kernel_filename, kernel_cmdline,
- initrd_filename, 1);
+ initrd_filename, cpu_model, 1);
}
QEMUMachine core99_machine = {
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index c4b7ff5baa..27d3d48486 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -518,10 +518,12 @@ CPUReadMemoryFunc *PPC_prep_io_read[] = {
#define NVRAM_SIZE 0x2000
/* PowerPC PREP hardware initialisation */
-static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device,
- DisplayState *ds, const char **fd_filename, int snapshot,
- const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+static void ppc_prep_init (int ram_size, int vga_ram_size, int boot_device,
+ DisplayState *ds, const char **fd_filename,
+ int snapshot, const char *kernel_filename,
+ const char *kernel_cmdline,
+ const char *initrd_filename,
+ const char *cpu_model)
{
CPUState *env;
char buf[1024];
@@ -543,12 +545,11 @@ static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device,
env = cpu_init();
register_savevm("cpu", 0, 3, cpu_save, cpu_load, env);
-
- /* Register CPU as a 604 */
- /* XXX: CPU model (or PVR) should be provided on command line */
- // ppc_find_by_name("604r", &def);
- // ppc_find_by_name("604e", &def);
- ppc_find_by_name("604", &def);
+
+ /* Default CPU is a 604 */
+ if (cpu_model == NULL)
+ cpu_model = "604";
+ ppc_find_by_name(cpu_model, &def);
if (def == NULL) {
cpu_abort(env, "Unable to find PowerPC CPU definition\n");
}
diff --git a/hw/realview.c b/hw/realview.c
index ea42705adb..325b3d1ab3 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -15,7 +15,7 @@
static void realview_init(int ram_size, int vga_ram_size, int boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename, const char *cpu_model)
{
CPUState *env;
void *pic;
diff --git a/hw/shix.c b/hw/shix.c
index 9577c092c2..5857d0e06b 100644
--- a/hw/shix.c
+++ b/hw/shix.c
@@ -70,7 +70,7 @@ void vga_screen_dump(const char *filename)
void shix_init(int ram_size, int vga_ram_size, int boot_device,
DisplayState * ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename, const char *cpu_model)
{
int ret;
CPUState *env;
diff --git a/hw/sun4m.c b/hw/sun4m.c
index 9b6aae53c8..c5f6ddda8b 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -211,7 +211,7 @@ static void main_cpu_reset(void *opaque)
static void sun4m_init(int ram_size, int vga_ram_size, int boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename, const char *cpu_model)
{
CPUState *env, *envs[MAX_CPUS];
char buf[1024];
diff --git a/hw/sun4u.c b/hw/sun4u.c
index 61069a6529..2357dc974a 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -257,7 +257,7 @@ static fdctrl_t *floppy_controller;
static void sun4u_init(int ram_size, int vga_ram_size, int boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename, const char *cpu_model)
{
CPUState *env;
char buf[1024];
diff --git a/hw/versatilepb.c b/hw/versatilepb.c
index bc42472ade..1bcc160b33 100644
--- a/hw/versatilepb.c
+++ b/hw/versatilepb.c
@@ -257,7 +257,7 @@ static void versatile_init(int ram_size, int vga_ram_size, int boot_device,
static void vpb_init(int ram_size, int vga_ram_size, int boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename, const char *cpu_model)
{
versatile_init(ram_size, vga_ram_size, boot_device,
ds, fd_filename, snapshot,
@@ -268,7 +268,7 @@ static void vpb_init(int ram_size, int vga_ram_size, int boot_device,
static void vab_init(int ram_size, int vga_ram_size, int boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename, const char *cpu_model)
{
versatile_init(ram_size, vga_ram_size, boot_device,
ds, fd_filename, snapshot,