Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hq1mf-0001VT-MB for qemu-devel@nongnu.org; Mon, 21 May 2007 02:54:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hq1md-0001Ui-IG for qemu-devel@nongnu.org; Mon, 21 May 2007 02:54:20 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hq1md-0001UW-5v for qemu-devel@nongnu.org; Mon, 21 May 2007 02:54:19 -0400 Received: from farad.aurel32.net ([82.232.2.251] helo=mail.aurel32.net) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Hq1jU-0002YD-T4 for qemu-devel@nongnu.org; Mon, 21 May 2007 02:51:05 -0400 Received: from amd64.aurel32.net ([2001:618:400:fc13:216:3eff:fe00:1009]) by mail.aurel32.net with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Hq1jQ-0000pX-CG for qemu-devel@nongnu.org; Mon, 21 May 2007 08:51:00 +0200 Received: from aurel32 by amd64.aurel32.net with local (Exim 4.67) (envelope-from ) id 1Hq1jQ-00060w-65 for qemu-devel@nongnu.org; Mon, 21 May 2007 08:51:00 +0200 Date: Mon, 21 May 2007 08:51:00 +0200 From: Aurelien Jarno Message-ID: <20070521065059.GA23089@amd64.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Subject: [Qemu-devel] [PATCH, MIPS64] 5Kc, 5Kf and 20Kc CPU support 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 Hi The patch below adds support for 5Kc, 5Kf and 20Kc CPU, ie all the CPU that can be found on a CoreLV card. Note that MIPS performance counters are not yet available in QEMU, so the corresponding configuration bit of the 20Kc CPU is not set. This patch also fixes the Status_rw_bitmask value of the R4000 CPU, as the PX bit should be writeable on this CPU. Finally it changes the default 64-bit CPU of the Malta board to a 5Kf one from a R4000 one. The R4000 is not really a good default choice, as it does not have the wait instruction, so QEMU uses all the host CPU with this target CPU. Bye, Aurelien Index: hw/mips_malta.c =================================================================== RCS file: /sources/qemu/qemu/hw/mips_malta.c,v retrieving revision 1.27 diff -u -d -p -r1.27 mips_malta.c --- hw/mips_malta.c 4 May 2007 14:34:34 -0000 1.27 +++ hw/mips_malta.c 21 May 2007 04:22:37 -0000 @@ -779,7 +779,7 @@ void mips_malta_init (int ram_size, int /* init CPUs */ if (cpu_model == NULL) { #ifdef TARGET_MIPS64 - cpu_model = "R4000"; + cpu_model = "5Kf"; #else cpu_model = "24Kf"; #endif Index: target-mips/translate_init.c =================================================================== RCS file: /sources/qemu/qemu/target-mips/translate_init.c,v retrieving revision 1.9 diff -u -d -p -r1.9 translate_init.c --- target-mips/translate_init.c 13 May 2007 13:49:44 -0000 1.9 +++ target-mips/translate_init.c 21 May 2007 04:22:38 -0000 @@ -145,7 +145,46 @@ static mips_def_t mips_defs[] = .CP0_Config3 = MIPS_CONFIG3, .SYNCI_Step = 16, .CCRes = 2, - .Status_rw_bitmask = 0x3678FFFF, + .Status_rw_bitmask = 0x36F8FFFF, + .CP1_fcr0 = (1 << FCR0_F64) | (1 << FCR0_L) | (1 << FCR0_W) | + (1 << FCR0_D) | (1 << FCR0_S) | + (0x5 << FCR0_PRID) | (0x0 << FCR0_REV), + }, + { + .name = "5Kc", + .CP0_PRid = 0x00018100, + .CP0_Config0 = MIPS_CONFIG0 | (0x2 << CP0C0_AT), + .CP0_Config1 = MIPS_CONFIG1 | (47 << CP0C1_MMU), + .CP0_Config2 = MIPS_CONFIG2, + .CP0_Config3 = MIPS_CONFIG3, + .SYNCI_Step = 16, + .CCRes = 2, + .Status_rw_bitmask = 0x32F8FFFF, + }, + { + .name = "5Kf", + .CP0_PRid = 0x00018100, + .CP0_Config0 = MIPS_CONFIG0 | (0x2 << CP0C0_AT), + .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (47 << CP0C1_MMU), + .CP0_Config2 = MIPS_CONFIG2, + .CP0_Config3 = MIPS_CONFIG3, + .SYNCI_Step = 16, + .CCRes = 2, + .Status_rw_bitmask = 0x36F8FFFF, + .CP1_fcr0 = (1 << FCR0_F64) | (1 << FCR0_L) | (1 << FCR0_W) | + (1 << FCR0_D) | (1 << FCR0_S) | + (0x5 << FCR0_PRID) | (0x0 << FCR0_REV), + }, + { + .name = "20Kc", + .CP0_PRid = 0x00018200, + .CP0_Config0 = MIPS_CONFIG0 | (0x2 << CP0C0_AT) | (0x2 << CP0C0_VI), + .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (47 << CP0C1_MMU), + .CP0_Config2 = MIPS_CONFIG2, + .CP0_Config3 = MIPS_CONFIG3, + .SYNCI_Step = 16, + .CCRes = 2, + .Status_rw_bitmask = 0x36FBFFFF, .CP1_fcr0 = (1 << FCR0_F64) | (1 << FCR0_L) | (1 << FCR0_W) | (1 << FCR0_D) | (1 << FCR0_S) | (0x5 << FCR0_PRID) | (0x0 << FCR0_REV), -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net