From patchwork Tue Jun 29 02:50:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chen huacai X-Patchwork-Id: 57234 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 500EBB6F1C for ; Tue, 29 Jun 2010 12:50:33 +1000 (EST) Received: from localhost ([127.0.0.1]:38360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTQtq-0004nC-DT for incoming@patchwork.ozlabs.org; Mon, 28 Jun 2010 22:50:14 -0400 Received: from [140.186.70.92] (port=36400 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTQsT-0004ks-Dm for qemu-devel@nongnu.org; Mon, 28 Jun 2010 22:48:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTQsQ-0007rQ-8z for qemu-devel@nongnu.org; Mon, 28 Jun 2010 22:48:47 -0400 Received: from mail-px0-f173.google.com ([209.85.212.173]:55962) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTQsQ-0007rK-3G for qemu-devel@nongnu.org; Mon, 28 Jun 2010 22:48:46 -0400 Received: by pxi2 with SMTP id 2so971850pxi.4 for ; Mon, 28 Jun 2010 19:48:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=Z9U18qUm4Ve8vOAocQjzSYMlqJTOh9EyLjbfG7vb4UA=; b=muePB/jc3pkqw0xQcuC1aCq6dGe5DKQElMTzqckZ4wPHNQYO8TuypBQwMMGKWH7D6F 61qF1LO1XIP1DYi4x4o4OR7cvUmWFAMK+rKQCSBTqLo2zdfGeEcHZ8ub02Mf+8M6PEoI VgKpTdYx/fDsJ627k4kTm8Hbaq3ccExyAVF9Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=WqXb2Bn1DzFAyvoqNJD2epClXElg4s3P/HZGi1VBcy5iiAgLSIt9NOO/yWmDFd9YgK N4dR04SxJQLk9I3J/YTO8MQeC33VsKZH1C8dL/aCfsE0Nr3pmmEwN2z0Ng9dyYOUbaG7 Y6HMrdMc7CMHcOPkSHVRYyvSzNkBjbJWI8fUQ= Received: by 10.143.137.1 with SMTP id p1mr6871923wfn.97.1277779725000; Mon, 28 Jun 2010 19:48:45 -0700 (PDT) Received: from localhost.localdomain ([211.69.198.200]) by mx.google.com with ESMTPS id n2sm4307363wfl.1.2010.06.28.19.48.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 28 Jun 2010 19:48:44 -0700 (PDT) From: Huacai Chen To: aurelien@aurel32.net Date: Tue, 29 Jun 2010 10:50:27 +0800 Message-Id: <1277779827-8780-1-git-send-email-zltjiangshi@gmail.com> X-Mailer: git-send-email 1.7.0.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: blauwirbel@gmail.com, yamahata@valinux.co.jp, qemu-devel@nongnu.org, Huacai Chen Subject: [Qemu-devel] [PATCH v6 5/6] MIPS: Initial support of fulong mini pc (CPU definition) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Huacai Chen --- target-mips/mips-defs.h | 4 ++++ target-mips/translate_init.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 0 deletions(-) diff --git a/target-mips/mips-defs.h b/target-mips/mips-defs.h index a7f4697..bf094a3 100644 --- a/target-mips/mips-defs.h +++ b/target-mips/mips-defs.h @@ -41,6 +41,8 @@ #define ASE_MICROMIPS 0x00080000 /* Chip specific instructions. */ +#define INSN_LOONGSON2E 0x20000000 +#define INSN_LOONGSON2F 0x40000000 #define INSN_VR54XX 0x80000000 /* MIPS CPU defines. */ @@ -49,6 +51,8 @@ #define CPU_MIPS3 (CPU_MIPS2 | ISA_MIPS3) #define CPU_MIPS4 (CPU_MIPS3 | ISA_MIPS4) #define CPU_VR54XX (CPU_MIPS4 | INSN_VR54XX) +#define CPU_LOONGSON2E (CPU_MIPS3 | INSN_LOONGSON2E) +#define CPU_LOONGSON2F (CPU_MIPS3 | INSN_LOONGSON2F) #define CPU_MIPS5 (CPU_MIPS4 | ISA_MIPS5) diff --git a/target-mips/translate_init.c b/target-mips/translate_init.c index b79ed56..0d9899e 100644 --- a/target-mips/translate_init.c +++ b/target-mips/translate_init.c @@ -454,6 +454,41 @@ static const mips_def_t mips_defs[] = .insn_flags = CPU_MIPS64R2 | ASE_MIPS3D, .mmu_type = MMU_TYPE_R4000, }, + { + .name = "Loongson-2E", + .CP0_PRid = 0x6302, + /*64KB I-cache and d-cache. 4 way with 32 bit cache line size*/ + .CP0_Config0 = (0x1<<17) | (0x1<<16) | (0x1<<11) | (0x1<<8) | (0x1<<5) | + (0x1<<4) | (0x1<<1), + /* Note: Config1 is only used internally, Loongson-2E has only Config0. */ + .CP0_Config1 = (1 << CP0C1_FP) | (47 << CP0C1_MMU), + .SYNCI_Step = 16, + .CCRes = 2, + .CP0_Status_rw_bitmask = 0x35D0FFFF, + .CP1_fcr0 = (0x5 << FCR0_PRID) | (0x1 << FCR0_REV), + .SEGBITS = 40, + .PABITS = 40, + .insn_flags = CPU_LOONGSON2E, + .mmu_type = MMU_TYPE_R4000, + }, + { + .name = "Loongson-2F", + .CP0_PRid = 0x6303, + /*64KB I-cache and d-cache. 4 way with 32 bit cache line size*/ + .CP0_Config0 = (0x1<<17) | (0x1<<16) | (0x1<<11) | (0x1<<8) | (0x1<<5) | + (0x1<<4) | (0x1<<1), + /* Note: Config1 is only used internally, Loongson-2F has only Config0. */ + .CP0_Config1 = (1 << CP0C1_FP) | (47 << CP0C1_MMU), + .SYNCI_Step = 16, + .CCRes = 2, + .CP0_Status_rw_bitmask = 0xF5D0FF1F, /*bit5:7 not writeable*/ + .CP1_fcr0 = (0x5 << FCR0_PRID) | (0x1 << FCR0_REV), + .SEGBITS = 40, + .PABITS = 40, + .insn_flags = CPU_LOONGSON2F, + .mmu_type = MMU_TYPE_R4000, + }, + #endif };