Commit 4207117c93357347500235952ce7891688089cb1
1 parent
21bd785e
Honour limited subset of --cpu values instead of ignoring.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2761 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
14 additions
and
9 deletions
hw/pxa2xx.c
@@ -1518,13 +1518,16 @@ struct pxa2xx_state_s *pxa270_init(DisplayState *ds, const char *revision) | @@ -1518,13 +1518,16 @@ struct pxa2xx_state_s *pxa270_init(DisplayState *ds, const char *revision) | ||
1518 | { | 1518 | { |
1519 | struct pxa2xx_state_s *s; | 1519 | struct pxa2xx_state_s *s; |
1520 | struct pxa2xx_ssp_s *ssp; | 1520 | struct pxa2xx_ssp_s *ssp; |
1521 | - char cpu_model[16]; | ||
1522 | int iomemtype, i; | 1521 | int iomemtype, i; |
1523 | s = (struct pxa2xx_state_s *) qemu_mallocz(sizeof(struct pxa2xx_state_s)); | 1522 | s = (struct pxa2xx_state_s *) qemu_mallocz(sizeof(struct pxa2xx_state_s)); |
1524 | 1523 | ||
1524 | + if (revision && strncmp(revision, "pxa27", 5)) { | ||
1525 | + fprintf(stderr, "Machine requires a PXA27x processor.\n"); | ||
1526 | + exit(1); | ||
1527 | + } | ||
1528 | + | ||
1525 | s->env = cpu_init(); | 1529 | s->env = cpu_init(); |
1526 | - snprintf(cpu_model, sizeof(cpu_model), "pxa270-%s", revision); | ||
1527 | - cpu_arm_set_model(s->env, cpu_model); | 1530 | + cpu_arm_set_model(s->env, revision ?: "pxa270"); |
1528 | 1531 | ||
1529 | s->pic = pxa2xx_pic_init(0x40d00000, s->env); | 1532 | s->pic = pxa2xx_pic_init(0x40d00000, s->env); |
1530 | 1533 |
hw/spitz.c
@@ -992,14 +992,16 @@ enum spitz_model_e { spitz, akita, borzoi, terrier }; | @@ -992,14 +992,16 @@ enum spitz_model_e { spitz, akita, borzoi, terrier }; | ||
992 | static void spitz_common_init(int ram_size, int vga_ram_size, | 992 | static void spitz_common_init(int ram_size, int vga_ram_size, |
993 | DisplayState *ds, const char *kernel_filename, | 993 | DisplayState *ds, const char *kernel_filename, |
994 | const char *kernel_cmdline, const char *initrd_filename, | 994 | const char *kernel_cmdline, const char *initrd_filename, |
995 | - enum spitz_model_e model, int arm_id) | 995 | + const char *cpu_model, enum spitz_model_e model, int arm_id) |
996 | { | 996 | { |
997 | uint32_t spitz_ram = 0x04000000; | 997 | uint32_t spitz_ram = 0x04000000; |
998 | uint32_t spitz_rom = 0x00800000; | 998 | uint32_t spitz_rom = 0x00800000; |
999 | struct pxa2xx_state_s *cpu; | 999 | struct pxa2xx_state_s *cpu; |
1000 | struct scoop_info_s *scp; | 1000 | struct scoop_info_s *scp; |
1001 | 1001 | ||
1002 | - cpu = pxa270_init(ds, (model == terrier) ? "c5" : "c0"); | 1002 | + if (!cpu_model) |
1003 | + cpu_model = (model == terrier) ? "pxa270-c5" : "pxa270-c0"; | ||
1004 | + cpu = pxa270_init(ds, cpu_model); | ||
1003 | 1005 | ||
1004 | /* Setup memory */ | 1006 | /* Setup memory */ |
1005 | if (ram_size < spitz_ram + spitz_rom) { | 1007 | if (ram_size < spitz_ram + spitz_rom) { |
@@ -1045,7 +1047,7 @@ static void spitz_init(int ram_size, int vga_ram_size, int boot_device, | @@ -1045,7 +1047,7 @@ static void spitz_init(int ram_size, int vga_ram_size, int boot_device, | ||
1045 | const char *initrd_filename, const char *cpu_model) | 1047 | const char *initrd_filename, const char *cpu_model) |
1046 | { | 1048 | { |
1047 | spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename, | 1049 | spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename, |
1048 | - kernel_cmdline, initrd_filename, spitz, 0x2c9); | 1050 | + kernel_cmdline, initrd_filename, cpu_model, spitz, 0x2c9); |
1049 | } | 1051 | } |
1050 | 1052 | ||
1051 | static void borzoi_init(int ram_size, int vga_ram_size, int boot_device, | 1053 | static void borzoi_init(int ram_size, int vga_ram_size, int boot_device, |
@@ -1054,7 +1056,7 @@ static void borzoi_init(int ram_size, int vga_ram_size, int boot_device, | @@ -1054,7 +1056,7 @@ static void borzoi_init(int ram_size, int vga_ram_size, int boot_device, | ||
1054 | const char *initrd_filename, const char *cpu_model) | 1056 | const char *initrd_filename, const char *cpu_model) |
1055 | { | 1057 | { |
1056 | spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename, | 1058 | spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename, |
1057 | - kernel_cmdline, initrd_filename, borzoi, 0x33f); | 1059 | + kernel_cmdline, initrd_filename, cpu_model, borzoi, 0x33f); |
1058 | } | 1060 | } |
1059 | 1061 | ||
1060 | static void akita_init(int ram_size, int vga_ram_size, int boot_device, | 1062 | static void akita_init(int ram_size, int vga_ram_size, int boot_device, |
@@ -1063,7 +1065,7 @@ static void akita_init(int ram_size, int vga_ram_size, int boot_device, | @@ -1063,7 +1065,7 @@ static void akita_init(int ram_size, int vga_ram_size, int boot_device, | ||
1063 | const char *initrd_filename, const char *cpu_model) | 1065 | const char *initrd_filename, const char *cpu_model) |
1064 | { | 1066 | { |
1065 | spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename, | 1067 | spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename, |
1066 | - kernel_cmdline, initrd_filename, akita, 0x2e8); | 1068 | + kernel_cmdline, initrd_filename, cpu_model, akita, 0x2e8); |
1067 | } | 1069 | } |
1068 | 1070 | ||
1069 | static void terrier_init(int ram_size, int vga_ram_size, int boot_device, | 1071 | static void terrier_init(int ram_size, int vga_ram_size, int boot_device, |
@@ -1072,7 +1074,7 @@ static void terrier_init(int ram_size, int vga_ram_size, int boot_device, | @@ -1072,7 +1074,7 @@ static void terrier_init(int ram_size, int vga_ram_size, int boot_device, | ||
1072 | const char *initrd_filename, const char *cpu_model) | 1074 | const char *initrd_filename, const char *cpu_model) |
1073 | { | 1075 | { |
1074 | spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename, | 1076 | spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename, |
1075 | - kernel_cmdline, initrd_filename, terrier, 0x33f); | 1077 | + kernel_cmdline, initrd_filename, cpu_model, terrier, 0x33f); |
1076 | } | 1078 | } |
1077 | 1079 | ||
1078 | QEMUMachine akitapda_machine = { | 1080 | QEMUMachine akitapda_machine = { |