Index: vl.c =================================================================== RCS file: /sources/qemu/qemu/vl.c,v retrieving revision 1.323 diff -u -r1.323 vl.c --- vl.c 29 Jul 2007 17:57:25 -0000 1.323 +++ vl.c 19 Aug 2007 01:31:31 -0000 @@ -196,6 +197,7 @@ const char *option_rom[MAX_OPTION_ROMS]; int nb_option_roms; int semihosting_enabled = 0; +int override_mtype = 0; int autostart = 1; #ifdef TARGET_ARM int old_param = 0; @@ -6590,6 +6592,9 @@ "\n" "Standard options:\n" "-M machine select emulated machine (-M ? for list)\n" +#ifdef TARGET_ARM + "-mtype machid set ARM machine type for generic machines\n" +#endif "-cpu cpu select CPU (-cpu ? for list)\n" "-fda/-fdb file use 'file' as floppy disk 0/1 image\n" "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n" @@ -6805,6 +6811,7 @@ QEMU_OPTION_name, QEMU_OPTION_prom_env, QEMU_OPTION_old_param, + QEMU_OPTION_mtype, }; typedef struct QEMUOption { @@ -6901,6 +6909,7 @@ { "option-rom", HAS_ARG, QEMU_OPTION_option_rom }, #if defined(TARGET_ARM) || defined(TARGET_M68K) { "semihosting", 0, QEMU_OPTION_semihosting }, + { "mtype", HAS_ARG, QEMU_OPTION_mtype }, #endif { "name", HAS_ARG, QEMU_OPTION_name }, #if defined(TARGET_SPARC) @@ -7684,6 +7694,12 @@ nb_prom_envs++; break; #endif + case QEMU_OPTION_mtype: + { + const char *p = optarg; + override_mtype = strtol(p, (char **)&p, 0); + } + break; #ifdef TARGET_ARM case QEMU_OPTION_old_param: old_param = 1; Index: vl.h =================================================================== RCS file: /sources/qemu/qemu/vl.h,v retrieving revision 1.260 diff -u -r1.260 vl.h --- vl.h 16 Aug 2007 19:56:27 -0000 1.260 +++ vl.h 19 Aug 2007 01:31:31 -0000 @@ -171,6 +171,8 @@ extern const char *option_rom[MAX_OPTION_ROMS]; extern int nb_option_roms; +extern int override_mtype; + #ifdef TARGET_SPARC #define MAX_PROM_ENVS 128 extern const char *prom_envs[MAX_PROM_ENVS]; Index: hw/arm_boot.c =================================================================== RCS file: /sources/qemu/qemu/hw/arm_boot.c,v retrieving revision 1.8 diff -u -r1.8 arm_boot.c --- hw/arm_boot.c 27 Jul 2007 22:08:46 -0000 1.8 +++ hw/arm_boot.c 19 Aug 2007 01:31:31 -0000 @@ -169,6 +169,8 @@ env->kernel_filename = kernel_filename; env->kernel_cmdline = kernel_cmdline; env->initrd_filename = initrd_filename; + if (override_mtype) + board_id = override_mtype; env->board_id = board_id; env->loader_start = loader_start; qemu_register_reset(main_cpu_reset, env);