From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KLByD-0004lV-91 for qemu-devel@nongnu.org; Tue, 22 Jul 2008 03:07:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KLByC-0004lJ-QK for qemu-devel@nongnu.org; Tue, 22 Jul 2008 03:07:37 -0400 Received: from [199.232.76.173] (port=55570 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KLByC-0004lG-KP for qemu-devel@nongnu.org; Tue, 22 Jul 2008 03:07:36 -0400 Received: from savannah.gnu.org ([199.232.41.3]:40252 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KLByB-0002mA-Qh for qemu-devel@nongnu.org; Tue, 22 Jul 2008 03:07:36 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KLByB-0006YB-5L for qemu-devel@nongnu.org; Tue, 22 Jul 2008 07:07:35 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KLByA-0006Y6-Pw for qemu-devel@nongnu.org; Tue, 22 Jul 2008 07:07:35 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Tue, 22 Jul 2008 07:07:34 +0000 Subject: [Qemu-devel] [4923] Add T1 and T2 CPUs, add a Sun4v machine Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4923 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4923 Author: blueswir1 Date: 2008-07-22 07:07:34 +0000 (Tue, 22 Jul 2008) Log Message: ----------- Add T1 and T2 CPUs, add a Sun4v machine Modified Paths: -------------- trunk/hw/boards.h trunk/hw/sun4u.c trunk/qemu-doc.texi trunk/target-sparc/TODO trunk/target-sparc/helper.c trunk/target-sparc/machine.c Modified: trunk/hw/boards.h =================================================================== --- trunk/hw/boards.h 2008-07-22 01:57:42 UTC (rev 4922) +++ trunk/hw/boards.h 2008-07-22 07:07:34 UTC (rev 4923) @@ -64,6 +64,7 @@ /* sun4u.c */ extern QEMUMachine sun4u_machine; +extern QEMUMachine sun4v_machine; /* integratorcp.c */ extern QEMUMachine integratorcp_machine; Modified: trunk/hw/sun4u.c =================================================================== --- trunk/hw/sun4u.c 2008-07-22 01:57:42 UTC (rev 4922) +++ trunk/hw/sun4u.c 2008-07-22 07:07:34 UTC (rev 4923) @@ -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 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 @@ 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 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, +}; Modified: trunk/qemu-doc.texi =================================================================== --- trunk/qemu-doc.texi 2008-07-22 01:57:42 UTC (rev 4922) +++ trunk/qemu-doc.texi 2008-07-22 07:07:34 UTC (rev 4923) @@ -75,7 +75,7 @@ @item G3 BW PowerMac (PowerPC processor) @item Mac99 PowerMac (PowerPC processor, in progress) @item Sun4m/Sun4c/Sun4d (32-bit Sparc processor) -@item Sun4u (64-bit Sparc processor, in progress) +@item Sun4u/Sun4v (64-bit Sparc processor, in progress) @item Malta board (32-bit and 64-bit MIPS processors) @item MIPS Magnum (64-bit MIPS processor) @item ARM Integrator/CP (ARM) @@ -2315,10 +2315,10 @@ @node Sparc64 System emulator @section Sparc64 System emulator -Use the executable @file{qemu-system-sparc64} to simulate a Sun4u machine. -The emulator is not usable for anything yet. +Use the executable @file{qemu-system-sparc64} to simulate a Sun4u or +Sun4v machine. The emulator is not usable for anything yet. -QEMU emulates the following sun4u peripherals: +QEMU emulates the following peripherals: @itemize @minus @item @@ -2329,8 +2329,24 @@ Non Volatile RAM M48T59 @item PC-compatible serial ports +@item +2 PCI IDE interfaces with hard disk and CD-ROM support @end itemize +@c man begin OPTIONS + +The following options are specific to the Sparc64 emulation: + +@table @option + +@item -M [sun4u|sun4v] + +Set the emulated machine type. The default is sun4u. + +@end table + +@c man end + @node MIPS System emulator @section MIPS System emulator Modified: trunk/target-sparc/TODO =================================================================== --- trunk/target-sparc/TODO 2008-07-22 01:57:42 UTC (rev 4922) +++ trunk/target-sparc/TODO 2008-07-22 07:07:34 UTC (rev 4923) @@ -86,4 +86,6 @@ - A lot of real machine types Sun4v: -- To be added +- A lot of unimplemented features + - A lot of real machine types + Modified: trunk/target-sparc/helper.c =================================================================== --- trunk/target-sparc/helper.c 2008-07-22 01:57:42 UTC (rev 4922) +++ trunk/target-sparc/helper.c 2008-07-22 07:07:34 UTC (rev 4923) @@ -1116,6 +1116,28 @@ .features = CPU_DEFAULT_FEATURES, }, { + .name = "Sun UltraSparc T1", + // defined in sparc_ifu_fdp.v and ctu.h + .iu_version = ((0x3eULL << 48) | (0x23ULL << 32) | (0x02ULL << 24) + | (MAXTL << 8)), + .fpu_version = 0x00000000, + .mmu_version = mmu_sun4v, + .nwindows = 8, + .features = CPU_DEFAULT_FEATURES | CPU_FEATURE_HYPV | CPU_FEATURE_CMT + | CPU_FEATURE_GL, + }, + { + .name = "Sun UltraSparc T2", + // defined in tlu_asi_ctl.v and n2_revid_cust.v + .iu_version = ((0x3eULL << 48) | (0x24ULL << 32) | (0x02ULL << 24) + | (MAXTL << 8)), + .fpu_version = 0x00000000, + .mmu_version = mmu_sun4v, + .nwindows = 8, + .features = CPU_DEFAULT_FEATURES | CPU_FEATURE_HYPV | CPU_FEATURE_CMT + | CPU_FEATURE_GL, + }, + { .name = "NEC UltraSparc I", .iu_version = ((0x22ULL << 48) | (0x10ULL << 32) | (0x40ULL << 24) | (MAXTL << 8)), Modified: trunk/target-sparc/machine.c =================================================================== --- trunk/target-sparc/machine.c 2008-07-22 01:57:42 UTC (rev 4922) +++ trunk/target-sparc/machine.c 2008-07-22 07:07:34 UTC (rev 4923) @@ -7,6 +7,7 @@ { #ifdef TARGET_SPARC64 qemu_register_machine(&sun4u_machine); + qemu_register_machine(&sun4v_machine); #else qemu_register_machine(&ss5_machine); qemu_register_machine(&ss10_machine);