From patchwork Sat Feb 16 12:48:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julio Guerra X-Patchwork-Id: 220959 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 665352C0090 for ; Sun, 17 Feb 2013 00:13:32 +1100 (EST) Received: from localhost ([::1]:42973 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6ha6-0004C8-2A for incoming@patchwork.ozlabs.org; Sat, 16 Feb 2013 08:13:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6hZr-0004A4-4U for qemu-devel@nongnu.org; Sat, 16 Feb 2013 08:13:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U6hZo-0002hf-Rw for qemu-devel@nongnu.org; Sat, 16 Feb 2013 08:13:15 -0500 Received: from mail-ia0-x22e.google.com ([2607:f8b0:4001:c02::22e]:37856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6hZo-0002hN-Fs; Sat, 16 Feb 2013 08:13:12 -0500 Received: by mail-ia0-f174.google.com with SMTP id o25so4076033iad.33 for ; Sat, 16 Feb 2013 05:13:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:from:date:x-google-sender-auth :message-id:subject:to:content-type; bh=kIs/Ap/qmsdhxu8qjRVRVzqbhVBKyTLLWhKRq6lpg7Y=; b=KLhzLmt98zv4GK2OcnAvdXi9oQhzszx5aeoiIx5r/y1b6Oukz3EViJWfJw4vITzEi1 5kkDS0dLpaX6CS6YQIWxrQsMDciG+FGlekNGT7om/BEZDrSTdqYxFr9uzVPkhOuONPf0 loSuj1TGXfOKvhGjJNheJQ4FFCwkupjxI3gxkf+PmLWwhYUT4AyxgUr6IHl4FEa7+ahP VVg6rq/EqC82Zff2gaEqgqFG2+c6Rc4iB2dZwABf4INL9ukJAXjLUNHuWOsDz1Za0BGV OYq4nKX/mwQmu8VhfOjCcDw9E4ChnwkGQRC0otiy1lxGUGt/lE0AQ2miJFD/1XTpjpoN l/RQ== X-Received: by 10.50.53.146 with SMTP id b18mr3933382igp.82.1361018904669; Sat, 16 Feb 2013 04:48:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.36.136 with HTTP; Sat, 16 Feb 2013 04:48:03 -0800 (PST) From: Julio Guerra Date: Sat, 16 Feb 2013 13:48:03 +0100 X-Google-Sender-Auth: J_Ja36Z0rOoZ4ruQ5ljOE7v7Yac Message-ID: To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Alexander Graf X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c02::22e Subject: [Qemu-devel] [PATCH] e600 core for MPC86xx processors 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 The MPC86xx processors are based on a e600 core which is not currently the case in qemu where they are based on the 7400 processor. This patch creates the e600 core and instantiates the MPC86xx processors based on it. Therefore, adding the high BATs and the SPRG 4..7 registers, which are e600-specific [1]. This allows to define the MPC8610 processor too and my program running on a real MPC8610 target is now able to run on qemu :) [1] http://cache.freescale.com/files/32bit/doc/ref_manual/E600CORERM.pdf Signed-off-by: Julio Guerra --- translate_init.c | 119 ++++--------------------------------------------------- 1 file changed, 9 insertions(+), 110 deletions(-) - gen_low_BATs(env); - gen_high_BATs(env); - gen_74xx_soft_tlb(env, 128, 2); - init_excp_7450(env); - env->dcache_line_size = 32; - env->icache_line_size = 32; - /* Allocate hardware IRQ controller */ - ppc6xx_irq_init(env); -} - #if defined (TARGET_PPC64) /* PowerPC 970 */ #define POWERPC_INSNS_970 (PPC_INSNS_BASE | PPC_STRING | PPC_MFTB | \ @@ -7797,7 +7692,9 @@ enum { POWERPC_SVR_8568E = 0x807D0011 | POWERPC_SVR_E500, POWERPC_SVR_8572 = 0x80E00010 | POWERPC_SVR_E500, POWERPC_SVR_8572E = 0x80E80010 | POWERPC_SVR_E500, - POWERPC_SVR_8610 = 0x80A00011, +#if 0 + POWERPC_SVR_8610 = xxx, +#endif POWERPC_SVR_8641 = 0x80900021, POWERPC_SVR_8641D = 0x80900121, }; @@ -8944,17 +8841,19 @@ static const ppc_def_t ppc_defs[] = { CPU_POWERPC_MPC8572E, POWERPC_SVR_8572E, e500v2), /* e600 family */ /* PowerPC e600 core */ - POWERPC_DEF("e600", CPU_POWERPC_e600, e600), + POWERPC_DEF("e600", CPU_POWERPC_e600, 7400), /* PowerPC e600 microcontrollers */ +#if defined (TODO) /* MPC8610 */ POWERPC_DEF_SVR("MPC8610", - CPU_POWERPC_MPC8610, POWERPC_SVR_8610, e600), + CPU_POWERPC_MPC8610, POWERPC_SVR_8610, 7400), +#endif /* MPC8641 */ POWERPC_DEF_SVR("MPC8641", - CPU_POWERPC_MPC8641, POWERPC_SVR_8641, e600), + CPU_POWERPC_MPC8641, POWERPC_SVR_8641, 7400), /* MPC8641D */ POWERPC_DEF_SVR("MPC8641D", - CPU_POWERPC_MPC8641D, POWERPC_SVR_8641D, e600), + CPU_POWERPC_MPC8641D, POWERPC_SVR_8641D, 7400), /* 32 bits "classic" PowerPC */ /* PowerPC 6xx family */ /* PowerPC 601 */ diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index a8dde96..f038850 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -6292,111 +6292,6 @@ static void init_proc_7457 (CPUPPCState *env) ppc6xx_irq_init(env); } -/* PowerPC e600 */ -#define POWERPC_INSNS_e600 (PPC_INSNS_BASE | PPC_STRING | PPC_MFTB | \ - PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | \ - PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | \ - PPC_FLOAT_STFIWX | \ - PPC_CACHE | PPC_CACHE_ICBI | \ - PPC_CACHE_DCBA | PPC_CACHE_DCBZ | \ - PPC_MEM_SYNC | PPC_MEM_EIEIO | \ - PPC_MEM_TLBIE | PPC_MEM_TLBSYNC | \ - PPC_MEM_TLBIA | PPC_74xx_TLB | \ - PPC_SEGMENT | PPC_EXTERN | \ - PPC_ALTIVEC) -#define POWERPC_INSNS2_e600 (PPC_NONE) -#define POWERPC_MSRM_e600 (0x000000000205FF77ULL) -#define POWERPC_MMU_e600 (POWERPC_MMU_32B) -#define POWERPC_EXCP_e600 (POWERPC_EXCP_74xx) -#define POWERPC_INPUT_e600 (PPC_FLAGS_INPUT_6xx) -#define POWERPC_BFDM_e600 (bfd_mach_ppc_7400) -#define POWERPC_FLAG_e600 (POWERPC_FLAG_VRE | POWERPC_FLAG_SE | \ - POWERPC_FLAG_BE | POWERPC_FLAG_PMM | \ - POWERPC_FLAG_BUS_CLK) -#define check_pow_e600 check_pow_hid0_74xx - -__attribute__ (( unused )) -static void init_proc_e600 (CPUPPCState *env) -{ - gen_spr_ne_601(env); - gen_spr_7xx(env); - /* Time base */ - gen_tbl(env); - /* 74xx specific SPR */ - gen_spr_74xx(env); - /* XXX : not implemented */ - spr_register(env, SPR_UBAMR, "UBAMR", - &spr_read_ureg, SPR_NOACCESS, - &spr_read_ureg, SPR_NOACCESS, - 0x00000000); - /* LDSTCR */ - /* XXX : not implemented */ - spr_register(env, SPR_LDSTCR, "LDSTCR", - SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_generic, - 0x00000000); - /* ICTRL */ - /* XXX : not implemented */ - spr_register(env, SPR_ICTRL, "ICTRL", - SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_generic, - 0x00000000); - /* MSSSR0 */ - /* XXX : not implemented */ - spr_register(env, SPR_MSSSR0, "MSSSR0", - SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_generic, - 0x00000000); - /* PMC */ - /* XXX : not implemented */ - spr_register(env, SPR_PMC5, "PMC5", - SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_generic, - 0x00000000); - /* XXX : not implemented */ - spr_register(env, SPR_UPMC5, "UPMC5", - &spr_read_ureg, SPR_NOACCESS, - &spr_read_ureg, SPR_NOACCESS, - 0x00000000); - /* XXX : not implemented */ - spr_register(env, SPR_PMC6, "PMC6", - SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_generic, - 0x00000000); - /* XXX : not implemented */ - spr_register(env, SPR_UPMC6, "UPMC6", - &spr_read_ureg, SPR_NOACCESS, - &spr_read_ureg, SPR_NOACCESS, - 0x00000000); - /* SPRGs */ - spr_register(env, SPR_SPRG4, "SPRG4", - SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_generic, - 0x00000000); - spr_register(env, SPR_SPRG5, "SPRG5", - SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_generic, - 0x00000000); - spr_register(env, SPR_SPRG6, "SPRG6", - SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_generic, - 0x00000000); - spr_register(env, SPR_SPRG7, "SPRG7", - SPR_NOACCESS, SPR_NOACCESS, - &spr_read_generic, &spr_write_generic, - 0x00000000); - - /* Memory management */