From patchwork Tue Aug 21 06:53:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia Liu X-Patchwork-Id: 178982 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AE7FC2C0091 for ; Tue, 21 Aug 2012 16:58:47 +1000 (EST) Received: from localhost ([::1]:47369 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3iQH-0000Py-S6 for incoming@patchwork.ozlabs.org; Tue, 21 Aug 2012 02:58:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3iQ3-0000HE-02 for qemu-devel@nongnu.org; Tue, 21 Aug 2012 02:58:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T3iQ1-0008Dx-1O for qemu-devel@nongnu.org; Tue, 21 Aug 2012 02:58:30 -0400 Received: from mail-pz0-f47.google.com ([209.85.210.47]:44485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3iQ0-0008Dh-Rx for qemu-devel@nongnu.org; Tue, 21 Aug 2012 02:58:28 -0400 Received: by daks35 with SMTP id s35so2964527dak.34 for ; Mon, 20 Aug 2012 23:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :content-type; bh=+8ohAvoBnsqETeN1y2vQlrW8aA+IbTV6RUmXo61odpE=; b=IEJOS7a0AzXXRzkon3FjYgKrc9oLmO1+vxeujq3puhc0lGYG8cJC77L3uqaqxHBLmi EpDjSr7mJyqMFL4ACDFrxYY9IGxMw25M3iOE7SEGp5/XjSvPP/a0JTq8fiv6q7Ybbwjz VxBZNSjRG9IVjtDytgVHHjAR+6p/1vGPy9vgkstbsKD81ASspUI2v+eo58Ilpxux9v1R 4dLyHLFKKmTkm4xdnkQ1jvHWfJT6U1/MgA9S/D6xbXLZZRZZy75PmqChFXVAYnvD6bIB A8xiR6ex6KCCW2EYDGOX/qKHSLIoHnXzgAmMwtZuxcTXKdi6gvKW3ogcC0h4dGzG6oPW L7nw== Received: by 10.68.138.166 with SMTP id qr6mr41078931pbb.69.1345532307971; Mon, 20 Aug 2012 23:58:27 -0700 (PDT) Received: from localhost ([1.202.183.51]) by mx.google.com with ESMTPS id rn4sm835594pbb.51.2012.08.20.23.58.23 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Aug 2012 23:58:26 -0700 (PDT) From: Jia Liu To: qemu-devel@nongnu.org Date: Tue, 21 Aug 2012 14:53:17 +0800 Message-Id: <1345531999-17872-12-git-send-email-proljc@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1345531999-17872-1-git-send-email-proljc@gmail.com> References: <1345531999-17872-1-git-send-email-proljc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.47 Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH v6 11/13] target-mips-ase-dsp: Add MIPS[32|64] ASE DSP[R1|R2] generic cpu model X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add MIPS[32|64] ASE DSP[R1|R2] generic cpu model for test. Signed-off-by: Jia Liu --- target-mips/translate_init.c | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/target-mips/translate_init.c b/target-mips/translate_init.c index c39138f..547fa00 100644 --- a/target-mips/translate_init.c +++ b/target-mips/translate_init.c @@ -311,6 +311,32 @@ static const mips_def_t mips_defs[] = .insn_flags = CPU_MIPS32R2 | ASE_MIPS16 | ASE_DSP | ASE_MT, .mmu_type = MMU_TYPE_R4000, }, + { + /* A generic CPU providing MIPS32 ASE DSP Release 2 features. + FIXME: Eventually this should be replaced by a real CPU model. */ + .name = "mips32dspr2", + .CP0_PRid = 0x00019300, + .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | + (MMU_TYPE_R4000 << CP0C0_MT), + .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (15 << CP0C1_MMU) | + (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | + (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | + (1 << CP0C1_CA), + .CP0_Config2 = MIPS_CONFIG2, + .CP0_Config3 = MIPS_CONFIG3 | (0 << CP0C3_VInt), + .CP0_LLAddr_rw_bitmask = 0, + .CP0_LLAddr_shift = 4, + .SYNCI_Step = 32, + .CCRes = 2, + /* No DSP implemented. */ + .CP0_Status_rw_bitmask = 0x3678FF1F, + .CP1_fcr0 = (1 << FCR0_F64) | (1 << FCR0_L) | (1 << FCR0_W) | + (1 << FCR0_D) | (1 << FCR0_S) | (0x93 << FCR0_PRID), + .SEGBITS = 32, + .PABITS = 32, + .insn_flags = CPU_MIPS32R2 | ASE_MIPS16 | ASE_DSP | ASE_DSPR2, + .mmu_type = MMU_TYPE_R4000, + }, #if defined(TARGET_MIPS64) { .name = "R4000", @@ -484,6 +510,35 @@ static const mips_def_t mips_defs[] = .insn_flags = CPU_LOONGSON2F, .mmu_type = MMU_TYPE_R4000, }, + { + /* A generic CPU providing MIPS64 ASE DSP Release 2 features. + FIXME: Eventually this should be replaced by a real CPU model. */ + .name = "mips64dspr2", + /* We emulate a later version of the 20Kc, earlier ones had a broken + WAIT instruction. */ + .CP0_PRid = 0x000182a0, + .CP0_Config0 = MIPS_CONFIG0 | (0x2 << CP0C0_AT) | + (MMU_TYPE_R4000 << CP0C0_MT) | (1 << CP0C0_VI), + .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (47 << CP0C1_MMU) | + (2 << CP0C1_IS) | (4 << CP0C1_IL) | (3 << CP0C1_IA) | + (2 << CP0C1_DS) | (4 << CP0C1_DL) | (3 << CP0C1_DA) | + (1 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP), + .CP0_Config2 = MIPS_CONFIG2, + .CP0_Config3 = MIPS_CONFIG3, + .CP0_LLAddr_rw_bitmask = 0, + .CP0_LLAddr_shift = 0, + .SYNCI_Step = 32, + .CCRes = 1, + .CP0_Status_rw_bitmask = 0x36FBFFFF, + /* The 20Kc has F64 / L / W but doesn't use the fcr0 bits. */ + .CP1_fcr0 = (1 << FCR0_3D) | (1 << FCR0_PS) | + (1 << FCR0_D) | (1 << FCR0_S) | + (0x82 << FCR0_PRID) | (0x0 << FCR0_REV), + .SEGBITS = 40, + .PABITS = 36, + .insn_flags = CPU_MIPS64R2 | ASE_DSP | ASE_DSPR2, + .mmu_type = MMU_TYPE_R4000, + }, #endif };