From patchwork Thu Oct 15 17:01:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 36131 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 5632AB7B8E for ; Fri, 16 Oct 2009 04:07:09 +1100 (EST) Received: from localhost ([127.0.0.1]:51054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyTn8-0006YD-Em for incoming@patchwork.ozlabs.org; Thu, 15 Oct 2009 13:07:06 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MyThg-0004H9-St for qemu-devel@nongnu.org; Thu, 15 Oct 2009 13:01:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MyThb-0004CM-HL for qemu-devel@nongnu.org; Thu, 15 Oct 2009 13:01:27 -0400 Received: from [199.232.76.173] (port=46103 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyThb-0004C8-4X for qemu-devel@nongnu.org; Thu, 15 Oct 2009 13:01:23 -0400 Received: from smtp20.orange.fr ([80.12.242.26]:26009) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MyTha-0007Am-9N for qemu-devel@nongnu.org; Thu, 15 Oct 2009 13:01:22 -0400 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2029.orange.fr (SMTP Server) with ESMTP id AA43D1C000A4; Thu, 15 Oct 2009 19:01:20 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2029.orange.fr (SMTP Server) with ESMTP id 9C5051C000B3; Thu, 15 Oct 2009 19:01:20 +0200 (CEST) Received: from localhost.localdomain (LPuteaux-156-15-47-90.w82-127.abo.wanadoo.fr [82.127.74.90]) by mwinf2029.orange.fr (SMTP Server) with ESMTP id 701DB1C000A6; Thu, 15 Oct 2009 19:01:20 +0200 (CEST) X-ME-UUID: 20091015170120459.701DB1C000A6@mwinf2029.orange.fr From: Thomas Monjalon To: qemu-devel@nongnu.org Date: Thu, 15 Oct 2009 19:01:19 +0200 Message-Id: X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <> References: <> MIME-Version: 1.0 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: =?utf-8?q?Fran=C3=A7ois=20Armand?= Subject: [Qemu-devel] [PATCH 1/3] ppc: better support of e300 CPU core 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 Declare HID2 register. Use high BATs for e300 (8 instead of 4). Fix index of high BATs registers. Before the fix, IBAT4-7 were overwriting IBAT0-3. Signed-off-by: François Armand --- target-ppc/translate_init.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 79d3b4c..910b4d9 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -233,7 +233,7 @@ static void spr_write_ibatu (void *opaque, int sprn, int gprn) static void spr_write_ibatu_h (void *opaque, int sprn, int gprn) { - TCGv_i32 t0 = tcg_const_i32((sprn - SPR_IBAT4U) / 2); + TCGv_i32 t0 = tcg_const_i32(((sprn - SPR_IBAT4U) / 2) + 4); gen_helper_store_ibatu(t0, cpu_gpr[gprn]); tcg_temp_free_i32(t0); } @@ -247,7 +247,7 @@ static void spr_write_ibatl (void *opaque, int sprn, int gprn) static void spr_write_ibatl_h (void *opaque, int sprn, int gprn) { - TCGv_i32 t0 = tcg_const_i32((sprn - SPR_IBAT4L) / 2); + TCGv_i32 t0 = tcg_const_i32(((sprn - SPR_IBAT4L) / 2) + 4); gen_helper_store_ibatl(t0, cpu_gpr[gprn]); tcg_temp_free_i32(t0); } @@ -4166,8 +4166,14 @@ static void init_proc_e300 (CPUPPCState *env) SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, 0x00000000); + /* XXX : not implemented */ + spr_register(env, SPR_HID2, "HID2", + SPR_NOACCESS, SPR_NOACCESS, + &spr_read_generic, &spr_write_generic, + 0x00000000); /* Memory management */ gen_low_BATs(env); + gen_high_BATs(env); gen_6xx_7xx_soft_tlb(env, 64, 2); init_excp_603(env); env->dcache_line_size = 32;