2005-07-03 04:59:34 +08:00
|
|
|
/*
|
|
|
|
* PowerPC CPU initialization for qemu.
|
2007-09-17 05:08:06 +08:00
|
|
|
*
|
2007-03-07 16:32:30 +08:00
|
|
|
* Copyright (c) 2003-2007 Jocelyn Mayer
|
2011-12-22 20:26:17 +08:00
|
|
|
* Copyright 2011 Freescale Semiconductor, Inc.
|
2005-07-03 04:59:34 +08:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-07-17 04:47:01 +08:00
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
2005-07-03 04:59:34 +08:00
|
|
|
*/
|
|
|
|
|
2016-01-27 02:16:58 +08:00
|
|
|
#include "qemu/osdep.h"
|
2012-10-24 17:12:21 +08:00
|
|
|
#include "disas/bfd.h"
|
2012-12-18 01:19:49 +08:00
|
|
|
#include "exec/gdbstub.h"
|
2012-12-18 01:20:04 +08:00
|
|
|
#include <sysemu/kvm.h>
|
2011-10-13 06:40:32 +08:00
|
|
|
#include "kvm_ppc.h"
|
2012-12-18 01:20:04 +08:00
|
|
|
#include "sysemu/arch_init.h"
|
2013-01-24 01:20:38 +08:00
|
|
|
#include "sysemu/cpus.h"
|
2013-02-18 07:16:49 +08:00
|
|
|
#include "cpu-models.h"
|
2013-03-13 08:40:33 +08:00
|
|
|
#include "mmu-hash32.h"
|
|
|
|
#include "mmu-hash64.h"
|
2013-08-06 03:40:44 +08:00
|
|
|
#include "qemu/error-report.h"
|
2014-05-23 10:26:50 +08:00
|
|
|
#include "qapi/visitor.h"
|
|
|
|
#include "hw/qdev-properties.h"
|
2007-09-29 20:01:46 +08:00
|
|
|
|
2005-07-03 04:59:34 +08:00
|
|
|
//#define PPC_DUMP_CPU
|
|
|
|
//#define PPC_DEBUG_SPR
|
2007-11-18 07:02:20 +08:00
|
|
|
//#define PPC_DUMP_SPR_ACCESSES
|
2014-06-23 21:23:08 +08:00
|
|
|
/* #define USE_APPLE_GDB */
|
2005-07-03 04:59:34 +08:00
|
|
|
|
2007-04-10 06:45:36 +08:00
|
|
|
/* For user-mode emulation, we don't emulate any IRQ controller */
|
|
|
|
#if defined(CONFIG_USER_ONLY)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
#define PPC_IRQ_INIT_FN(name) \
|
|
|
|
static inline void glue(glue(ppc, name),_irq_init) (CPUPPCState *env) \
|
|
|
|
{ \
|
2007-04-10 06:45:36 +08:00
|
|
|
}
|
|
|
|
#else
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
#define PPC_IRQ_INIT_FN(name) \
|
2007-04-10 06:45:36 +08:00
|
|
|
void glue(glue(ppc, name),_irq_init) (CPUPPCState *env);
|
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
2007-10-01 09:27:10 +08:00
|
|
|
PPC_IRQ_INIT_FN(40x);
|
2007-04-10 06:45:36 +08:00
|
|
|
PPC_IRQ_INIT_FN(6xx);
|
2007-04-16 15:34:39 +08:00
|
|
|
PPC_IRQ_INIT_FN(970);
|
2011-04-01 12:15:19 +08:00
|
|
|
PPC_IRQ_INIT_FN(POWER7);
|
2009-03-03 00:42:32 +08:00
|
|
|
PPC_IRQ_INIT_FN(e500);
|
2007-04-10 06:45:36 +08:00
|
|
|
|
2005-07-03 04:59:34 +08:00
|
|
|
/* Generic callbacks:
|
|
|
|
* do nothing but store/retrieve spr value
|
|
|
|
*/
|
2012-06-21 19:39:48 +08:00
|
|
|
static void spr_load_dump_spr(int sprn)
|
|
|
|
{
|
|
|
|
#ifdef PPC_DUMP_SPR_ACCESSES
|
|
|
|
TCGv_i32 t0 = tcg_const_i32(sprn);
|
2013-02-21 02:24:57 +08:00
|
|
|
gen_helper_load_dump_spr(cpu_env, t0);
|
2012-06-21 19:39:48 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_generic (DisasContext *ctx, int gprn, int sprn)
|
2007-04-16 15:10:48 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
gen_load_spr(cpu_gpr[gprn], sprn);
|
2012-06-21 19:39:48 +08:00
|
|
|
spr_load_dump_spr(sprn);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void spr_store_dump_spr(int sprn)
|
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
#ifdef PPC_DUMP_SPR_ACCESSES
|
2012-06-21 19:39:48 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32(sprn);
|
2013-02-21 02:24:57 +08:00
|
|
|
gen_helper_store_dump_spr(cpu_env, t0);
|
2012-06-21 19:39:48 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2008-12-07 21:40:29 +08:00
|
|
|
#endif
|
2007-04-16 15:10:48 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_generic (DisasContext *ctx, int sprn, int gprn)
|
2007-04-16 15:10:48 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
gen_store_spr(sprn, cpu_gpr[gprn]);
|
2012-06-21 19:39:48 +08:00
|
|
|
spr_store_dump_spr(sprn);
|
2008-12-07 21:40:29 +08:00
|
|
|
}
|
2007-04-16 15:10:48 +08:00
|
|
|
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_generic32(DisasContext *ctx, int sprn, int gprn)
|
2012-06-21 20:01:06 +08:00
|
|
|
{
|
|
|
|
#ifdef TARGET_PPC64
|
|
|
|
TCGv t0 = tcg_temp_new();
|
|
|
|
tcg_gen_ext32u_tl(t0, cpu_gpr[gprn]);
|
|
|
|
gen_store_spr(sprn, t0);
|
|
|
|
tcg_temp_free(t0);
|
|
|
|
spr_store_dump_spr(sprn);
|
|
|
|
#else
|
2014-11-26 18:39:48 +08:00
|
|
|
spr_write_generic(ctx, sprn, gprn);
|
2012-06-21 20:01:06 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_clear (DisasContext *ctx, int sprn, int gprn)
|
2007-04-16 15:10:48 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
TCGv t0 = tcg_temp_new();
|
|
|
|
TCGv t1 = tcg_temp_new();
|
|
|
|
gen_load_spr(t0, sprn);
|
|
|
|
tcg_gen_neg_tl(t1, cpu_gpr[gprn]);
|
|
|
|
tcg_gen_and_tl(t0, t0, t1);
|
|
|
|
gen_store_spr(sprn, t0);
|
|
|
|
tcg_temp_free(t0);
|
|
|
|
tcg_temp_free(t1);
|
2007-04-16 15:10:48 +08:00
|
|
|
}
|
2013-09-25 21:41:12 +08:00
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_access_nop(DisasContext *ctx, int sprn, int gprn)
|
2013-09-25 21:41:12 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-04-16 15:10:48 +08:00
|
|
|
#endif
|
|
|
|
|
2007-03-07 16:32:30 +08:00
|
|
|
/* SPR common to all PowerPC */
|
2005-07-03 04:59:34 +08:00
|
|
|
/* XER */
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_xer (DisasContext *ctx, int gprn, int sprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2013-02-20 15:52:13 +08:00
|
|
|
gen_read_xer(cpu_gpr[gprn]);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_xer (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2013-02-20 15:52:13 +08:00
|
|
|
gen_write_xer(cpu_gpr[gprn]);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* LR */
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_lr (DisasContext *ctx, int gprn, int sprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_gen_mov_tl(cpu_gpr[gprn], cpu_lr);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_lr (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_gen_mov_tl(cpu_lr, cpu_gpr[gprn]);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2011-08-31 23:45:10 +08:00
|
|
|
/* CFAR */
|
|
|
|
#if defined(TARGET_PPC64) && !defined(CONFIG_USER_ONLY)
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_cfar (DisasContext *ctx, int gprn, int sprn)
|
2011-08-31 23:45:10 +08:00
|
|
|
{
|
|
|
|
tcg_gen_mov_tl(cpu_gpr[gprn], cpu_cfar);
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_cfar (DisasContext *ctx, int sprn, int gprn)
|
2011-08-31 23:45:10 +08:00
|
|
|
{
|
|
|
|
tcg_gen_mov_tl(cpu_cfar, cpu_gpr[gprn]);
|
|
|
|
}
|
|
|
|
#endif /* defined(TARGET_PPC64) && !defined(CONFIG_USER_ONLY) */
|
|
|
|
|
2005-07-03 04:59:34 +08:00
|
|
|
/* CTR */
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_ctr (DisasContext *ctx, int gprn, int sprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_gen_mov_tl(cpu_gpr[gprn], cpu_ctr);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_ctr (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_gen_mov_tl(cpu_ctr, cpu_gpr[gprn]);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* User read access to SPR */
|
|
|
|
/* USPRx */
|
|
|
|
/* UMMCRx */
|
|
|
|
/* UPMCx */
|
|
|
|
/* USIA */
|
|
|
|
/* UDECR */
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_ureg (DisasContext *ctx, int gprn, int sprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
gen_load_spr(cpu_gpr[gprn], sprn + 0x10);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:40 +08:00
|
|
|
#if defined(TARGET_PPC64) && !defined(CONFIG_USER_ONLY)
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_ureg(DisasContext *ctx, int sprn, int gprn)
|
2014-06-04 20:50:40 +08:00
|
|
|
{
|
|
|
|
gen_store_spr(sprn + 0x10, cpu_gpr[gprn]);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-03-07 16:32:30 +08:00
|
|
|
/* SPR common to all non-embedded PowerPC */
|
2005-07-03 04:59:34 +08:00
|
|
|
/* DECR */
|
2007-03-07 16:32:30 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_decr (DisasContext *ctx, int gprn, int sprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2014-11-26 18:39:59 +08:00
|
|
|
if (ctx->tb->cflags & CF_USE_ICOUNT) {
|
2011-02-15 16:39:54 +08:00
|
|
|
gen_io_start();
|
|
|
|
}
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_load_decr(cpu_gpr[gprn], cpu_env);
|
2014-11-26 18:39:59 +08:00
|
|
|
if (ctx->tb->cflags & CF_USE_ICOUNT) {
|
2011-02-15 16:39:54 +08:00
|
|
|
gen_io_end();
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_stop_exception(ctx);
|
2011-02-15 16:39:54 +08:00
|
|
|
}
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_decr (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2014-11-26 18:39:59 +08:00
|
|
|
if (ctx->tb->cflags & CF_USE_ICOUNT) {
|
2011-02-15 16:39:54 +08:00
|
|
|
gen_io_start();
|
|
|
|
}
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_store_decr(cpu_env, cpu_gpr[gprn]);
|
2014-11-26 18:39:59 +08:00
|
|
|
if (ctx->tb->cflags & CF_USE_ICOUNT) {
|
2011-02-15 16:39:54 +08:00
|
|
|
gen_io_end();
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_stop_exception(ctx);
|
2011-02-15 16:39:54 +08:00
|
|
|
}
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
2007-03-07 16:32:30 +08:00
|
|
|
#endif
|
2005-07-03 04:59:34 +08:00
|
|
|
|
2007-03-07 16:32:30 +08:00
|
|
|
/* SPR common to all non-embedded PowerPC, except 601 */
|
2005-07-03 04:59:34 +08:00
|
|
|
/* Time base */
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_tbl (DisasContext *ctx, int gprn, int sprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2014-11-26 18:39:59 +08:00
|
|
|
if (ctx->tb->cflags & CF_USE_ICOUNT) {
|
2011-02-15 16:39:54 +08:00
|
|
|
gen_io_start();
|
|
|
|
}
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_load_tbl(cpu_gpr[gprn], cpu_env);
|
2014-11-26 18:39:59 +08:00
|
|
|
if (ctx->tb->cflags & CF_USE_ICOUNT) {
|
2011-02-15 16:39:54 +08:00
|
|
|
gen_io_end();
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_stop_exception(ctx);
|
2011-02-15 16:39:54 +08:00
|
|
|
}
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_tbu (DisasContext *ctx, int gprn, int sprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2014-11-26 18:39:59 +08:00
|
|
|
if (ctx->tb->cflags & CF_USE_ICOUNT) {
|
2011-02-15 16:39:54 +08:00
|
|
|
gen_io_start();
|
|
|
|
}
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_load_tbu(cpu_gpr[gprn], cpu_env);
|
2014-11-26 18:39:59 +08:00
|
|
|
if (ctx->tb->cflags & CF_USE_ICOUNT) {
|
2011-02-15 16:39:54 +08:00
|
|
|
gen_io_end();
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_stop_exception(ctx);
|
2011-02-15 16:39:54 +08:00
|
|
|
}
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2007-09-30 08:38:38 +08:00
|
|
|
__attribute__ (( unused ))
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_atbl (DisasContext *ctx, int gprn, int sprn)
|
2007-09-30 08:38:38 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_load_atbl(cpu_gpr[gprn], cpu_env);
|
2007-09-30 08:38:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__ (( unused ))
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_atbu (DisasContext *ctx, int gprn, int sprn)
|
2007-09-30 08:38:38 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_load_atbu(cpu_gpr[gprn], cpu_env);
|
2007-09-30 08:38:38 +08:00
|
|
|
}
|
|
|
|
|
2007-03-07 16:32:30 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_tbl (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2014-11-26 18:39:59 +08:00
|
|
|
if (ctx->tb->cflags & CF_USE_ICOUNT) {
|
2011-02-15 16:39:54 +08:00
|
|
|
gen_io_start();
|
|
|
|
}
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_store_tbl(cpu_env, cpu_gpr[gprn]);
|
2014-11-26 18:39:59 +08:00
|
|
|
if (ctx->tb->cflags & CF_USE_ICOUNT) {
|
2011-02-15 16:39:54 +08:00
|
|
|
gen_io_end();
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_stop_exception(ctx);
|
2011-02-15 16:39:54 +08:00
|
|
|
}
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_tbu (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2014-11-26 18:39:59 +08:00
|
|
|
if (ctx->tb->cflags & CF_USE_ICOUNT) {
|
2011-02-15 16:39:54 +08:00
|
|
|
gen_io_start();
|
|
|
|
}
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_store_tbu(cpu_env, cpu_gpr[gprn]);
|
2014-11-26 18:39:59 +08:00
|
|
|
if (ctx->tb->cflags & CF_USE_ICOUNT) {
|
2011-02-15 16:39:54 +08:00
|
|
|
gen_io_end();
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_stop_exception(ctx);
|
2011-02-15 16:39:54 +08:00
|
|
|
}
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
2007-09-30 08:38:38 +08:00
|
|
|
|
|
|
|
__attribute__ (( unused ))
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_atbl (DisasContext *ctx, int sprn, int gprn)
|
2007-09-30 08:38:38 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_store_atbl(cpu_env, cpu_gpr[gprn]);
|
2007-09-30 08:38:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__ (( unused ))
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_atbu (DisasContext *ctx, int sprn, int gprn)
|
2007-09-30 08:38:38 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_store_atbu(cpu_env, cpu_gpr[gprn]);
|
2007-09-30 08:38:38 +08:00
|
|
|
}
|
2011-04-01 12:15:12 +08:00
|
|
|
|
|
|
|
#if defined(TARGET_PPC64)
|
|
|
|
__attribute__ (( unused ))
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_purr (DisasContext *ctx, int gprn, int sprn)
|
2011-04-01 12:15:12 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_load_purr(cpu_gpr[gprn], cpu_env);
|
2011-04-01 12:15:12 +08:00
|
|
|
}
|
|
|
|
#endif
|
2007-03-07 16:32:30 +08:00
|
|
|
#endif
|
2005-07-03 04:59:34 +08:00
|
|
|
|
2007-03-07 16:32:30 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2005-07-03 04:59:34 +08:00
|
|
|
/* IBAT0U...IBAT0U */
|
|
|
|
/* IBAT0L...IBAT7L */
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_ibat (DisasContext *ctx, int gprn, int sprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUPPCState, IBAT[sprn & 1][(sprn - SPR_IBAT0U) / 2]));
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_ibat_h (DisasContext *ctx, int gprn, int sprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2015-10-15 01:43:19 +08:00
|
|
|
tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUPPCState, IBAT[sprn & 1][((sprn - SPR_IBAT4U) / 2) + 4]));
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_ibatu (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32((sprn - SPR_IBAT0U) / 2);
|
2012-05-30 12:23:31 +08:00
|
|
|
gen_helper_store_ibatu(cpu_env, t0, cpu_gpr[gprn]);
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_ibatu_h (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2009-10-16 01:01:19 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32(((sprn - SPR_IBAT4U) / 2) + 4);
|
2012-05-30 12:23:31 +08:00
|
|
|
gen_helper_store_ibatu(cpu_env, t0, cpu_gpr[gprn]);
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_ibatl (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32((sprn - SPR_IBAT0L) / 2);
|
2012-05-30 12:23:31 +08:00
|
|
|
gen_helper_store_ibatl(cpu_env, t0, cpu_gpr[gprn]);
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_ibatl_h (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2009-10-16 01:01:19 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32(((sprn - SPR_IBAT4L) / 2) + 4);
|
2012-05-30 12:23:31 +08:00
|
|
|
gen_helper_store_ibatl(cpu_env, t0, cpu_gpr[gprn]);
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* DBAT0U...DBAT7U */
|
|
|
|
/* DBAT0L...DBAT7L */
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_dbat (DisasContext *ctx, int gprn, int sprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUPPCState, DBAT[sprn & 1][(sprn - SPR_DBAT0U) / 2]));
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_dbat_h (DisasContext *ctx, int gprn, int sprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUPPCState, DBAT[sprn & 1][((sprn - SPR_DBAT4U) / 2) + 4]));
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_dbatu (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32((sprn - SPR_DBAT0U) / 2);
|
2012-05-30 12:23:31 +08:00
|
|
|
gen_helper_store_dbatu(cpu_env, t0, cpu_gpr[gprn]);
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_dbatu_h (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32(((sprn - SPR_DBAT4U) / 2) + 4);
|
2012-05-30 12:23:31 +08:00
|
|
|
gen_helper_store_dbatu(cpu_env, t0, cpu_gpr[gprn]);
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_dbatl (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32((sprn - SPR_DBAT0L) / 2);
|
2012-05-30 12:23:31 +08:00
|
|
|
gen_helper_store_dbatl(cpu_env, t0, cpu_gpr[gprn]);
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_dbatl_h (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32(((sprn - SPR_DBAT4L) / 2) + 4);
|
2012-05-30 12:23:31 +08:00
|
|
|
gen_helper_store_dbatl(cpu_env, t0, cpu_gpr[gprn]);
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* SDR1 */
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_sdr1 (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2012-05-30 12:23:38 +08:00
|
|
|
gen_helper_store_sdr1(cpu_env, cpu_gpr[gprn]);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2007-03-07 16:32:30 +08:00
|
|
|
/* 64 bits PowerPC specific SPRs */
|
2007-10-01 12:48:45 +08:00
|
|
|
#if defined(TARGET_PPC64)
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_hior (DisasContext *ctx, int gprn, int sprn)
|
2009-03-01 02:39:42 +08:00
|
|
|
{
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUPPCState, excp_prefix));
|
2009-03-01 02:39:42 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_hior (DisasContext *ctx, int sprn, int gprn)
|
2009-03-01 02:39:42 +08:00
|
|
|
{
|
|
|
|
TCGv t0 = tcg_temp_new();
|
|
|
|
tcg_gen_andi_tl(t0, cpu_gpr[gprn], 0x3FFFFF00000ULL);
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_st_tl(t0, cpu_env, offsetof(CPUPPCState, excp_prefix));
|
2009-03-01 02:39:42 +08:00
|
|
|
tcg_temp_free(t0);
|
|
|
|
}
|
2007-03-07 16:32:30 +08:00
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
#endif
|
2007-03-07 16:32:30 +08:00
|
|
|
|
|
|
|
/* PowerPC 601 specific registers */
|
|
|
|
/* RTC */
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_601_rtcl (DisasContext *ctx, int gprn, int sprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_load_601_rtcl(cpu_gpr[gprn], cpu_env);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_601_rtcu (DisasContext *ctx, int gprn, int sprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_load_601_rtcu(cpu_gpr[gprn], cpu_env);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_601_rtcu (DisasContext *ctx, int sprn, int gprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_store_601_rtcu(cpu_env, cpu_gpr[gprn]);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_601_rtcl (DisasContext *ctx, int sprn, int gprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_store_601_rtcl(cpu_env, cpu_gpr[gprn]);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
2007-11-04 10:55:33 +08:00
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_hid0_601 (DisasContext *ctx, int sprn, int gprn)
|
2007-11-04 10:55:33 +08:00
|
|
|
{
|
2012-05-30 12:23:38 +08:00
|
|
|
gen_helper_store_hid0_601(cpu_env, cpu_gpr[gprn]);
|
2007-11-04 10:55:33 +08:00
|
|
|
/* Must stop the translation as endianness may have changed */
|
2008-12-12 06:42:14 +08:00
|
|
|
gen_stop_exception(ctx);
|
2007-11-04 10:55:33 +08:00
|
|
|
}
|
2007-03-07 16:32:30 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Unified bats */
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_601_ubat (DisasContext *ctx, int gprn, int sprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUPPCState, IBAT[sprn & 1][(sprn - SPR_IBAT0U) / 2]));
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_601_ubatu (DisasContext *ctx, int sprn, int gprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32((sprn - SPR_IBAT0U) / 2);
|
2012-05-30 12:23:31 +08:00
|
|
|
gen_helper_store_601_batl(cpu_env, t0, cpu_gpr[gprn]);
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_601_ubatl (DisasContext *ctx, int sprn, int gprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32((sprn - SPR_IBAT0U) / 2);
|
2012-05-30 12:23:31 +08:00
|
|
|
gen_helper_store_601_batu(cpu_env, t0, cpu_gpr[gprn]);
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* PowerPC 40x specific registers */
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_40x_pit (DisasContext *ctx, int gprn, int sprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_load_40x_pit(cpu_gpr[gprn], cpu_env);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_40x_pit (DisasContext *ctx, int sprn, int gprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_store_40x_pit(cpu_env, cpu_gpr[gprn]);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_40x_dbcr0 (DisasContext *ctx, int sprn, int gprn)
|
2007-04-17 04:09:45 +08:00
|
|
|
{
|
2012-05-30 12:23:38 +08:00
|
|
|
gen_helper_store_40x_dbcr0(cpu_env, cpu_gpr[gprn]);
|
2007-04-17 04:09:45 +08:00
|
|
|
/* We must stop translation as we may have rebooted */
|
2008-12-12 06:42:14 +08:00
|
|
|
gen_stop_exception(ctx);
|
2007-04-17 04:09:45 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_40x_sler (DisasContext *ctx, int sprn, int gprn)
|
2007-04-24 14:44:14 +08:00
|
|
|
{
|
2012-05-30 12:23:38 +08:00
|
|
|
gen_helper_store_40x_sler(cpu_env, cpu_gpr[gprn]);
|
2007-04-24 14:44:14 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_booke_tcr (DisasContext *ctx, int sprn, int gprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_store_booke_tcr(cpu_env, cpu_gpr[gprn]);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_booke_tsr (DisasContext *ctx, int sprn, int gprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2012-05-30 12:23:36 +08:00
|
|
|
gen_helper_store_booke_tsr(cpu_env, cpu_gpr[gprn]);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* PowerPC 403 specific registers */
|
|
|
|
/* PBL1 / PBU1 / PBL2 / PBU2 */
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_403_pbr (DisasContext *ctx, int gprn, int sprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_ld_tl(cpu_gpr[gprn], cpu_env, offsetof(CPUPPCState, pb[sprn - SPR_403_PBL1]));
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_403_pbr (DisasContext *ctx, int sprn, int gprn)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32(sprn - SPR_403_PBL1);
|
2012-05-30 12:23:38 +08:00
|
|
|
gen_helper_store_403_pbr(cpu_env, t0, cpu_gpr[gprn]);
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_pir (DisasContext *ctx, int sprn, int gprn)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
TCGv t0 = tcg_temp_new();
|
|
|
|
tcg_gen_andi_tl(t0, cpu_gpr[gprn], 0xF);
|
|
|
|
gen_store_spr(SPR_PIR, t0);
|
|
|
|
tcg_temp_free(t0);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
2007-03-07 16:32:30 +08:00
|
|
|
#endif
|
2005-07-03 04:59:34 +08:00
|
|
|
|
2009-03-09 14:27:14 +08:00
|
|
|
/* SPE specific registers */
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_spefscr (DisasContext *ctx, int gprn, int sprn)
|
2009-03-09 14:27:14 +08:00
|
|
|
{
|
|
|
|
TCGv_i32 t0 = tcg_temp_new_i32();
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_ld_i32(t0, cpu_env, offsetof(CPUPPCState, spe_fscr));
|
2009-03-09 14:27:14 +08:00
|
|
|
tcg_gen_extu_i32_tl(cpu_gpr[gprn], t0);
|
|
|
|
tcg_temp_free_i32(t0);
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_spefscr (DisasContext *ctx, int sprn, int gprn)
|
2009-03-09 14:27:14 +08:00
|
|
|
{
|
|
|
|
TCGv_i32 t0 = tcg_temp_new_i32();
|
|
|
|
tcg_gen_trunc_tl_i32(t0, cpu_gpr[gprn]);
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_st_i32(t0, cpu_env, offsetof(CPUPPCState, spe_fscr));
|
2009-03-09 14:27:14 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
|
|
|
}
|
|
|
|
|
2007-10-01 09:32:49 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
/* Callback used to write the exception vector base */
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_excp_prefix (DisasContext *ctx, int sprn, int gprn)
|
2007-10-01 09:32:49 +08:00
|
|
|
{
|
2008-12-07 21:40:29 +08:00
|
|
|
TCGv t0 = tcg_temp_new();
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_ld_tl(t0, cpu_env, offsetof(CPUPPCState, ivpr_mask));
|
2008-12-07 21:40:29 +08:00
|
|
|
tcg_gen_and_tl(t0, t0, cpu_gpr[gprn]);
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_st_tl(t0, cpu_env, offsetof(CPUPPCState, excp_prefix));
|
2008-12-07 21:40:29 +08:00
|
|
|
gen_store_spr(sprn, t0);
|
2009-03-09 14:27:24 +08:00
|
|
|
tcg_temp_free(t0);
|
2007-10-01 09:32:49 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_excp_vector (DisasContext *ctx, int sprn, int gprn)
|
2007-10-01 09:32:49 +08:00
|
|
|
{
|
2012-01-20 02:31:51 +08:00
|
|
|
int sprn_offs;
|
2007-10-01 09:32:49 +08:00
|
|
|
|
|
|
|
if (sprn >= SPR_BOOKE_IVOR0 && sprn <= SPR_BOOKE_IVOR15) {
|
2012-01-20 02:31:51 +08:00
|
|
|
sprn_offs = sprn - SPR_BOOKE_IVOR0;
|
2007-10-01 09:32:49 +08:00
|
|
|
} else if (sprn >= SPR_BOOKE_IVOR32 && sprn <= SPR_BOOKE_IVOR37) {
|
2012-01-20 02:31:51 +08:00
|
|
|
sprn_offs = sprn - SPR_BOOKE_IVOR32 + 32;
|
|
|
|
} else if (sprn >= SPR_BOOKE_IVOR38 && sprn <= SPR_BOOKE_IVOR42) {
|
|
|
|
sprn_offs = sprn - SPR_BOOKE_IVOR38 + 38;
|
2007-10-01 09:32:49 +08:00
|
|
|
} else {
|
|
|
|
printf("Trying to write an unknown exception vector %d %03x\n",
|
|
|
|
sprn, sprn);
|
2008-12-12 06:42:14 +08:00
|
|
|
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
|
2012-01-20 02:31:51 +08:00
|
|
|
return;
|
2007-10-01 09:32:49 +08:00
|
|
|
}
|
2012-01-20 02:31:51 +08:00
|
|
|
|
|
|
|
TCGv t0 = tcg_temp_new();
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_ld_tl(t0, cpu_env, offsetof(CPUPPCState, ivor_mask));
|
2012-01-20 02:31:51 +08:00
|
|
|
tcg_gen_and_tl(t0, t0, cpu_gpr[gprn]);
|
2012-03-14 08:38:22 +08:00
|
|
|
tcg_gen_st_tl(t0, cpu_env, offsetof(CPUPPCState, excp_vectors[sprn_offs]));
|
2012-01-20 02:31:51 +08:00
|
|
|
gen_store_spr(sprn, t0);
|
|
|
|
tcg_temp_free(t0);
|
2007-10-01 09:32:49 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-02-04 03:55:59 +08:00
|
|
|
static inline void vscr_init (CPUPPCState *env, uint32_t val)
|
|
|
|
{
|
|
|
|
env->vscr = val;
|
|
|
|
/* Altivec always uses round-to-nearest */
|
|
|
|
set_float_rounding_mode(float_round_nearest_even, &env->vec_status);
|
|
|
|
set_flush_to_zero(vscr_nj, &env->vec_status);
|
|
|
|
}
|
|
|
|
|
2013-02-21 00:41:50 +08:00
|
|
|
#ifdef CONFIG_USER_ONLY
|
|
|
|
#define spr_register_kvm(env, num, name, uea_read, uea_write, \
|
|
|
|
oea_read, oea_write, one_reg_id, initial_value) \
|
|
|
|
_spr_register(env, num, name, uea_read, uea_write, initial_value)
|
2016-03-21 20:52:32 +08:00
|
|
|
#define spr_register_kvm_hv(env, num, name, uea_read, uea_write, \
|
|
|
|
oea_read, oea_write, hea_read, hea_write, \
|
|
|
|
one_reg_id, initial_value) \
|
|
|
|
_spr_register(env, num, name, uea_read, uea_write, initial_value)
|
2013-02-21 00:41:50 +08:00
|
|
|
#else
|
|
|
|
#if !defined(CONFIG_KVM)
|
|
|
|
#define spr_register_kvm(env, num, name, uea_read, uea_write, \
|
2016-03-21 20:52:32 +08:00
|
|
|
oea_read, oea_write, one_reg_id, initial_value) \
|
|
|
|
_spr_register(env, num, name, uea_read, uea_write, \
|
|
|
|
oea_read, oea_write, oea_read, oea_write, initial_value)
|
|
|
|
#define spr_register_kvm_hv(env, num, name, uea_read, uea_write, \
|
|
|
|
oea_read, oea_write, hea_read, hea_write, \
|
|
|
|
one_reg_id, initial_value) \
|
2013-02-21 00:41:50 +08:00
|
|
|
_spr_register(env, num, name, uea_read, uea_write, \
|
2016-03-21 20:52:32 +08:00
|
|
|
oea_read, oea_write, hea_read, hea_write, initial_value)
|
2007-03-07 16:32:30 +08:00
|
|
|
#else
|
2013-02-21 00:41:50 +08:00
|
|
|
#define spr_register_kvm(env, num, name, uea_read, uea_write, \
|
2016-03-21 20:52:32 +08:00
|
|
|
oea_read, oea_write, one_reg_id, initial_value) \
|
|
|
|
_spr_register(env, num, name, uea_read, uea_write, \
|
|
|
|
oea_read, oea_write, oea_read, oea_write, \
|
|
|
|
one_reg_id, initial_value)
|
|
|
|
#define spr_register_kvm_hv(env, num, name, uea_read, uea_write, \
|
|
|
|
oea_read, oea_write, hea_read, hea_write, \
|
|
|
|
one_reg_id, initial_value) \
|
2013-02-21 00:41:50 +08:00
|
|
|
_spr_register(env, num, name, uea_read, uea_write, \
|
2016-03-21 20:52:32 +08:00
|
|
|
oea_read, oea_write, hea_read, hea_write, \
|
|
|
|
one_reg_id, initial_value)
|
2013-02-21 00:41:50 +08:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define spr_register(env, num, name, uea_read, uea_write, \
|
|
|
|
oea_read, oea_write, initial_value) \
|
|
|
|
spr_register_kvm(env, num, name, uea_read, uea_write, \
|
|
|
|
oea_read, oea_write, 0, initial_value)
|
|
|
|
|
2016-03-21 20:52:32 +08:00
|
|
|
#define spr_register_hv(env, num, name, uea_read, uea_write, \
|
|
|
|
oea_read, oea_write, hea_read, hea_write, \
|
|
|
|
initial_value) \
|
|
|
|
spr_register_kvm_hv(env, num, name, uea_read, uea_write, \
|
|
|
|
oea_read, oea_write, hea_read, hea_write, \
|
|
|
|
0, initial_value)
|
|
|
|
|
2013-02-21 00:41:50 +08:00
|
|
|
static inline void _spr_register(CPUPPCState *env, int num,
|
2008-09-20 16:07:15 +08:00
|
|
|
const char *name,
|
2014-11-26 18:39:48 +08:00
|
|
|
void (*uea_read)(DisasContext *ctx, int gprn, int sprn),
|
|
|
|
void (*uea_write)(DisasContext *ctx, int sprn, int gprn),
|
2013-02-21 00:41:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
void (*oea_read)(DisasContext *ctx, int gprn, int sprn),
|
|
|
|
void (*oea_write)(DisasContext *ctx, int sprn, int gprn),
|
2016-03-21 20:52:32 +08:00
|
|
|
void (*hea_read)(DisasContext *opaque, int gprn, int sprn),
|
|
|
|
void (*hea_write)(DisasContext *opaque, int sprn, int gprn),
|
2007-03-07 16:32:30 +08:00
|
|
|
#endif
|
2013-02-21 00:41:50 +08:00
|
|
|
#if defined(CONFIG_KVM)
|
|
|
|
uint64_t one_reg_id,
|
|
|
|
#endif
|
|
|
|
target_ulong initial_value)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2009-10-02 05:12:16 +08:00
|
|
|
ppc_spr_t *spr;
|
2005-07-03 04:59:34 +08:00
|
|
|
|
|
|
|
spr = &env->spr_cb[num];
|
|
|
|
if (spr->name != NULL ||env-> spr[num] != 0x00000000 ||
|
2007-03-07 16:32:30 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
spr->oea_read != NULL || spr->oea_write != NULL ||
|
|
|
|
#endif
|
|
|
|
spr->uea_read != NULL || spr->uea_write != NULL) {
|
2005-07-03 04:59:34 +08:00
|
|
|
printf("Error: Trying to register SPR %d (%03x) twice !\n", num, num);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
#if defined(PPC_DEBUG_SPR)
|
2009-08-16 19:13:18 +08:00
|
|
|
printf("*** register spr %d (%03x) %s val " TARGET_FMT_lx "\n", num, num,
|
|
|
|
name, initial_value);
|
2005-07-03 04:59:34 +08:00
|
|
|
#endif
|
|
|
|
spr->name = name;
|
|
|
|
spr->uea_read = uea_read;
|
|
|
|
spr->uea_write = uea_write;
|
2007-03-07 16:32:30 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2005-07-03 04:59:34 +08:00
|
|
|
spr->oea_read = oea_read;
|
|
|
|
spr->oea_write = oea_write;
|
2016-03-21 20:52:32 +08:00
|
|
|
spr->hea_read = hea_read;
|
|
|
|
spr->hea_write = hea_write;
|
2014-01-06 13:36:40 +08:00
|
|
|
#endif
|
|
|
|
#if defined(CONFIG_KVM)
|
|
|
|
spr->one_reg_id = one_reg_id,
|
2007-03-07 16:32:30 +08:00
|
|
|
#endif
|
2014-03-19 21:03:57 +08:00
|
|
|
env->spr[num] = spr->default_value = initial_value;
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Generic PowerPC SPRs */
|
|
|
|
static void gen_spr_generic (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Integer processing */
|
|
|
|
spr_register(env, SPR_XER, "XER",
|
|
|
|
&spr_read_xer, &spr_write_xer,
|
|
|
|
&spr_read_xer, &spr_write_xer,
|
|
|
|
0x00000000);
|
|
|
|
/* Branch contol */
|
|
|
|
spr_register(env, SPR_LR, "LR",
|
|
|
|
&spr_read_lr, &spr_write_lr,
|
|
|
|
&spr_read_lr, &spr_write_lr,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_CTR, "CTR",
|
|
|
|
&spr_read_ctr, &spr_write_ctr,
|
|
|
|
&spr_read_ctr, &spr_write_ctr,
|
|
|
|
0x00000000);
|
|
|
|
/* Interrupt processing */
|
|
|
|
spr_register(env, SPR_SRR0, "SRR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SRR1, "SRR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Processor control */
|
|
|
|
spr_register(env, SPR_SPRG0, "SPRG0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG1, "SPRG1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG2, "SPRG2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG3, "SPRG3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* SPR common to all non-embedded PowerPC, including 601 */
|
|
|
|
static void gen_spr_ne_601 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Exception processing */
|
2013-02-21 00:41:50 +08:00
|
|
|
spr_register_kvm(env, SPR_DSISR, "DSISR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_DSISR, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_DAR, "DAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_DAR, 0x00000000);
|
2005-07-03 04:59:34 +08:00
|
|
|
/* Timer */
|
|
|
|
spr_register(env, SPR_DECR, "DECR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_decr, &spr_write_decr,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
spr_register(env, SPR_SDR1, "SDR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2011-04-01 12:15:15 +08:00
|
|
|
&spr_read_generic, &spr_write_sdr1,
|
2005-07-03 04:59:34 +08:00
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* BATs 0-3 */
|
|
|
|
static void gen_low_BATs (CPUPPCState *env)
|
|
|
|
{
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2005-07-03 04:59:34 +08:00
|
|
|
spr_register(env, SPR_IBAT0U, "IBAT0U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat, &spr_write_ibatu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT0L, "IBAT0L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat, &spr_write_ibatl,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT1U, "IBAT1U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat, &spr_write_ibatu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT1L, "IBAT1L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat, &spr_write_ibatl,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT2U, "IBAT2U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat, &spr_write_ibatu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT2L, "IBAT2L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat, &spr_write_ibatl,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT3U, "IBAT3U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat, &spr_write_ibatu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT3L, "IBAT3L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat, &spr_write_ibatl,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT0U, "DBAT0U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat, &spr_write_dbatu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT0L, "DBAT0L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat, &spr_write_dbatl,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT1U, "DBAT1U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat, &spr_write_dbatu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT1L, "DBAT1L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat, &spr_write_dbatl,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT2U, "DBAT2U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat, &spr_write_dbatu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT2L, "DBAT2L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat, &spr_write_dbatl,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT3U, "DBAT3U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat, &spr_write_dbatu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT3L, "DBAT3L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat, &spr_write_dbatl,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
env->nb_BATs += 4;
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* BATs 4-7 */
|
|
|
|
static void gen_high_BATs (CPUPPCState *env)
|
|
|
|
{
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2005-07-03 04:59:34 +08:00
|
|
|
spr_register(env, SPR_IBAT4U, "IBAT4U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat_h, &spr_write_ibatu_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT4L, "IBAT4L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat_h, &spr_write_ibatl_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT5U, "IBAT5U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat_h, &spr_write_ibatu_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT5L, "IBAT5L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat_h, &spr_write_ibatl_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT6U, "IBAT6U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat_h, &spr_write_ibatu_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT6L, "IBAT6L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat_h, &spr_write_ibatl_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT7U, "IBAT7U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat_h, &spr_write_ibatu_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT7L, "IBAT7L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_ibat_h, &spr_write_ibatl_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT4U, "DBAT4U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat_h, &spr_write_dbatu_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT4L, "DBAT4L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat_h, &spr_write_dbatl_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT5U, "DBAT5U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat_h, &spr_write_dbatu_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT5L, "DBAT5L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat_h, &spr_write_dbatl_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT6U, "DBAT6U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat_h, &spr_write_dbatu_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT6L, "DBAT6L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat_h, &spr_write_dbatl_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT7U, "DBAT7U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat_h, &spr_write_dbatu_h,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DBAT7L, "DBAT7L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_dbat_h, &spr_write_dbatl_h,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
env->nb_BATs += 4;
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Generic PowerPC time base */
|
|
|
|
static void gen_tbl (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
spr_register(env, SPR_VTBL, "TBL",
|
|
|
|
&spr_read_tbl, SPR_NOACCESS,
|
|
|
|
&spr_read_tbl, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_TBL, "TBL",
|
2010-03-26 08:25:36 +08:00
|
|
|
&spr_read_tbl, SPR_NOACCESS,
|
|
|
|
&spr_read_tbl, &spr_write_tbl,
|
2005-07-03 04:59:34 +08:00
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_VTBU, "TBU",
|
|
|
|
&spr_read_tbu, SPR_NOACCESS,
|
|
|
|
&spr_read_tbu, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_TBU, "TBU",
|
2010-03-26 08:25:36 +08:00
|
|
|
&spr_read_tbu, SPR_NOACCESS,
|
|
|
|
&spr_read_tbu, &spr_write_tbu,
|
2005-07-03 04:59:34 +08:00
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2007-03-07 16:32:30 +08:00
|
|
|
/* Softare table search registers */
|
|
|
|
static void gen_6xx_7xx_soft_tlb (CPUPPCState *env, int nb_tlbs, int nb_ways)
|
|
|
|
{
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2007-03-07 16:32:30 +08:00
|
|
|
env->nb_tlb = nb_tlbs;
|
|
|
|
env->nb_ways = nb_ways;
|
|
|
|
env->id_tlbs = 1;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_6XX;
|
2007-03-07 16:32:30 +08:00
|
|
|
spr_register(env, SPR_DMISS, "DMISS",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_DCMP, "DCMP",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_HASH1, "HASH1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_HASH2, "HASH2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IMISS, "IMISS",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_ICMP, "ICMP",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_RPA, "RPA",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* SPR common to MPC755 and G2 */
|
|
|
|
static void gen_spr_G2_755 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* SGPRs */
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2005-07-03 04:59:34 +08:00
|
|
|
/* SPR common to all 7xx PowerPC implementations */
|
|
|
|
static void gen_spr_7xx (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Breakpoints */
|
|
|
|
/* XXX : not implemented */
|
2013-02-21 00:41:50 +08:00
|
|
|
spr_register_kvm(env, SPR_DABR, "DABR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_DABR, 0x00000000);
|
2005-07-03 04:59:34 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_IABR, "IABR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Cache management */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_ICTC, "ICTC",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Performance monitors */
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_MMCR0, "MMCR0",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_MMCR1, "MMCR1",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC1, "PMC1",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC2, "PMC2",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC3, "PMC3",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC4, "PMC4",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_SIAR, "SIAR",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UMMCR0, "UMMCR0",
|
2005-07-03 04:59:34 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UMMCR1, "UMMCR1",
|
2005-07-03 04:59:34 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC1, "UPMC1",
|
2005-07-03 04:59:34 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC2, "UPMC2",
|
2005-07-03 04:59:34 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC3, "UPMC3",
|
2005-07-03 04:59:34 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC4, "UPMC4",
|
2005-07-03 04:59:34 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_USIAR, "USIAR",
|
2005-07-03 04:59:34 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* External access control */
|
2005-07-03 04:59:34 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_EAR, "EAR",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
|
2013-03-12 08:31:47 +08:00
|
|
|
#ifdef TARGET_PPC64
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_uamr (DisasContext *ctx, int gprn, int sprn)
|
2013-03-12 08:31:47 +08:00
|
|
|
{
|
|
|
|
gen_load_spr(cpu_gpr[gprn], SPR_AMR);
|
|
|
|
spr_load_dump_spr(SPR_AMR);
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_uamr (DisasContext *ctx, int sprn, int gprn)
|
2013-03-12 08:31:47 +08:00
|
|
|
{
|
|
|
|
gen_store_spr(SPR_AMR, cpu_gpr[gprn]);
|
|
|
|
spr_store_dump_spr(SPR_AMR);
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_uamr_pr (DisasContext *ctx, int sprn, int gprn)
|
2013-03-12 08:31:47 +08:00
|
|
|
{
|
|
|
|
TCGv t0 = tcg_temp_new();
|
|
|
|
|
|
|
|
gen_load_spr(t0, SPR_UAMOR);
|
|
|
|
tcg_gen_and_tl(t0, t0, cpu_gpr[gprn]);
|
|
|
|
gen_store_spr(SPR_AMR, t0);
|
|
|
|
spr_store_dump_spr(SPR_AMR);
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_USER_ONLY */
|
|
|
|
|
|
|
|
static void gen_spr_amr (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
/* Virtual Page Class Key protection */
|
|
|
|
/* The AMR is accessible either via SPR 13 or SPR 29. 13 is
|
|
|
|
* userspace accessible, 29 is privileged. So we only need to set
|
|
|
|
* the kvm ONE_REG id on one of them, we use 29 */
|
|
|
|
spr_register(env, SPR_UAMR, "UAMR",
|
|
|
|
&spr_read_uamr, &spr_write_uamr_pr,
|
|
|
|
&spr_read_uamr, &spr_write_uamr,
|
|
|
|
0);
|
|
|
|
spr_register_kvm(env, SPR_AMR, "AMR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
2014-01-06 13:36:39 +08:00
|
|
|
KVM_REG_PPC_AMR, 0);
|
2013-03-12 08:31:47 +08:00
|
|
|
spr_register_kvm(env, SPR_UAMOR, "UAMOR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_UAMOR, 0);
|
2016-03-21 20:52:33 +08:00
|
|
|
spr_register_hv(env, SPR_AMOR, "AMOR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0);
|
2013-03-12 08:31:47 +08:00
|
|
|
#endif /* !CONFIG_USER_ONLY */
|
|
|
|
}
|
|
|
|
#endif /* TARGET_PPC64 */
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void gen_spr_thrm (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Thermal management */
|
2005-07-03 04:59:34 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_THRM1, "THRM1",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_THRM2, "THRM2",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_THRM3, "THRM3",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* SPR specific to PowerPC 604 implementation */
|
|
|
|
static void gen_spr_604 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Processor identification */
|
|
|
|
spr_register(env, SPR_PIR, "PIR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_pir,
|
|
|
|
0x00000000);
|
|
|
|
/* Breakpoints */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_IABR, "IABR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2013-02-21 00:41:50 +08:00
|
|
|
spr_register_kvm(env, SPR_DABR, "DABR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_DABR, 0x00000000);
|
2005-07-03 04:59:34 +08:00
|
|
|
/* Performance counters */
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_MMCR0, "MMCR0",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC1, "PMC1",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC2, "PMC2",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_SIAR, "SIAR",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_SDA, "SDA",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* External access control */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_EAR, "EAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2007-03-07 16:32:30 +08:00
|
|
|
/* SPR specific to PowerPC 603 implementation */
|
|
|
|
static void gen_spr_603 (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2007-03-07 16:32:30 +08:00
|
|
|
/* External access control */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_EAR, "EAR",
|
2005-07-03 04:59:34 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-03-07 16:32:30 +08:00
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2013-04-03 12:03:38 +08:00
|
|
|
/* Breakpoints */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_IABR, "IABR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2007-03-07 16:32:30 +08:00
|
|
|
/* SPR specific to PowerPC G2 implementation */
|
|
|
|
static void gen_spr_G2 (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2007-03-07 16:32:30 +08:00
|
|
|
/* Memory base address */
|
|
|
|
/* MBAR */
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-03-07 16:32:30 +08:00
|
|
|
spr_register(env, SPR_MBAR, "MBAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Exception processing */
|
2007-03-30 18:07:33 +08:00
|
|
|
spr_register(env, SPR_BOOKE_CSRR0, "CSRR0",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-03-30 18:07:33 +08:00
|
|
|
spr_register(env, SPR_BOOKE_CSRR1, "CSRR1",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Breakpoints */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_DABR, "DABR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_DABR2, "DABR2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_IABR, "IABR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_IABR2, "IABR2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_IBCR, "IBCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_DBCR, "DBCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* SPR specific to PowerPC 602 implementation */
|
|
|
|
static void gen_spr_602 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* ESA registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_SER, "SER",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_SEBR, "SEBR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_ESASRR, "ESASRR",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Floating point status */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_SP, "SP",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_LT, "LT",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Watchdog timer */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_TCR, "TCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Interrupt base */
|
|
|
|
spr_register(env, SPR_IBR, "IBR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_IABR, "IABR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* SPR specific to PowerPC 601 implementation */
|
|
|
|
static void gen_spr_601 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Multiplication/division register */
|
|
|
|
/* MQ */
|
|
|
|
spr_register(env, SPR_MQ, "MQ",
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* RTC registers */
|
|
|
|
spr_register(env, SPR_601_RTCU, "RTCU",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
SPR_NOACCESS, &spr_write_601_rtcu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_601_VRTCU, "RTCU",
|
|
|
|
&spr_read_601_rtcu, SPR_NOACCESS,
|
|
|
|
&spr_read_601_rtcu, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_601_RTCL, "RTCL",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
SPR_NOACCESS, &spr_write_601_rtcl,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_601_VRTCL, "RTCL",
|
|
|
|
&spr_read_601_rtcl, SPR_NOACCESS,
|
|
|
|
&spr_read_601_rtcl, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* Timer */
|
|
|
|
#if 0 /* ? */
|
|
|
|
spr_register(env, SPR_601_UDECR, "UDECR",
|
|
|
|
&spr_read_decr, SPR_NOACCESS,
|
|
|
|
&spr_read_decr, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
#endif
|
|
|
|
/* External access control */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_EAR, "EAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2007-03-07 16:32:30 +08:00
|
|
|
spr_register(env, SPR_IBAT0U, "IBAT0U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_601_ubat, &spr_write_601_ubatu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT0L, "IBAT0L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_601_ubat, &spr_write_601_ubatl,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT1U, "IBAT1U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_601_ubat, &spr_write_601_ubatu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT1L, "IBAT1L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_601_ubat, &spr_write_601_ubatl,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT2U, "IBAT2U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_601_ubat, &spr_write_601_ubatu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT2L, "IBAT2L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_601_ubat, &spr_write_601_ubatl,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT3U, "IBAT3U",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_601_ubat, &spr_write_601_ubatu,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_IBAT3L, "IBAT3L",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_601_ubat, &spr_write_601_ubatl,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
env->nb_BATs = 4;
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_74xx (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Processor identification */
|
|
|
|
spr_register(env, SPR_PIR, "PIR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_pir,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_74XX_MMCR2, "MMCR2",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_74XX_UMMCR2, "UMMCR2",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX: not implemented */
|
|
|
|
spr_register(env, SPR_BAMR, "BAMR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_MSSCR0, "MSSCR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Altivec */
|
|
|
|
spr_register(env, SPR_VRSAVE, "VRSAVE",
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-11-21 21:08:23 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L2CR, "L2CR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2013-09-25 21:41:12 +08:00
|
|
|
&spr_read_generic, spr_access_nop,
|
2007-11-21 21:08:23 +08:00
|
|
|
0x00000000);
|
2009-02-04 03:55:59 +08:00
|
|
|
/* Not strictly an SPR */
|
|
|
|
vscr_init(env, 0x00010000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_l3_ctrl (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* L3CR */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L3CR, "L3CR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* L3ITCR0 */
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_L3ITCR0, "L3ITCR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* L3PM */
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_L3PM, "L3PM",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2007-10-01 12:48:45 +08:00
|
|
|
static void gen_74xx_soft_tlb (CPUPPCState *env, int nb_tlbs, int nb_ways)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2007-10-01 12:48:45 +08:00
|
|
|
env->nb_tlb = nb_tlbs;
|
|
|
|
env->nb_ways = nb_ways;
|
|
|
|
env->id_tlbs = 1;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_6XX;
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_PTEHI, "PTEHI",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_PTELO, "PTELO",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_TLBMISS, "TLBMISS",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
2011-05-01 05:34:58 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_e500_l1csr0 (DisasContext *ctx, int sprn, int gprn)
|
2011-05-01 05:34:58 +08:00
|
|
|
{
|
|
|
|
TCGv t0 = tcg_temp_new();
|
|
|
|
|
2014-01-20 00:49:11 +08:00
|
|
|
tcg_gen_andi_tl(t0, cpu_gpr[gprn], L1CSR0_DCE | L1CSR0_CPE);
|
|
|
|
gen_store_spr(sprn, t0);
|
|
|
|
tcg_temp_free(t0);
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_e500_l1csr1(DisasContext *ctx, int sprn, int gprn)
|
2014-01-20 00:49:11 +08:00
|
|
|
{
|
|
|
|
TCGv t0 = tcg_temp_new();
|
|
|
|
|
|
|
|
tcg_gen_andi_tl(t0, cpu_gpr[gprn], L1CSR1_ICE | L1CSR1_CPE);
|
2011-05-01 05:34:58 +08:00
|
|
|
gen_store_spr(sprn, t0);
|
|
|
|
tcg_temp_free(t0);
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_booke206_mmucsr0 (DisasContext *ctx, int sprn, int gprn)
|
2011-05-01 05:34:58 +08:00
|
|
|
{
|
2014-05-29 01:25:36 +08:00
|
|
|
gen_helper_booke206_tlbflush(cpu_env, cpu_gpr[gprn]);
|
2011-05-01 05:34:58 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_booke_pid (DisasContext *ctx, int sprn, int gprn)
|
2011-05-01 05:34:58 +08:00
|
|
|
{
|
2011-05-21 04:30:19 +08:00
|
|
|
TCGv_i32 t0 = tcg_const_i32(sprn);
|
2012-05-30 12:23:31 +08:00
|
|
|
gen_helper_booke_setpid(cpu_env, t0, cpu_gpr[gprn]);
|
2011-05-21 04:30:19 +08:00
|
|
|
tcg_temp_free_i32(t0);
|
2011-05-01 05:34:58 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void gen_spr_usprgh (CPUPPCState *env)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2007-11-18 07:02:20 +08:00
|
|
|
spr_register(env, SPR_USPRG4, "USPRG4",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG5, "USPRG5",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG6, "USPRG6",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG7, "USPRG7",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
2007-03-07 16:32:30 +08:00
|
|
|
0x00000000);
|
2007-11-18 07:02:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* PowerPC BookE SPR */
|
|
|
|
static void gen_spr_BookE (CPUPPCState *env, uint64_t ivor_mask)
|
|
|
|
{
|
2008-09-20 16:07:15 +08:00
|
|
|
const char *ivor_names[64] = {
|
2007-11-18 07:02:20 +08:00
|
|
|
"IVOR0", "IVOR1", "IVOR2", "IVOR3",
|
|
|
|
"IVOR4", "IVOR5", "IVOR6", "IVOR7",
|
|
|
|
"IVOR8", "IVOR9", "IVOR10", "IVOR11",
|
|
|
|
"IVOR12", "IVOR13", "IVOR14", "IVOR15",
|
|
|
|
"IVOR16", "IVOR17", "IVOR18", "IVOR19",
|
|
|
|
"IVOR20", "IVOR21", "IVOR22", "IVOR23",
|
|
|
|
"IVOR24", "IVOR25", "IVOR26", "IVOR27",
|
|
|
|
"IVOR28", "IVOR29", "IVOR30", "IVOR31",
|
|
|
|
"IVOR32", "IVOR33", "IVOR34", "IVOR35",
|
|
|
|
"IVOR36", "IVOR37", "IVOR38", "IVOR39",
|
|
|
|
"IVOR40", "IVOR41", "IVOR42", "IVOR43",
|
|
|
|
"IVOR44", "IVOR45", "IVOR46", "IVOR47",
|
|
|
|
"IVOR48", "IVOR49", "IVOR50", "IVOR51",
|
|
|
|
"IVOR52", "IVOR53", "IVOR54", "IVOR55",
|
|
|
|
"IVOR56", "IVOR57", "IVOR58", "IVOR59",
|
|
|
|
"IVOR60", "IVOR61", "IVOR62", "IVOR63",
|
|
|
|
};
|
|
|
|
#define SPR_BOOKE_IVORxx (-1)
|
|
|
|
int ivor_sprn[64] = {
|
|
|
|
SPR_BOOKE_IVOR0, SPR_BOOKE_IVOR1, SPR_BOOKE_IVOR2, SPR_BOOKE_IVOR3,
|
|
|
|
SPR_BOOKE_IVOR4, SPR_BOOKE_IVOR5, SPR_BOOKE_IVOR6, SPR_BOOKE_IVOR7,
|
|
|
|
SPR_BOOKE_IVOR8, SPR_BOOKE_IVOR9, SPR_BOOKE_IVOR10, SPR_BOOKE_IVOR11,
|
|
|
|
SPR_BOOKE_IVOR12, SPR_BOOKE_IVOR13, SPR_BOOKE_IVOR14, SPR_BOOKE_IVOR15,
|
|
|
|
SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx,
|
|
|
|
SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx,
|
|
|
|
SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx,
|
|
|
|
SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx,
|
|
|
|
SPR_BOOKE_IVOR32, SPR_BOOKE_IVOR33, SPR_BOOKE_IVOR34, SPR_BOOKE_IVOR35,
|
2012-01-20 02:31:51 +08:00
|
|
|
SPR_BOOKE_IVOR36, SPR_BOOKE_IVOR37, SPR_BOOKE_IVOR38, SPR_BOOKE_IVOR39,
|
|
|
|
SPR_BOOKE_IVOR40, SPR_BOOKE_IVOR41, SPR_BOOKE_IVOR42, SPR_BOOKE_IVORxx,
|
2007-11-18 07:02:20 +08:00
|
|
|
SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx,
|
|
|
|
SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx,
|
|
|
|
SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx,
|
|
|
|
SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx,
|
|
|
|
SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx, SPR_BOOKE_IVORxx,
|
|
|
|
};
|
|
|
|
int i;
|
|
|
|
|
2007-03-07 16:32:30 +08:00
|
|
|
/* Interrupt processing */
|
2007-03-30 18:07:33 +08:00
|
|
|
spr_register(env, SPR_BOOKE_CSRR0, "CSRR0",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-03-30 18:07:33 +08:00
|
|
|
spr_register(env, SPR_BOOKE_CSRR1, "CSRR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-03-07 16:32:30 +08:00
|
|
|
/* Debug */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC1, "IAC1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC2, "IAC2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DAC1, "DAC1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DAC2, "DAC2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DBCR0, "DBCR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2012-10-07 04:54:25 +08:00
|
|
|
&spr_read_generic, &spr_write_40x_dbcr0,
|
2007-03-07 16:32:30 +08:00
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DBCR1, "DBCR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DBCR2, "DBCR2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DBSR, "DBSR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-04-17 04:09:45 +08:00
|
|
|
&spr_read_generic, &spr_write_clear,
|
2007-03-07 16:32:30 +08:00
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_DEAR, "DEAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_ESR, "ESR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-03-30 18:07:33 +08:00
|
|
|
spr_register(env, SPR_BOOKE_IVPR, "IVPR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-10-01 09:32:49 +08:00
|
|
|
&spr_read_generic, &spr_write_excp_prefix,
|
2007-03-30 18:07:33 +08:00
|
|
|
0x00000000);
|
|
|
|
/* Exception vectors */
|
2007-11-18 07:02:20 +08:00
|
|
|
for (i = 0; i < 64; i++) {
|
|
|
|
if (ivor_mask & (1ULL << i)) {
|
|
|
|
if (ivor_sprn[i] == SPR_BOOKE_IVORxx) {
|
|
|
|
fprintf(stderr, "ERROR: IVOR %d SPR is not defined\n", i);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
spr_register(env, ivor_sprn[i], ivor_names[i],
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_excp_vector,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
}
|
2007-03-07 16:32:30 +08:00
|
|
|
spr_register(env, SPR_BOOKE_PID, "PID",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2011-05-01 05:34:58 +08:00
|
|
|
&spr_read_generic, &spr_write_booke_pid,
|
2007-03-07 16:32:30 +08:00
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_TCR, "TCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_booke_tcr,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_TSR, "TSR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_booke_tsr,
|
|
|
|
0x00000000);
|
|
|
|
/* Timer */
|
|
|
|
spr_register(env, SPR_DECR, "DECR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_decr, &spr_write_decr,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_DECAR, "DECAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
SPR_NOACCESS, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* SPRGs */
|
|
|
|
spr_register(env, SPR_USPRG0, "USPRG0",
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2011-05-01 05:34:58 +08:00
|
|
|
static inline uint32_t gen_tlbncfg(uint32_t assoc, uint32_t minsize,
|
|
|
|
uint32_t maxsize, uint32_t flags,
|
|
|
|
uint32_t nentries)
|
|
|
|
{
|
|
|
|
return (assoc << TLBnCFG_ASSOC_SHIFT) |
|
|
|
|
(minsize << TLBnCFG_MINSIZE_SHIFT) |
|
|
|
|
(maxsize << TLBnCFG_MAXSIZE_SHIFT) |
|
|
|
|
flags | nentries;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* BookE 2.06 storage control registers */
|
|
|
|
static void gen_spr_BookE206(CPUPPCState *env, uint32_t mas_mask,
|
|
|
|
uint32_t *tlbncfg)
|
2007-03-30 18:07:33 +08:00
|
|
|
{
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2008-09-20 16:07:15 +08:00
|
|
|
const char *mas_names[8] = {
|
2007-11-18 07:02:20 +08:00
|
|
|
"MAS0", "MAS1", "MAS2", "MAS3", "MAS4", "MAS5", "MAS6", "MAS7",
|
|
|
|
};
|
|
|
|
int mas_sprn[8] = {
|
|
|
|
SPR_BOOKE_MAS0, SPR_BOOKE_MAS1, SPR_BOOKE_MAS2, SPR_BOOKE_MAS3,
|
|
|
|
SPR_BOOKE_MAS4, SPR_BOOKE_MAS5, SPR_BOOKE_MAS6, SPR_BOOKE_MAS7,
|
|
|
|
};
|
|
|
|
int i;
|
|
|
|
|
2007-03-30 18:07:33 +08:00
|
|
|
/* TLB assist registers */
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-11-18 07:02:20 +08:00
|
|
|
for (i = 0; i < 8; i++) {
|
2014-11-26 18:39:48 +08:00
|
|
|
void (*uea_write)(DisasContext *ctx, int sprn, int gprn) = &spr_write_generic32;
|
2012-06-21 20:01:06 +08:00
|
|
|
if (i == 2 && (mas_mask & (1 << i)) && (env->insns_flags & PPC_64B)) {
|
|
|
|
uea_write = &spr_write_generic;
|
|
|
|
}
|
2007-11-18 07:02:20 +08:00
|
|
|
if (mas_mask & (1 << i)) {
|
|
|
|
spr_register(env, mas_sprn[i], mas_names[i],
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2012-06-21 20:01:06 +08:00
|
|
|
&spr_read_generic, uea_write,
|
2007-11-18 07:02:20 +08:00
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
}
|
2007-03-30 18:07:33 +08:00
|
|
|
if (env->nb_pids > 1) {
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-03-30 18:07:33 +08:00
|
|
|
spr_register(env, SPR_BOOKE_PID1, "PID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2011-05-01 05:34:58 +08:00
|
|
|
&spr_read_generic, &spr_write_booke_pid,
|
2007-03-30 18:07:33 +08:00
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
if (env->nb_pids > 2) {
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-03-30 18:07:33 +08:00
|
|
|
spr_register(env, SPR_BOOKE_PID2, "PID2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2011-05-01 05:34:58 +08:00
|
|
|
&spr_read_generic, &spr_write_booke_pid,
|
2007-03-30 18:07:33 +08:00
|
|
|
0x00000000);
|
|
|
|
}
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-10-05 21:11:25 +08:00
|
|
|
spr_register(env, SPR_MMUCFG, "MMUCFG",
|
2007-03-30 18:07:33 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000); /* TOFIX */
|
|
|
|
switch (env->nb_ways) {
|
|
|
|
case 4:
|
|
|
|
spr_register(env, SPR_BOOKE_TLB3CFG, "TLB3CFG",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
2011-05-01 05:34:58 +08:00
|
|
|
tlbncfg[3]);
|
2007-03-30 18:07:33 +08:00
|
|
|
/* Fallthru */
|
|
|
|
case 3:
|
|
|
|
spr_register(env, SPR_BOOKE_TLB2CFG, "TLB2CFG",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
2011-05-01 05:34:58 +08:00
|
|
|
tlbncfg[2]);
|
2007-03-30 18:07:33 +08:00
|
|
|
/* Fallthru */
|
|
|
|
case 2:
|
|
|
|
spr_register(env, SPR_BOOKE_TLB1CFG, "TLB1CFG",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
2011-05-01 05:34:58 +08:00
|
|
|
tlbncfg[1]);
|
2007-03-30 18:07:33 +08:00
|
|
|
/* Fallthru */
|
|
|
|
case 1:
|
|
|
|
spr_register(env, SPR_BOOKE_TLB0CFG, "TLB0CFG",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
2011-05-01 05:34:58 +08:00
|
|
|
tlbncfg[0]);
|
2007-03-30 18:07:33 +08:00
|
|
|
/* Fallthru */
|
|
|
|
case 0:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2011-05-01 05:34:58 +08:00
|
|
|
|
|
|
|
gen_spr_usprgh(env);
|
2007-03-30 18:07:33 +08:00
|
|
|
}
|
|
|
|
|
2007-03-07 16:32:30 +08:00
|
|
|
/* SPR specific to PowerPC 440 implementation */
|
|
|
|
static void gen_spr_440 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Cache control */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_DNV0, "DNV0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_DNV1, "DNV1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_DNV2, "DNV2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_DNV3, "DNV3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_440_DTV0, "DTV0",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_440_DTV1, "DTV1",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_440_DTV2, "DTV2",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_440_DTV3, "DTV3",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_DVLIM, "DVLIM",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_INV0, "INV0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_INV1, "INV1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_INV2, "INV2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_INV3, "INV3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_440_ITV0, "ITV0",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_440_ITV1, "ITV1",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_440_ITV2, "ITV2",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_440_ITV3, "ITV3",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_IVLIM, "IVLIM",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Cache debug */
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_BOOKE_DCDBTRH, "DCDBTRH",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_BOOKE_DCDBTRL, "DCDBTRL",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_BOOKE_ICDBDR, "ICDBDR",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_BOOKE_ICDBTRH, "ICDBTRH",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_BOOKE_ICDBTRL, "ICDBTRL",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_DBDR, "DBDR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Processor control */
|
|
|
|
spr_register(env, SPR_4xx_CCR0, "CCR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_440_RSTCFG, "RSTCFG",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* Storage control */
|
|
|
|
spr_register(env, SPR_440_MMUCR, "MMUCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* SPR shared between PowerPC 40x implementations */
|
|
|
|
static void gen_spr_40x (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Cache */
|
2012-04-07 15:23:39 +08:00
|
|
|
/* not emulated, as QEMU do not emulate caches */
|
2007-03-07 16:32:30 +08:00
|
|
|
spr_register(env, SPR_40x_DCCR, "DCCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2012-04-07 15:23:39 +08:00
|
|
|
/* not emulated, as QEMU do not emulate caches */
|
2007-03-07 16:32:30 +08:00
|
|
|
spr_register(env, SPR_40x_ICCR, "ICCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2012-04-07 15:23:39 +08:00
|
|
|
/* not emulated, as QEMU do not emulate caches */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_BOOKE_ICDBDR, "ICDBDR",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* Exception */
|
|
|
|
spr_register(env, SPR_40x_DEAR, "DEAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_40x_ESR, "ESR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_40x_EVPR, "EVPR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-10-01 09:32:49 +08:00
|
|
|
&spr_read_generic, &spr_write_excp_prefix,
|
2007-03-07 16:32:30 +08:00
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_40x_SRR2, "SRR2",
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_40x_SRR3, "SRR3",
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Timers */
|
|
|
|
spr_register(env, SPR_40x_PIT, "PIT",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_40x_pit, &spr_write_40x_pit,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_40x_TCR, "TCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_booke_tcr,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_40x_TSR, "TSR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_booke_tsr,
|
|
|
|
0x00000000);
|
2007-09-21 13:50:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* SPR specific to PowerPC 405 implementation */
|
|
|
|
static void gen_spr_405 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* MMU */
|
|
|
|
spr_register(env, SPR_40x_PID, "PID",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_4xx_CCR0, "CCR0",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
2007-09-21 13:50:37 +08:00
|
|
|
0x00700000);
|
|
|
|
/* Debug interface */
|
2007-03-07 16:32:30 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_40x_DBCR0, "DBCR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-04-17 04:09:45 +08:00
|
|
|
&spr_read_generic, &spr_write_40x_dbcr0,
|
2007-03-07 16:32:30 +08:00
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_405_DBCR1, "DBCR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-03-07 16:32:30 +08:00
|
|
|
spr_register(env, SPR_40x_DBSR, "DBSR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-04-17 04:09:45 +08:00
|
|
|
&spr_read_generic, &spr_write_clear,
|
|
|
|
/* Last reset was system reset */
|
2007-03-07 16:32:30 +08:00
|
|
|
0x00000300);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_40x_DAC1, "DAC1",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_40x_DAC2, "DAC2",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-09-21 13:50:37 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_405_DVC1, "DVC1",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
2007-09-21 13:50:37 +08:00
|
|
|
0x00000000);
|
2007-03-07 16:32:30 +08:00
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_405_DVC2, "DVC2",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_40x_IAC1, "IAC1",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_40x_IAC2, "IAC2",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_405_IAC3, "IAC3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_405_IAC4, "IAC4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Storage control */
|
2007-10-01 09:38:03 +08:00
|
|
|
/* XXX: TODO: not implemented */
|
2007-03-07 16:32:30 +08:00
|
|
|
spr_register(env, SPR_405_SLER, "SLER",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-04-24 14:44:14 +08:00
|
|
|
&spr_read_generic, &spr_write_40x_sler,
|
2007-03-07 16:32:30 +08:00
|
|
|
0x00000000);
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_40x_ZPR, "ZPR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-03-07 16:32:30 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_405_SU0R, "SU0R",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* SPRG */
|
|
|
|
spr_register(env, SPR_USPRG0, "USPRG0",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG4, "SPRG4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-04-17 10:50:56 +08:00
|
|
|
&spr_read_generic, &spr_write_generic,
|
2007-03-07 16:32:30 +08:00
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG5, "SPRG5",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-04-17 10:50:56 +08:00
|
|
|
spr_read_generic, &spr_write_generic,
|
2007-03-07 16:32:30 +08:00
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG6, "SPRG6",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-04-17 10:50:56 +08:00
|
|
|
spr_read_generic, &spr_write_generic,
|
2007-03-07 16:32:30 +08:00
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG7, "SPRG7",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-04-17 10:50:56 +08:00
|
|
|
spr_read_generic, &spr_write_generic,
|
2007-03-07 16:32:30 +08:00
|
|
|
0x00000000);
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_spr_usprgh(env);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* SPR shared between PowerPC 401 & 403 implementations */
|
|
|
|
static void gen_spr_401_403 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Time base */
|
|
|
|
spr_register(env, SPR_403_VTBL, "TBL",
|
|
|
|
&spr_read_tbl, SPR_NOACCESS,
|
|
|
|
&spr_read_tbl, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_403_TBL, "TBL",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
SPR_NOACCESS, &spr_write_tbl,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_403_VTBU, "TBU",
|
|
|
|
&spr_read_tbu, SPR_NOACCESS,
|
|
|
|
&spr_read_tbu, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_403_TBU, "TBU",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
SPR_NOACCESS, &spr_write_tbu,
|
|
|
|
0x00000000);
|
|
|
|
/* Debug */
|
2012-04-07 15:23:39 +08:00
|
|
|
/* not emulated, as QEMU do not emulate caches */
|
2007-03-07 16:32:30 +08:00
|
|
|
spr_register(env, SPR_403_CDBCR, "CDBCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2007-09-21 13:50:37 +08:00
|
|
|
/* SPR specific to PowerPC 401 implementation */
|
|
|
|
static void gen_spr_401 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Debug interface */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_40x_DBCR0, "DBCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_40x_dbcr0,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_40x_DBSR, "DBSR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_clear,
|
|
|
|
/* Last reset was system reset */
|
|
|
|
0x00000300);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_40x_DAC1, "DAC",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_40x_IAC1, "IAC",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Storage control */
|
2007-10-01 09:38:03 +08:00
|
|
|
/* XXX: TODO: not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_405_SLER, "SLER",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_40x_sler,
|
|
|
|
0x00000000);
|
2012-04-07 15:23:39 +08:00
|
|
|
/* not emulated, as QEMU never does speculative access */
|
2007-10-01 09:38:03 +08:00
|
|
|
spr_register(env, SPR_40x_SGR, "SGR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0xFFFFFFFF);
|
2012-04-07 15:23:39 +08:00
|
|
|
/* not emulated, as QEMU do not emulate caches */
|
2007-10-01 09:38:03 +08:00
|
|
|
spr_register(env, SPR_40x_DCWR, "DCWR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-09-21 13:50:37 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void gen_spr_401x2 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_401(env);
|
|
|
|
spr_register(env, SPR_40x_PID, "PID",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_40x_ZPR, "ZPR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2007-03-07 16:32:30 +08:00
|
|
|
/* SPR specific to PowerPC 403 implementation */
|
|
|
|
static void gen_spr_403 (CPUPPCState *env)
|
|
|
|
{
|
2007-09-21 13:50:37 +08:00
|
|
|
/* Debug interface */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_40x_DBCR0, "DBCR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_40x_dbcr0,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_40x_DBSR, "DBSR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_clear,
|
|
|
|
/* Last reset was system reset */
|
|
|
|
0x00000300);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_40x_DAC1, "DAC1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_40x_DAC2, "DAC2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_40x_IAC1, "IAC1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_40x_IAC2, "IAC2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_403_real (CPUPPCState *env)
|
|
|
|
{
|
2007-03-07 16:32:30 +08:00
|
|
|
spr_register(env, SPR_403_PBL1, "PBL1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_403_pbr, &spr_write_403_pbr,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_403_PBU1, "PBU1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_403_pbr, &spr_write_403_pbr,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_403_PBL2, "PBL2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_403_pbr, &spr_write_403_pbr,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_403_PBU2, "PBU2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_403_pbr, &spr_write_403_pbr,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_403_mmu (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* MMU */
|
|
|
|
spr_register(env, SPR_40x_PID, "PID",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-09-21 13:50:37 +08:00
|
|
|
spr_register(env, SPR_40x_ZPR, "ZPR",
|
2007-03-07 16:32:30 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* SPR specific to PowerPC compression coprocessor extension */
|
|
|
|
static void gen_spr_compress (CPUPPCState *env)
|
|
|
|
{
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-03-07 16:32:30 +08:00
|
|
|
spr_register(env, SPR_401_SKR, "SKR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void gen_spr_5xx_8xx (CPUPPCState *env)
|
2007-09-29 21:06:16 +08:00
|
|
|
{
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Exception processing */
|
2013-02-21 00:41:50 +08:00
|
|
|
spr_register_kvm(env, SPR_DSISR, "DSISR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_DSISR, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_DAR, "DAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_DAR, 0x00000000);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Timer */
|
|
|
|
spr_register(env, SPR_DECR, "DECR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_decr, &spr_write_decr,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_EIE, "EIE",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_EID, "EID",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_NRI, "NRI",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_CMPA, "CMPA",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_CMPB, "CMPB",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_CMPC, "CMPC",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_CMPD, "CMPD",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_ECR, "ECR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_DER, "DER",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_COUNTA, "COUNTA",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_COUNTB, "COUNTB",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_CMPE, "CMPE",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_CMPF, "CMPF",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_CMPG, "CMPG",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_CMPH, "CMPH",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_LCTRL1, "LCTRL1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_LCTRL2, "LCTRL2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_BAR, "BAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_DPDR, "DPDR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_IMMR, "IMMR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_5xx (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_MI_GRA, "MI_GRA",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_L2U_GRA, "L2U_GRA",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RPCU_BBCMCR, "L2U_BBCMCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_L2U_MCR, "L2U_MCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_MI_RBA0, "MI_RBA0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_MI_RBA1, "MI_RBA1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_MI_RBA2, "MI_RBA2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_MI_RBA3, "MI_RBA3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_L2U_RBA0, "L2U_RBA0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_L2U_RBA1, "L2U_RBA1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_L2U_RBA2, "L2U_RBA2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_L2U_RBA3, "L2U_RBA3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_MI_RA0, "MI_RA0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_MI_RA1, "MI_RA1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_MI_RA2, "MI_RA2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_MI_RA3, "MI_RA3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_L2U_RA0, "L2U_RA0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_L2U_RA1, "L2U_RA1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_L2U_RA2, "L2U_RA2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_L2U_RA3, "L2U_RA3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_RCPU_FPECR, "FPECR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_8xx (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_IC_CST, "IC_CST",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_IC_ADR, "IC_ADR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_IC_DAT, "IC_DAT",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_DC_CST, "DC_CST",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_DC_ADR, "DC_ADR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_DC_DAT, "DC_DAT",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MI_CTR, "MI_CTR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MI_AP, "MI_AP",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MI_EPN, "MI_EPN",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MI_TWC, "MI_TWC",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MI_RPN, "MI_RPN",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MI_DBCAM, "MI_DBCAM",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MI_DBRAM0, "MI_DBRAM0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MI_DBRAM1, "MI_DBRAM1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MD_CTR, "MD_CTR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MD_CASID, "MD_CASID",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MD_AP, "MD_AP",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MD_EPN, "MD_EPN",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MD_TWB, "MD_TWB",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MD_TWC, "MD_TWC",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MD_RPN, "MD_RPN",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MD_TW, "MD_TW",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MD_DBCAM, "MD_DBCAM",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MD_DBRAM0, "MD_DBRAM0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MPC_MD_DBRAM1, "MD_DBRAM1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
|
|
|
// XXX: TODO
|
|
|
|
/*
|
|
|
|
* AMR => SPR 29 (Power 2.04)
|
|
|
|
* CTRL => SPR 136 (Power 2.04)
|
|
|
|
* CTRL => SPR 152 (Power 2.04)
|
|
|
|
* SCOMC => SPR 276 (64 bits ?)
|
|
|
|
* SCOMD => SPR 277 (64 bits ?)
|
|
|
|
* TBU40 => SPR 286 (Power 2.04 hypv)
|
|
|
|
* HSPRG0 => SPR 304 (Power 2.04 hypv)
|
|
|
|
* HSPRG1 => SPR 305 (Power 2.04 hypv)
|
|
|
|
* HDSISR => SPR 306 (Power 2.04 hypv)
|
|
|
|
* HDAR => SPR 307 (Power 2.04 hypv)
|
|
|
|
* PURR => SPR 309 (Power 2.04 hypv)
|
|
|
|
* HDEC => SPR 310 (Power 2.04 hypv)
|
|
|
|
* HIOR => SPR 311 (hypv)
|
|
|
|
* RMOR => SPR 312 (970)
|
|
|
|
* HRMOR => SPR 313 (Power 2.04 hypv)
|
|
|
|
* HSRR0 => SPR 314 (Power 2.04 hypv)
|
|
|
|
* HSRR1 => SPR 315 (Power 2.04 hypv)
|
|
|
|
* LPIDR => SPR 317 (970)
|
|
|
|
* EPR => SPR 702 (Power 2.04 emb)
|
|
|
|
* perf => 768-783 (Power 2.04)
|
|
|
|
* perf => 784-799 (Power 2.04)
|
|
|
|
* PPR => SPR 896 (Power 2.04)
|
|
|
|
* EPLC => SPR 947 (Power 2.04 emb)
|
|
|
|
* EPSC => SPR 948 (Power 2.04 emb)
|
|
|
|
* DABRX => 1015 (Power 2.04 hypv)
|
|
|
|
* FPECR => SPR 1022 (?)
|
|
|
|
* ... and more (thermal management, performance counters, ...)
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Exception vectors models */
|
|
|
|
static void init_excp_4xx_real (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PIT] = 0x00001000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FIT] = 0x00001010;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_WDT] = 0x00001020;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DEBUG] = 0x00002000;
|
|
|
|
env->ivor_mask = 0x0000FFF0UL;
|
2007-11-03 21:37:12 +08:00
|
|
|
env->ivpr_mask = 0xFFFF0000UL;
|
2007-10-05 21:09:54 +08:00
|
|
|
/* Hardware reset vector */
|
|
|
|
env->hreset_vector = 0xFFFFFFFCUL;
|
2007-09-29 21:06:16 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_excp_4xx_softmmu (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PIT] = 0x00001000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FIT] = 0x00001010;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_WDT] = 0x00001020;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DTLB] = 0x00001100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ITLB] = 0x00001200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DEBUG] = 0x00002000;
|
|
|
|
env->ivor_mask = 0x0000FFF0UL;
|
|
|
|
env->ivpr_mask = 0xFFFF0000UL;
|
|
|
|
/* Hardware reset vector */
|
|
|
|
env->hreset_vector = 0xFFFFFFFCUL;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void init_excp_MPC5xx (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPA] = 0x00000E00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EMUL] = 0x00001000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DABR] = 0x00001C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MEXTBR] = 0x00001E00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_NMEXTBR] = 0x00001F00;
|
|
|
|
env->ivor_mask = 0x0000FFF0UL;
|
|
|
|
env->ivpr_mask = 0xFFFF0000UL;
|
|
|
|
/* Hardware reset vector */
|
PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450
According to the different user's manuals, the vector offset for system
reset (both /HRESET and /SRESET) is 0x00100.
This patch may break support of some executables, as the power-on start
address may change. For a specific board, if the power-on start address
is different than HRESET vector (i.e. 0x00000100 or 0xfff00100), this
should be fixed in board's initialization code.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-03-29 10:06:28 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-11-18 07:02:20 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void init_excp_MPC8xx (CPUPPCState *env)
|
2007-09-29 21:06:16 +08:00
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
2007-11-18 07:02:20 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000900;
|
2007-09-29 21:06:16 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
2007-11-18 07:02:20 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPA] = 0x00000E00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EMUL] = 0x00001000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ITLB] = 0x00001100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DTLB] = 0x00001200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ITLBE] = 0x00001300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DTLBE] = 0x00001400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DABR] = 0x00001C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MEXTBR] = 0x00001E00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_NMEXTBR] = 0x00001F00;
|
|
|
|
env->ivor_mask = 0x0000FFF0UL;
|
|
|
|
env->ivpr_mask = 0xFFFF0000UL;
|
2007-10-05 21:09:54 +08:00
|
|
|
/* Hardware reset vector */
|
PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450
According to the different user's manuals, the vector offset for system
reset (both /HRESET and /SRESET) is 0x00100.
This patch may break support of some executables, as the power-on start
address may change. For a specific board, if the power-on start address
is different than HRESET vector (i.e. 0x00000100 or 0xfff00100), this
should be fixed in board's initialization code.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-03-29 10:06:28 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-09-29 21:06:16 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_excp_G2 (CPUPPCState *env)
|
2007-09-29 21:06:16 +08:00
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
2007-11-18 07:02:20 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000A00;
|
2007-09-29 21:06:16 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IFTLB] = 0x00001000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DLTLB] = 0x00001100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSTLB] = 0x00001200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400;
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Hardware reset vector */
|
PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450
According to the different user's manuals, the vector offset for system
reset (both /HRESET and /SRESET) is 0x00100.
This patch may break support of some executables, as the power-on start
address may change. For a specific board, if the power-on start address
is different than HRESET vector (i.e. 0x00000100 or 0xfff00100), this
should be fixed in board's initialization code.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-03-29 10:06:28 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-11-18 07:02:20 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2012-06-21 21:17:59 +08:00
|
|
|
static void init_excp_e200(CPUPPCState *env, target_ulong ivpr_mask)
|
2007-11-18 07:02:20 +08:00
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000FFC;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_APU] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FIT] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_WDT] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DTLB] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ITLB] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DEBUG] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SPEU] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EFPDI] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EFPRI] = 0x00000000;
|
|
|
|
env->ivor_mask = 0x0000FFF7UL;
|
2012-06-21 21:17:59 +08:00
|
|
|
env->ivpr_mask = ivpr_mask;
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Hardware reset vector */
|
|
|
|
env->hreset_vector = 0xFFFFFFFCUL;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void init_excp_BookE (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_APU] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FIT] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_WDT] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DTLB] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ITLB] = 0x00000000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DEBUG] = 0x00000000;
|
2014-09-06 00:39:05 +08:00
|
|
|
env->ivor_mask = 0x0000FFF0UL;
|
2007-11-18 07:02:20 +08:00
|
|
|
env->ivpr_mask = 0xFFFF0000UL;
|
|
|
|
/* Hardware reset vector */
|
|
|
|
env->hreset_vector = 0xFFFFFFFCUL;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void init_excp_601 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IO] = 0x00000A00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RUNM] = 0x00002000;
|
2007-10-05 21:09:54 +08:00
|
|
|
/* Hardware reset vector */
|
2007-11-18 07:02:20 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-09-29 21:06:16 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_excp_602 (CPUPPCState *env)
|
2007-09-29 21:06:16 +08:00
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2007-11-19 21:22:47 +08:00
|
|
|
/* XXX: exception prefix has a special behavior on 602 */
|
2007-09-29 21:06:16 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IFTLB] = 0x00001000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DLTLB] = 0x00001100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSTLB] = 0x00001200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400;
|
2007-11-18 07:02:20 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_WDT] = 0x00001500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EMUL] = 0x00001600;
|
2007-10-05 21:09:54 +08:00
|
|
|
/* Hardware reset vector */
|
PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450
According to the different user's manuals, the vector offset for system
reset (both /HRESET and /SRESET) is 0x00100.
This patch may break support of some executables, as the power-on start
address may change. For a specific board, if the power-on start address
is different than HRESET vector (i.e. 0x00000100 or 0xfff00100), this
should be fixed in board's initialization code.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-03-29 10:06:28 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-09-29 21:06:16 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_excp_603 (CPUPPCState *env)
|
2007-09-29 21:06:16 +08:00
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IFTLB] = 0x00001000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DLTLB] = 0x00001100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSTLB] = 0x00001200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400;
|
2007-10-05 21:09:54 +08:00
|
|
|
/* Hardware reset vector */
|
PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450
According to the different user's manuals, the vector offset for system
reset (both /HRESET and /SRESET) is 0x00100.
This patch may break support of some executables, as the power-on start
address may change. For a specific board, if the power-on start address
is different than HRESET vector (i.e. 0x00000100 or 0xfff00100), this
should be fixed in board's initialization code.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-03-29 10:06:28 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-09-29 21:06:16 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void init_excp_604 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400;
|
2007-10-05 21:09:54 +08:00
|
|
|
/* Hardware reset vector */
|
2009-04-29 02:07:01 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-09-29 21:06:16 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void init_excp_7x0 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300;
|
2007-11-21 21:08:23 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400;
|
2007-09-29 21:06:16 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_THERM] = 0x00001700;
|
2007-10-05 21:09:54 +08:00
|
|
|
/* Hardware reset vector */
|
PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450
According to the different user's manuals, the vector offset for system
reset (both /HRESET and /SRESET) is 0x00100.
This patch may break support of some executables, as the power-on start
address may change. For a specific board, if the power-on start address
is different than HRESET vector (i.e. 0x00000100 or 0xfff00100), this
should be fixed in board's initialization code.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-03-29 10:06:28 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-09-29 21:06:16 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2007-11-21 21:08:23 +08:00
|
|
|
static void init_excp_750cl (CPUPPCState *env)
|
2007-09-29 21:06:16 +08:00
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400;
|
2007-11-21 21:08:23 +08:00
|
|
|
/* Hardware reset vector */
|
PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450
According to the different user's manuals, the vector offset for system
reset (both /HRESET and /SRESET) is 0x00100.
This patch may break support of some executables, as the power-on start
address may change. For a specific board, if the power-on start address
is different than HRESET vector (i.e. 0x00000100 or 0xfff00100), this
should be fixed in board's initialization code.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-03-29 10:06:28 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-11-21 21:08:23 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void init_excp_750cx (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300;
|
2007-09-29 21:06:16 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_THERM] = 0x00001700;
|
2007-10-05 21:09:54 +08:00
|
|
|
/* Hardware reset vector */
|
PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450
According to the different user's manuals, the vector offset for system
reset (both /HRESET and /SRESET) is 0x00100.
This patch may break support of some executables, as the power-on start
address may change. For a specific board, if the power-on start address
is different than HRESET vector (i.e. 0x00000100 or 0xfff00100), this
should be fixed in board's initialization code.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-03-29 10:06:28 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-09-29 21:06:16 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2007-10-08 10:23:00 +08:00
|
|
|
/* XXX: Check if this is correct */
|
|
|
|
static void init_excp_7x5 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
2007-11-21 21:08:23 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00;
|
2007-10-08 10:23:00 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_IFTLB] = 0x00001000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DLTLB] = 0x00001100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSTLB] = 0x00001200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400;
|
2007-11-21 21:08:23 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_THERM] = 0x00001700;
|
2007-10-08 10:23:00 +08:00
|
|
|
/* Hardware reset vector */
|
PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450
According to the different user's manuals, the vector offset for system
reset (both /HRESET and /SRESET) is 0x00100.
This patch may break support of some executables, as the power-on start
address may change. For a specific board, if the power-on start address
is different than HRESET vector (i.e. 0x00000100 or 0xfff00100), this
should be fixed in board's initialization code.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-03-29 10:06:28 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-10-08 10:23:00 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2007-09-29 21:06:16 +08:00
|
|
|
static void init_excp_7400 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_VPU] = 0x00000F20;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_VPUA] = 0x00001600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_THERM] = 0x00001700;
|
2007-10-05 21:09:54 +08:00
|
|
|
/* Hardware reset vector */
|
PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450
According to the different user's manuals, the vector offset for system
reset (both /HRESET and /SRESET) is 0x00100.
This patch may break support of some executables, as the power-on start
address may change. For a specific board, if the power-on start address
is different than HRESET vector (i.e. 0x00000100 or 0xfff00100), this
should be fixed in board's initialization code.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-03-29 10:06:28 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-09-29 21:06:16 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void init_excp_7450 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_VPU] = 0x00000F20;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IFTLB] = 0x00001000;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DLTLB] = 0x00001100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSTLB] = 0x00001200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_VPUA] = 0x00001600;
|
2007-10-05 21:09:54 +08:00
|
|
|
/* Hardware reset vector */
|
PPC: fix hreset_vector for 60x, 7x0, 7x5, G2, MPC8xx, MPC5xx, 7400 and 7450
According to the different user's manuals, the vector offset for system
reset (both /HRESET and /SRESET) is 0x00100.
This patch may break support of some executables, as the power-on start
address may change. For a specific board, if the power-on start address
is different than HRESET vector (i.e. 0x00000100 or 0xfff00100), this
should be fixed in board's initialization code.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-03-29 10:06:28 +08:00
|
|
|
env->hreset_vector = 0x00000100UL;
|
2007-09-29 21:06:16 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined (TARGET_PPC64)
|
|
|
|
static void init_excp_970 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSEG] = 0x00000380;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISEG] = 0x00000480;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_HDECR] = 0x00000980;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_VPU] = 0x00000F20;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MAINT] = 0x00001600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_VPUA] = 0x00001700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_THERM] = 0x00001800;
|
2007-10-05 21:09:54 +08:00
|
|
|
/* Hardware reset vector */
|
|
|
|
env->hreset_vector = 0x0000000000000100ULL;
|
2007-09-29 21:06:16 +08:00
|
|
|
#endif
|
|
|
|
}
|
2011-04-01 12:15:19 +08:00
|
|
|
|
|
|
|
static void init_excp_POWER7 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DSEG] = 0x00000380;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ISEG] = 0x00000480;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_HDECR] = 0x00000980;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_VPU] = 0x00000F20;
|
2013-10-22 19:06:17 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_VSXU] = 0x00000F40;
|
2014-06-04 20:50:56 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_FU] = 0x00000F60;
|
2011-04-01 12:15:19 +08:00
|
|
|
env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_MAINT] = 0x00001600;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_VPUA] = 0x00001700;
|
|
|
|
env->excp_vectors[POWERPC_EXCP_THERM] = 0x00001800;
|
|
|
|
/* Hardware reset vector */
|
|
|
|
env->hreset_vector = 0x0000000000000100ULL;
|
|
|
|
#endif
|
|
|
|
}
|
2007-09-29 21:06:16 +08:00
|
|
|
#endif
|
|
|
|
|
2007-10-26 07:14:50 +08:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* Power management enable checks */
|
|
|
|
static int check_pow_none (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int check_pow_nocheck (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int check_pow_hid0 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
if (env->spr[SPR_HID0] & 0x00E00000)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-12-10 15:40:16 +08:00
|
|
|
static int check_pow_hid0_74xx (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
if (env->spr[SPR_HID0] & 0x00600000)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-05-20 01:59:05 +08:00
|
|
|
static bool ppc_cpu_interrupts_big_endian_always(PowerPCCPU *cpu)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef TARGET_PPC64
|
|
|
|
static bool ppc_cpu_interrupts_big_endian_lpcr(PowerPCCPU *cpu)
|
|
|
|
{
|
|
|
|
return !(cpu->env.spr[SPR_LPCR] & LPCR_ILE);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* PowerPC implementations definitions */
|
2007-03-07 16:32:30 +08:00
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
#define POWERPC_FAMILY(_name) \
|
|
|
|
static void \
|
|
|
|
glue(glue(ppc_, _name), _cpu_family_class_init)(ObjectClass *, void *); \
|
|
|
|
\
|
|
|
|
static const TypeInfo \
|
|
|
|
glue(glue(ppc_, _name), _cpu_family_type_info) = { \
|
|
|
|
.name = stringify(_name) "-family-" TYPE_POWERPC_CPU, \
|
|
|
|
.parent = TYPE_POWERPC_CPU, \
|
|
|
|
.abstract = true, \
|
|
|
|
.class_init = glue(glue(ppc_, _name), _cpu_family_class_init), \
|
|
|
|
}; \
|
|
|
|
\
|
|
|
|
static void glue(glue(ppc_, _name), _cpu_family_register_types)(void) \
|
|
|
|
{ \
|
|
|
|
type_register_static( \
|
|
|
|
&glue(glue(ppc_, _name), _cpu_family_type_info)); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
type_init(glue(glue(ppc_, _name), _cpu_family_register_types)) \
|
|
|
|
\
|
|
|
|
static void glue(glue(ppc_, _name), _cpu_family_class_init)
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_401 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_40x(env);
|
|
|
|
gen_spr_401_403(env);
|
|
|
|
gen_spr_401(env);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_4xx_real(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
2007-10-01 09:27:10 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc40x_irq_init(env);
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(12, 16, 20, 24);
|
|
|
|
SET_WDT_PERIOD(16, 20, 24, 28);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
2007-03-07 16:32:30 +08:00
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(401)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 401";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_401;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_WRTEE | PPC_DCR |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_40x_ICBT |
|
|
|
|
PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_4xx_COMMON | PPC_40x_EXCP;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_KEY) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_REAL;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_40x;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_401;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DE |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_401x2 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_40x(env);
|
|
|
|
gen_spr_401_403(env);
|
|
|
|
gen_spr_401x2(env);
|
|
|
|
gen_spr_compress(env);
|
|
|
|
/* Memory management */
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
env->nb_tlb = 64;
|
|
|
|
env->nb_ways = 1;
|
|
|
|
env->id_tlbs = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_EMB;
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_4xx_softmmu(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
2007-10-01 09:27:10 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc40x_irq_init(env);
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(12, 16, 20, 24);
|
|
|
|
SET_WDT_PERIOD(16, 20, 24, 28);
|
2007-03-07 16:32:30 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(401x2)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 401x2";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_401x2;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_DCR | PPC_WRTEE |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_40x_ICBT |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_40x_TLB | PPC_MEM_TLBIA | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_4xx_COMMON | PPC_40x_EXCP;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << 20) |
|
|
|
|
(1ull << MSR_KEY) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_4xx_Z;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_40x;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_401;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DE |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-09-29 21:06:16 +08:00
|
|
|
static void init_proc_401x3 (CPUPPCState *env)
|
2007-03-07 16:32:30 +08:00
|
|
|
{
|
2007-10-01 09:27:10 +08:00
|
|
|
gen_spr_40x(env);
|
|
|
|
gen_spr_401_403(env);
|
|
|
|
gen_spr_401(env);
|
|
|
|
gen_spr_401x2(env);
|
|
|
|
gen_spr_compress(env);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_4xx_softmmu(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
2007-10-01 09:27:10 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc40x_irq_init(env);
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(12, 16, 20, 24);
|
|
|
|
SET_WDT_PERIOD(16, 20, 24, 28);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(401x3)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 401x3";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_401x3;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_DCR | PPC_WRTEE |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_40x_ICBT |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_40x_TLB | PPC_MEM_TLBIA | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_4xx_COMMON | PPC_40x_EXCP;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << 20) |
|
|
|
|
(1ull << MSR_KEY) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_DWE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_4xx_Z;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_40x;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_401;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DE |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_IOP480 (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
gen_spr_40x(env);
|
|
|
|
gen_spr_401_403(env);
|
|
|
|
gen_spr_401x2(env);
|
|
|
|
gen_spr_compress(env);
|
|
|
|
/* Memory management */
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
env->nb_tlb = 64;
|
|
|
|
env->nb_ways = 1;
|
|
|
|
env->id_tlbs = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_EMB;
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_4xx_softmmu(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
2007-10-01 09:27:10 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc40x_irq_init(env);
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(8, 12, 16, 20);
|
|
|
|
SET_WDT_PERIOD(16, 20, 24, 28);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(IOP480)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "IOP480";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_IOP480;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_DCR | PPC_WRTEE |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_40x_ICBT |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_40x_TLB | PPC_MEM_TLBIA | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_4xx_COMMON | PPC_40x_EXCP;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << 20) |
|
|
|
|
(1ull << MSR_KEY) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_4xx_Z;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_40x;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_401;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DE |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_403 (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
gen_spr_40x(env);
|
|
|
|
gen_spr_401_403(env);
|
|
|
|
gen_spr_403(env);
|
|
|
|
gen_spr_403_real(env);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_4xx_real(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
2007-10-01 09:27:10 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc40x_irq_init(env);
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(8, 12, 16, 20);
|
|
|
|
SET_WDT_PERIOD(16, 20, 24, 28);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(403)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 403";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_403;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_DCR | PPC_WRTEE |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_40x_ICBT |
|
|
|
|
PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_4xx_COMMON | PPC_40x_EXCP;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_PE) |
|
|
|
|
(1ull << MSR_PX) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_REAL;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_40x;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_401;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_PX |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_403GCX (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
gen_spr_40x(env);
|
|
|
|
gen_spr_401_403(env);
|
|
|
|
gen_spr_403(env);
|
|
|
|
gen_spr_403_real(env);
|
|
|
|
gen_spr_403_mmu(env);
|
|
|
|
/* Bus access control */
|
2012-04-07 15:23:39 +08:00
|
|
|
/* not emulated, as QEMU never does speculative access */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_40x_SGR, "SGR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0xFFFFFFFF);
|
2012-04-07 15:23:39 +08:00
|
|
|
/* not emulated, as QEMU do not emulate caches */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_40x_DCWR, "DCWR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
env->nb_tlb = 64;
|
|
|
|
env->nb_ways = 1;
|
|
|
|
env->id_tlbs = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_EMB;
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2007-11-18 07:02:20 +08:00
|
|
|
init_excp_4xx_softmmu(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc40x_irq_init(env);
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(8, 12, 16, 20);
|
|
|
|
SET_WDT_PERIOD(16, 20, 24, 28);
|
2007-11-18 07:02:20 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(403GCX)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 403 GCX";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_403GCX;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_DCR | PPC_WRTEE |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_40x_ICBT |
|
|
|
|
PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_40x_TLB | PPC_MEM_TLBIA | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_4xx_COMMON | PPC_40x_EXCP;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_PE) |
|
|
|
|
(1ull << MSR_PX) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_4xx_Z;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_40x;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_401;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_PX |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_405 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
gen_spr_40x(env);
|
|
|
|
gen_spr_405(env);
|
|
|
|
/* Bus access control */
|
2012-04-07 15:23:39 +08:00
|
|
|
/* not emulated, as QEMU never does speculative access */
|
2007-11-18 07:02:20 +08:00
|
|
|
spr_register(env, SPR_40x_SGR, "SGR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0xFFFFFFFF);
|
2012-04-07 15:23:39 +08:00
|
|
|
/* not emulated, as QEMU do not emulate caches */
|
2007-11-18 07:02:20 +08:00
|
|
|
spr_register(env, SPR_40x_DCWR, "DCWR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->nb_tlb = 64;
|
|
|
|
env->nb_ways = 1;
|
|
|
|
env->id_tlbs = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_EMB;
|
2007-11-18 07:02:20 +08:00
|
|
|
#endif
|
|
|
|
init_excp_4xx_softmmu(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc40x_irq_init(env);
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(8, 12, 16, 20);
|
|
|
|
SET_WDT_PERIOD(16, 20, 24, 28);
|
2007-11-18 07:02:20 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(405)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 405";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_405;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_DCR | PPC_WRTEE |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_40x_ICBT |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_40x_TLB | PPC_MEM_TLBIA | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_4xx_COMMON | PPC_405_MAC | PPC_40x_EXCP;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_DWE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_4xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_40x;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_405;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
|
|
|
|
POWERPC_FLAG_DE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_440EP (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
gen_spr_BookE(env, 0x000000000000FFFFULL);
|
|
|
|
gen_spr_440(env);
|
|
|
|
gen_spr_usprgh(env);
|
|
|
|
/* Processor identification */
|
|
|
|
spr_register(env, SPR_BOOKE_PIR, "PIR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_pir,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC3, "IAC3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC4, "IAC4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DVC1, "DVC1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DVC2, "DVC2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_MCSR, "MCSR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_MCSRR0, "MCSRR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_MCSRR1, "MCSRR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_CCR1, "CCR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->nb_tlb = 64;
|
|
|
|
env->nb_ways = 1;
|
|
|
|
env->id_tlbs = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_EMB;
|
2007-11-18 07:02:20 +08:00
|
|
|
#endif
|
|
|
|
init_excp_BookE(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
2012-01-04 05:01:40 +08:00
|
|
|
ppc40x_irq_init(env);
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(12, 16, 20, 24);
|
|
|
|
SET_WDT_PERIOD(20, 24, 28, 32);
|
2007-11-18 07:02:20 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(440EP)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 440 EP";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_440EP;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FRES | PPC_FLOAT_FSEL |
|
|
|
|
PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE |
|
|
|
|
PPC_FLOAT_STFIWX |
|
|
|
|
PPC_DCR | PPC_WRTEE | PPC_RFMCI |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_TLBSYNC | PPC_MFTB |
|
|
|
|
PPC_BOOKE | PPC_4xx_COMMON | PPC_405_MAC |
|
|
|
|
PPC_440_SPEC;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_DWE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_BOOKE;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_BOOKE;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_BookE;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
|
|
|
|
POWERPC_FLAG_DE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_440GP (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
gen_spr_BookE(env, 0x000000000000FFFFULL);
|
|
|
|
gen_spr_440(env);
|
|
|
|
gen_spr_usprgh(env);
|
|
|
|
/* Processor identification */
|
|
|
|
spr_register(env, SPR_BOOKE_PIR, "PIR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_pir,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC3, "IAC3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC4, "IAC4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DVC1, "DVC1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DVC2, "DVC2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->nb_tlb = 64;
|
|
|
|
env->nb_ways = 1;
|
|
|
|
env->id_tlbs = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_EMB;
|
2007-11-18 07:02:20 +08:00
|
|
|
#endif
|
|
|
|
init_excp_BookE(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
/* XXX: TODO: allocate internal IRQ controller */
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(12, 16, 20, 24);
|
|
|
|
SET_WDT_PERIOD(20, 24, 28, 32);
|
2007-11-18 07:02:20 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(440GP)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 440 GP";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_440GP;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_DCR | PPC_DCRX | PPC_WRTEE | PPC_MFAPIDI |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_TLBSYNC | PPC_TLBIVA | PPC_MFTB |
|
|
|
|
PPC_BOOKE | PPC_4xx_COMMON | PPC_405_MAC |
|
|
|
|
PPC_440_SPEC;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_DWE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_BOOKE;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_BOOKE;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_BookE;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
|
|
|
|
POWERPC_FLAG_DE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_440x4 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
gen_spr_BookE(env, 0x000000000000FFFFULL);
|
|
|
|
gen_spr_440(env);
|
|
|
|
gen_spr_usprgh(env);
|
|
|
|
/* Processor identification */
|
|
|
|
spr_register(env, SPR_BOOKE_PIR, "PIR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_pir,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC3, "IAC3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC4, "IAC4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DVC1, "DVC1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DVC2, "DVC2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->nb_tlb = 64;
|
|
|
|
env->nb_ways = 1;
|
|
|
|
env->id_tlbs = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_EMB;
|
2007-11-18 07:02:20 +08:00
|
|
|
#endif
|
|
|
|
init_excp_BookE(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
2007-11-18 07:02:20 +08:00
|
|
|
/* XXX: TODO: allocate internal IRQ controller */
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(12, 16, 20, 24);
|
|
|
|
SET_WDT_PERIOD(20, 24, 28, 32);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(440x4)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 440x4";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_440x4;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_DCR | PPC_WRTEE |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_TLBSYNC | PPC_MFTB |
|
|
|
|
PPC_BOOKE | PPC_4xx_COMMON | PPC_405_MAC |
|
|
|
|
PPC_440_SPEC;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_DWE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_BOOKE;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_BOOKE;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_BookE;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
|
|
|
|
POWERPC_FLAG_DE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_440x5 (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_spr_BookE(env, 0x000000000000FFFFULL);
|
|
|
|
gen_spr_440(env);
|
|
|
|
gen_spr_usprgh(env);
|
|
|
|
/* Processor identification */
|
|
|
|
spr_register(env, SPR_BOOKE_PIR, "PIR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_pir,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC3, "IAC3",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
2007-11-18 07:02:20 +08:00
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC4, "IAC4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DVC1, "DVC1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DVC2, "DVC2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_MCSR, "MCSR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_MCSRR0, "MCSRR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_MCSRR1, "MCSRR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_CCR1, "CCR1",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
env->nb_tlb = 64;
|
|
|
|
env->nb_ways = 1;
|
|
|
|
env->id_tlbs = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_EMB;
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2007-11-18 07:02:20 +08:00
|
|
|
init_excp_BookE(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
2010-09-11 21:29:01 +08:00
|
|
|
ppc40x_irq_init(env);
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(12, 16, 20, 24);
|
|
|
|
SET_WDT_PERIOD(20, 24, 28, 32);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(440x5)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 440x5";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_440x5;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_DCR | PPC_WRTEE | PPC_RFMCI |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_TLBSYNC | PPC_MFTB |
|
|
|
|
PPC_BOOKE | PPC_4xx_COMMON | PPC_405_MAC |
|
|
|
|
PPC_440_SPEC;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_DWE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_BOOKE;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_BOOKE;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_BookE;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
|
|
|
|
POWERPC_FLAG_DE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2014-09-13 03:31:33 +08:00
|
|
|
POWERPC_FAMILY(440x5wDFPU)(ObjectClass *oc, void *data)
|
|
|
|
{
|
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
|
|
|
dc->desc = "PowerPC 440x5 with double precision FPU";
|
|
|
|
pcc->init_proc = init_proc_440x5;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSQRT |
|
|
|
|
PPC_FLOAT_STFIWX |
|
|
|
|
PPC_DCR | PPC_WRTEE | PPC_RFMCI |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_TLBSYNC | PPC_MFTB |
|
|
|
|
PPC_BOOKE | PPC_4xx_COMMON | PPC_405_MAC |
|
|
|
|
PPC_440_SPEC;
|
|
|
|
pcc->insns_flags2 = PPC2_FP_CVT_S64;
|
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_DWE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
|
|
|
pcc->mmu_model = POWERPC_MMU_BOOKE;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_BOOKE;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_BookE;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
|
|
|
|
POWERPC_FLAG_DE | POWERPC_FLAG_BUS_CLK;
|
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_460 (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_spr_BookE(env, 0x000000000000FFFFULL);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
gen_spr_440(env);
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_spr_usprgh(env);
|
|
|
|
/* Processor identification */
|
|
|
|
spr_register(env, SPR_BOOKE_PIR, "PIR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_pir,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC3, "IAC3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC4, "IAC4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DVC1, "DVC1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DVC2, "DVC2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_BOOKE_MCSR, "MCSR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_MCSRR0, "MCSRR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_MCSRR1, "MCSRR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_440_CCR1, "CCR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_DCRIPR, "SPR_DCRIPR",
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Memory management */
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
env->nb_tlb = 64;
|
|
|
|
env->nb_ways = 1;
|
|
|
|
env->id_tlbs = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_EMB;
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_BookE(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* XXX: TODO: allocate internal IRQ controller */
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(12, 16, 20, 24);
|
|
|
|
SET_WDT_PERIOD(20, 24, 28, 32);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(460)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 460 (guessed)";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_460;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_DCR | PPC_DCRX | PPC_DCRUX |
|
|
|
|
PPC_WRTEE | PPC_MFAPIDI | PPC_MFTB |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_TLBSYNC | PPC_TLBIVA |
|
|
|
|
PPC_BOOKE | PPC_4xx_COMMON | PPC_405_MAC |
|
|
|
|
PPC_440_SPEC;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_DWE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_BOOKE;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_BOOKE;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_BookE;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
|
|
|
|
POWERPC_FLAG_DE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_460F (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_spr_BookE(env, 0x000000000000FFFFULL);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
gen_spr_440(env);
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_spr_usprgh(env);
|
|
|
|
/* Processor identification */
|
|
|
|
spr_register(env, SPR_BOOKE_PIR, "PIR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_pir,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC3, "IAC3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC4, "IAC4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DVC1, "DVC1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_DVC2, "DVC2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_MCSR, "MCSR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_MCSRR0, "MCSRR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_MCSRR1, "MCSRR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_440_CCR1, "CCR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_DCRIPR, "SPR_DCRIPR",
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Memory management */
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
env->nb_tlb = 64;
|
|
|
|
env->nb_ways = 1;
|
|
|
|
env->id_tlbs = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_EMB;
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_BookE(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* XXX: TODO: allocate internal IRQ controller */
|
2011-09-13 12:00:32 +08:00
|
|
|
|
|
|
|
SET_FIT_PERIOD(12, 16, 20, 24);
|
|
|
|
SET_WDT_PERIOD(20, 24, 28, 32);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(460F)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 460F (guessed)";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_460F;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FRES | PPC_FLOAT_FSEL |
|
|
|
|
PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE |
|
|
|
|
PPC_FLOAT_STFIWX | PPC_MFTB |
|
|
|
|
PPC_DCR | PPC_DCRX | PPC_DCRUX |
|
|
|
|
PPC_WRTEE | PPC_MFAPIDI |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_TLBSYNC | PPC_TLBIVA |
|
|
|
|
PPC_BOOKE | PPC_4xx_COMMON | PPC_405_MAC |
|
|
|
|
PPC_440_SPEC;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_DWE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_BOOKE;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_BOOKE;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_BookE;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_403;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
|
|
|
|
POWERPC_FLAG_DE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_MPC5xx (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
gen_spr_5xx_8xx(env);
|
|
|
|
gen_spr_5xx(env);
|
|
|
|
init_excp_MPC5xx(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
/* XXX: TODO: allocate internal IRQ controller */
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(MPC5xx)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "Freescale 5xx cores (aka RCPU)";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_MPC5xx;
|
|
|
|
pcc->check_pow = check_pow_none;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_MEM_EIEIO | PPC_MEM_SYNC |
|
|
|
|
PPC_CACHE_ICBI | PPC_FLOAT | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_MFTB;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_REAL;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_603;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_RCPU;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_505;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_MPC8xx (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
gen_spr_5xx_8xx(env);
|
|
|
|
gen_spr_8xx(env);
|
|
|
|
init_excp_MPC8xx(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
/* XXX: TODO: allocate internal IRQ controller */
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(MPC8xx)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "Freescale 8xx cores (aka PowerQUICC)";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_MPC8xx;
|
|
|
|
pcc->check_pow = check_pow_none;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
|
|
|
|
PPC_MEM_EIEIO | PPC_MEM_SYNC |
|
|
|
|
PPC_CACHE_ICBI | PPC_MFTB;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_MPC8xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_603;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_RCPU;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_860;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Freescale 82xx cores (aka PowerQUICC-II) */
|
2013-02-18 07:16:46 +08:00
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_G2 (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_G2_755(env);
|
|
|
|
gen_spr_G2(env);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
2007-11-21 21:08:23 +08:00
|
|
|
/* External access control */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_EAR, "EAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Hardware implementation register */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
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);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Memory management */
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_low_BATs(env);
|
|
|
|
gen_high_BATs(env);
|
|
|
|
gen_6xx_7xx_soft_tlb(env, 64, 2);
|
|
|
|
init_excp_G2(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(G2)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC G2";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_G2;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC | PPC_6xx_TLB |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_TGPR) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_AL) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_RI);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_G2;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_ec603e;
|
|
|
|
pcc->flags = POWERPC_FLAG_TGPR | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_G2LE (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_G2_755(env);
|
|
|
|
gen_spr_G2(env);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
2007-11-21 21:08:23 +08:00
|
|
|
/* External access control */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_EAR, "EAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Hardware implementation register */
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-11-18 07:02:20 +08:00
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-11-18 07:02:20 +08:00
|
|
|
spr_register(env, SPR_HID2, "HID2",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2013-04-03 12:03:38 +08:00
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Memory management */
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_low_BATs(env);
|
|
|
|
gen_high_BATs(env);
|
|
|
|
gen_6xx_7xx_soft_tlb(env, 64, 2);
|
|
|
|
init_excp_G2(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(G2LE)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC G2LE";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_G2LE;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC | PPC_6xx_TLB |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_TGPR) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_AL) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_G2;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_ec603e;
|
|
|
|
pcc->flags = POWERPC_FLAG_TGPR | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_e200 (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2007-09-29 21:06:16 +08:00
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_spr_BookE(env, 0x000000070000FFFFULL);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-11-18 07:02:20 +08:00
|
|
|
spr_register(env, SPR_BOOKE_SPEFSCR, "SPEFSCR",
|
2009-03-09 14:27:14 +08:00
|
|
|
&spr_read_spefscr, &spr_write_spefscr,
|
|
|
|
&spr_read_spefscr, &spr_write_spefscr,
|
2007-09-29 21:06:16 +08:00
|
|
|
0x00000000);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Memory management */
|
2011-05-01 05:34:58 +08:00
|
|
|
gen_spr_BookE206(env, 0x0000005D, NULL);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
2007-09-29 21:06:16 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
2007-09-29 21:06:16 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-11-18 07:02:20 +08:00
|
|
|
spr_register(env, SPR_Exxx_ALTCTXCR, "ALTCTXCR",
|
2007-09-29 21:06:16 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-11-18 07:02:20 +08:00
|
|
|
spr_register(env, SPR_Exxx_BUCSR, "BUCSR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-09-29 21:06:16 +08:00
|
|
|
&spr_read_generic, &spr_write_generic,
|
2007-11-18 07:02:20 +08:00
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_Exxx_CTXCR, "CTXCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_Exxx_DBCNT, "DBCNT",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_Exxx_DBCR3, "DBCR3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_Exxx_L1CFG0, "L1CFG0",
|
2014-01-23 18:43:49 +08:00
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
2007-11-18 07:02:20 +08:00
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_Exxx_L1CSR0, "L1CSR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_Exxx_L1FINV0, "L1FINV0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_TLB0CFG, "TLB0CFG",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_TLB1CFG, "TLB1CFG",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC3, "IAC3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_IAC4, "IAC4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2011-05-01 05:34:58 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MMUCSR0, "MMUCSR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000); /* TOFIX */
|
2007-11-18 07:02:20 +08:00
|
|
|
spr_register(env, SPR_BOOKE_DSRR0, "DSRR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_DSRR1, "DSRR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-09-29 21:06:16 +08:00
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2007-09-29 21:06:16 +08:00
|
|
|
env->nb_tlb = 64;
|
|
|
|
env->nb_ways = 1;
|
|
|
|
env->id_tlbs = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_EMB;
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2012-06-21 21:17:59 +08:00
|
|
|
init_excp_e200(env, 0xFFFF0000UL);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
2007-09-29 21:06:16 +08:00
|
|
|
/* XXX: TODO: allocate internal IRQ controller */
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(e200)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "e200 core";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_e200;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
/* XXX: unimplemented instructions:
|
|
|
|
* dcblc
|
|
|
|
* dcbtlst
|
|
|
|
* dcbtstls
|
|
|
|
* icblc
|
|
|
|
* icbtls
|
|
|
|
* tlbivax
|
|
|
|
* all SPE multiply-accumulate instructions
|
|
|
|
*/
|
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL |
|
|
|
|
PPC_SPE | PPC_SPE_SINGLE |
|
|
|
|
PPC_WRTEE | PPC_RFDI |
|
|
|
|
PPC_CACHE | PPC_CACHE_LOCK | PPC_CACHE_ICBI |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_TLBSYNC | PPC_TLBIVAX |
|
|
|
|
PPC_BOOKE;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_UCLE) |
|
|
|
|
(1ull << MSR_SPE) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_DWE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_BOOKE206;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_BOOKE;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_BookE;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_860;
|
|
|
|
pcc->flags = POWERPC_FLAG_SPE | POWERPC_FLAG_CE |
|
|
|
|
POWERPC_FLAG_UBLE | POWERPC_FLAG_DE |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
static void init_proc_e300 (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_603(env);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2009-10-16 01:01:19 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID2, "HID2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2014-11-07 00:23:50 +08:00
|
|
|
/* Breakpoints */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_DABR, "DABR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_DABR2, "DABR2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_IABR2, "IABR2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_IBCR, "IBCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_DBCR, "DBCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
2009-10-16 01:01:19 +08:00
|
|
|
gen_high_BATs(env);
|
2007-11-18 07:02:20 +08:00
|
|
|
gen_6xx_7xx_soft_tlb(env, 64, 2);
|
|
|
|
init_excp_603(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(e300)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "e300 core";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_e300;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC | PPC_6xx_TLB |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_TGPR) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_AL) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_603;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_603;
|
|
|
|
pcc->flags = POWERPC_FLAG_TGPR | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2012-06-21 03:55:55 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_mas73(DisasContext *ctx, int sprn, int gprn)
|
2012-06-21 03:55:55 +08:00
|
|
|
{
|
|
|
|
TCGv val = tcg_temp_new();
|
|
|
|
tcg_gen_ext32u_tl(val, cpu_gpr[gprn]);
|
|
|
|
gen_store_spr(SPR_BOOKE_MAS3, val);
|
2012-06-24 12:18:41 +08:00
|
|
|
tcg_gen_shri_tl(val, cpu_gpr[gprn], 32);
|
2012-06-21 03:55:55 +08:00
|
|
|
gen_store_spr(SPR_BOOKE_MAS7, val);
|
|
|
|
tcg_temp_free(val);
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_mas73(DisasContext *ctx, int gprn, int sprn)
|
2012-06-21 03:55:55 +08:00
|
|
|
{
|
|
|
|
TCGv mas7 = tcg_temp_new();
|
|
|
|
TCGv mas3 = tcg_temp_new();
|
|
|
|
gen_load_spr(mas7, SPR_BOOKE_MAS7);
|
|
|
|
tcg_gen_shli_tl(mas7, mas7, 32);
|
|
|
|
gen_load_spr(mas3, SPR_BOOKE_MAS3);
|
|
|
|
tcg_gen_or_tl(cpu_gpr[gprn], mas3, mas7);
|
|
|
|
tcg_temp_free(mas3);
|
|
|
|
tcg_temp_free(mas7);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2011-12-22 20:26:17 +08:00
|
|
|
enum fsl_e500_version {
|
|
|
|
fsl_e500v1,
|
|
|
|
fsl_e500v2,
|
|
|
|
fsl_e500mc,
|
2012-06-21 03:55:55 +08:00
|
|
|
fsl_e5500,
|
2011-12-22 20:26:17 +08:00
|
|
|
};
|
|
|
|
|
2011-05-01 05:34:58 +08:00
|
|
|
static void init_proc_e500 (CPUPPCState *env, int version)
|
2007-11-18 07:02:20 +08:00
|
|
|
{
|
2013-09-03 23:38:47 +08:00
|
|
|
PowerPCCPU *cpu = ppc_env_get_cpu(env);
|
2011-05-01 05:34:58 +08:00
|
|
|
uint32_t tlbncfg[2];
|
2012-06-21 03:55:55 +08:00
|
|
|
uint64_t ivor_mask;
|
2012-06-21 21:17:59 +08:00
|
|
|
uint64_t ivpr_mask = 0xFFFF0000ULL;
|
2012-01-31 10:46:55 +08:00
|
|
|
uint32_t l1cfg0 = 0x3800 /* 8 ways */
|
|
|
|
| 0x0020; /* 32 kb */
|
2014-01-20 00:47:43 +08:00
|
|
|
uint32_t l1cfg1 = 0x3800 /* 8 ways */
|
|
|
|
| 0x0020; /* 32 kb */
|
2011-05-01 05:34:58 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
int i;
|
|
|
|
#endif
|
|
|
|
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
2011-05-01 05:34:58 +08:00
|
|
|
/*
|
|
|
|
* XXX The e500 doesn't implement IVOR7 and IVOR9, but doesn't
|
|
|
|
* complain when accessing them.
|
|
|
|
* gen_spr_BookE(env, 0x0000000F0000FD7FULL);
|
|
|
|
*/
|
2012-06-21 03:55:55 +08:00
|
|
|
switch (version) {
|
|
|
|
case fsl_e500v1:
|
|
|
|
case fsl_e500v2:
|
|
|
|
default:
|
|
|
|
ivor_mask = 0x0000000F0000FFFFULL;
|
|
|
|
break;
|
|
|
|
case fsl_e500mc:
|
|
|
|
case fsl_e5500:
|
|
|
|
ivor_mask = 0x000003FE0000FFFFULL;
|
|
|
|
break;
|
2012-01-20 01:57:26 +08:00
|
|
|
}
|
|
|
|
gen_spr_BookE(env, ivor_mask);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Processor identification */
|
|
|
|
spr_register(env, SPR_BOOKE_PIR, "PIR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_pir,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_BOOKE_SPEFSCR, "SPEFSCR",
|
2009-03-09 14:27:14 +08:00
|
|
|
&spr_read_spefscr, &spr_write_spefscr,
|
|
|
|
&spr_read_spefscr, &spr_write_spefscr,
|
2007-11-18 07:02:20 +08:00
|
|
|
0x00000000);
|
2012-04-19 21:34:06 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Memory management */
|
|
|
|
env->nb_pids = 3;
|
2011-05-01 05:34:58 +08:00
|
|
|
env->nb_ways = 2;
|
|
|
|
env->id_tlbs = 0;
|
|
|
|
switch (version) {
|
2011-12-22 20:26:17 +08:00
|
|
|
case fsl_e500v1:
|
2011-05-01 05:34:58 +08:00
|
|
|
tlbncfg[0] = gen_tlbncfg(2, 1, 1, 0, 256);
|
|
|
|
tlbncfg[1] = gen_tlbncfg(16, 1, 9, TLBnCFG_AVAIL | TLBnCFG_IPROT, 16);
|
|
|
|
break;
|
2011-12-22 20:26:17 +08:00
|
|
|
case fsl_e500v2:
|
2011-05-01 05:34:58 +08:00
|
|
|
tlbncfg[0] = gen_tlbncfg(4, 1, 1, 0, 512);
|
|
|
|
tlbncfg[1] = gen_tlbncfg(16, 1, 12, TLBnCFG_AVAIL | TLBnCFG_IPROT, 16);
|
2011-12-22 20:26:17 +08:00
|
|
|
break;
|
|
|
|
case fsl_e500mc:
|
2012-06-21 03:55:55 +08:00
|
|
|
case fsl_e5500:
|
2011-12-22 20:26:17 +08:00
|
|
|
tlbncfg[0] = gen_tlbncfg(4, 1, 1, 0, 512);
|
|
|
|
tlbncfg[1] = gen_tlbncfg(64, 1, 12, TLBnCFG_AVAIL | TLBnCFG_IPROT, 64);
|
2012-04-19 21:34:06 +08:00
|
|
|
break;
|
|
|
|
default:
|
2013-09-03 23:38:47 +08:00
|
|
|
cpu_abort(CPU(cpu), "Unknown CPU: " TARGET_FMT_lx "\n", env->spr[SPR_PVR]);
|
2012-04-19 21:34:06 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
/* Cache sizes */
|
|
|
|
switch (version) {
|
|
|
|
case fsl_e500v1:
|
|
|
|
case fsl_e500v2:
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
break;
|
|
|
|
case fsl_e500mc:
|
2012-06-21 03:55:55 +08:00
|
|
|
case fsl_e5500:
|
2011-12-22 20:26:17 +08:00
|
|
|
env->dcache_line_size = 64;
|
|
|
|
env->icache_line_size = 64;
|
2012-01-31 10:46:55 +08:00
|
|
|
l1cfg0 |= 0x1000000; /* 64 byte cache block size */
|
2014-01-20 00:47:43 +08:00
|
|
|
l1cfg1 |= 0x1000000; /* 64 byte cache block size */
|
2011-05-01 05:34:58 +08:00
|
|
|
break;
|
|
|
|
default:
|
2013-09-03 23:38:47 +08:00
|
|
|
cpu_abort(CPU(cpu), "Unknown CPU: " TARGET_FMT_lx "\n", env->spr[SPR_PVR]);
|
2011-05-01 05:34:58 +08:00
|
|
|
}
|
|
|
|
gen_spr_BookE206(env, 0x000000DF, tlbncfg);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_Exxx_BBEAR, "BBEAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_Exxx_BBTAR, "BBTAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_Exxx_MCAR, "MCAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_BOOKE_MCSR, "MCSR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_Exxx_NPIDR, "NPIDR",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_Exxx_BUCSR, "BUCSR",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2007-11-18 07:02:20 +08:00
|
|
|
spr_register(env, SPR_Exxx_L1CFG0, "L1CFG0",
|
2014-01-23 18:43:49 +08:00
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
2012-01-31 10:46:55 +08:00
|
|
|
l1cfg0);
|
2014-01-20 00:47:43 +08:00
|
|
|
spr_register(env, SPR_Exxx_L1CFG1, "L1CFG1",
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
l1cfg1);
|
2007-11-18 07:02:20 +08:00
|
|
|
spr_register(env, SPR_Exxx_L1CSR0, "L1CSR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2011-05-01 05:34:58 +08:00
|
|
|
&spr_read_generic, &spr_write_e500_l1csr0,
|
2007-11-18 07:02:20 +08:00
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_Exxx_L1CSR1, "L1CSR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2014-01-20 00:49:11 +08:00
|
|
|
&spr_read_generic, &spr_write_e500_l1csr1,
|
2007-11-18 07:02:20 +08:00
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_MCSRR0, "MCSRR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_MCSRR1, "MCSRR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2011-05-01 05:34:58 +08:00
|
|
|
spr_register(env, SPR_MMUCSR0, "MMUCSR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_booke206_mmucsr0,
|
|
|
|
0x00000000);
|
2012-06-21 03:55:55 +08:00
|
|
|
spr_register(env, SPR_BOOKE_EPR, "EPR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2013-01-04 18:21:04 +08:00
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
2012-06-21 03:55:55 +08:00
|
|
|
0x00000000);
|
|
|
|
/* XXX better abstract into Emb.xxx features */
|
|
|
|
if (version == fsl_e5500) {
|
|
|
|
spr_register(env, SPR_BOOKE_EPCR, "EPCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BOOKE_MAS7_MAS3, "MAS7_MAS3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_mas73, &spr_write_mas73,
|
|
|
|
0x00000000);
|
|
|
|
ivpr_mask = (target_ulong)~0xFFFFULL;
|
|
|
|
}
|
2011-05-01 05:34:58 +08:00
|
|
|
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2011-05-01 05:34:58 +08:00
|
|
|
env->nb_tlb = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_MAS;
|
2011-05-01 05:34:58 +08:00
|
|
|
for (i = 0; i < BOOKE206_MAX_TLBN; i++) {
|
|
|
|
env->nb_tlb += booke206_tlb_size(env, i);
|
|
|
|
}
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2011-05-01 05:34:58 +08:00
|
|
|
|
2012-06-21 21:17:59 +08:00
|
|
|
init_excp_e200(env, ivpr_mask);
|
2009-03-03 00:42:32 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppce500_irq_init(env);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
2011-05-01 05:34:58 +08:00
|
|
|
static void init_proc_e500v1(CPUPPCState *env)
|
|
|
|
{
|
2011-12-22 20:26:17 +08:00
|
|
|
init_proc_e500(env, fsl_e500v1);
|
2011-05-01 05:34:58 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(e500v1)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "e500v1 core";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_e500v1;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL |
|
|
|
|
PPC_SPE | PPC_SPE_SINGLE |
|
|
|
|
PPC_WRTEE | PPC_RFDI |
|
|
|
|
PPC_CACHE | PPC_CACHE_LOCK | PPC_CACHE_ICBI |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC;
|
|
|
|
pcc->insns_flags2 = PPC2_BOOKE206;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_UCLE) |
|
|
|
|
(1ull << MSR_SPE) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_DWE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_BOOKE206;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_BOOKE;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_BookE;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_860;
|
|
|
|
pcc->flags = POWERPC_FLAG_SPE | POWERPC_FLAG_CE |
|
|
|
|
POWERPC_FLAG_UBLE | POWERPC_FLAG_DE |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2011-05-01 05:34:58 +08:00
|
|
|
static void init_proc_e500v2(CPUPPCState *env)
|
|
|
|
{
|
2011-12-22 20:26:17 +08:00
|
|
|
init_proc_e500(env, fsl_e500v2);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(e500v2)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "e500v2 core";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_e500v2;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL |
|
|
|
|
PPC_SPE | PPC_SPE_SINGLE | PPC_SPE_DOUBLE |
|
|
|
|
PPC_WRTEE | PPC_RFDI |
|
|
|
|
PPC_CACHE | PPC_CACHE_LOCK | PPC_CACHE_ICBI |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC;
|
|
|
|
pcc->insns_flags2 = PPC2_BOOKE206;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_UCLE) |
|
|
|
|
(1ull << MSR_SPE) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_DWE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_BOOKE206;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_BOOKE;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_BookE;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_860;
|
|
|
|
pcc->flags = POWERPC_FLAG_SPE | POWERPC_FLAG_CE |
|
|
|
|
POWERPC_FLAG_UBLE | POWERPC_FLAG_DE |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2011-12-22 20:26:17 +08:00
|
|
|
static void init_proc_e500mc(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
init_proc_e500(env, fsl_e500mc);
|
2011-05-01 05:34:58 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(e500mc)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "e500mc core";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_e500mc;
|
|
|
|
pcc->check_pow = check_pow_none;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL |
|
|
|
|
PPC_WRTEE | PPC_RFDI | PPC_RFMCI |
|
|
|
|
PPC_CACHE | PPC_CACHE_LOCK | PPC_CACHE_ICBI |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_FSEL |
|
|
|
|
PPC_FLOAT_STFIWX | PPC_WAIT |
|
|
|
|
PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC;
|
|
|
|
pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_GS) |
|
|
|
|
(1ull << MSR_UCLE) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PX) |
|
|
|
|
(1ull << MSR_RI);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_BOOKE206;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_BOOKE;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_BookE;
|
|
|
|
/* FIXME: figure out the correct flag for e500mc */
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_e500;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DE |
|
|
|
|
POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2012-06-21 03:55:55 +08:00
|
|
|
#ifdef TARGET_PPC64
|
|
|
|
static void init_proc_e5500(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
init_proc_e500(env, fsl_e5500);
|
|
|
|
}
|
2013-02-18 07:16:42 +08:00
|
|
|
|
|
|
|
POWERPC_FAMILY(e5500)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "e5500 core";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_e5500;
|
|
|
|
pcc->check_pow = check_pow_none;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL |
|
|
|
|
PPC_WRTEE | PPC_RFDI | PPC_RFMCI |
|
|
|
|
PPC_CACHE | PPC_CACHE_LOCK | PPC_CACHE_ICBI |
|
|
|
|
PPC_CACHE_DCBZ | PPC_CACHE_DCBA |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_FSEL |
|
|
|
|
PPC_FLOAT_STFIWX | PPC_WAIT |
|
|
|
|
PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC |
|
|
|
|
PPC_64B | PPC_POPCNTB | PPC_POPCNTWD;
|
2014-09-13 03:31:32 +08:00
|
|
|
pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 | \
|
|
|
|
PPC2_FP_CVT_S64;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_CM) |
|
|
|
|
(1ull << MSR_GS) |
|
|
|
|
(1ull << MSR_UCLE) |
|
|
|
|
(1ull << MSR_CE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PX) |
|
|
|
|
(1ull << MSR_RI);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_BOOKE206;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_BOOKE;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_BookE;
|
|
|
|
/* FIXME: figure out the correct flag for e5500 */
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_e500;
|
|
|
|
pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DE |
|
|
|
|
POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
2012-06-21 03:55:55 +08:00
|
|
|
#endif
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Non-embedded PowerPC */
|
|
|
|
|
|
|
|
/* POWER : same as 601, without mfmsr, mfsr */
|
2013-02-18 07:16:43 +08:00
|
|
|
POWERPC_FAMILY(POWER)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:43 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "POWER";
|
2013-02-18 07:16:49 +08:00
|
|
|
/* pcc->insns_flags = XXX_TODO; */
|
2013-02-18 07:16:45 +08:00
|
|
|
/* POWER RSC (from RAD6000) */
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_AL) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:43 +08:00
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
2007-11-19 21:22:47 +08:00
|
|
|
#define POWERPC_MSRR_601 (0x0000000000001040ULL)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
|
|
|
static void init_proc_601 (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_601(env);
|
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-11-04 10:55:33 +08:00
|
|
|
&spr_read_generic, &spr_write_hid0_601,
|
2007-11-03 21:37:12 +08:00
|
|
|
0x80010080);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_601_HID2, "HID2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_601_HID5, "HID5",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_601(env);
|
2007-11-19 21:22:47 +08:00
|
|
|
/* XXX: beware that dcache line size is 64
|
|
|
|
* but dcbz uses 32 bytes "sectors"
|
|
|
|
* XXX: this breaks clcs instruction !
|
|
|
|
*/
|
|
|
|
env->dcache_line_size = 32;
|
2007-10-04 08:51:58 +08:00
|
|
|
env->icache_line_size = 64;
|
2007-11-03 21:37:12 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(601)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 601";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_601;
|
|
|
|
pcc->check_pow = check_pow_none;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_POWER_BR |
|
|
|
|
PPC_FLOAT |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO | PPC_MEM_TLBIE |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_601;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->excp_model = POWERPC_EXCP_601;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_601;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_RTC_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-19 21:22:47 +08:00
|
|
|
#define POWERPC_MSRR_601v (0x0000000000001040ULL)
|
|
|
|
|
|
|
|
static void init_proc_601v (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
init_proc_601(env);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_601_HID15, "HID15",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(601v)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 601v";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_601v;
|
|
|
|
pcc->check_pow = check_pow_none;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_POWER_BR |
|
|
|
|
PPC_FLOAT |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO | PPC_MEM_TLBIE |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_601;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_601;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_RTC_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_602 (CPUPPCState *env)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_602(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
|
|
|
gen_6xx_7xx_soft_tlb(env, 64, 2);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_602(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
2005-07-03 04:59:34 +08:00
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(602)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 602";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_602;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_6xx_TLB | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_SEGMENT | PPC_602_SPEC;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_VSX) |
|
|
|
|
(1ull << MSR_SA) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_TGPR) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
/* XXX: 602 MMU is quite specific. Should add a special case */
|
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_602;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_602;
|
|
|
|
pcc->flags = POWERPC_FLAG_TGPR | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_603 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_603(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
|
|
|
gen_6xx_7xx_soft_tlb(env, 64, 2);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_603(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(603)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 603";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_603;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC | PPC_6xx_TLB |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_TGPR) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_603;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_603;
|
|
|
|
pcc->flags = POWERPC_FLAG_TGPR | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_603E (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_603(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
|
|
|
gen_6xx_7xx_soft_tlb(env, 64, 2);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_603(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(603E)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 603e";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_603E;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC | PPC_6xx_TLB |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_TGPR) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_603E;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_ec603e;
|
|
|
|
pcc->flags = POWERPC_FLAG_TGPR | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_604 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_604(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
2007-11-19 21:22:47 +08:00
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
|
|
|
init_excp_604(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(604)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 604";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_604;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_32B;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->excp_model = POWERPC_EXCP_604;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_604;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
|
|
|
|
POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-19 21:22:47 +08:00
|
|
|
static void init_proc_604E (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_604(env);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_MMCR1, "MMCR1",
|
2007-11-19 21:22:47 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC3, "PMC3",
|
2007-11-19 21:22:47 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC4, "PMC4",
|
2007-11-19 21:22:47 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_604(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(604E)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 604E";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_604E;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_32B;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->excp_model = POWERPC_EXCP_604;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_604;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
|
|
|
|
POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-21 21:08:23 +08:00
|
|
|
static void init_proc_740 (CPUPPCState *env)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* Thermal management */
|
|
|
|
gen_spr_thrm(env);
|
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_7x0(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(740)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 740";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_740;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_32B;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->excp_model = POWERPC_EXCP_7x0;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_750;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
|
|
|
|
POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-21 21:08:23 +08:00
|
|
|
static void init_proc_750 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L2CR, "L2CR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2013-09-25 21:41:12 +08:00
|
|
|
&spr_read_generic, spr_access_nop,
|
2007-11-21 21:08:23 +08:00
|
|
|
0x00000000);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* Thermal management */
|
|
|
|
gen_spr_thrm(env);
|
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
|
|
|
/* XXX: high BATs are also present but are known to be bugged on
|
|
|
|
* die version 1.x
|
|
|
|
*/
|
|
|
|
init_excp_7x0(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(750)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 750";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_750;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_32B;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->excp_model = POWERPC_EXCP_7x0;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_750;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
|
|
|
|
POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-21 21:08:23 +08:00
|
|
|
static void init_proc_750cl (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L2CR, "L2CR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2013-09-25 21:41:12 +08:00
|
|
|
&spr_read_generic, spr_access_nop,
|
2007-11-21 21:08:23 +08:00
|
|
|
0x00000000);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* Thermal management */
|
|
|
|
/* Those registers are fake on 750CL */
|
|
|
|
spr_register(env, SPR_THRM1, "THRM1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_THRM2, "THRM2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_THRM3, "THRM3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX: not implemented */
|
|
|
|
spr_register(env, SPR_750_TDCL, "TDCL",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_750_TDCH, "TDCH",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* DMA */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750_WPAR, "WPAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_750_DMAL, "DMAL",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_750_DMAU, "DMAU",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750CL_HID2, "HID2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750CL_HID4, "HID4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Quantization registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750_GQR0, "GQR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750_GQR1, "GQR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750_GQR2, "GQR2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750_GQR3, "GQR3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750_GQR4, "GQR4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750_GQR5, "GQR5",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750_GQR6, "GQR6",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750_GQR7, "GQR7",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
|
|
|
/* PowerPC 750cl has 8 DBATs and 8 IBATs */
|
|
|
|
gen_high_BATs(env);
|
|
|
|
init_excp_750cl(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(750cl)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 750 CL";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_750cl;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
/* XXX: not implemented:
|
|
|
|
* cache lock instructions:
|
|
|
|
* dcbz_l
|
|
|
|
* floating point paired instructions
|
|
|
|
* psq_lux
|
|
|
|
* psq_lx
|
|
|
|
* psq_stux
|
|
|
|
* psq_stx
|
|
|
|
* ps_abs
|
|
|
|
* ps_add
|
|
|
|
* ps_cmpo0
|
|
|
|
* ps_cmpo1
|
|
|
|
* ps_cmpu0
|
|
|
|
* ps_cmpu1
|
|
|
|
* ps_div
|
|
|
|
* ps_madd
|
|
|
|
* ps_madds0
|
|
|
|
* ps_madds1
|
|
|
|
* ps_merge00
|
|
|
|
* ps_merge01
|
|
|
|
* ps_merge10
|
|
|
|
* ps_merge11
|
|
|
|
* ps_mr
|
|
|
|
* ps_msub
|
|
|
|
* ps_mul
|
|
|
|
* ps_muls0
|
|
|
|
* ps_muls1
|
|
|
|
* ps_nabs
|
|
|
|
* ps_neg
|
|
|
|
* ps_nmadd
|
|
|
|
* ps_nmsub
|
|
|
|
* ps_res
|
|
|
|
* ps_rsqrte
|
|
|
|
* ps_sel
|
|
|
|
* ps_sub
|
|
|
|
* ps_sum0
|
|
|
|
* ps_sum1
|
|
|
|
*/
|
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_32B;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->excp_model = POWERPC_EXCP_7x0;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_750;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
|
|
|
|
POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-21 21:08:23 +08:00
|
|
|
static void init_proc_750cx (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L2CR, "L2CR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2013-09-25 21:41:12 +08:00
|
|
|
&spr_read_generic, spr_access_nop,
|
2007-11-21 21:08:23 +08:00
|
|
|
0x00000000);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* Thermal management */
|
|
|
|
gen_spr_thrm(env);
|
|
|
|
/* This register is not implemented but is present for compatibility */
|
|
|
|
spr_register(env, SPR_SDA, "SDA",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
2007-12-10 15:40:16 +08:00
|
|
|
/* PowerPC 750cx has 8 DBATs and 8 IBATs */
|
|
|
|
gen_high_BATs(env);
|
2007-11-21 21:08:23 +08:00
|
|
|
init_excp_750cx(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(750cx)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 750CX";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_750cx;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_32B;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->excp_model = POWERPC_EXCP_7x0;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_750;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
|
|
|
|
POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_750fx (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
2007-11-21 21:08:23 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L2CR, "L2CR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2013-09-25 21:41:12 +08:00
|
|
|
&spr_read_generic, spr_access_nop,
|
2007-11-21 21:08:23 +08:00
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* Thermal management */
|
|
|
|
gen_spr_thrm(env);
|
2007-11-21 21:08:23 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750_THRM4, "THRM4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2007-11-21 21:08:23 +08:00
|
|
|
spr_register(env, SPR_750FX_HID2, "HID2",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
|
|
|
/* PowerPC 750fx & 750gx has 8 DBATs and 8 IBATs */
|
|
|
|
gen_high_BATs(env);
|
2007-11-21 21:08:23 +08:00
|
|
|
init_excp_7x0(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(750fx)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 750FX";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_750fx;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_32B;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->excp_model = POWERPC_EXCP_7x0;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_750;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
|
|
|
|
POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-21 21:08:23 +08:00
|
|
|
static void init_proc_750gx (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
/* XXX : not implemented (XXX: different from 750fx) */
|
|
|
|
spr_register(env, SPR_L2CR, "L2CR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2013-09-25 21:41:12 +08:00
|
|
|
&spr_read_generic, spr_access_nop,
|
2007-11-21 21:08:23 +08:00
|
|
|
0x00000000);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* Thermal management */
|
|
|
|
gen_spr_thrm(env);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_750_THRM4, "THRM4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented (XXX: different from 750fx) */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented (XXX: different from 750fx) */
|
|
|
|
spr_register(env, SPR_750FX_HID2, "HID2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
|
|
|
/* PowerPC 750fx & 750gx has 8 DBATs and 8 IBATs */
|
|
|
|
gen_high_BATs(env);
|
|
|
|
init_excp_7x0(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(750gx)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 750GX";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_750gx;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_32B;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->excp_model = POWERPC_EXCP_7x0;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_750;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
|
|
|
|
POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-21 21:08:23 +08:00
|
|
|
static void init_proc_745 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
gen_spr_G2_755(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* Thermal management */
|
|
|
|
gen_spr_thrm(env);
|
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
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_7x5(env);
|
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(745)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 745";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_745;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC | PPC_6xx_TLB |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_7x5;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_750;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
|
|
|
|
POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-11-21 21:08:23 +08:00
|
|
|
static void init_proc_755 (CPUPPCState *env)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
2007-11-21 21:08:23 +08:00
|
|
|
gen_spr_7xx(env);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
gen_spr_G2_755(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* L2 cache control */
|
|
|
|
/* XXX : not implemented */
|
2007-11-21 21:08:23 +08:00
|
|
|
spr_register(env, SPR_L2CR, "L2CR",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2013-09-25 21:41:12 +08:00
|
|
|
&spr_read_generic, spr_access_nop,
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L2PMCR, "L2PMCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-11-21 21:08:23 +08:00
|
|
|
/* Thermal management */
|
|
|
|
gen_spr_thrm(env);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
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);
|
2007-10-08 10:23:00 +08:00
|
|
|
init_excp_7x5(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(755)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 755";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_755;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
|
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FRSQRTE | PPC_FLOAT_STFIWX |
|
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC | PPC_6xx_TLB |
|
|
|
|
PPC_SEGMENT | PPC_EXTERN;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_7x5;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_750;
|
|
|
|
pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
|
|
|
|
POWERPC_FLAG_PMM | POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_7400 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* 74xx specific SPR */
|
|
|
|
gen_spr_74xx(env);
|
2007-12-10 15:40:16 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_UBAMR, "UBAMR",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX: this seems not implemented on all revisions. */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MSSCR1, "MSSCR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Thermal management */
|
|
|
|
gen_spr_thrm(env);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_7400(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(7400)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 7400 (aka G4)";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_7400;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = 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_SEGMENT | PPC_EXTERN |
|
|
|
|
PPC_ALTIVEC;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_VR) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_32B;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->excp_model = POWERPC_EXCP_74xx;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_7400;
|
|
|
|
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_7410 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* 74xx specific SPR */
|
|
|
|
gen_spr_74xx(env);
|
2007-12-10 15:40:16 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_UBAMR, "UBAMR",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Thermal management */
|
|
|
|
gen_spr_thrm(env);
|
|
|
|
/* L2PMCR */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L2PMCR, "L2PMCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* LDSTDB */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_LDSTDB, "LDSTDB",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_7400(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(7410)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 7410 (aka G4)";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_7410;
|
|
|
|
pcc->check_pow = check_pow_hid0;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = 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_SEGMENT | PPC_EXTERN |
|
|
|
|
PPC_ALTIVEC;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_VR) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_32B;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->excp_model = POWERPC_EXCP_74xx;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_7400;
|
|
|
|
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_7440 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* 74xx specific SPR */
|
|
|
|
gen_spr_74xx(env);
|
2007-12-10 15:40:16 +08:00
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_UBAMR, "UBAMR",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* 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 */
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_MSSSR0, "MSSSR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* PMC */
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC5, "PMC5",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC5, "UPMC5",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC6, "PMC6",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC6, "UPMC6",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
2007-10-01 12:48:45 +08:00
|
|
|
gen_74xx_soft_tlb(env, 128, 2);
|
2007-10-05 21:09:54 +08:00
|
|
|
init_excp_7450(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(7440)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 7440 (aka G4)";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_7440;
|
|
|
|
pcc->check_pow = check_pow_hid0_74xx;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = 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;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_VR) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_74xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_74xx;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_7400;
|
|
|
|
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_7450 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* 74xx specific SPR */
|
|
|
|
gen_spr_74xx(env);
|
|
|
|
/* Level 3 cache control */
|
|
|
|
gen_l3_ctrl(env);
|
2007-12-10 15:40:16 +08:00
|
|
|
/* L3ITCR1 */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L3ITCR1, "L3ITCR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* L3ITCR2 */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L3ITCR2, "L3ITCR2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* L3ITCR3 */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L3ITCR3, "L3ITCR3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* L3OHCR */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L3OHCR, "L3OHCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_UBAMR, "UBAMR",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* 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 */
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_MSSSR0, "MSSSR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* PMC */
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC5, "PMC5",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC5, "UPMC5",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC6, "PMC6",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC6, "UPMC6",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
2007-10-01 12:48:45 +08:00
|
|
|
gen_74xx_soft_tlb(env, 128, 2);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_7450(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(7450)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 7450 (aka G4)";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_7450;
|
|
|
|
pcc->check_pow = check_pow_hid0_74xx;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = 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;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_VR) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_74xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_74xx;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_7400;
|
|
|
|
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_7445 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* 74xx specific SPR */
|
|
|
|
gen_spr_74xx(env);
|
|
|
|
/* 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 */
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_MSSSR0, "MSSSR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* PMC */
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC5, "PMC5",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC5, "UPMC5",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC6, "PMC6",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC6, "UPMC6",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
&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_USPRG4, "USPRG4",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG5, "SPRG5",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG5, "USPRG5",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG6, "SPRG6",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG6, "USPRG6",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG7, "SPRG7",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG7, "USPRG7",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
|
|
|
gen_high_BATs(env);
|
2007-10-01 12:48:45 +08:00
|
|
|
gen_74xx_soft_tlb(env, 128, 2);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_7450(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(7445)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 7445 (aka G4)";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_7445;
|
|
|
|
pcc->check_pow = check_pow_hid0_74xx;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = 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;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_VR) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_74xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_74xx;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_7400;
|
|
|
|
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static void init_proc_7455 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* 74xx specific SPR */
|
|
|
|
gen_spr_74xx(env);
|
|
|
|
/* Level 3 cache control */
|
|
|
|
gen_l3_ctrl(env);
|
|
|
|
/* 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 */
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_MSSSR0, "MSSSR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* PMC */
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC5, "PMC5",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC5, "UPMC5",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC6, "PMC6",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-01 12:48:45 +08:00
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC6, "UPMC6",
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
&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_USPRG4, "USPRG4",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG5, "SPRG5",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG5, "USPRG5",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG6, "SPRG6",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG6, "USPRG6",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG7, "SPRG7",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG7, "USPRG7",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
gen_low_BATs(env);
|
|
|
|
gen_high_BATs(env);
|
2007-10-01 12:48:45 +08:00
|
|
|
gen_74xx_soft_tlb(env, 128, 2);
|
2007-09-29 21:06:16 +08:00
|
|
|
init_excp_7450(env);
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 32;
|
|
|
|
env->icache_line_size = 32;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
ppc6xx_irq_init(env);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(7455)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 7455 (aka G4)";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_7455;
|
|
|
|
pcc->check_pow = check_pow_hid0_74xx;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = 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;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_VR) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_74xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_74xx;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_7400;
|
|
|
|
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2007-12-10 15:40:16 +08:00
|
|
|
static void init_proc_7457 (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_spr_7xx(env);
|
|
|
|
/* Time base */
|
|
|
|
gen_tbl(env);
|
|
|
|
/* 74xx specific SPR */
|
|
|
|
gen_spr_74xx(env);
|
|
|
|
/* Level 3 cache control */
|
|
|
|
gen_l3_ctrl(env);
|
|
|
|
/* L3ITCR1 */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L3ITCR1, "L3ITCR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* L3ITCR2 */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L3ITCR2, "L3ITCR2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* L3ITCR3 */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L3ITCR3, "L3ITCR3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* L3OHCR */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_L3OHCR, "L3OHCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
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 */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC5, "PMC5",
|
2007-12-10 15:40:16 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC5, "UPMC5",
|
2007-12-10 15:40:16 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC6, "PMC6",
|
2007-12-10 15:40:16 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC6, "UPMC6",
|
2007-12-10 15:40:16 +08:00
|
|
|
&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_USPRG4, "USPRG4",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG5, "SPRG5",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG5, "USPRG5",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG6, "SPRG6",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG6, "USPRG6",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG7, "SPRG7",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG7, "USPRG7",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(7457)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "PowerPC 7457 (aka G4)";
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_7457;
|
|
|
|
pcc->check_pow = check_pow_hid0_74xx;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = 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;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_VR) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_SOFT_74xx;
|
|
|
|
pcc->excp_model = POWERPC_EXCP_74xx;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_7400;
|
|
|
|
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2013-06-25 05:15:54 +08:00
|
|
|
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);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_LDSTCR, "LDSTCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_ICTRL, "ICTRL",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_MSSSR0, "MSSSR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC5, "PMC5",
|
2013-06-25 05:15:54 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC5, "UPMC5",
|
2013-06-25 05:15:54 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_PMC6, "PMC6",
|
2013-06-25 05:15:54 +08:00
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
/* XXX : not implemented */
|
2014-06-04 20:50:36 +08:00
|
|
|
spr_register(env, SPR_7XX_UPMC6, "UPMC6",
|
2013-06-25 05:15:54 +08:00
|
|
|
&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_USPRG4, "USPRG4",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG5, "SPRG5",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG5, "USPRG5",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG6, "SPRG6",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG6, "USPRG6",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_SPRG7, "SPRG7",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_USPRG7, "USPRG7",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
/* Memory management */
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
POWERPC_FAMILY(e600)(ObjectClass *oc, void *data)
|
|
|
|
{
|
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
|
|
|
dc->desc = "PowerPC e600";
|
|
|
|
pcc->init_proc = init_proc_e600;
|
|
|
|
pcc->check_pow = check_pow_hid0_74xx;
|
|
|
|
pcc->insns_flags = 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;
|
|
|
|
pcc->insns_flags2 = PPC_NONE;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_VR) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_ILE) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_EP) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-06-25 05:15:54 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_32B;
|
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash32_handle_mmu_fault;
|
|
|
|
#endif
|
|
|
|
pcc->excp_model = POWERPC_EXCP_74xx;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_6xx;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc_7400;
|
|
|
|
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
|
|
|
}
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
#if defined (TARGET_PPC64)
|
2007-10-08 07:10:08 +08:00
|
|
|
#if defined(CONFIG_USER_ONLY)
|
|
|
|
#define POWERPC970_HID5_INIT 0x00000080
|
|
|
|
#else
|
|
|
|
#define POWERPC970_HID5_INIT 0x00000000
|
|
|
|
#endif
|
|
|
|
|
2014-06-04 20:50:45 +08:00
|
|
|
enum BOOK3S_CPU_TYPE {
|
|
|
|
BOOK3S_CPU_970,
|
|
|
|
BOOK3S_CPU_POWER5PLUS,
|
2014-06-04 20:50:54 +08:00
|
|
|
BOOK3S_CPU_POWER6,
|
|
|
|
BOOK3S_CPU_POWER7,
|
|
|
|
BOOK3S_CPU_POWER8
|
2014-06-04 20:50:45 +08:00
|
|
|
};
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void gen_fscr_facility_check(DisasContext *ctx, int facility_sprn,
|
|
|
|
int bit, int sprn, int cause)
|
2014-06-04 20:50:57 +08:00
|
|
|
{
|
|
|
|
TCGv_i32 t1 = tcg_const_i32(bit);
|
|
|
|
TCGv_i32 t2 = tcg_const_i32(sprn);
|
|
|
|
TCGv_i32 t3 = tcg_const_i32(cause);
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_update_current_nip(ctx);
|
2014-06-04 20:50:57 +08:00
|
|
|
gen_helper_fscr_facility_check(cpu_env, t1, t2, t3);
|
|
|
|
|
|
|
|
tcg_temp_free_i32(t3);
|
|
|
|
tcg_temp_free_i32(t2);
|
|
|
|
tcg_temp_free_i32(t1);
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void gen_msr_facility_check(DisasContext *ctx, int facility_sprn,
|
|
|
|
int bit, int sprn, int cause)
|
2014-06-04 20:50:59 +08:00
|
|
|
{
|
|
|
|
TCGv_i32 t1 = tcg_const_i32(bit);
|
|
|
|
TCGv_i32 t2 = tcg_const_i32(sprn);
|
|
|
|
TCGv_i32 t3 = tcg_const_i32(cause);
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_update_current_nip(ctx);
|
2014-06-04 20:50:59 +08:00
|
|
|
gen_helper_msr_facility_check(cpu_env, t1, t2, t3);
|
|
|
|
|
|
|
|
tcg_temp_free_i32(t3);
|
|
|
|
tcg_temp_free_i32(t2);
|
|
|
|
tcg_temp_free_i32(t1);
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_prev_upper32(DisasContext *ctx, int gprn, int sprn)
|
2014-06-04 20:50:59 +08:00
|
|
|
{
|
|
|
|
TCGv spr_up = tcg_temp_new();
|
|
|
|
TCGv spr = tcg_temp_new();
|
|
|
|
|
|
|
|
gen_load_spr(spr, sprn - 1);
|
|
|
|
tcg_gen_shri_tl(spr_up, spr, 32);
|
|
|
|
tcg_gen_ext32u_tl(cpu_gpr[gprn], spr_up);
|
|
|
|
|
|
|
|
tcg_temp_free(spr);
|
|
|
|
tcg_temp_free(spr_up);
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_prev_upper32(DisasContext *ctx, int sprn, int gprn)
|
2014-06-04 20:50:59 +08:00
|
|
|
{
|
|
|
|
TCGv spr = tcg_temp_new();
|
|
|
|
|
|
|
|
gen_load_spr(spr, sprn - 1);
|
|
|
|
tcg_gen_deposit_tl(spr, spr, cpu_gpr[gprn], 32, 32);
|
|
|
|
gen_store_spr(sprn - 1, spr);
|
|
|
|
|
|
|
|
tcg_temp_free(spr);
|
|
|
|
}
|
|
|
|
|
2007-10-26 07:14:50 +08:00
|
|
|
static int check_pow_970 (CPUPPCState *env)
|
|
|
|
{
|
2014-06-04 20:50:37 +08:00
|
|
|
if (env->spr[SPR_HID0] & (HID0_DEEPNAP | HID0_DOZE | HID0_NAP)) {
|
2007-10-26 07:14:50 +08:00
|
|
|
return 1;
|
2014-06-04 20:50:37 +08:00
|
|
|
}
|
2007-10-26 07:14:50 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:38 +08:00
|
|
|
static void gen_spr_970_hid(CPUPPCState *env)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
|
|
|
/* Hardware implementation registers */
|
|
|
|
/* XXX : not implemented */
|
|
|
|
spr_register(env, SPR_HID0, "HID0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2007-10-04 04:27:44 +08:00
|
|
|
&spr_read_generic, &spr_write_clear,
|
2007-10-04 08:51:58 +08:00
|
|
|
0x60000000);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
spr_register(env, SPR_HID1, "HID1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2007-10-04 09:50:03 +08:00
|
|
|
spr_register(env, SPR_970_HID5, "HID5",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
2007-10-08 07:10:08 +08:00
|
|
|
POWERPC970_HID5_INIT);
|
2014-06-04 20:50:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_970_hior(CPUPPCState *env)
|
|
|
|
{
|
2007-10-06 06:06:02 +08:00
|
|
|
spr_register(env, SPR_HIOR, "SPR_HIOR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2009-03-01 02:39:42 +08:00
|
|
|
&spr_read_hior, &spr_write_hior,
|
|
|
|
0x00000000);
|
2014-06-04 20:50:38 +08:00
|
|
|
}
|
2013-02-18 07:16:42 +08:00
|
|
|
|
2014-06-04 20:50:44 +08:00
|
|
|
static void gen_spr_970_lpar(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Logical partitionning */
|
|
|
|
/* PPC970: HID4 is effectively the LPCR */
|
|
|
|
spr_register(env, SPR_970_HID4, "HID4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:38 +08:00
|
|
|
static void gen_spr_book3s_common(CPUPPCState *env)
|
|
|
|
{
|
2009-03-08 04:54:03 +08:00
|
|
|
spr_register(env, SPR_CTRL, "SPR_CTRL",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
2013-12-23 10:42:22 +08:00
|
|
|
SPR_NOACCESS, &spr_write_generic,
|
2009-03-08 04:54:03 +08:00
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_UCTRL, "SPR_UCTRL",
|
2014-06-04 20:50:39 +08:00
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
2009-03-08 04:54:03 +08:00
|
|
|
0x00000000);
|
2014-06-04 20:50:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_book3s_altivec(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
if (!(env->insns_flags & PPC_ALTIVEC)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:51:02 +08:00
|
|
|
spr_register_kvm(env, SPR_VRSAVE, "VRSAVE",
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_VRSAVE, 0x00000000);
|
2014-06-04 20:50:38 +08:00
|
|
|
|
|
|
|
/* Can't find information on what this should be on reset. This
|
|
|
|
* value is the one used by 74xx processors. */
|
|
|
|
vscr_init(env, 0x00010000);
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:40 +08:00
|
|
|
static void gen_spr_book3s_dbg(CPUPPCState *env)
|
|
|
|
{
|
2014-06-04 20:51:03 +08:00
|
|
|
/*
|
|
|
|
* TODO: different specs define different scopes for these,
|
|
|
|
* will have to address this:
|
|
|
|
* 970: super/write and super/read
|
|
|
|
* powerisa 2.03..2.04: hypv/write and super/read.
|
|
|
|
* powerisa 2.05 and newer: hypv/write and hypv/read.
|
|
|
|
*/
|
2014-06-04 20:50:40 +08:00
|
|
|
spr_register_kvm(env, SPR_DABR, "DABR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_DABR, 0x00000000);
|
2014-06-04 20:51:03 +08:00
|
|
|
spr_register_kvm(env, SPR_DABRX, "DABRX",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_DABRX, 0x00000000);
|
2014-06-04 20:50:40 +08:00
|
|
|
}
|
|
|
|
|
2016-03-21 20:52:33 +08:00
|
|
|
static void gen_spr_book3s_207_dbg(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
spr_register_kvm_hv(env, SPR_DAWR, "DAWR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_DAWR, 0x00000000);
|
|
|
|
spr_register_kvm_hv(env, SPR_DAWRX, "DAWRX",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_DAWRX, 0x00000000);
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:40 +08:00
|
|
|
static void gen_spr_970_dbg(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Breakpoints */
|
|
|
|
spr_register(env, SPR_IABR, "IABR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_book3s_pmu_sup(CPUPPCState *env)
|
|
|
|
{
|
2014-06-04 20:50:47 +08:00
|
|
|
spr_register_kvm(env, SPR_POWER_MMCR0, "MMCR0",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_MMCR0, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_MMCR1, "MMCR1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_MMCR1, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_MMCRA, "MMCRA",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_MMCRA, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_PMC1, "PMC1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_PMC1, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_PMC2, "PMC2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_PMC2, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_PMC3, "PMC3",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_PMC3, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_PMC4, "PMC4",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_PMC4, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_PMC5, "PMC5",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_PMC5, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_PMC6, "PMC6",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_PMC6, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_SIAR, "SIAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_SIAR, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_SDAR, "SDAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_SDAR, 0x00000000);
|
2014-06-04 20:50:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_book3s_pmu_user(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
spr_register(env, SPR_POWER_UMMCR0, "UMMCR0",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_POWER_UMMCR1, "UMMCR1",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
2014-06-04 20:50:42 +08:00
|
|
|
spr_register(env, SPR_POWER_UMMCRA, "UMMCRA",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
2014-06-04 20:50:40 +08:00
|
|
|
spr_register(env, SPR_POWER_UPMC1, "UPMC1",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_POWER_UPMC2, "UPMC2",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_POWER_UPMC3, "UPMC3",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_POWER_UPMC4, "UPMC4",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
2014-06-04 20:50:42 +08:00
|
|
|
spr_register(env, SPR_POWER_UPMC5, "UPMC5",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_POWER_UPMC6, "UPMC6",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
2014-06-04 20:50:40 +08:00
|
|
|
spr_register(env, SPR_POWER_USIAR, "USIAR",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
2014-06-04 20:50:42 +08:00
|
|
|
spr_register(env, SPR_POWER_USDAR, "USDAR",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
2014-06-04 20:50:40 +08:00
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:43 +08:00
|
|
|
static void gen_spr_970_pmu_sup(CPUPPCState *env)
|
|
|
|
{
|
2014-06-04 20:50:47 +08:00
|
|
|
spr_register_kvm(env, SPR_970_PMC7, "PMC7",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_PMC7, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_970_PMC8, "PMC8",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_PMC8, 0x00000000);
|
2014-06-04 20:50:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_970_pmu_user(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
spr_register(env, SPR_970_UPMC7, "UPMC7",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_970_UPMC8, "UPMC8",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:58 +08:00
|
|
|
static void gen_spr_power8_pmu_sup(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
spr_register_kvm(env, SPR_POWER_MMCR2, "MMCR2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_MMCR2, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_MMCRS, "MMCRS",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_MMCRS, 0x00000000);
|
2016-03-03 04:19:22 +08:00
|
|
|
spr_register_kvm(env, SPR_POWER_SIER, "SIER",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_SIER, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_SPMC1, "SPMC1",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_SPMC1, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_POWER_SPMC2, "SPMC2",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_SPMC2, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_TACR, "TACR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_TACR, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_TCSCR, "TCSCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_TCSCR, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_CSIGR, "CSIGR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_CSIGR, 0x00000000);
|
2014-06-04 20:50:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_power8_pmu_user(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
spr_register(env, SPR_POWER_UMMCR2, "UMMCR2",
|
|
|
|
&spr_read_ureg, SPR_NOACCESS,
|
|
|
|
&spr_read_ureg, &spr_write_ureg,
|
|
|
|
0x00000000);
|
2016-03-03 04:19:22 +08:00
|
|
|
spr_register(env, SPR_POWER_USIER, "USIER",
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
2014-06-04 20:50:58 +08:00
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:40 +08:00
|
|
|
static void gen_spr_power5p_ear(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* External access control */
|
|
|
|
spr_register(env, SPR_EAR, "EAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:45 +08:00
|
|
|
static void gen_spr_power5p_lpar(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Logical partitionning */
|
|
|
|
spr_register_kvm(env, SPR_LPCR, "LPCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_LPCR, 0x00000000);
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:48 +08:00
|
|
|
static void gen_spr_book3s_ids(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Processor identification */
|
|
|
|
spr_register(env, SPR_PIR, "PIR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_pir,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:55 +08:00
|
|
|
static void gen_spr_power8_ids(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
/* Thread identification */
|
|
|
|
spr_register(env, SPR_TIR, "TIR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:48 +08:00
|
|
|
static void gen_spr_book3s_purr(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
/* PURR & SPURR: Hack - treat these as aliases for the TB for now */
|
|
|
|
spr_register_kvm(env, SPR_PURR, "PURR",
|
|
|
|
&spr_read_purr, SPR_NOACCESS,
|
|
|
|
&spr_read_purr, SPR_NOACCESS,
|
|
|
|
KVM_REG_PPC_PURR, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_SPURR, "SPURR",
|
|
|
|
&spr_read_purr, SPR_NOACCESS,
|
|
|
|
&spr_read_purr, SPR_NOACCESS,
|
|
|
|
KVM_REG_PPC_SPURR, 0x00000000);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:50 +08:00
|
|
|
static void gen_spr_power6_dbg(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
spr_register(env, SPR_CFAR, "SPR_CFAR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_cfar, &spr_write_cfar,
|
|
|
|
0x00000000);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_power5p_common(CPUPPCState *env)
|
|
|
|
{
|
2014-06-04 20:51:02 +08:00
|
|
|
spr_register_kvm(env, SPR_PPR, "PPR",
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_PPR, 0x00000000);
|
2014-06-04 20:50:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_power6_common(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
spr_register_kvm(env, SPR_DSCR, "SPR_DSCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_DSCR, 0x00000000);
|
|
|
|
#endif
|
|
|
|
/*
|
|
|
|
* Register PCR to report POWERPC_EXCP_PRIV_REG instead of
|
|
|
|
* POWERPC_EXCP_INVAL_SPR.
|
|
|
|
*/
|
|
|
|
spr_register(env, SPR_PCR, "PCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_tar(DisasContext *ctx, int gprn, int sprn)
|
2014-06-04 20:50:57 +08:00
|
|
|
{
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_fscr_facility_check(ctx, SPR_FSCR, FSCR_TAR, sprn, FSCR_IC_TAR);
|
|
|
|
spr_read_generic(ctx, gprn, sprn);
|
2014-06-04 20:50:57 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_tar(DisasContext *ctx, int sprn, int gprn)
|
2014-06-04 20:50:57 +08:00
|
|
|
{
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_fscr_facility_check(ctx, SPR_FSCR, FSCR_TAR, sprn, FSCR_IC_TAR);
|
|
|
|
spr_write_generic(ctx, sprn, gprn);
|
2014-06-04 20:50:57 +08:00
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:49 +08:00
|
|
|
static void gen_spr_power8_tce_address_control(CPUPPCState *env)
|
|
|
|
{
|
2016-03-03 04:19:21 +08:00
|
|
|
spr_register_kvm(env, SPR_TAR, "TAR",
|
|
|
|
&spr_read_tar, &spr_write_tar,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_TAR, 0x00000000);
|
2014-06-04 20:50:49 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_tm(DisasContext *ctx, int gprn, int sprn)
|
2014-06-04 20:50:59 +08:00
|
|
|
{
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_msr_facility_check(ctx, SPR_FSCR, MSR_TM, sprn, FSCR_IC_TM);
|
|
|
|
spr_read_generic(ctx, gprn, sprn);
|
2014-06-04 20:50:59 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_tm(DisasContext *ctx, int sprn, int gprn)
|
2014-06-04 20:50:59 +08:00
|
|
|
{
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_msr_facility_check(ctx, SPR_FSCR, MSR_TM, sprn, FSCR_IC_TM);
|
|
|
|
spr_write_generic(ctx, sprn, gprn);
|
2014-06-04 20:50:59 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_tm_upper32(DisasContext *ctx, int gprn, int sprn)
|
2014-06-04 20:50:59 +08:00
|
|
|
{
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_msr_facility_check(ctx, SPR_FSCR, MSR_TM, sprn, FSCR_IC_TM);
|
|
|
|
spr_read_prev_upper32(ctx, gprn, sprn);
|
2014-06-04 20:50:59 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_tm_upper32(DisasContext *ctx, int sprn, int gprn)
|
2014-06-04 20:50:59 +08:00
|
|
|
{
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_msr_facility_check(ctx, SPR_FSCR, MSR_TM, sprn, FSCR_IC_TM);
|
|
|
|
spr_write_prev_upper32(ctx, sprn, gprn);
|
2014-06-04 20:50:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_power8_tm(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
spr_register_kvm(env, SPR_TFHAR, "TFHAR",
|
|
|
|
&spr_read_tm, &spr_write_tm,
|
|
|
|
&spr_read_tm, &spr_write_tm,
|
|
|
|
KVM_REG_PPC_TFHAR, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_TFIAR, "TFIAR",
|
|
|
|
&spr_read_tm, &spr_write_tm,
|
|
|
|
&spr_read_tm, &spr_write_tm,
|
|
|
|
KVM_REG_PPC_TFIAR, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_TEXASR, "TEXASR",
|
|
|
|
&spr_read_tm, &spr_write_tm,
|
|
|
|
&spr_read_tm, &spr_write_tm,
|
|
|
|
KVM_REG_PPC_TEXASR, 0x00000000);
|
|
|
|
spr_register(env, SPR_TEXASRU, "TEXASRU",
|
|
|
|
&spr_read_tm_upper32, &spr_write_tm_upper32,
|
|
|
|
&spr_read_tm_upper32, &spr_write_tm_upper32,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_ebb(DisasContext *ctx, int gprn, int sprn)
|
2014-06-04 20:51:01 +08:00
|
|
|
{
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_fscr_facility_check(ctx, SPR_FSCR, FSCR_EBB, sprn, FSCR_IC_EBB);
|
|
|
|
spr_read_generic(ctx, gprn, sprn);
|
2014-06-04 20:51:01 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_ebb(DisasContext *ctx, int sprn, int gprn)
|
2014-06-04 20:51:01 +08:00
|
|
|
{
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_fscr_facility_check(ctx, SPR_FSCR, FSCR_EBB, sprn, FSCR_IC_EBB);
|
|
|
|
spr_write_generic(ctx, sprn, gprn);
|
2014-06-04 20:51:01 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_read_ebb_upper32(DisasContext *ctx, int gprn, int sprn)
|
2014-06-04 20:51:01 +08:00
|
|
|
{
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_fscr_facility_check(ctx, SPR_FSCR, FSCR_EBB, sprn, FSCR_IC_EBB);
|
|
|
|
spr_read_prev_upper32(ctx, gprn, sprn);
|
2014-06-04 20:51:01 +08:00
|
|
|
}
|
|
|
|
|
2014-11-26 18:39:48 +08:00
|
|
|
static void spr_write_ebb_upper32(DisasContext *ctx, int sprn, int gprn)
|
2014-06-04 20:51:01 +08:00
|
|
|
{
|
2014-11-26 18:39:48 +08:00
|
|
|
gen_fscr_facility_check(ctx, SPR_FSCR, FSCR_EBB, sprn, FSCR_IC_EBB);
|
|
|
|
spr_write_prev_upper32(ctx, sprn, gprn);
|
2014-06-04 20:51:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_spr_power8_ebb(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
spr_register(env, SPR_BESCRS, "BESCRS",
|
|
|
|
&spr_read_ebb, &spr_write_ebb,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BESCRSU, "BESCRSU",
|
|
|
|
&spr_read_ebb_upper32, &spr_write_ebb_upper32,
|
|
|
|
&spr_read_prev_upper32, &spr_write_prev_upper32,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BESCRR, "BESCRR",
|
|
|
|
&spr_read_ebb, &spr_write_ebb,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0x00000000);
|
|
|
|
spr_register(env, SPR_BESCRRU, "BESCRRU",
|
|
|
|
&spr_read_ebb_upper32, &spr_write_ebb_upper32,
|
|
|
|
&spr_read_prev_upper32, &spr_write_prev_upper32,
|
|
|
|
0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_EBBHR, "EBBHR",
|
|
|
|
&spr_read_ebb, &spr_write_ebb,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_EBBHR, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_EBBRR, "EBBRR",
|
|
|
|
&spr_read_ebb, &spr_write_ebb,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_EBBRR, 0x00000000);
|
|
|
|
spr_register_kvm(env, SPR_BESCR, "BESCR",
|
|
|
|
&spr_read_ebb, &spr_write_ebb,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
KVM_REG_PPC_BESCR, 0x00000000);
|
|
|
|
}
|
|
|
|
|
2015-03-02 14:55:38 +08:00
|
|
|
/* Virtual Time Base */
|
|
|
|
static void gen_spr_vtb(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
spr_register(env, SPR_VTB, "VTB",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_tbl, SPR_NOACCESS,
|
|
|
|
0x00000000);
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:56 +08:00
|
|
|
static void gen_spr_power8_fscr(CPUPPCState *env)
|
|
|
|
{
|
2014-06-04 20:50:57 +08:00
|
|
|
#if defined(CONFIG_USER_ONLY)
|
|
|
|
target_ulong initval = 1ULL << FSCR_TAR;
|
|
|
|
#else
|
|
|
|
target_ulong initval = 0;
|
|
|
|
#endif
|
2014-06-04 20:50:56 +08:00
|
|
|
spr_register_kvm(env, SPR_FSCR, "FSCR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
2014-06-04 20:50:57 +08:00
|
|
|
KVM_REG_PPC_FSCR, initval);
|
2014-06-04 20:50:56 +08:00
|
|
|
}
|
|
|
|
|
2016-03-03 04:19:20 +08:00
|
|
|
static void gen_spr_power8_pspb(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
spr_register_kvm(env, SPR_PSPB, "PSPB",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic32,
|
|
|
|
KVM_REG_PPC_PSPB, 0);
|
|
|
|
}
|
|
|
|
|
2016-03-21 20:52:35 +08:00
|
|
|
static void gen_spr_power8_ic(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
spr_register_hv(env, SPR_IC, "IC",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, &spr_write_generic,
|
|
|
|
0);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:45 +08:00
|
|
|
static void init_proc_book3s_64(CPUPPCState *env, int version)
|
2014-06-04 20:50:38 +08:00
|
|
|
{
|
|
|
|
gen_spr_ne_601(env);
|
|
|
|
gen_tbl(env);
|
|
|
|
gen_spr_book3s_altivec(env);
|
2014-06-04 20:50:40 +08:00
|
|
|
gen_spr_book3s_pmu_sup(env);
|
|
|
|
gen_spr_book3s_pmu_user(env);
|
2014-06-04 20:50:38 +08:00
|
|
|
gen_spr_book3s_common(env);
|
2014-06-04 20:50:40 +08:00
|
|
|
|
2014-06-04 20:50:54 +08:00
|
|
|
switch (version) {
|
|
|
|
case BOOK3S_CPU_970:
|
|
|
|
case BOOK3S_CPU_POWER5PLUS:
|
|
|
|
gen_spr_970_hid(env);
|
|
|
|
gen_spr_970_hior(env);
|
|
|
|
gen_low_BATs(env);
|
|
|
|
gen_spr_970_pmu_sup(env);
|
|
|
|
gen_spr_970_pmu_user(env);
|
|
|
|
break;
|
|
|
|
case BOOK3S_CPU_POWER7:
|
|
|
|
case BOOK3S_CPU_POWER8:
|
|
|
|
gen_spr_book3s_ids(env);
|
|
|
|
gen_spr_amr(env);
|
|
|
|
gen_spr_book3s_purr(env);
|
2015-10-22 15:30:59 +08:00
|
|
|
env->ci_large_pages = true;
|
2014-06-04 20:50:54 +08:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
|
|
|
}
|
2014-06-04 20:50:45 +08:00
|
|
|
if (version >= BOOK3S_CPU_POWER5PLUS) {
|
2014-06-04 20:50:54 +08:00
|
|
|
gen_spr_power5p_common(env);
|
2014-06-04 20:50:45 +08:00
|
|
|
gen_spr_power5p_lpar(env);
|
|
|
|
gen_spr_power5p_ear(env);
|
|
|
|
} else {
|
|
|
|
gen_spr_970_lpar(env);
|
|
|
|
}
|
2014-06-04 20:50:54 +08:00
|
|
|
if (version == BOOK3S_CPU_970) {
|
|
|
|
gen_spr_970_dbg(env);
|
|
|
|
}
|
|
|
|
if (version >= BOOK3S_CPU_POWER6) {
|
|
|
|
gen_spr_power6_common(env);
|
|
|
|
gen_spr_power6_dbg(env);
|
|
|
|
}
|
|
|
|
if (version >= BOOK3S_CPU_POWER8) {
|
|
|
|
gen_spr_power8_tce_address_control(env);
|
2014-06-04 20:50:55 +08:00
|
|
|
gen_spr_power8_ids(env);
|
2014-06-04 20:51:01 +08:00
|
|
|
gen_spr_power8_ebb(env);
|
2014-06-04 20:50:56 +08:00
|
|
|
gen_spr_power8_fscr(env);
|
2014-06-04 20:50:58 +08:00
|
|
|
gen_spr_power8_pmu_sup(env);
|
|
|
|
gen_spr_power8_pmu_user(env);
|
2014-06-04 20:50:59 +08:00
|
|
|
gen_spr_power8_tm(env);
|
2016-03-03 04:19:20 +08:00
|
|
|
gen_spr_power8_pspb(env);
|
2015-03-02 14:55:38 +08:00
|
|
|
gen_spr_vtb(env);
|
2016-03-21 20:52:35 +08:00
|
|
|
gen_spr_power8_ic(env);
|
2014-06-04 20:50:54 +08:00
|
|
|
}
|
2014-06-04 20:51:03 +08:00
|
|
|
if (version < BOOK3S_CPU_POWER8) {
|
|
|
|
gen_spr_book3s_dbg(env);
|
2016-03-21 20:52:33 +08:00
|
|
|
} else {
|
|
|
|
gen_spr_book3s_207_dbg(env);
|
2014-06-04 20:51:03 +08:00
|
|
|
}
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2014-06-04 20:50:54 +08:00
|
|
|
switch (version) {
|
|
|
|
case BOOK3S_CPU_970:
|
|
|
|
case BOOK3S_CPU_POWER5PLUS:
|
|
|
|
env->slb_nr = 64;
|
|
|
|
break;
|
|
|
|
case BOOK3S_CPU_POWER7:
|
|
|
|
case BOOK3S_CPU_POWER8:
|
|
|
|
default:
|
|
|
|
env->slb_nr = 32;
|
|
|
|
break;
|
|
|
|
}
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
2014-06-04 20:50:54 +08:00
|
|
|
/* Allocate hardware IRQ controller */
|
|
|
|
switch (version) {
|
|
|
|
case BOOK3S_CPU_970:
|
|
|
|
case BOOK3S_CPU_POWER5PLUS:
|
|
|
|
init_excp_970(env);
|
|
|
|
ppc970_irq_init(env);
|
|
|
|
break;
|
|
|
|
case BOOK3S_CPU_POWER7:
|
|
|
|
case BOOK3S_CPU_POWER8:
|
|
|
|
init_excp_POWER7(env);
|
|
|
|
ppcPOWER7_irq_init(env);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
|
|
|
}
|
|
|
|
|
2007-10-04 08:51:58 +08:00
|
|
|
env->dcache_line_size = 128;
|
|
|
|
env->icache_line_size = 128;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:45 +08:00
|
|
|
static void init_proc_970(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
init_proc_book3s_64(env, BOOK3S_CPU_970);
|
|
|
|
}
|
|
|
|
|
2014-06-04 20:50:37 +08:00
|
|
|
POWERPC_FAMILY(970)(ObjectClass *oc, void *data)
|
2013-02-18 07:16:42 +08:00
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2014-06-04 20:50:37 +08:00
|
|
|
dc->desc = "PowerPC 970";
|
|
|
|
pcc->init_proc = init_proc_970;
|
|
|
|
pcc->check_pow = check_pow_970;
|
2013-02-18 07:16:43 +08:00
|
|
|
pcc->insns_flags = 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_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_64B | PPC_ALTIVEC |
|
|
|
|
PPC_SEGMENT_64B | PPC_SLBI;
|
2014-09-13 03:31:32 +08:00
|
|
|
pcc->insns_flags2 = PPC2_FP_CVT_S64;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_SF) |
|
|
|
|
(1ull << MSR_VR) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_64B;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash64_handle_mmu_fault;
|
|
|
|
#endif
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->excp_model = POWERPC_EXCP_970;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_970;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc64;
|
|
|
|
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2014-04-08 07:42:53 +08:00
|
|
|
pcc->l1_dcache_size = 0x8000;
|
|
|
|
pcc->l1_icache_size = 0x10000;
|
2013-02-18 07:16:42 +08:00
|
|
|
}
|
|
|
|
|
2013-08-01 09:42:02 +08:00
|
|
|
static void init_proc_power5plus(CPUPPCState *env)
|
|
|
|
{
|
2014-06-04 20:50:45 +08:00
|
|
|
init_proc_book3s_64(env, BOOK3S_CPU_POWER5PLUS);
|
2013-08-01 09:42:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
POWERPC_FAMILY(POWER5P)(ObjectClass *oc, void *data)
|
|
|
|
{
|
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-10-16 00:33:36 +08:00
|
|
|
dc->fw_name = "PowerPC,POWER5";
|
2013-08-01 09:42:02 +08:00
|
|
|
dc->desc = "POWER5+";
|
|
|
|
pcc->init_proc = init_proc_power5plus;
|
2014-06-04 20:50:46 +08:00
|
|
|
pcc->check_pow = check_pow_970;
|
2013-08-01 09:42:02 +08:00
|
|
|
pcc->insns_flags = 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_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_64B |
|
|
|
|
PPC_SEGMENT_64B | PPC_SLBI;
|
2014-09-13 03:31:32 +08:00
|
|
|
pcc->insns_flags2 = PPC2_FP_CVT_S64;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_SF) |
|
|
|
|
(1ull << MSR_VR) |
|
|
|
|
(1ull << MSR_POW) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI);
|
2015-10-22 15:30:58 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_2_03;
|
2013-08-01 09:42:02 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash64_handle_mmu_fault;
|
|
|
|
#endif
|
|
|
|
pcc->excp_model = POWERPC_EXCP_970;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_970;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc64;
|
|
|
|
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
|
|
|
POWERPC_FLAG_BUS_CLK;
|
2014-04-08 07:42:53 +08:00
|
|
|
pcc->l1_dcache_size = 0x8000;
|
|
|
|
pcc->l1_icache_size = 0x10000;
|
2013-08-01 09:42:02 +08:00
|
|
|
}
|
|
|
|
|
qom: Swap 'name' next to visitor in ObjectPropertyAccessor
Similar to the previous patch, it's nice to have all functions
in the tree that involve a visitor and a name for conversion to
or from QAPI to consistently stick the 'name' parameter next
to the Visitor parameter.
Done by manually changing include/qom/object.h and qom/object.c,
then running this Coccinelle script and touching up the fallout
(Coccinelle insisted on adding some trailing whitespace).
@ rule1 @
identifier fn;
typedef Object, Visitor, Error;
identifier obj, v, opaque, name, errp;
@@
void fn
- (Object *obj, Visitor *v, void *opaque, const char *name,
+ (Object *obj, Visitor *v, const char *name, void *opaque,
Error **errp) { ... }
@@
identifier rule1.fn;
expression obj, v, opaque, name, errp;
@@
fn(obj, v,
- opaque, name,
+ name, opaque,
errp)
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1454075341-13658-20-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-01-29 21:48:55 +08:00
|
|
|
static void powerpc_get_compat(Object *obj, Visitor *v, const char *name,
|
|
|
|
void *opaque, Error **errp)
|
2014-05-23 10:26:50 +08:00
|
|
|
{
|
|
|
|
char *value = (char *)"";
|
|
|
|
Property *prop = opaque;
|
|
|
|
uint32_t *max_compat = qdev_get_prop_ptr(DEVICE(obj), prop);
|
|
|
|
|
|
|
|
switch (*max_compat) {
|
|
|
|
case CPU_POWERPC_LOGICAL_2_05:
|
|
|
|
value = (char *)"power6";
|
|
|
|
break;
|
|
|
|
case CPU_POWERPC_LOGICAL_2_06:
|
|
|
|
value = (char *)"power7";
|
|
|
|
break;
|
|
|
|
case CPU_POWERPC_LOGICAL_2_07:
|
|
|
|
value = (char *)"power8";
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
error_setg(errp, "Internal error: compat is set to %x",
|
|
|
|
max_compat ? *max_compat : -1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
qapi: Swap visit_* arguments for consistent 'name' placement
JSON uses "name":value, but many of our visitor interfaces were
called with visit_type_FOO(v, &value, name, errp). This can be
a bit confusing to have to mentally swap the parameter order to
match JSON order. It's particularly bad for visit_start_struct(),
where the 'name' parameter is smack in the middle of the
otherwise-related group of 'obj, kind, size' parameters! It's
time to do a global swap of the parameter ordering, so that the
'name' parameter is always immediately after the Visitor argument.
Additional reason in favor of the swap: the existing include/qjson.h
prefers listing 'name' first in json_prop_*(), and I have plans to
unify that file with the qapi visitors; listing 'name' first in
qapi will minimize churn to the (admittedly few) qjson.h clients.
Later patches will then fix docs, object.h, visitor-impl.h, and
those clients to match.
Done by first patching scripts/qapi*.py by hand to make generated
files do what I want, then by running the following Coccinelle
script to affect the rest of the code base:
$ spatch --sp-file script `git grep -l '\bvisit_' -- '**/*.[ch]'`
I then had to apply some touchups (Coccinelle insisted on TAB
indentation in visitor.h, and botched the signature of
visit_type_enum() by rewriting 'const char *const strings[]' to
the syntactically invalid 'const char*const[] strings'). The
movement of parameters is sufficient to provoke compiler errors
if any callers were missed.
// Part 1: Swap declaration order
@@
type TV, TErr, TObj, T1, T2;
identifier OBJ, ARG1, ARG2;
@@
void visit_start_struct
-(TV v, TObj OBJ, T1 ARG1, const char *name, T2 ARG2, TErr errp)
+(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)
{ ... }
@@
type bool, TV, T1;
identifier ARG1;
@@
bool visit_optional
-(TV v, T1 ARG1, const char *name)
+(TV v, const char *name, T1 ARG1)
{ ... }
@@
type TV, TErr, TObj, T1;
identifier OBJ, ARG1;
@@
void visit_get_next_type
-(TV v, TObj OBJ, T1 ARG1, const char *name, TErr errp)
+(TV v, const char *name, TObj OBJ, T1 ARG1, TErr errp)
{ ... }
@@
type TV, TErr, TObj, T1, T2;
identifier OBJ, ARG1, ARG2;
@@
void visit_type_enum
-(TV v, TObj OBJ, T1 ARG1, T2 ARG2, const char *name, TErr errp)
+(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)
{ ... }
@@
type TV, TErr, TObj;
identifier OBJ;
identifier VISIT_TYPE =~ "^visit_type_";
@@
void VISIT_TYPE
-(TV v, TObj OBJ, const char *name, TErr errp)
+(TV v, const char *name, TObj OBJ, TErr errp)
{ ... }
// Part 2: swap caller order
@@
expression V, NAME, OBJ, ARG1, ARG2, ERR;
identifier VISIT_TYPE =~ "^visit_type_";
@@
(
-visit_start_struct(V, OBJ, ARG1, NAME, ARG2, ERR)
+visit_start_struct(V, NAME, OBJ, ARG1, ARG2, ERR)
|
-visit_optional(V, ARG1, NAME)
+visit_optional(V, NAME, ARG1)
|
-visit_get_next_type(V, OBJ, ARG1, NAME, ERR)
+visit_get_next_type(V, NAME, OBJ, ARG1, ERR)
|
-visit_type_enum(V, OBJ, ARG1, ARG2, NAME, ERR)
+visit_type_enum(V, NAME, OBJ, ARG1, ARG2, ERR)
|
-VISIT_TYPE(V, OBJ, NAME, ERR)
+VISIT_TYPE(V, NAME, OBJ, ERR)
)
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1454075341-13658-19-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-01-29 21:48:54 +08:00
|
|
|
visit_type_str(v, name, &value, errp);
|
2014-05-23 10:26:50 +08:00
|
|
|
}
|
|
|
|
|
qom: Swap 'name' next to visitor in ObjectPropertyAccessor
Similar to the previous patch, it's nice to have all functions
in the tree that involve a visitor and a name for conversion to
or from QAPI to consistently stick the 'name' parameter next
to the Visitor parameter.
Done by manually changing include/qom/object.h and qom/object.c,
then running this Coccinelle script and touching up the fallout
(Coccinelle insisted on adding some trailing whitespace).
@ rule1 @
identifier fn;
typedef Object, Visitor, Error;
identifier obj, v, opaque, name, errp;
@@
void fn
- (Object *obj, Visitor *v, void *opaque, const char *name,
+ (Object *obj, Visitor *v, const char *name, void *opaque,
Error **errp) { ... }
@@
identifier rule1.fn;
expression obj, v, opaque, name, errp;
@@
fn(obj, v,
- opaque, name,
+ name, opaque,
errp)
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1454075341-13658-20-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-01-29 21:48:55 +08:00
|
|
|
static void powerpc_set_compat(Object *obj, Visitor *v, const char *name,
|
|
|
|
void *opaque, Error **errp)
|
2014-05-23 10:26:50 +08:00
|
|
|
{
|
|
|
|
Error *error = NULL;
|
|
|
|
char *value = NULL;
|
|
|
|
Property *prop = opaque;
|
|
|
|
uint32_t *max_compat = qdev_get_prop_ptr(DEVICE(obj), prop);
|
|
|
|
|
qapi: Swap visit_* arguments for consistent 'name' placement
JSON uses "name":value, but many of our visitor interfaces were
called with visit_type_FOO(v, &value, name, errp). This can be
a bit confusing to have to mentally swap the parameter order to
match JSON order. It's particularly bad for visit_start_struct(),
where the 'name' parameter is smack in the middle of the
otherwise-related group of 'obj, kind, size' parameters! It's
time to do a global swap of the parameter ordering, so that the
'name' parameter is always immediately after the Visitor argument.
Additional reason in favor of the swap: the existing include/qjson.h
prefers listing 'name' first in json_prop_*(), and I have plans to
unify that file with the qapi visitors; listing 'name' first in
qapi will minimize churn to the (admittedly few) qjson.h clients.
Later patches will then fix docs, object.h, visitor-impl.h, and
those clients to match.
Done by first patching scripts/qapi*.py by hand to make generated
files do what I want, then by running the following Coccinelle
script to affect the rest of the code base:
$ spatch --sp-file script `git grep -l '\bvisit_' -- '**/*.[ch]'`
I then had to apply some touchups (Coccinelle insisted on TAB
indentation in visitor.h, and botched the signature of
visit_type_enum() by rewriting 'const char *const strings[]' to
the syntactically invalid 'const char*const[] strings'). The
movement of parameters is sufficient to provoke compiler errors
if any callers were missed.
// Part 1: Swap declaration order
@@
type TV, TErr, TObj, T1, T2;
identifier OBJ, ARG1, ARG2;
@@
void visit_start_struct
-(TV v, TObj OBJ, T1 ARG1, const char *name, T2 ARG2, TErr errp)
+(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)
{ ... }
@@
type bool, TV, T1;
identifier ARG1;
@@
bool visit_optional
-(TV v, T1 ARG1, const char *name)
+(TV v, const char *name, T1 ARG1)
{ ... }
@@
type TV, TErr, TObj, T1;
identifier OBJ, ARG1;
@@
void visit_get_next_type
-(TV v, TObj OBJ, T1 ARG1, const char *name, TErr errp)
+(TV v, const char *name, TObj OBJ, T1 ARG1, TErr errp)
{ ... }
@@
type TV, TErr, TObj, T1, T2;
identifier OBJ, ARG1, ARG2;
@@
void visit_type_enum
-(TV v, TObj OBJ, T1 ARG1, T2 ARG2, const char *name, TErr errp)
+(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)
{ ... }
@@
type TV, TErr, TObj;
identifier OBJ;
identifier VISIT_TYPE =~ "^visit_type_";
@@
void VISIT_TYPE
-(TV v, TObj OBJ, const char *name, TErr errp)
+(TV v, const char *name, TObj OBJ, TErr errp)
{ ... }
// Part 2: swap caller order
@@
expression V, NAME, OBJ, ARG1, ARG2, ERR;
identifier VISIT_TYPE =~ "^visit_type_";
@@
(
-visit_start_struct(V, OBJ, ARG1, NAME, ARG2, ERR)
+visit_start_struct(V, NAME, OBJ, ARG1, ARG2, ERR)
|
-visit_optional(V, ARG1, NAME)
+visit_optional(V, NAME, ARG1)
|
-visit_get_next_type(V, OBJ, ARG1, NAME, ERR)
+visit_get_next_type(V, NAME, OBJ, ARG1, ERR)
|
-visit_type_enum(V, OBJ, ARG1, ARG2, NAME, ERR)
+visit_type_enum(V, NAME, OBJ, ARG1, ARG2, ERR)
|
-VISIT_TYPE(V, OBJ, NAME, ERR)
+VISIT_TYPE(V, NAME, OBJ, ERR)
)
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1454075341-13658-19-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-01-29 21:48:54 +08:00
|
|
|
visit_type_str(v, name, &value, &error);
|
2014-05-23 10:26:50 +08:00
|
|
|
if (error) {
|
|
|
|
error_propagate(errp, error);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strcmp(value, "power6") == 0) {
|
|
|
|
*max_compat = CPU_POWERPC_LOGICAL_2_05;
|
|
|
|
} else if (strcmp(value, "power7") == 0) {
|
|
|
|
*max_compat = CPU_POWERPC_LOGICAL_2_06;
|
|
|
|
} else if (strcmp(value, "power8") == 0) {
|
|
|
|
*max_compat = CPU_POWERPC_LOGICAL_2_07;
|
|
|
|
} else {
|
|
|
|
error_setg(errp, "Invalid compatibility mode \"%s\"", value);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static PropertyInfo powerpc_compat_propinfo = {
|
|
|
|
.name = "str",
|
2014-10-07 14:33:20 +08:00
|
|
|
.description = "compatibility mode, power6/power7/power8",
|
2014-05-23 10:26:50 +08:00
|
|
|
.get = powerpc_get_compat,
|
|
|
|
.set = powerpc_set_compat,
|
|
|
|
};
|
|
|
|
|
|
|
|
#define DEFINE_PROP_POWERPC_COMPAT(_n, _s, _f) \
|
|
|
|
DEFINE_PROP(_n, _s, _f, powerpc_compat_propinfo, uint32_t)
|
|
|
|
|
|
|
|
static Property powerpc_servercpu_properties[] = {
|
|
|
|
DEFINE_PROP_POWERPC_COMPAT("compat", PowerPCCPU, max_compat),
|
|
|
|
DEFINE_PROP_END_OF_LIST(),
|
|
|
|
};
|
|
|
|
|
2016-01-15 14:54:42 +08:00
|
|
|
#ifdef CONFIG_SOFTMMU
|
|
|
|
static const struct ppc_segment_page_sizes POWER7_POWER8_sps = {
|
|
|
|
.sps = {
|
|
|
|
{
|
|
|
|
.page_shift = 12, /* 4K */
|
|
|
|
.slb_enc = 0,
|
|
|
|
.enc = { { .page_shift = 12, .pte_enc = 0 },
|
|
|
|
{ .page_shift = 16, .pte_enc = 0x7 },
|
|
|
|
{ .page_shift = 24, .pte_enc = 0x38 }, },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.page_shift = 16, /* 64K */
|
|
|
|
.slb_enc = SLB_VSID_64K,
|
|
|
|
.enc = { { .page_shift = 16, .pte_enc = 0x1 },
|
|
|
|
{ .page_shift = 24, .pte_enc = 0x8 }, },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.page_shift = 24, /* 16M */
|
|
|
|
.slb_enc = SLB_VSID_16M,
|
|
|
|
.enc = { { .page_shift = 24, .pte_enc = 0 }, },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.page_shift = 34, /* 16G */
|
|
|
|
.slb_enc = SLB_VSID_16G,
|
|
|
|
.enc = { { .page_shift = 34, .pte_enc = 0x3 }, },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
#endif /* CONFIG_SOFTMMU */
|
|
|
|
|
2011-04-01 12:15:19 +08:00
|
|
|
static void init_proc_POWER7 (CPUPPCState *env)
|
|
|
|
{
|
2014-06-04 20:50:54 +08:00
|
|
|
init_proc_book3s_64(env, BOOK3S_CPU_POWER7);
|
2011-04-01 12:15:19 +08:00
|
|
|
}
|
|
|
|
|
2014-07-03 22:48:55 +08:00
|
|
|
static bool ppc_pvr_match_power7(PowerPCCPUClass *pcc, uint32_t pvr)
|
|
|
|
{
|
|
|
|
if ((pvr & CPU_POWERPC_POWER_SERVER_MASK) == CPU_POWERPC_POWER7P_BASE) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if ((pvr & CPU_POWERPC_POWER_SERVER_MASK) == CPU_POWERPC_POWER7_BASE) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:42 +08:00
|
|
|
POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data)
|
|
|
|
{
|
2013-02-18 07:16:46 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
2013-02-18 07:16:42 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-10-16 00:33:36 +08:00
|
|
|
dc->fw_name = "PowerPC,POWER7";
|
2013-02-18 07:16:46 +08:00
|
|
|
dc->desc = "POWER7";
|
2014-05-23 10:26:50 +08:00
|
|
|
dc->props = powerpc_servercpu_properties;
|
2014-07-03 22:48:55 +08:00
|
|
|
pcc->pvr_match = ppc_pvr_match_power7;
|
2014-05-23 10:26:53 +08:00
|
|
|
pcc->pcr_mask = PCR_COMPAT_2_05 | PCR_COMPAT_2_06;
|
2013-02-18 07:16:42 +08:00
|
|
|
pcc->init_proc = init_proc_POWER7;
|
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2013-04-01 13:06:23 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB |
|
2013-02-18 07:16:43 +08:00
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE |
|
2014-01-08 00:06:09 +08:00
|
|
|
PPC_FLOAT_FRSQRTES |
|
2013-02-18 07:16:43 +08:00
|
|
|
PPC_FLOAT_STFIWX |
|
2014-01-08 00:06:05 +08:00
|
|
|
PPC_FLOAT_EXT |
|
2013-02-18 07:16:43 +08:00
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
|
|
|
PPC_64B | PPC_ALTIVEC |
|
|
|
|
PPC_SEGMENT_64B | PPC_SLBI |
|
|
|
|
PPC_POPCNTB | PPC_POPCNTWD;
|
2014-01-08 00:05:49 +08:00
|
|
|
pcc->insns_flags2 = PPC2_VSX | PPC2_DFP | PPC2_DBRX | PPC2_ISA205 |
|
2014-01-08 00:05:55 +08:00
|
|
|
PPC2_PERM_ISA206 | PPC2_DIVE_ISA206 |
|
2014-01-08 00:06:06 +08:00
|
|
|
PPC2_ATOMIC_ISA206 | PPC2_FP_CVT_ISA206 |
|
2014-09-13 03:31:32 +08:00
|
|
|
PPC2_FP_TST_ISA206 | PPC2_FP_CVT_S64;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_SF) |
|
|
|
|
(1ull << MSR_VR) |
|
|
|
|
(1ull << MSR_VSX) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2013-02-18 07:16:45 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_2_06;
|
2013-03-13 08:40:33 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash64_handle_mmu_fault;
|
2016-01-15 14:54:42 +08:00
|
|
|
pcc->sps = &POWER7_POWER8_sps;
|
2013-11-19 09:39:15 +08:00
|
|
|
#endif
|
|
|
|
pcc->excp_model = POWERPC_EXCP_POWER7;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_POWER7;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc64;
|
|
|
|
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
|
|
|
POWERPC_FLAG_BUS_CLK | POWERPC_FLAG_CFAR |
|
|
|
|
POWERPC_FLAG_VSX;
|
|
|
|
pcc->l1_dcache_size = 0x8000;
|
|
|
|
pcc->l1_icache_size = 0x8000;
|
2014-05-20 01:59:05 +08:00
|
|
|
pcc->interrupts_big_endian = ppc_cpu_interrupts_big_endian_lpcr;
|
2013-11-19 09:39:15 +08:00
|
|
|
}
|
|
|
|
|
2014-02-11 01:26:54 +08:00
|
|
|
static void init_proc_POWER8(CPUPPCState *env)
|
|
|
|
{
|
2014-06-04 20:50:54 +08:00
|
|
|
init_proc_book3s_64(env, BOOK3S_CPU_POWER8);
|
2014-02-11 01:26:54 +08:00
|
|
|
}
|
|
|
|
|
2014-07-03 22:48:55 +08:00
|
|
|
static bool ppc_pvr_match_power8(PowerPCCPUClass *pcc, uint32_t pvr)
|
|
|
|
{
|
2016-03-03 08:08:19 +08:00
|
|
|
if ((pvr & CPU_POWERPC_POWER_SERVER_MASK) == CPU_POWERPC_POWER8NVL_BASE) {
|
|
|
|
return true;
|
|
|
|
}
|
2014-07-03 22:48:55 +08:00
|
|
|
if ((pvr & CPU_POWERPC_POWER_SERVER_MASK) == CPU_POWERPC_POWER8E_BASE) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if ((pvr & CPU_POWERPC_POWER_SERVER_MASK) == CPU_POWERPC_POWER8_BASE) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-06-30 22:30:18 +08:00
|
|
|
POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data)
|
2013-07-04 14:42:32 +08:00
|
|
|
{
|
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2013-10-16 00:33:36 +08:00
|
|
|
dc->fw_name = "PowerPC,POWER8";
|
2014-06-30 22:30:18 +08:00
|
|
|
dc->desc = "POWER8";
|
2014-05-23 10:26:50 +08:00
|
|
|
dc->props = powerpc_servercpu_properties;
|
2014-07-03 22:48:55 +08:00
|
|
|
pcc->pvr_match = ppc_pvr_match_power8;
|
2014-05-23 10:26:53 +08:00
|
|
|
pcc->pcr_mask = PCR_COMPAT_2_05 | PCR_COMPAT_2_06;
|
2014-02-11 01:26:54 +08:00
|
|
|
pcc->init_proc = init_proc_POWER8;
|
2013-07-04 14:42:32 +08:00
|
|
|
pcc->check_pow = check_pow_nocheck;
|
2014-03-25 10:40:27 +08:00
|
|
|
pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB |
|
2013-07-04 14:42:32 +08:00
|
|
|
PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES |
|
|
|
|
PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE |
|
2014-01-08 00:06:09 +08:00
|
|
|
PPC_FLOAT_FRSQRTES |
|
2013-07-04 14:42:32 +08:00
|
|
|
PPC_FLOAT_STFIWX |
|
2014-01-08 00:06:05 +08:00
|
|
|
PPC_FLOAT_EXT |
|
2013-07-04 14:42:32 +08:00
|
|
|
PPC_CACHE | PPC_CACHE_ICBI | PPC_CACHE_DCBZ |
|
|
|
|
PPC_MEM_SYNC | PPC_MEM_EIEIO |
|
|
|
|
PPC_MEM_TLBIE | PPC_MEM_TLBSYNC |
|
2014-02-11 01:26:58 +08:00
|
|
|
PPC_64B | PPC_64BX | PPC_ALTIVEC |
|
2013-07-04 14:42:32 +08:00
|
|
|
PPC_SEGMENT_64B | PPC_SLBI |
|
|
|
|
PPC_POPCNTB | PPC_POPCNTWD;
|
2014-01-08 00:05:49 +08:00
|
|
|
pcc->insns_flags2 = PPC2_VSX | PPC2_VSX207 | PPC2_DFP | PPC2_DBRX |
|
2014-01-08 00:05:55 +08:00
|
|
|
PPC2_PERM_ISA206 | PPC2_DIVE_ISA206 |
|
2014-01-08 00:06:06 +08:00
|
|
|
PPC2_ATOMIC_ISA206 | PPC2_FP_CVT_ISA206 |
|
2014-02-11 01:26:56 +08:00
|
|
|
PPC2_FP_TST_ISA206 | PPC2_BCTAR_ISA207 |
|
2014-03-07 12:37:39 +08:00
|
|
|
PPC2_LSQ_ISA207 | PPC2_ALTIVEC_207 |
|
2014-12-19 00:34:32 +08:00
|
|
|
PPC2_ISA205 | PPC2_ISA207S | PPC2_FP_CVT_S64 |
|
|
|
|
PPC2_TM;
|
2014-04-16 01:21:12 +08:00
|
|
|
pcc->msr_mask = (1ull << MSR_SF) |
|
2014-06-04 20:50:59 +08:00
|
|
|
(1ull << MSR_TM) |
|
2014-04-16 01:21:12 +08:00
|
|
|
(1ull << MSR_VR) |
|
|
|
|
(1ull << MSR_VSX) |
|
|
|
|
(1ull << MSR_EE) |
|
|
|
|
(1ull << MSR_PR) |
|
|
|
|
(1ull << MSR_FP) |
|
|
|
|
(1ull << MSR_ME) |
|
|
|
|
(1ull << MSR_FE0) |
|
|
|
|
(1ull << MSR_SE) |
|
|
|
|
(1ull << MSR_DE) |
|
|
|
|
(1ull << MSR_FE1) |
|
|
|
|
(1ull << MSR_IR) |
|
|
|
|
(1ull << MSR_DR) |
|
|
|
|
(1ull << MSR_PMM) |
|
|
|
|
(1ull << MSR_RI) |
|
|
|
|
(1ull << MSR_LE);
|
2015-10-22 15:30:58 +08:00
|
|
|
pcc->mmu_model = POWERPC_MMU_2_07;
|
2013-07-04 14:42:32 +08:00
|
|
|
#if defined(CONFIG_SOFTMMU)
|
|
|
|
pcc->handle_mmu_fault = ppc_hash64_handle_mmu_fault;
|
2016-01-15 14:54:42 +08:00
|
|
|
pcc->sps = &POWER7_POWER8_sps;
|
2013-07-04 14:42:32 +08:00
|
|
|
#endif
|
|
|
|
pcc->excp_model = POWERPC_EXCP_POWER7;
|
|
|
|
pcc->bus_model = PPC_FLAGS_INPUT_POWER7;
|
|
|
|
pcc->bfd_mach = bfd_mach_ppc64;
|
|
|
|
pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
|
|
|
|
POWERPC_FLAG_BE | POWERPC_FLAG_PMM |
|
2013-10-22 19:05:46 +08:00
|
|
|
POWERPC_FLAG_BUS_CLK | POWERPC_FLAG_CFAR |
|
2014-12-19 00:34:32 +08:00
|
|
|
POWERPC_FLAG_VSX | POWERPC_FLAG_TM;
|
2013-07-04 14:42:32 +08:00
|
|
|
pcc->l1_dcache_size = 0x8000;
|
|
|
|
pcc->l1_icache_size = 0x8000;
|
2014-05-20 01:59:05 +08:00
|
|
|
pcc->interrupts_big_endian = ppc_cpu_interrupts_big_endian_lpcr;
|
2013-07-04 14:42:32 +08:00
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
2016-03-21 20:52:34 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
|
|
|
|
void cpu_ppc_set_papr(PowerPCCPU *cpu)
|
|
|
|
{
|
|
|
|
CPUPPCState *env = &cpu->env;
|
|
|
|
|
|
|
|
/* PAPR always has exception vectors in RAM not ROM. To ensure this,
|
|
|
|
* MSR[IP] should never be set.
|
|
|
|
*
|
|
|
|
* We also disallow setting of MSR_HV
|
|
|
|
*/
|
|
|
|
env->msr_mask &= ~((1ull << MSR_EP) | MSR_HVB);
|
|
|
|
|
|
|
|
/* Tell KVM that we're in PAPR mode */
|
|
|
|
if (kvm_enabled()) {
|
|
|
|
kvmppc_set_papr(cpu);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* !defined(CONFIG_USER_ONLY) */
|
|
|
|
|
|
|
|
#endif /* defined (TARGET_PPC64) */
|
2013-02-18 07:16:04 +08:00
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/*****************************************************************************/
|
2011-04-28 23:20:36 +08:00
|
|
|
/* Generic CPU instantiation routine */
|
2013-02-18 07:16:41 +08:00
|
|
|
static void init_ppc_proc(PowerPCCPU *cpu)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
2013-02-18 07:16:41 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
|
|
|
|
CPUPPCState *env = &cpu->env;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2007-09-29 21:06:16 +08:00
|
|
|
int i;
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
env->irq_inputs = NULL;
|
2007-09-29 21:06:16 +08:00
|
|
|
/* Set all exception vectors to an invalid address */
|
|
|
|
for (i = 0; i < POWERPC_EXCP_NB; i++)
|
|
|
|
env->excp_vectors[i] = (target_ulong)(-1ULL);
|
|
|
|
env->ivor_mask = 0x00000000;
|
|
|
|
env->ivpr_mask = 0x00000000;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Default MMU definitions */
|
|
|
|
env->nb_BATs = 0;
|
|
|
|
env->nb_tlb = 0;
|
|
|
|
env->nb_ways = 0;
|
2011-06-17 07:00:28 +08:00
|
|
|
env->tlb_type = TLB_NONE;
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Register SPR common to all PowerPC implementations */
|
|
|
|
gen_spr_generic(env);
|
|
|
|
spr_register(env, SPR_PVR, "PVR",
|
2009-06-05 09:45:03 +08:00
|
|
|
/* Linux permits userspace to read PVR */
|
|
|
|
#if defined(CONFIG_LINUX_USER)
|
|
|
|
&spr_read_generic,
|
|
|
|
#else
|
|
|
|
SPR_NOACCESS,
|
|
|
|
#endif
|
|
|
|
SPR_NOACCESS,
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
2013-02-18 07:16:41 +08:00
|
|
|
pcc->pvr);
|
2007-11-18 07:02:20 +08:00
|
|
|
/* Register SVR if it's defined to anything else than POWERPC_SVR_NONE */
|
2013-02-18 07:16:41 +08:00
|
|
|
if (pcc->svr != POWERPC_SVR_NONE) {
|
|
|
|
if (pcc->svr & POWERPC_SVR_E500) {
|
2007-11-18 07:02:20 +08:00
|
|
|
spr_register(env, SPR_E500_SVR, "SVR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
2013-02-18 07:16:41 +08:00
|
|
|
pcc->svr & ~POWERPC_SVR_E500);
|
2007-11-18 07:02:20 +08:00
|
|
|
} else {
|
|
|
|
spr_register(env, SPR_SVR, "SVR",
|
|
|
|
SPR_NOACCESS, SPR_NOACCESS,
|
|
|
|
&spr_read_generic, SPR_NOACCESS,
|
2013-02-18 07:16:41 +08:00
|
|
|
pcc->svr);
|
2007-11-18 07:02:20 +08:00
|
|
|
}
|
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* PowerPC implementation specific initialisations (SPRs, timers, ...) */
|
2013-02-18 07:16:41 +08:00
|
|
|
(*pcc->init_proc)(env);
|
2013-03-29 10:06:27 +08:00
|
|
|
|
2007-10-08 10:58:07 +08:00
|
|
|
/* MSR bits & flags consistency checks */
|
|
|
|
if (env->msr_mask & (1 << 25)) {
|
|
|
|
switch (env->flags & (POWERPC_FLAG_SPE | POWERPC_FLAG_VRE)) {
|
|
|
|
case POWERPC_FLAG_SPE:
|
|
|
|
case POWERPC_FLAG_VRE:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
fprintf(stderr, "PowerPC MSR definition inconsistency\n"
|
|
|
|
"Should define POWERPC_FLAG_SPE or POWERPC_FLAG_VRE\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
} else if (env->flags & (POWERPC_FLAG_SPE | POWERPC_FLAG_VRE)) {
|
|
|
|
fprintf(stderr, "PowerPC MSR definition inconsistency\n"
|
|
|
|
"Should not define POWERPC_FLAG_SPE nor POWERPC_FLAG_VRE\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (env->msr_mask & (1 << 17)) {
|
|
|
|
switch (env->flags & (POWERPC_FLAG_TGPR | POWERPC_FLAG_CE)) {
|
|
|
|
case POWERPC_FLAG_TGPR:
|
|
|
|
case POWERPC_FLAG_CE:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
fprintf(stderr, "PowerPC MSR definition inconsistency\n"
|
|
|
|
"Should define POWERPC_FLAG_TGPR or POWERPC_FLAG_CE\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
} else if (env->flags & (POWERPC_FLAG_TGPR | POWERPC_FLAG_CE)) {
|
|
|
|
fprintf(stderr, "PowerPC MSR definition inconsistency\n"
|
|
|
|
"Should not define POWERPC_FLAG_TGPR nor POWERPC_FLAG_CE\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (env->msr_mask & (1 << 10)) {
|
|
|
|
switch (env->flags & (POWERPC_FLAG_SE | POWERPC_FLAG_DWE |
|
|
|
|
POWERPC_FLAG_UBLE)) {
|
|
|
|
case POWERPC_FLAG_SE:
|
|
|
|
case POWERPC_FLAG_DWE:
|
|
|
|
case POWERPC_FLAG_UBLE:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
fprintf(stderr, "PowerPC MSR definition inconsistency\n"
|
|
|
|
"Should define POWERPC_FLAG_SE or POWERPC_FLAG_DWE or "
|
|
|
|
"POWERPC_FLAG_UBLE\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
} else if (env->flags & (POWERPC_FLAG_SE | POWERPC_FLAG_DWE |
|
|
|
|
POWERPC_FLAG_UBLE)) {
|
|
|
|
fprintf(stderr, "PowerPC MSR definition inconsistency\n"
|
|
|
|
"Should not define POWERPC_FLAG_SE nor POWERPC_FLAG_DWE nor "
|
|
|
|
"POWERPC_FLAG_UBLE\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (env->msr_mask & (1 << 9)) {
|
|
|
|
switch (env->flags & (POWERPC_FLAG_BE | POWERPC_FLAG_DE)) {
|
|
|
|
case POWERPC_FLAG_BE:
|
|
|
|
case POWERPC_FLAG_DE:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
fprintf(stderr, "PowerPC MSR definition inconsistency\n"
|
|
|
|
"Should define POWERPC_FLAG_BE or POWERPC_FLAG_DE\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
} else if (env->flags & (POWERPC_FLAG_BE | POWERPC_FLAG_DE)) {
|
|
|
|
fprintf(stderr, "PowerPC MSR definition inconsistency\n"
|
|
|
|
"Should not define POWERPC_FLAG_BE nor POWERPC_FLAG_DE\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (env->msr_mask & (1 << 2)) {
|
|
|
|
switch (env->flags & (POWERPC_FLAG_PX | POWERPC_FLAG_PMM)) {
|
|
|
|
case POWERPC_FLAG_PX:
|
|
|
|
case POWERPC_FLAG_PMM:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
fprintf(stderr, "PowerPC MSR definition inconsistency\n"
|
|
|
|
"Should define POWERPC_FLAG_PX or POWERPC_FLAG_PMM\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
} else if (env->flags & (POWERPC_FLAG_PX | POWERPC_FLAG_PMM)) {
|
|
|
|
fprintf(stderr, "PowerPC MSR definition inconsistency\n"
|
|
|
|
"Should not define POWERPC_FLAG_PX nor POWERPC_FLAG_PMM\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
2007-11-19 09:48:12 +08:00
|
|
|
if ((env->flags & (POWERPC_FLAG_RTC_CLK | POWERPC_FLAG_BUS_CLK)) == 0) {
|
|
|
|
fprintf(stderr, "PowerPC flags inconsistency\n"
|
|
|
|
"Should define the time-base and decrementer clock source\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Allocate TLBs buffer when needed */
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
if (env->nb_tlb != 0) {
|
|
|
|
int nb_tlb = env->nb_tlb;
|
|
|
|
if (env->id_tlbs != 0)
|
|
|
|
nb_tlb *= 2;
|
2011-06-17 07:00:28 +08:00
|
|
|
switch (env->tlb_type) {
|
|
|
|
case TLB_6XX:
|
2011-08-21 11:09:37 +08:00
|
|
|
env->tlb.tlb6 = g_malloc0(nb_tlb * sizeof(ppc6xx_tlb_t));
|
2011-06-17 07:00:28 +08:00
|
|
|
break;
|
|
|
|
case TLB_EMB:
|
2011-08-21 11:09:37 +08:00
|
|
|
env->tlb.tlbe = g_malloc0(nb_tlb * sizeof(ppcemb_tlb_t));
|
2011-06-17 07:00:28 +08:00
|
|
|
break;
|
|
|
|
case TLB_MAS:
|
2011-08-21 11:09:37 +08:00
|
|
|
env->tlb.tlbm = g_malloc0(nb_tlb * sizeof(ppcmas_tlb_t));
|
2011-06-17 07:00:28 +08:00
|
|
|
break;
|
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
/* Pre-compute some useful values */
|
|
|
|
env->tlb_per_way = env->nb_tlb / env->nb_ways;
|
|
|
|
}
|
|
|
|
if (env->irq_inputs == NULL) {
|
|
|
|
fprintf(stderr, "WARNING: no internal IRQ controller registered.\n"
|
2012-04-07 15:23:39 +08:00
|
|
|
" Attempt QEMU to crash very soon !\n");
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
#endif
|
2007-10-26 07:14:50 +08:00
|
|
|
if (env->check_pow == NULL) {
|
|
|
|
fprintf(stderr, "WARNING: no power management check handler "
|
|
|
|
"registered.\n"
|
2012-04-07 15:23:39 +08:00
|
|
|
" Attempt QEMU to crash very soon !\n");
|
2007-10-26 07:14:50 +08:00
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(PPC_DUMP_CPU)
|
|
|
|
static void dump_ppc_sprs (CPUPPCState *env)
|
|
|
|
{
|
|
|
|
ppc_spr_t *spr;
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
uint32_t sr, sw;
|
|
|
|
#endif
|
|
|
|
uint32_t ur, uw;
|
|
|
|
int i, j, n;
|
|
|
|
|
|
|
|
printf("Special purpose registers:\n");
|
|
|
|
for (i = 0; i < 32; i++) {
|
|
|
|
for (j = 0; j < 32; j++) {
|
|
|
|
n = (i << 5) | j;
|
|
|
|
spr = &env->spr_cb[n];
|
|
|
|
uw = spr->uea_write != NULL && spr->uea_write != SPR_NOACCESS;
|
|
|
|
ur = spr->uea_read != NULL && spr->uea_read != SPR_NOACCESS;
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
sw = spr->oea_write != NULL && spr->oea_write != SPR_NOACCESS;
|
|
|
|
sr = spr->oea_read != NULL && spr->oea_read != SPR_NOACCESS;
|
|
|
|
if (sw || sr || uw || ur) {
|
|
|
|
printf("SPR: %4d (%03x) %-8s s%c%c u%c%c\n",
|
|
|
|
(i << 5) | j, (i << 5) | j, spr->name,
|
|
|
|
sw ? 'w' : '-', sr ? 'r' : '-',
|
|
|
|
uw ? 'w' : '-', ur ? 'r' : '-');
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
if (uw || ur) {
|
|
|
|
printf("SPR: %4d (%03x) %-8s u%c%c\n",
|
|
|
|
(i << 5) | j, (i << 5) | j, spr->name,
|
|
|
|
uw ? 'w' : '-', ur ? 'r' : '-');
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fflush(stdout);
|
|
|
|
fflush(stderr);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
/* Opcode types */
|
|
|
|
enum {
|
|
|
|
PPC_DIRECT = 0, /* Opcode routine */
|
|
|
|
PPC_INDIRECT = 1, /* Indirect opcode table */
|
|
|
|
};
|
|
|
|
|
2014-09-26 17:07:37 +08:00
|
|
|
#define PPC_OPCODE_MASK 0x3
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
static inline int is_indirect_opcode (void *handler)
|
|
|
|
{
|
2014-09-26 17:07:37 +08:00
|
|
|
return ((uintptr_t)handler & PPC_OPCODE_MASK) == PPC_INDIRECT;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
|
2009-10-02 05:12:16 +08:00
|
|
|
static inline opc_handler_t **ind_table(void *handler)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
2014-09-26 17:07:37 +08:00
|
|
|
return (opc_handler_t **)((uintptr_t)handler & ~PPC_OPCODE_MASK);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Instruction table creation */
|
|
|
|
/* Opcodes tables creation */
|
2009-10-02 05:12:16 +08:00
|
|
|
static void fill_new_table (opc_handler_t **table, int len)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
table[i] = &invalid_handler;
|
|
|
|
}
|
|
|
|
|
2009-10-02 05:12:16 +08:00
|
|
|
static int create_new_table (opc_handler_t **table, unsigned char idx)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
2009-10-02 05:12:16 +08:00
|
|
|
opc_handler_t **tmp;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
2014-09-26 17:07:37 +08:00
|
|
|
tmp = g_new(opc_handler_t *, PPC_CPU_INDIRECT_OPCODES_LEN);
|
|
|
|
fill_new_table(tmp, PPC_CPU_INDIRECT_OPCODES_LEN);
|
2012-04-15 22:13:48 +08:00
|
|
|
table[idx] = (opc_handler_t *)((uintptr_t)tmp | PPC_INDIRECT);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-10-02 05:12:16 +08:00
|
|
|
static int insert_in_table (opc_handler_t **table, unsigned char idx,
|
|
|
|
opc_handler_t *handler)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
|
|
|
if (table[idx] != &invalid_handler)
|
|
|
|
return -1;
|
|
|
|
table[idx] = handler;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-10-02 05:12:16 +08:00
|
|
|
static int register_direct_insn (opc_handler_t **ppc_opcodes,
|
|
|
|
unsigned char idx, opc_handler_t *handler)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
|
|
|
if (insert_in_table(ppc_opcodes, idx, handler) < 0) {
|
|
|
|
printf("*** ERROR: opcode %02x already assigned in main "
|
|
|
|
"opcode table\n", idx);
|
2007-11-18 07:14:53 +08:00
|
|
|
#if defined(DO_PPC_STATISTICS) || defined(PPC_DUMP_CPU)
|
|
|
|
printf(" Registered handler '%s' - new handler '%s'\n",
|
|
|
|
ppc_opcodes[idx]->oname, handler->oname);
|
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-10-02 05:12:16 +08:00
|
|
|
static int register_ind_in_table (opc_handler_t **table,
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
unsigned char idx1, unsigned char idx2,
|
2009-10-02 05:12:16 +08:00
|
|
|
opc_handler_t *handler)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
|
|
|
if (table[idx1] == &invalid_handler) {
|
|
|
|
if (create_new_table(table, idx1) < 0) {
|
|
|
|
printf("*** ERROR: unable to create indirect table "
|
|
|
|
"idx=%02x\n", idx1);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (!is_indirect_opcode(table[idx1])) {
|
|
|
|
printf("*** ERROR: idx %02x already assigned to a direct "
|
|
|
|
"opcode\n", idx1);
|
2007-11-18 07:14:53 +08:00
|
|
|
#if defined(DO_PPC_STATISTICS) || defined(PPC_DUMP_CPU)
|
|
|
|
printf(" Registered handler '%s' - new handler '%s'\n",
|
|
|
|
ind_table(table[idx1])[idx2]->oname, handler->oname);
|
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2007-04-16 17:31:49 +08:00
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
if (handler != NULL &&
|
|
|
|
insert_in_table(ind_table(table[idx1]), idx2, handler) < 0) {
|
|
|
|
printf("*** ERROR: opcode %02x already assigned in "
|
|
|
|
"opcode table %02x\n", idx2, idx1);
|
2007-11-18 07:14:53 +08:00
|
|
|
#if defined(DO_PPC_STATISTICS) || defined(PPC_DUMP_CPU)
|
|
|
|
printf(" Registered handler '%s' - new handler '%s'\n",
|
|
|
|
ind_table(table[idx1])[idx2]->oname, handler->oname);
|
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
return -1;
|
2007-04-16 17:31:49 +08:00
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-10-02 05:12:16 +08:00
|
|
|
static int register_ind_insn (opc_handler_t **ppc_opcodes,
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
unsigned char idx1, unsigned char idx2,
|
2009-10-02 05:12:16 +08:00
|
|
|
opc_handler_t *handler)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
2015-09-05 03:20:28 +08:00
|
|
|
return register_ind_in_table(ppc_opcodes, idx1, idx2, handler);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
|
2009-10-02 05:12:16 +08:00
|
|
|
static int register_dblind_insn (opc_handler_t **ppc_opcodes,
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
unsigned char idx1, unsigned char idx2,
|
2009-10-02 05:12:16 +08:00
|
|
|
unsigned char idx3, opc_handler_t *handler)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
|
|
|
if (register_ind_in_table(ppc_opcodes, idx1, idx2, NULL) < 0) {
|
|
|
|
printf("*** ERROR: unable to join indirect table idx "
|
|
|
|
"[%02x-%02x]\n", idx1, idx2);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (register_ind_in_table(ind_table(ppc_opcodes[idx1]), idx2, idx3,
|
|
|
|
handler) < 0) {
|
|
|
|
printf("*** ERROR: unable to insert opcode "
|
|
|
|
"[%02x-%02x-%02x]\n", idx1, idx2, idx3);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-10-02 05:12:16 +08:00
|
|
|
static int register_insn (opc_handler_t **ppc_opcodes, opcode_t *insn)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
|
|
|
if (insn->opc2 != 0xFF) {
|
|
|
|
if (insn->opc3 != 0xFF) {
|
|
|
|
if (register_dblind_insn(ppc_opcodes, insn->opc1, insn->opc2,
|
|
|
|
insn->opc3, &insn->handler) < 0)
|
|
|
|
return -1;
|
|
|
|
} else {
|
|
|
|
if (register_ind_insn(ppc_opcodes, insn->opc1,
|
|
|
|
insn->opc2, &insn->handler) < 0)
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (register_direct_insn(ppc_opcodes, insn->opc1, &insn->handler) < 0)
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-10-02 05:12:16 +08:00
|
|
|
static int test_opcode_table (opc_handler_t **table, int len)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
|
|
|
int i, count, tmp;
|
|
|
|
|
|
|
|
for (i = 0, count = 0; i < len; i++) {
|
|
|
|
/* Consistency fixup */
|
|
|
|
if (table[i] == NULL)
|
|
|
|
table[i] = &invalid_handler;
|
|
|
|
if (table[i] != &invalid_handler) {
|
|
|
|
if (is_indirect_opcode(table[i])) {
|
2014-09-26 17:07:37 +08:00
|
|
|
tmp = test_opcode_table(ind_table(table[i]),
|
|
|
|
PPC_CPU_INDIRECT_OPCODES_LEN);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
if (tmp == 0) {
|
|
|
|
free(table[i]);
|
|
|
|
table[i] = &invalid_handler;
|
|
|
|
} else {
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
2009-10-02 05:12:16 +08:00
|
|
|
static void fix_opcode_tables (opc_handler_t **ppc_opcodes)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
2014-09-26 17:07:37 +08:00
|
|
|
if (test_opcode_table(ppc_opcodes, PPC_CPU_OPCODES_LEN) == 0)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
printf("*** WARNING: no opcode defined !\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2013-01-06 16:31:30 +08:00
|
|
|
static void create_ppc_opcodes(PowerPCCPU *cpu, Error **errp)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
2013-01-06 16:31:30 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
|
|
|
|
CPUPPCState *env = &cpu->env;
|
2009-10-02 05:12:16 +08:00
|
|
|
opcode_t *opc;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
2014-09-26 17:07:37 +08:00
|
|
|
fill_new_table(env->opcodes, PPC_CPU_OPCODES_LEN);
|
2009-06-17 23:22:31 +08:00
|
|
|
for (opc = opcodes; opc < &opcodes[ARRAY_SIZE(opcodes)]; opc++) {
|
2013-02-18 07:16:41 +08:00
|
|
|
if (((opc->handler.type & pcc->insns_flags) != 0) ||
|
|
|
|
((opc->handler.type2 & pcc->insns_flags2) != 0)) {
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
if (register_insn(env->opcodes, opc) < 0) {
|
2013-01-06 16:31:30 +08:00
|
|
|
error_setg(errp, "ERROR initializing PowerPC instruction "
|
error: Strip trailing '\n' from error string arguments (again)
Commit 6daf194d and be62a2eb got rid of a bunch, but they keep coming
back. Tracked down with this Coccinelle semantic patch:
@r@
expression err, eno, cls, fmt;
position p;
@@
(
error_report(fmt, ...)@p
|
error_set(err, cls, fmt, ...)@p
|
error_set_errno(err, eno, cls, fmt, ...)@p
|
error_setg(err, fmt, ...)@p
|
error_setg_errno(err, eno, fmt, ...)@p
)
@script:python@
fmt << r.fmt;
p << r.p;
@@
if "\\n" in str(fmt):
print "%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1360354939-10994-4-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-09 04:22:16 +08:00
|
|
|
"0x%02x 0x%02x 0x%02x", opc->opc1, opc->opc2,
|
2013-01-06 16:31:30 +08:00
|
|
|
opc->opc3);
|
|
|
|
return;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-10-02 05:12:16 +08:00
|
|
|
fix_opcode_tables(env->opcodes);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
fflush(stdout);
|
|
|
|
fflush(stderr);
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(PPC_DUMP_CPU)
|
2007-10-08 10:58:07 +08:00
|
|
|
static void dump_ppc_insns (CPUPPCState *env)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
2009-10-02 05:12:16 +08:00
|
|
|
opc_handler_t **table, *handler;
|
2008-09-20 16:07:15 +08:00
|
|
|
const char *p, *q;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
uint8_t opc1, opc2, opc3;
|
|
|
|
|
|
|
|
printf("Instructions set:\n");
|
|
|
|
/* opc1 is 6 bits long */
|
2014-09-26 17:07:37 +08:00
|
|
|
for (opc1 = 0x00; opc1 < PPC_CPU_OPCODES_LEN; opc1++) {
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
table = env->opcodes;
|
|
|
|
handler = table[opc1];
|
|
|
|
if (is_indirect_opcode(handler)) {
|
|
|
|
/* opc2 is 5 bits long */
|
2014-09-26 17:07:37 +08:00
|
|
|
for (opc2 = 0; opc2 < PPC_CPU_INDIRECT_OPCODES_LEN; opc2++) {
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
table = env->opcodes;
|
|
|
|
handler = env->opcodes[opc1];
|
|
|
|
table = ind_table(handler);
|
|
|
|
handler = table[opc2];
|
|
|
|
if (is_indirect_opcode(handler)) {
|
|
|
|
table = ind_table(handler);
|
|
|
|
/* opc3 is 5 bits long */
|
2014-09-26 17:07:37 +08:00
|
|
|
for (opc3 = 0; opc3 < PPC_CPU_INDIRECT_OPCODES_LEN;
|
|
|
|
opc3++) {
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
handler = table[opc3];
|
|
|
|
if (handler->handler != &gen_invalid) {
|
2007-11-18 07:14:53 +08:00
|
|
|
/* Special hack to properly dump SPE insns */
|
|
|
|
p = strchr(handler->oname, '_');
|
|
|
|
if (p == NULL) {
|
|
|
|
printf("INSN: %02x %02x %02x (%02d %04d) : "
|
|
|
|
"%s\n",
|
|
|
|
opc1, opc2, opc3, opc1,
|
|
|
|
(opc3 << 5) | opc2,
|
|
|
|
handler->oname);
|
|
|
|
} else {
|
|
|
|
q = "speundef";
|
|
|
|
if ((p - handler->oname) != strlen(q) ||
|
|
|
|
memcmp(handler->oname, q, strlen(q)) != 0) {
|
|
|
|
/* First instruction */
|
|
|
|
printf("INSN: %02x %02x %02x (%02d %04d) : "
|
|
|
|
"%.*s\n",
|
|
|
|
opc1, opc2 << 1, opc3, opc1,
|
|
|
|
(opc3 << 6) | (opc2 << 1),
|
|
|
|
(int)(p - handler->oname),
|
|
|
|
handler->oname);
|
|
|
|
}
|
|
|
|
if (strcmp(p + 1, q) != 0) {
|
|
|
|
/* Second instruction */
|
|
|
|
printf("INSN: %02x %02x %02x (%02d %04d) : "
|
|
|
|
"%s\n",
|
|
|
|
opc1, (opc2 << 1) | 1, opc3, opc1,
|
|
|
|
(opc3 << 6) | (opc2 << 1) | 1,
|
|
|
|
p + 1);
|
|
|
|
}
|
|
|
|
}
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (handler->handler != &gen_invalid) {
|
|
|
|
printf("INSN: %02x %02x -- (%02d %04d) : %s\n",
|
|
|
|
opc1, opc2, opc1, opc2, handler->oname);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (handler->handler != &gen_invalid) {
|
|
|
|
printf("INSN: %02x -- -- (%02d ----) : %s\n",
|
|
|
|
opc1, opc1, handler->oname);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-04-16 17:31:49 +08:00
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
|
2016-01-15 23:00:31 +08:00
|
|
|
static bool avr_need_swap(CPUPPCState *env)
|
|
|
|
{
|
|
|
|
#ifdef HOST_WORDS_BIGENDIAN
|
2016-01-15 23:00:38 +08:00
|
|
|
return msr_le;
|
2016-01-15 23:00:31 +08:00
|
|
|
#else
|
2016-01-15 23:00:38 +08:00
|
|
|
return !msr_le;
|
2016-01-15 23:00:31 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2012-03-14 08:38:22 +08:00
|
|
|
static int gdb_get_float_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
|
2009-01-24 23:08:00 +08:00
|
|
|
{
|
|
|
|
if (n < 32) {
|
|
|
|
stfq_p(mem_buf, env->fpr[n]);
|
2016-01-15 23:00:25 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 8);
|
2009-01-24 23:08:00 +08:00
|
|
|
return 8;
|
|
|
|
}
|
|
|
|
if (n == 32) {
|
2011-09-01 12:56:00 +08:00
|
|
|
stl_p(mem_buf, env->fpscr);
|
2016-01-15 23:00:25 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 4);
|
2009-01-24 23:08:00 +08:00
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-03-14 08:38:22 +08:00
|
|
|
static int gdb_set_float_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
|
2009-01-24 23:08:00 +08:00
|
|
|
{
|
|
|
|
if (n < 32) {
|
2016-01-15 23:00:25 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 8);
|
2009-01-24 23:08:00 +08:00
|
|
|
env->fpr[n] = ldfq_p(mem_buf);
|
|
|
|
return 8;
|
|
|
|
}
|
|
|
|
if (n == 32) {
|
2016-01-15 23:00:25 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 4);
|
2013-03-19 15:41:53 +08:00
|
|
|
helper_store_fpscr(env, ldl_p(mem_buf), 0xffffffff);
|
2009-01-24 23:08:00 +08:00
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-03-14 08:38:22 +08:00
|
|
|
static int gdb_get_avr_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
|
2009-01-24 23:08:09 +08:00
|
|
|
{
|
|
|
|
if (n < 32) {
|
2016-01-15 23:00:31 +08:00
|
|
|
if (!avr_need_swap(env)) {
|
|
|
|
stq_p(mem_buf, env->avr[n].u64[0]);
|
|
|
|
stq_p(mem_buf+8, env->avr[n].u64[1]);
|
|
|
|
} else {
|
|
|
|
stq_p(mem_buf, env->avr[n].u64[1]);
|
|
|
|
stq_p(mem_buf+8, env->avr[n].u64[0]);
|
|
|
|
}
|
2016-01-15 23:00:38 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 8);
|
|
|
|
ppc_maybe_bswap_register(env, mem_buf + 8, 8);
|
2009-01-24 23:08:09 +08:00
|
|
|
return 16;
|
|
|
|
}
|
2009-03-08 06:00:49 +08:00
|
|
|
if (n == 32) {
|
2009-01-24 23:08:09 +08:00
|
|
|
stl_p(mem_buf, env->vscr);
|
2016-01-15 23:00:38 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 4);
|
2009-01-24 23:08:09 +08:00
|
|
|
return 4;
|
|
|
|
}
|
2009-03-08 06:00:49 +08:00
|
|
|
if (n == 33) {
|
2009-01-24 23:08:09 +08:00
|
|
|
stl_p(mem_buf, (uint32_t)env->spr[SPR_VRSAVE]);
|
2016-01-15 23:00:38 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 4);
|
2009-01-24 23:08:09 +08:00
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-03-14 08:38:22 +08:00
|
|
|
static int gdb_set_avr_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
|
2009-01-24 23:08:09 +08:00
|
|
|
{
|
|
|
|
if (n < 32) {
|
2016-01-15 23:00:38 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 8);
|
|
|
|
ppc_maybe_bswap_register(env, mem_buf + 8, 8);
|
2016-01-15 23:00:31 +08:00
|
|
|
if (!avr_need_swap(env)) {
|
|
|
|
env->avr[n].u64[0] = ldq_p(mem_buf);
|
|
|
|
env->avr[n].u64[1] = ldq_p(mem_buf+8);
|
|
|
|
} else {
|
|
|
|
env->avr[n].u64[1] = ldq_p(mem_buf);
|
|
|
|
env->avr[n].u64[0] = ldq_p(mem_buf+8);
|
|
|
|
}
|
2009-01-24 23:08:09 +08:00
|
|
|
return 16;
|
|
|
|
}
|
2009-03-08 06:00:49 +08:00
|
|
|
if (n == 32) {
|
2016-01-15 23:00:38 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 4);
|
2009-01-24 23:08:09 +08:00
|
|
|
env->vscr = ldl_p(mem_buf);
|
|
|
|
return 4;
|
|
|
|
}
|
2009-03-08 06:00:49 +08:00
|
|
|
if (n == 33) {
|
2016-01-15 23:00:38 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 4);
|
2009-01-24 23:08:09 +08:00
|
|
|
env->spr[SPR_VRSAVE] = (target_ulong)ldl_p(mem_buf);
|
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-03-14 08:38:22 +08:00
|
|
|
static int gdb_get_spe_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
|
2009-01-24 23:08:17 +08:00
|
|
|
{
|
|
|
|
if (n < 32) {
|
|
|
|
#if defined(TARGET_PPC64)
|
|
|
|
stl_p(mem_buf, env->gpr[n] >> 32);
|
2016-01-15 23:00:44 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 4);
|
2009-01-24 23:08:17 +08:00
|
|
|
#else
|
|
|
|
stl_p(mem_buf, env->gprh[n]);
|
|
|
|
#endif
|
|
|
|
return 4;
|
|
|
|
}
|
2009-03-08 06:00:49 +08:00
|
|
|
if (n == 32) {
|
2009-01-24 23:08:17 +08:00
|
|
|
stq_p(mem_buf, env->spe_acc);
|
2016-01-15 23:00:44 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 8);
|
2009-01-24 23:08:17 +08:00
|
|
|
return 8;
|
|
|
|
}
|
2009-03-08 06:00:49 +08:00
|
|
|
if (n == 33) {
|
2009-03-09 14:27:14 +08:00
|
|
|
stl_p(mem_buf, env->spe_fscr);
|
2016-01-15 23:00:44 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 4);
|
2009-01-24 23:08:17 +08:00
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-03-14 08:38:22 +08:00
|
|
|
static int gdb_set_spe_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
|
2009-01-24 23:08:17 +08:00
|
|
|
{
|
|
|
|
if (n < 32) {
|
|
|
|
#if defined(TARGET_PPC64)
|
|
|
|
target_ulong lo = (uint32_t)env->gpr[n];
|
2016-01-15 23:00:44 +08:00
|
|
|
target_ulong hi;
|
|
|
|
|
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 4);
|
|
|
|
|
|
|
|
hi = (target_ulong)ldl_p(mem_buf) << 32;
|
2009-01-24 23:08:17 +08:00
|
|
|
env->gpr[n] = lo | hi;
|
|
|
|
#else
|
|
|
|
env->gprh[n] = ldl_p(mem_buf);
|
|
|
|
#endif
|
|
|
|
return 4;
|
|
|
|
}
|
2009-03-08 06:00:49 +08:00
|
|
|
if (n == 32) {
|
2016-01-15 23:00:44 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 8);
|
2009-01-24 23:08:17 +08:00
|
|
|
env->spe_acc = ldq_p(mem_buf);
|
|
|
|
return 8;
|
|
|
|
}
|
2009-03-08 06:00:49 +08:00
|
|
|
if (n == 33) {
|
2016-01-15 23:00:44 +08:00
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 4);
|
2009-03-09 14:27:14 +08:00
|
|
|
env->spe_fscr = ldl_p(mem_buf);
|
2009-01-24 23:08:17 +08:00
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-01-15 23:00:51 +08:00
|
|
|
static int gdb_get_vsx_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
|
|
|
|
{
|
|
|
|
if (n < 32) {
|
|
|
|
stq_p(mem_buf, env->vsr[n]);
|
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 8);
|
|
|
|
return 8;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int gdb_set_vsx_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
|
|
|
|
{
|
|
|
|
if (n < 32) {
|
|
|
|
ppc_maybe_bswap_register(env, mem_buf, 8);
|
|
|
|
env->vsr[n] = ldq_p(mem_buf);
|
|
|
|
return 8;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-12-17 13:18:02 +08:00
|
|
|
static int ppc_fixup_cpu(PowerPCCPU *cpu)
|
2012-04-04 13:02:05 +08:00
|
|
|
{
|
2012-12-17 13:18:02 +08:00
|
|
|
CPUPPCState *env = &cpu->env;
|
|
|
|
|
2012-04-04 13:02:05 +08:00
|
|
|
/* TCG doesn't (yet) emulate some groups of instructions that
|
|
|
|
* are implemented on some otherwise supported CPUs (e.g. VSX
|
|
|
|
* and decimal floating point instructions on POWER7). We
|
|
|
|
* remove unsupported instruction groups from the cpu state's
|
|
|
|
* instruction masks and hope the guest can cope. For at
|
|
|
|
* least the pseries machine, the unavailability of these
|
|
|
|
* instructions can be advertised to the guest via the device
|
|
|
|
* tree. */
|
|
|
|
if ((env->insns_flags & ~PPC_TCG_INSNS)
|
|
|
|
|| (env->insns_flags2 & ~PPC_TCG_INSNS2)) {
|
|
|
|
fprintf(stderr, "Warning: Disabling some instructions which are not "
|
|
|
|
"emulated by TCG (0x%" PRIx64 ", 0x%" PRIx64 ")\n",
|
|
|
|
env->insns_flags & ~PPC_TCG_INSNS,
|
|
|
|
env->insns_flags2 & ~PPC_TCG_INSNS2);
|
|
|
|
}
|
|
|
|
env->insns_flags &= PPC_TCG_INSNS;
|
|
|
|
env->insns_flags2 &= PPC_TCG_INSNS2;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-01-24 00:47:44 +08:00
|
|
|
static inline bool ppc_cpu_is_valid(PowerPCCPUClass *pcc)
|
|
|
|
{
|
|
|
|
#ifdef TARGET_PPCEMB
|
|
|
|
return pcc->mmu_model == POWERPC_MMU_BOOKE ||
|
|
|
|
pcc->mmu_model == POWERPC_MMU_SOFT_4xx ||
|
|
|
|
pcc->mmu_model == POWERPC_MMU_SOFT_4xx_Z;
|
|
|
|
#else
|
|
|
|
return true;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2013-01-16 10:55:14 +08:00
|
|
|
static void ppc_cpu_realizefn(DeviceState *dev, Error **errp)
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
{
|
2013-06-29 03:27:39 +08:00
|
|
|
CPUState *cs = CPU(dev);
|
2013-01-16 10:55:14 +08:00
|
|
|
PowerPCCPU *cpu = POWERPC_CPU(dev);
|
2013-01-06 16:31:30 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
|
|
|
|
Error *local_err = NULL;
|
2013-01-24 01:20:38 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
int max_smt = kvm_enabled() ? kvmppc_smt_threads() : 1;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
if (smp_threads > max_smt) {
|
2013-02-18 07:16:01 +08:00
|
|
|
error_setg(errp, "Cannot support more than %d threads on PPC with %s",
|
|
|
|
max_smt, kvm_enabled() ? "KVM" : "TCG");
|
|
|
|
return;
|
2013-01-24 01:20:38 +08:00
|
|
|
}
|
2014-03-05 16:32:36 +08:00
|
|
|
if (!is_power_of_2(smp_threads)) {
|
|
|
|
error_setg(errp, "Cannot support %d threads on PPC with %s, "
|
|
|
|
"threads count must be a power of 2.",
|
|
|
|
smp_threads, kvm_enabled() ? "KVM" : "TCG");
|
|
|
|
return;
|
|
|
|
}
|
2015-06-24 10:31:14 +08:00
|
|
|
#endif
|
|
|
|
|
2015-06-24 10:31:18 +08:00
|
|
|
cpu_exec_init(cs, &local_err);
|
2015-06-24 10:31:14 +08:00
|
|
|
if (local_err != NULL) {
|
|
|
|
error_propagate(errp, local_err);
|
|
|
|
return;
|
|
|
|
}
|
2014-02-01 22:45:51 +08:00
|
|
|
|
2015-06-24 10:31:14 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2014-02-01 22:45:51 +08:00
|
|
|
cpu->cpu_dt_id = (cs->cpu_index / smp_threads) * max_smt
|
|
|
|
+ (cs->cpu_index % smp_threads);
|
2013-01-24 01:20:38 +08:00
|
|
|
#endif
|
ppc64: Rudimentary Support for extra page sizes on server CPUs
More recent Power server chips (i.e. based on the 64 bit hash MMU)
support more than just the traditional 4k and 16M page sizes. This
can get quite complicated, because which page sizes are supported,
which combinations are supported within an MMU segment and how these
page sizes are encoded both in the SLB entry and the hash PTE can vary
depending on the CPU model (they are not specified by the
architecture). In addition the firmware or hypervisor may not permit
use of certain page sizes, for various reasons. Whether various page
sizes are supported on KVM, for example, depends on whether the PR or
HV variant of KVM is in use, and on the page size of the memory
backing the guest's RAM.
This patch adds information to the CPUState and cpu defs to describe
the supported page sizes and encodings. Since TCG does not yet
support any extended page sizes, we just set this to NULL in the
static CPU definitions, expanding this to the default 4k and 16M page
sizes when we initialize the cpu state. When using KVM, however, we
instead determine available page sizes using the new
KVM_PPC_GET_SMMU_INFO call. For old kernels without that call, we use
some defaults, with some guesswork which should do the right thing for
existing HV and PR implementations. The fallback might not be correct
for future versions, but that's ok, because they'll have
KVM_PPC_GET_SMMU_INFO.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-19 03:56:25 +08:00
|
|
|
|
2014-02-01 22:45:51 +08:00
|
|
|
if (tcg_enabled()) {
|
2012-12-17 13:18:02 +08:00
|
|
|
if (ppc_fixup_cpu(cpu) != 0) {
|
2013-01-06 16:31:30 +08:00
|
|
|
error_setg(errp, "Unable to emulate selected CPU with TCG");
|
|
|
|
return;
|
2012-04-04 13:02:05 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:44 +08:00
|
|
|
#if defined(TARGET_PPCEMB)
|
2014-01-24 00:47:44 +08:00
|
|
|
if (!ppc_cpu_is_valid(pcc)) {
|
|
|
|
error_setg(errp, "CPU does not possess a BookE or 4xx MMU. "
|
2013-02-18 07:16:44 +08:00
|
|
|
"Please use qemu-system-ppc or qemu-system-ppc64 instead "
|
|
|
|
"or choose another CPU model.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-01-06 16:31:30 +08:00
|
|
|
create_ppc_opcodes(cpu, &local_err);
|
|
|
|
if (local_err != NULL) {
|
|
|
|
error_propagate(errp, local_err);
|
|
|
|
return;
|
|
|
|
}
|
2013-02-18 07:16:41 +08:00
|
|
|
init_ppc_proc(cpu);
|
2009-01-24 23:08:00 +08:00
|
|
|
|
2013-02-18 07:16:41 +08:00
|
|
|
if (pcc->insns_flags & PPC_FLOAT) {
|
2013-06-29 03:27:39 +08:00
|
|
|
gdb_register_coprocessor(cs, gdb_get_float_reg, gdb_set_float_reg,
|
2009-01-24 23:08:00 +08:00
|
|
|
33, "power-fpu.xml", 0);
|
|
|
|
}
|
2013-02-18 07:16:41 +08:00
|
|
|
if (pcc->insns_flags & PPC_ALTIVEC) {
|
2013-06-29 03:27:39 +08:00
|
|
|
gdb_register_coprocessor(cs, gdb_get_avr_reg, gdb_set_avr_reg,
|
2009-01-24 23:08:09 +08:00
|
|
|
34, "power-altivec.xml", 0);
|
|
|
|
}
|
2013-02-18 07:16:41 +08:00
|
|
|
if (pcc->insns_flags & PPC_SPE) {
|
2013-06-29 03:27:39 +08:00
|
|
|
gdb_register_coprocessor(cs, gdb_get_spe_reg, gdb_set_spe_reg,
|
2009-01-24 23:08:17 +08:00
|
|
|
34, "power-spe.xml", 0);
|
|
|
|
}
|
2016-01-15 23:00:51 +08:00
|
|
|
if (pcc->insns_flags2 & PPC2_VSX) {
|
|
|
|
gdb_register_coprocessor(cs, gdb_get_vsx_reg, gdb_set_vsx_reg,
|
|
|
|
32, "power-vsx.xml", 0);
|
|
|
|
}
|
2009-01-24 23:08:17 +08:00
|
|
|
|
2013-07-27 08:53:25 +08:00
|
|
|
qemu_init_vcpu(cs);
|
|
|
|
|
2013-01-16 10:55:14 +08:00
|
|
|
pcc->parent_realize(dev, errp);
|
|
|
|
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
#if defined(PPC_DUMP_CPU)
|
2007-04-16 17:31:49 +08:00
|
|
|
{
|
2013-06-29 03:27:39 +08:00
|
|
|
CPUPPCState *env = &cpu->env;
|
2008-09-20 16:07:15 +08:00
|
|
|
const char *mmu_model, *excp_model, *bus_model;
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
switch (env->mmu_model) {
|
|
|
|
case POWERPC_MMU_32B:
|
|
|
|
mmu_model = "PowerPC 32";
|
|
|
|
break;
|
|
|
|
case POWERPC_MMU_SOFT_6xx:
|
|
|
|
mmu_model = "PowerPC 6xx/7xx with software driven TLBs";
|
|
|
|
break;
|
|
|
|
case POWERPC_MMU_SOFT_74xx:
|
|
|
|
mmu_model = "PowerPC 74xx with software driven TLBs";
|
|
|
|
break;
|
|
|
|
case POWERPC_MMU_SOFT_4xx:
|
|
|
|
mmu_model = "PowerPC 4xx with software driven TLBs";
|
|
|
|
break;
|
|
|
|
case POWERPC_MMU_SOFT_4xx_Z:
|
|
|
|
mmu_model = "PowerPC 4xx with software driven TLBs "
|
|
|
|
"and zones protections";
|
|
|
|
break;
|
2007-11-18 06:42:36 +08:00
|
|
|
case POWERPC_MMU_REAL:
|
|
|
|
mmu_model = "PowerPC real mode only";
|
|
|
|
break;
|
|
|
|
case POWERPC_MMU_MPC8xx:
|
|
|
|
mmu_model = "PowerPC MPC8xx";
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
break;
|
|
|
|
case POWERPC_MMU_BOOKE:
|
|
|
|
mmu_model = "PowerPC BookE";
|
|
|
|
break;
|
2011-05-01 05:34:58 +08:00
|
|
|
case POWERPC_MMU_BOOKE206:
|
|
|
|
mmu_model = "PowerPC BookE 2.06";
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
break;
|
2007-11-18 06:42:36 +08:00
|
|
|
case POWERPC_MMU_601:
|
|
|
|
mmu_model = "PowerPC 601";
|
|
|
|
break;
|
2007-10-03 09:05:39 +08:00
|
|
|
#if defined (TARGET_PPC64)
|
|
|
|
case POWERPC_MMU_64B:
|
|
|
|
mmu_model = "PowerPC 64";
|
|
|
|
break;
|
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
default:
|
|
|
|
mmu_model = "Unknown or invalid";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
switch (env->excp_model) {
|
|
|
|
case POWERPC_EXCP_STD:
|
|
|
|
excp_model = "PowerPC";
|
|
|
|
break;
|
|
|
|
case POWERPC_EXCP_40x:
|
|
|
|
excp_model = "PowerPC 40x";
|
|
|
|
break;
|
|
|
|
case POWERPC_EXCP_601:
|
|
|
|
excp_model = "PowerPC 601";
|
|
|
|
break;
|
|
|
|
case POWERPC_EXCP_602:
|
|
|
|
excp_model = "PowerPC 602";
|
|
|
|
break;
|
|
|
|
case POWERPC_EXCP_603:
|
|
|
|
excp_model = "PowerPC 603";
|
|
|
|
break;
|
|
|
|
case POWERPC_EXCP_603E:
|
|
|
|
excp_model = "PowerPC 603e";
|
|
|
|
break;
|
|
|
|
case POWERPC_EXCP_604:
|
|
|
|
excp_model = "PowerPC 604";
|
|
|
|
break;
|
|
|
|
case POWERPC_EXCP_7x0:
|
|
|
|
excp_model = "PowerPC 740/750";
|
|
|
|
break;
|
|
|
|
case POWERPC_EXCP_7x5:
|
|
|
|
excp_model = "PowerPC 745/755";
|
|
|
|
break;
|
|
|
|
case POWERPC_EXCP_74xx:
|
|
|
|
excp_model = "PowerPC 74xx";
|
|
|
|
break;
|
|
|
|
case POWERPC_EXCP_BOOKE:
|
|
|
|
excp_model = "PowerPC BookE";
|
|
|
|
break;
|
2007-10-03 09:05:39 +08:00
|
|
|
#if defined (TARGET_PPC64)
|
|
|
|
case POWERPC_EXCP_970:
|
|
|
|
excp_model = "PowerPC 970";
|
|
|
|
break;
|
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
default:
|
|
|
|
excp_model = "Unknown or invalid";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
switch (env->bus_model) {
|
|
|
|
case PPC_FLAGS_INPUT_6xx:
|
|
|
|
bus_model = "PowerPC 6xx";
|
|
|
|
break;
|
|
|
|
case PPC_FLAGS_INPUT_BookE:
|
|
|
|
bus_model = "PowerPC BookE";
|
|
|
|
break;
|
|
|
|
case PPC_FLAGS_INPUT_405:
|
|
|
|
bus_model = "PowerPC 405";
|
|
|
|
break;
|
|
|
|
case PPC_FLAGS_INPUT_401:
|
|
|
|
bus_model = "PowerPC 401/403";
|
|
|
|
break;
|
2007-11-18 06:42:36 +08:00
|
|
|
case PPC_FLAGS_INPUT_RCPU:
|
|
|
|
bus_model = "RCPU / MPC8xx";
|
|
|
|
break;
|
2007-10-03 09:05:39 +08:00
|
|
|
#if defined (TARGET_PPC64)
|
|
|
|
case PPC_FLAGS_INPUT_970:
|
|
|
|
bus_model = "PowerPC 970";
|
|
|
|
break;
|
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
default:
|
|
|
|
bus_model = "Unknown or invalid";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
printf("PowerPC %-12s : PVR %08x MSR %016" PRIx64 "\n"
|
|
|
|
" MMU model : %s\n",
|
2013-12-20 10:14:57 +08:00
|
|
|
object_class_get_name(OBJECT_CLASS(pcc)),
|
|
|
|
pcc->pvr, pcc->msr_mask, mmu_model);
|
2007-10-07 23:43:50 +08:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
2013-12-20 10:14:57 +08:00
|
|
|
if (env->tlb.tlb6) {
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
printf(" %d %s TLB in %d ways\n",
|
|
|
|
env->nb_tlb, env->id_tlbs ? "splitted" : "merged",
|
|
|
|
env->nb_ways);
|
|
|
|
}
|
2007-10-07 23:43:50 +08:00
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
printf(" Exceptions model : %s\n"
|
|
|
|
" Bus model : %s\n",
|
|
|
|
excp_model, bus_model);
|
2007-10-08 10:58:07 +08:00
|
|
|
printf(" MSR features :\n");
|
|
|
|
if (env->flags & POWERPC_FLAG_SPE)
|
|
|
|
printf(" signal processing engine enable"
|
|
|
|
"\n");
|
|
|
|
else if (env->flags & POWERPC_FLAG_VRE)
|
|
|
|
printf(" vector processor enable\n");
|
|
|
|
if (env->flags & POWERPC_FLAG_TGPR)
|
|
|
|
printf(" temporary GPRs\n");
|
|
|
|
else if (env->flags & POWERPC_FLAG_CE)
|
|
|
|
printf(" critical input enable\n");
|
|
|
|
if (env->flags & POWERPC_FLAG_SE)
|
|
|
|
printf(" single-step trace mode\n");
|
|
|
|
else if (env->flags & POWERPC_FLAG_DWE)
|
|
|
|
printf(" debug wait enable\n");
|
|
|
|
else if (env->flags & POWERPC_FLAG_UBLE)
|
|
|
|
printf(" user BTB lock enable\n");
|
|
|
|
if (env->flags & POWERPC_FLAG_BE)
|
|
|
|
printf(" branch-step trace mode\n");
|
|
|
|
else if (env->flags & POWERPC_FLAG_DE)
|
|
|
|
printf(" debug interrupt enable\n");
|
|
|
|
if (env->flags & POWERPC_FLAG_PX)
|
|
|
|
printf(" inclusive protection\n");
|
|
|
|
else if (env->flags & POWERPC_FLAG_PMM)
|
|
|
|
printf(" performance monitor mark\n");
|
|
|
|
if (env->flags == POWERPC_FLAG_NONE)
|
|
|
|
printf(" none\n");
|
2007-11-19 09:48:12 +08:00
|
|
|
printf(" Time-base/decrementer clock source: %s\n",
|
|
|
|
env->flags & POWERPC_FLAG_RTC_CLK ? "RTC clock" : "bus clock");
|
2013-06-29 03:27:39 +08:00
|
|
|
dump_ppc_insns(env);
|
|
|
|
dump_ppc_sprs(env);
|
|
|
|
fflush(stdout);
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
2007-04-16 17:31:49 +08:00
|
|
|
#endif
|
Great rework and cleanups to ease PowerPC implementations definitions.
* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-27 07:54:22 +08:00
|
|
|
}
|
2005-07-03 04:59:34 +08:00
|
|
|
|
2013-06-10 04:11:49 +08:00
|
|
|
static void ppc_cpu_unrealizefn(DeviceState *dev, Error **errp)
|
|
|
|
{
|
|
|
|
PowerPCCPU *cpu = POWERPC_CPU(dev);
|
|
|
|
CPUPPCState *env = &cpu->env;
|
2014-09-26 17:07:38 +08:00
|
|
|
opc_handler_t **table;
|
|
|
|
int i, j;
|
2013-06-10 04:11:49 +08:00
|
|
|
|
2015-06-24 10:31:14 +08:00
|
|
|
cpu_exec_exit(CPU(dev));
|
|
|
|
|
2013-06-10 04:11:49 +08:00
|
|
|
for (i = 0; i < PPC_CPU_OPCODES_LEN; i++) {
|
2014-09-26 17:07:38 +08:00
|
|
|
if (env->opcodes[i] == &invalid_handler) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (is_indirect_opcode(env->opcodes[i])) {
|
|
|
|
table = ind_table(env->opcodes[i]);
|
|
|
|
for (j = 0; j < PPC_CPU_INDIRECT_OPCODES_LEN; j++) {
|
|
|
|
if (table[j] != &invalid_handler &&
|
|
|
|
is_indirect_opcode(table[j])) {
|
|
|
|
g_free((opc_handler_t *)((uintptr_t)table[j] &
|
|
|
|
~PPC_INDIRECT));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_free((opc_handler_t *)((uintptr_t)env->opcodes[i] &
|
|
|
|
~PPC_INDIRECT));
|
2013-06-10 04:11:49 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-23 10:26:56 +08:00
|
|
|
int ppc_get_compat_smt_threads(PowerPCCPU *cpu)
|
|
|
|
{
|
2014-07-09 22:40:56 +08:00
|
|
|
int ret = MIN(smp_threads, kvmppc_smt_threads());
|
2014-05-23 10:26:56 +08:00
|
|
|
|
|
|
|
switch (cpu->cpu_version) {
|
|
|
|
case CPU_POWERPC_LOGICAL_2_05:
|
2014-07-09 22:40:56 +08:00
|
|
|
ret = MIN(ret, 2);
|
2014-05-23 10:26:56 +08:00
|
|
|
break;
|
|
|
|
case CPU_POWERPC_LOGICAL_2_06:
|
2014-07-09 22:40:56 +08:00
|
|
|
ret = MIN(ret, 4);
|
2014-05-23 10:26:56 +08:00
|
|
|
break;
|
|
|
|
case CPU_POWERPC_LOGICAL_2_07:
|
2014-07-09 22:40:56 +08:00
|
|
|
ret = MIN(ret, 8);
|
2014-05-23 10:26:56 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2014-07-09 22:40:56 +08:00
|
|
|
return ret;
|
2014-05-23 10:26:56 +08:00
|
|
|
}
|
|
|
|
|
2016-01-20 09:58:07 +08:00
|
|
|
void ppc_set_compat(PowerPCCPU *cpu, uint32_t cpu_version, Error **errp)
|
2014-05-23 10:26:52 +08:00
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
CPUPPCState *env = &cpu->env;
|
|
|
|
|
|
|
|
cpu->cpu_version = cpu_version;
|
|
|
|
|
|
|
|
switch (cpu_version) {
|
|
|
|
case CPU_POWERPC_LOGICAL_2_05:
|
|
|
|
env->spr[SPR_PCR] = PCR_COMPAT_2_05;
|
|
|
|
break;
|
|
|
|
case CPU_POWERPC_LOGICAL_2_06:
|
|
|
|
env->spr[SPR_PCR] = PCR_COMPAT_2_06;
|
|
|
|
break;
|
|
|
|
case CPU_POWERPC_LOGICAL_2_06_PLUS:
|
|
|
|
env->spr[SPR_PCR] = PCR_COMPAT_2_06;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
env->spr[SPR_PCR] = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-01-20 09:58:07 +08:00
|
|
|
if (kvm_enabled()) {
|
|
|
|
ret = kvmppc_set_compat(cpu, cpu->cpu_version);
|
|
|
|
if (ret < 0) {
|
|
|
|
error_setg_errno(errp, -ret,
|
|
|
|
"Unable to set CPU compatibility mode in KVM");
|
|
|
|
}
|
2014-05-23 10:26:58 +08:00
|
|
|
}
|
2014-05-23 10:26:52 +08:00
|
|
|
}
|
|
|
|
|
2013-01-06 16:31:30 +08:00
|
|
|
static gint ppc_cpu_compare_class_pvr(gconstpointer a, gconstpointer b)
|
2011-10-18 08:00:51 +08:00
|
|
|
{
|
2013-01-06 16:31:30 +08:00
|
|
|
ObjectClass *oc = (ObjectClass *)a;
|
|
|
|
uint32_t pvr = *(uint32_t *)b;
|
|
|
|
PowerPCCPUClass *pcc = (PowerPCCPUClass *)a;
|
|
|
|
|
|
|
|
/* -cpu host does a PVR lookup during construction */
|
|
|
|
if (unlikely(strcmp(object_class_get_name(oc),
|
|
|
|
TYPE_HOST_POWERPC_CPU) == 0)) {
|
|
|
|
return -1;
|
2011-10-18 08:00:51 +08:00
|
|
|
}
|
|
|
|
|
2014-01-24 00:47:44 +08:00
|
|
|
if (!ppc_cpu_is_valid(pcc)) {
|
2013-02-18 07:16:44 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2013-02-18 07:16:41 +08:00
|
|
|
return pcc->pvr == pvr ? 0 : -1;
|
2011-10-18 08:00:51 +08:00
|
|
|
}
|
|
|
|
|
2013-01-06 16:31:30 +08:00
|
|
|
PowerPCCPUClass *ppc_cpu_class_by_pvr(uint32_t pvr)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2013-01-06 16:31:30 +08:00
|
|
|
GSList *list, *item;
|
|
|
|
PowerPCCPUClass *pcc = NULL;
|
ppc: Remove broken partial PVR matching
The ppc target contains a ppc_find_by_pvr() function, which looks up a
CPU spec based on a PVR (that is, based on the value in the target cpu's
Processor Version Register). PVR values contain information on both the
cpu model (upper 16 bits, usually) and on the precise revision (low 16
bits, usually).
ppc_find_by_pvr, as well as making exact PVR matches, attempts to find
"close" PVR matches, when we don't have a CPU spec for the exact revision
specified. This sounds like a good idea, execpt that the current logic
is completely nonsensical.
It seems to assume CPU families are subdivided bit by bit in the PVR in a
way they just aren't. Specifically, it requires a match on all bits of the
specified pvr up to the last non-zero bit. This has the bizarre effect
that when the low bits are simply a sequential revision number (a common
though not universal pattern), then odd specified revisions must be matched
exactly, whereas even specified revisions will also match the next odd
revision, likewise for powers of 4, 8 and so forth.
To correctly do inexact matching we'd need to re-organize the table of CPU
specs to include a mask showing what PVR range the spec is compatible with
(similar to the cputable code in the Linux kernel).
For now, just remove the bogosity by only permitting exact PVR matches.
That at least makes the matching simple and consistent. If we need inexact
matching we can add the necessary per-subfamily masks later.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-10-13 06:40:31 +08:00
|
|
|
|
2013-01-06 16:31:30 +08:00
|
|
|
list = object_class_get_list(TYPE_POWERPC_CPU, false);
|
|
|
|
item = g_slist_find_custom(list, &pvr, ppc_cpu_compare_class_pvr);
|
|
|
|
if (item != NULL) {
|
|
|
|
pcc = POWERPC_CPU_CLASS(item->data);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
2013-01-06 16:31:30 +08:00
|
|
|
g_slist_free(list);
|
|
|
|
|
|
|
|
return pcc;
|
|
|
|
}
|
|
|
|
|
2013-09-27 16:05:03 +08:00
|
|
|
static gint ppc_cpu_compare_class_pvr_mask(gconstpointer a, gconstpointer b)
|
|
|
|
{
|
|
|
|
ObjectClass *oc = (ObjectClass *)a;
|
|
|
|
uint32_t pvr = *(uint32_t *)b;
|
|
|
|
PowerPCCPUClass *pcc = (PowerPCCPUClass *)a;
|
|
|
|
|
|
|
|
/* -cpu host does a PVR lookup during construction */
|
|
|
|
if (unlikely(strcmp(object_class_get_name(oc),
|
|
|
|
TYPE_HOST_POWERPC_CPU) == 0)) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2014-01-24 00:47:44 +08:00
|
|
|
if (!ppc_cpu_is_valid(pcc)) {
|
2013-09-27 16:05:03 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2014-01-24 00:47:44 +08:00
|
|
|
|
2014-07-03 22:48:55 +08:00
|
|
|
if (pcc->pvr_match(pcc, pvr)) {
|
|
|
|
return 0;
|
|
|
|
}
|
2013-09-27 16:05:03 +08:00
|
|
|
|
2014-07-03 22:48:55 +08:00
|
|
|
return -1;
|
2013-09-27 16:05:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
PowerPCCPUClass *ppc_cpu_class_by_pvr_mask(uint32_t pvr)
|
|
|
|
{
|
|
|
|
GSList *list, *item;
|
|
|
|
PowerPCCPUClass *pcc = NULL;
|
|
|
|
|
|
|
|
list = object_class_get_list(TYPE_POWERPC_CPU, true);
|
|
|
|
item = g_slist_find_custom(list, &pvr, ppc_cpu_compare_class_pvr_mask);
|
|
|
|
if (item != NULL) {
|
|
|
|
pcc = POWERPC_CPU_CLASS(item->data);
|
|
|
|
}
|
|
|
|
g_slist_free(list);
|
|
|
|
|
|
|
|
return pcc;
|
|
|
|
}
|
|
|
|
|
2013-01-06 16:31:30 +08:00
|
|
|
static gint ppc_cpu_compare_class_name(gconstpointer a, gconstpointer b)
|
|
|
|
{
|
|
|
|
ObjectClass *oc = (ObjectClass *)a;
|
|
|
|
const char *name = b;
|
2013-02-18 07:16:44 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
2007-11-11 07:51:02 +08:00
|
|
|
|
2013-01-06 16:31:30 +08:00
|
|
|
if (strncasecmp(name, object_class_get_name(oc), strlen(name)) == 0 &&
|
2014-01-24 00:47:44 +08:00
|
|
|
ppc_cpu_is_valid(pcc) &&
|
2013-01-06 16:31:30 +08:00
|
|
|
strcmp(object_class_get_name(oc) + strlen(name),
|
|
|
|
"-" TYPE_POWERPC_CPU) == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return -1;
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-06-22 09:53:35 +08:00
|
|
|
static ObjectClass *ppc_cpu_class_by_name(const char *name);
|
|
|
|
|
|
|
|
static ObjectClass *ppc_cpu_class_by_alias(PowerPCCPUAlias *alias)
|
|
|
|
{
|
|
|
|
ObjectClass *invalid_class = (void*)ppc_cpu_class_by_alias;
|
|
|
|
|
|
|
|
/* Cache target class lookups in the alias table */
|
|
|
|
if (!alias->oc) {
|
|
|
|
alias->oc = ppc_cpu_class_by_name(alias->model);
|
|
|
|
if (!alias->oc) {
|
|
|
|
/* Fast check for non-existing aliases */
|
|
|
|
alias->oc = invalid_class;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (alias->oc == invalid_class) {
|
|
|
|
return NULL;
|
|
|
|
} else {
|
|
|
|
return alias->oc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-01-06 16:31:30 +08:00
|
|
|
static ObjectClass *ppc_cpu_class_by_name(const char *name)
|
2007-11-11 07:51:02 +08:00
|
|
|
{
|
2013-01-06 16:31:30 +08:00
|
|
|
GSList *list, *item;
|
|
|
|
ObjectClass *ret = NULL;
|
2008-09-20 16:07:15 +08:00
|
|
|
const char *p;
|
2013-01-06 16:31:30 +08:00
|
|
|
int i, len;
|
2007-11-11 07:51:02 +08:00
|
|
|
|
|
|
|
/* Check if the given name is a PVR */
|
|
|
|
len = strlen(name);
|
|
|
|
if (len == 10 && name[0] == '0' && name[1] == 'x') {
|
|
|
|
p = name + 2;
|
|
|
|
goto check_pvr;
|
|
|
|
} else if (len == 8) {
|
|
|
|
p = name;
|
|
|
|
check_pvr:
|
|
|
|
for (i = 0; i < 8; i++) {
|
2008-11-16 21:53:32 +08:00
|
|
|
if (!qemu_isxdigit(*p++))
|
2007-11-11 07:51:02 +08:00
|
|
|
break;
|
|
|
|
}
|
2013-01-06 16:31:30 +08:00
|
|
|
if (i == 8) {
|
2015-09-05 03:20:28 +08:00
|
|
|
return OBJECT_CLASS(ppc_cpu_class_by_pvr(strtoul(name, NULL, 16)));
|
2011-10-18 08:00:51 +08:00
|
|
|
}
|
2013-01-06 16:31:30 +08:00
|
|
|
}
|
2011-10-18 08:00:51 +08:00
|
|
|
|
2013-01-06 16:31:30 +08:00
|
|
|
list = object_class_get_list(TYPE_POWERPC_CPU, false);
|
|
|
|
item = g_slist_find_custom(list, name, ppc_cpu_compare_class_name);
|
|
|
|
if (item != NULL) {
|
|
|
|
ret = OBJECT_CLASS(item->data);
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
2013-01-06 16:31:30 +08:00
|
|
|
g_slist_free(list);
|
2007-11-11 07:51:02 +08:00
|
|
|
|
2014-04-12 01:34:26 +08:00
|
|
|
if (ret) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; ppc_cpu_aliases[i].alias != NULL; i++) {
|
|
|
|
if (strcmp(ppc_cpu_aliases[i].alias, name) == 0) {
|
|
|
|
return ppc_cpu_class_by_alias(&ppc_cpu_aliases[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
|
|
|
|
2013-01-06 16:31:30 +08:00
|
|
|
PowerPCCPU *cpu_ppc_init(const char *cpu_model)
|
2005-07-03 04:59:34 +08:00
|
|
|
{
|
2014-03-04 10:17:10 +08:00
|
|
|
return POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model));
|
2013-01-06 16:31:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Sort by PVR, ordering special case "host" last. */
|
|
|
|
static gint ppc_cpu_list_compare(gconstpointer a, gconstpointer b)
|
|
|
|
{
|
|
|
|
ObjectClass *oc_a = (ObjectClass *)a;
|
|
|
|
ObjectClass *oc_b = (ObjectClass *)b;
|
|
|
|
PowerPCCPUClass *pcc_a = POWERPC_CPU_CLASS(oc_a);
|
|
|
|
PowerPCCPUClass *pcc_b = POWERPC_CPU_CLASS(oc_b);
|
|
|
|
const char *name_a = object_class_get_name(oc_a);
|
|
|
|
const char *name_b = object_class_get_name(oc_b);
|
|
|
|
|
|
|
|
if (strcmp(name_a, TYPE_HOST_POWERPC_CPU) == 0) {
|
|
|
|
return 1;
|
|
|
|
} else if (strcmp(name_b, TYPE_HOST_POWERPC_CPU) == 0) {
|
|
|
|
return -1;
|
|
|
|
} else {
|
|
|
|
/* Avoid an integer overflow during subtraction */
|
2013-02-18 07:16:41 +08:00
|
|
|
if (pcc_a->pvr < pcc_b->pvr) {
|
2013-01-06 16:31:30 +08:00
|
|
|
return -1;
|
2013-02-18 07:16:41 +08:00
|
|
|
} else if (pcc_a->pvr > pcc_b->pvr) {
|
2013-01-06 16:31:30 +08:00
|
|
|
return 1;
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ppc_cpu_list_entry(gpointer data, gpointer user_data)
|
|
|
|
{
|
|
|
|
ObjectClass *oc = data;
|
|
|
|
CPUListState *s = user_data;
|
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
2013-02-18 07:16:40 +08:00
|
|
|
const char *typename = object_class_get_name(oc);
|
|
|
|
char *name;
|
2013-02-23 15:34:28 +08:00
|
|
|
int i;
|
2013-01-06 16:31:30 +08:00
|
|
|
|
2014-01-24 00:47:44 +08:00
|
|
|
if (!ppc_cpu_is_valid(pcc)) {
|
2013-02-18 07:16:44 +08:00
|
|
|
return;
|
|
|
|
}
|
2013-02-23 19:22:12 +08:00
|
|
|
if (unlikely(strcmp(typename, TYPE_HOST_POWERPC_CPU) == 0)) {
|
|
|
|
return;
|
|
|
|
}
|
2013-02-18 07:16:44 +08:00
|
|
|
|
2013-02-18 07:16:40 +08:00
|
|
|
name = g_strndup(typename,
|
|
|
|
strlen(typename) - strlen("-" TYPE_POWERPC_CPU));
|
2013-01-06 16:31:30 +08:00
|
|
|
(*s->cpu_fprintf)(s->file, "PowerPC %-16s PVR %08x\n",
|
2013-02-18 07:16:41 +08:00
|
|
|
name, pcc->pvr);
|
2013-02-25 11:43:17 +08:00
|
|
|
for (i = 0; ppc_cpu_aliases[i].alias != NULL; i++) {
|
2013-06-22 09:53:35 +08:00
|
|
|
PowerPCCPUAlias *alias = &ppc_cpu_aliases[i];
|
|
|
|
ObjectClass *alias_oc = ppc_cpu_class_by_alias(alias);
|
2013-02-23 15:34:28 +08:00
|
|
|
|
|
|
|
if (alias_oc != oc) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
(*s->cpu_fprintf)(s->file, "PowerPC %-16s (alias for %s)\n",
|
|
|
|
alias->alias, name);
|
|
|
|
}
|
2013-02-18 07:16:40 +08:00
|
|
|
g_free(name);
|
2013-01-06 16:31:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void ppc_cpu_list(FILE *f, fprintf_function cpu_fprintf)
|
|
|
|
{
|
|
|
|
CPUListState s = {
|
|
|
|
.file = f,
|
|
|
|
.cpu_fprintf = cpu_fprintf,
|
|
|
|
};
|
|
|
|
GSList *list;
|
|
|
|
|
|
|
|
list = object_class_get_list(TYPE_POWERPC_CPU, false);
|
|
|
|
list = g_slist_sort(list, ppc_cpu_list_compare);
|
|
|
|
g_slist_foreach(list, ppc_cpu_list_entry, &s);
|
|
|
|
g_slist_free(list);
|
2013-02-18 07:16:04 +08:00
|
|
|
|
2013-02-23 19:22:12 +08:00
|
|
|
#ifdef CONFIG_KVM
|
|
|
|
cpu_fprintf(f, "\n");
|
|
|
|
cpu_fprintf(f, "PowerPC %-16s\n", "host");
|
|
|
|
#endif
|
2013-01-06 16:31:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void ppc_cpu_defs_entry(gpointer data, gpointer user_data)
|
|
|
|
{
|
|
|
|
ObjectClass *oc = data;
|
|
|
|
CpuDefinitionInfoList **first = user_data;
|
2013-02-18 07:16:40 +08:00
|
|
|
const char *typename;
|
2013-01-06 16:31:30 +08:00
|
|
|
CpuDefinitionInfoList *entry;
|
|
|
|
CpuDefinitionInfo *info;
|
2013-02-18 07:16:44 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
|
2014-01-24 00:47:44 +08:00
|
|
|
if (!ppc_cpu_is_valid(pcc)) {
|
2013-02-18 07:16:44 +08:00
|
|
|
return;
|
|
|
|
}
|
2013-01-06 16:31:30 +08:00
|
|
|
|
2013-02-18 07:16:40 +08:00
|
|
|
typename = object_class_get_name(oc);
|
2013-01-06 16:31:30 +08:00
|
|
|
info = g_malloc0(sizeof(*info));
|
2013-02-18 07:16:40 +08:00
|
|
|
info->name = g_strndup(typename,
|
|
|
|
strlen(typename) - strlen("-" TYPE_POWERPC_CPU));
|
2013-01-06 16:31:30 +08:00
|
|
|
|
|
|
|
entry = g_malloc0(sizeof(*entry));
|
|
|
|
entry->value = info;
|
|
|
|
entry->next = *first;
|
|
|
|
*first = entry;
|
2005-07-03 04:59:34 +08:00
|
|
|
}
|
2012-04-06 20:39:03 +08:00
|
|
|
|
2012-08-15 11:17:36 +08:00
|
|
|
CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
|
2012-08-11 00:04:15 +08:00
|
|
|
{
|
|
|
|
CpuDefinitionInfoList *cpu_list = NULL;
|
2013-01-06 16:31:30 +08:00
|
|
|
GSList *list;
|
2013-02-23 15:52:24 +08:00
|
|
|
int i;
|
2012-08-11 00:04:15 +08:00
|
|
|
|
2013-01-06 16:31:30 +08:00
|
|
|
list = object_class_get_list(TYPE_POWERPC_CPU, false);
|
|
|
|
g_slist_foreach(list, ppc_cpu_defs_entry, &cpu_list);
|
|
|
|
g_slist_free(list);
|
2012-08-11 00:04:15 +08:00
|
|
|
|
2013-02-25 11:43:17 +08:00
|
|
|
for (i = 0; ppc_cpu_aliases[i].alias != NULL; i++) {
|
2013-06-22 09:53:35 +08:00
|
|
|
PowerPCCPUAlias *alias = &ppc_cpu_aliases[i];
|
2013-02-23 15:52:24 +08:00
|
|
|
ObjectClass *oc;
|
|
|
|
CpuDefinitionInfoList *entry;
|
|
|
|
CpuDefinitionInfo *info;
|
|
|
|
|
2013-06-22 09:53:35 +08:00
|
|
|
oc = ppc_cpu_class_by_alias(alias);
|
2013-02-23 15:52:24 +08:00
|
|
|
if (oc == NULL) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
info = g_malloc0(sizeof(*info));
|
|
|
|
info->name = g_strdup(alias->alias);
|
|
|
|
|
|
|
|
entry = g_malloc0(sizeof(*entry));
|
|
|
|
entry->value = info;
|
|
|
|
entry->next = cpu_list;
|
|
|
|
cpu_list = entry;
|
|
|
|
}
|
|
|
|
|
2013-01-06 16:31:30 +08:00
|
|
|
return cpu_list;
|
|
|
|
}
|
2012-08-11 00:04:15 +08:00
|
|
|
|
2013-06-22 01:09:18 +08:00
|
|
|
static void ppc_cpu_set_pc(CPUState *cs, vaddr value)
|
|
|
|
{
|
|
|
|
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
|
|
|
|
|
|
|
cpu->env.nip = value;
|
|
|
|
}
|
|
|
|
|
2013-08-26 00:53:55 +08:00
|
|
|
static bool ppc_cpu_has_work(CPUState *cs)
|
|
|
|
{
|
|
|
|
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
|
|
|
CPUPPCState *env = &cpu->env;
|
|
|
|
|
|
|
|
return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD);
|
|
|
|
}
|
|
|
|
|
2014-09-14 00:45:16 +08:00
|
|
|
static void ppc_cpu_exec_enter(CPUState *cs)
|
|
|
|
{
|
|
|
|
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
|
|
|
CPUPPCState *env = &cpu->env;
|
|
|
|
|
|
|
|
env->reserve_addr = -1;
|
|
|
|
}
|
|
|
|
|
2012-04-06 20:39:03 +08:00
|
|
|
/* CPUClass::reset() */
|
|
|
|
static void ppc_cpu_reset(CPUState *s)
|
|
|
|
{
|
|
|
|
PowerPCCPU *cpu = POWERPC_CPU(s);
|
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
|
|
|
|
CPUPPCState *env = &cpu->env;
|
2012-04-06 21:35:34 +08:00
|
|
|
target_ulong msr;
|
2014-03-19 21:03:57 +08:00
|
|
|
int i;
|
2012-04-06 21:35:34 +08:00
|
|
|
|
2012-04-06 20:39:03 +08:00
|
|
|
pcc->parent_reset(s);
|
|
|
|
|
2012-04-06 21:35:34 +08:00
|
|
|
msr = (target_ulong)0;
|
|
|
|
if (0) {
|
|
|
|
/* XXX: find a suitable condition to enable the hypervisor mode */
|
|
|
|
msr |= (target_ulong)MSR_HVB;
|
|
|
|
}
|
|
|
|
msr |= (target_ulong)0 << MSR_AP; /* TO BE CHECKED */
|
|
|
|
msr |= (target_ulong)0 << MSR_SA; /* TO BE CHECKED */
|
|
|
|
msr |= (target_ulong)1 << MSR_EP;
|
|
|
|
#if defined(DO_SINGLE_STEP) && 0
|
|
|
|
/* Single step trace mode */
|
|
|
|
msr |= (target_ulong)1 << MSR_SE;
|
|
|
|
msr |= (target_ulong)1 << MSR_BE;
|
|
|
|
#endif
|
|
|
|
#if defined(CONFIG_USER_ONLY)
|
|
|
|
msr |= (target_ulong)1 << MSR_FP; /* Allow floating point usage */
|
|
|
|
msr |= (target_ulong)1 << MSR_VR; /* Allow altivec usage */
|
2014-05-29 22:12:22 +08:00
|
|
|
msr |= (target_ulong)1 << MSR_VSX; /* Allow VSX usage */
|
2012-04-06 21:35:34 +08:00
|
|
|
msr |= (target_ulong)1 << MSR_SPE; /* Allow SPE usage */
|
|
|
|
msr |= (target_ulong)1 << MSR_PR;
|
2014-06-04 20:50:59 +08:00
|
|
|
#if defined(TARGET_PPC64)
|
|
|
|
msr |= (target_ulong)1 << MSR_TM; /* Transactional memory */
|
|
|
|
#endif
|
2014-05-29 22:12:20 +08:00
|
|
|
#if !defined(TARGET_WORDS_BIGENDIAN)
|
|
|
|
msr |= (target_ulong)1 << MSR_LE; /* Little-endian user mode */
|
2014-06-29 00:45:27 +08:00
|
|
|
if (!((env->msr_mask >> MSR_LE) & 1)) {
|
|
|
|
fprintf(stderr, "Selected CPU does not support little-endian.\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
2014-05-29 22:12:20 +08:00
|
|
|
#endif
|
2012-04-06 21:35:34 +08:00
|
|
|
#endif
|
2013-03-29 10:06:27 +08:00
|
|
|
|
2012-04-06 21:35:34 +08:00
|
|
|
#if defined(TARGET_PPC64)
|
|
|
|
if (env->mmu_model & POWERPC_MMU_64) {
|
2016-03-16 17:43:52 +08:00
|
|
|
msr |= (1ULL << MSR_SF);
|
2012-04-06 21:35:34 +08:00
|
|
|
}
|
|
|
|
#endif
|
2013-03-29 10:06:27 +08:00
|
|
|
|
|
|
|
hreg_store_msr(env, msr, 1);
|
|
|
|
|
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
env->nip = env->hreset_vector | env->excp_prefix;
|
|
|
|
if (env->mmu_model != POWERPC_MMU_REAL) {
|
|
|
|
ppc_tlb_invalidate_all(env);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-04-06 21:35:34 +08:00
|
|
|
hreg_compute_hflags(env);
|
|
|
|
env->reserve_addr = (target_ulong)-1ULL;
|
|
|
|
/* Be sure no exception or interrupt is pending */
|
|
|
|
env->pending_interrupts = 0;
|
2013-08-26 14:31:06 +08:00
|
|
|
s->exception_index = POWERPC_EXCP_NONE;
|
2012-04-06 21:35:34 +08:00
|
|
|
env->error_code = 0;
|
2012-09-26 01:12:21 +08:00
|
|
|
|
|
|
|
#if defined(TARGET_PPC64) && !defined(CONFIG_USER_ONLY)
|
target-ppc: Rework storage of VPA registration state
With PAPR guests, hypercalls allow registration of the Virtual Processor
Area (VPA), SLB shadow and dispatch trace log (DTL), each of which allow
for certain communication between the guest and hypervisor. Currently, we
store the addresses of the three areas and the size of the dtl in
CPUPPCState.
The SLB shadow and DTL are variable sized, with the size being retrieved
from within the registered memory area at the hypercall time. This size
can later be overwritten with other information, however, so we need to
save the size as of registration time. We already do this for the DTL,
but not for the SLB shadow, so this patch fixes that.
In addition, we change the storage of the VPA information to use fixed
size integer types which will make life easier for syncing this data with
KVM, which we will need in future.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-10-09 02:17:38 +08:00
|
|
|
env->vpa_addr = 0;
|
|
|
|
env->slb_shadow_addr = 0;
|
|
|
|
env->slb_shadow_size = 0;
|
|
|
|
env->dtl_addr = 0;
|
2012-09-26 01:12:21 +08:00
|
|
|
env->dtl_size = 0;
|
|
|
|
#endif /* TARGET_PPC64 */
|
|
|
|
|
2014-03-19 21:03:57 +08:00
|
|
|
for (i = 0; i < ARRAY_SIZE(env->spr_cb); i++) {
|
|
|
|
ppc_spr_t *spr = &env->spr_cb[i];
|
|
|
|
|
|
|
|
if (!spr->name) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
env->spr[i] = spr->default_value;
|
|
|
|
}
|
|
|
|
|
2012-04-06 21:35:34 +08:00
|
|
|
/* Flush all TLBs */
|
2013-09-04 08:19:44 +08:00
|
|
|
tlb_flush(s, 1);
|
2012-04-06 20:39:03 +08:00
|
|
|
}
|
|
|
|
|
2014-06-25 01:51:19 +08:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
static bool ppc_cpu_is_big_endian(CPUState *cs)
|
|
|
|
{
|
|
|
|
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
|
|
|
CPUPPCState *env = &cpu->env;
|
|
|
|
|
|
|
|
cpu_synchronize_state(cs);
|
|
|
|
|
|
|
|
return !msr_le;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-04-06 21:09:01 +08:00
|
|
|
static void ppc_cpu_initfn(Object *obj)
|
|
|
|
{
|
2013-01-17 19:13:41 +08:00
|
|
|
CPUState *cs = CPU(obj);
|
2012-04-06 21:09:01 +08:00
|
|
|
PowerPCCPU *cpu = POWERPC_CPU(obj);
|
2013-01-06 16:31:30 +08:00
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
|
2012-04-06 21:09:01 +08:00
|
|
|
CPUPPCState *env = &cpu->env;
|
|
|
|
|
2013-01-17 19:13:41 +08:00
|
|
|
cs->env_ptr = env;
|
2013-01-06 16:31:30 +08:00
|
|
|
|
2013-02-18 07:16:41 +08:00
|
|
|
env->msr_mask = pcc->msr_mask;
|
|
|
|
env->mmu_model = pcc->mmu_model;
|
|
|
|
env->excp_model = pcc->excp_model;
|
|
|
|
env->bus_model = pcc->bus_model;
|
|
|
|
env->insns_flags = pcc->insns_flags;
|
|
|
|
env->insns_flags2 = pcc->insns_flags2;
|
|
|
|
env->flags = pcc->flags;
|
|
|
|
env->bfd_mach = pcc->bfd_mach;
|
|
|
|
env->check_pow = pcc->check_pow;
|
2013-01-06 16:31:30 +08:00
|
|
|
|
|
|
|
#if defined(TARGET_PPC64)
|
2013-02-18 07:16:41 +08:00
|
|
|
if (pcc->sps) {
|
|
|
|
env->sps = *pcc->sps;
|
2013-01-06 16:31:30 +08:00
|
|
|
} else if (env->mmu_model & POWERPC_MMU_64) {
|
|
|
|
/* Use default sets of page sizes */
|
|
|
|
static const struct ppc_segment_page_sizes defsps = {
|
|
|
|
.sps = {
|
|
|
|
{ .page_shift = 12, /* 4K */
|
|
|
|
.slb_enc = 0,
|
|
|
|
.enc = { { .page_shift = 12, .pte_enc = 0 } }
|
|
|
|
},
|
|
|
|
{ .page_shift = 24, /* 16M */
|
|
|
|
.slb_enc = 0x100,
|
|
|
|
.enc = { { .page_shift = 24, .pte_enc = 0 } }
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
env->sps = defsps;
|
|
|
|
}
|
|
|
|
#endif /* defined(TARGET_PPC64) */
|
2013-01-20 08:26:37 +08:00
|
|
|
|
|
|
|
if (tcg_enabled()) {
|
|
|
|
ppc_translate_init();
|
|
|
|
}
|
2012-04-06 21:09:01 +08:00
|
|
|
}
|
|
|
|
|
2014-07-03 22:48:55 +08:00
|
|
|
static bool ppc_pvr_match_default(PowerPCCPUClass *pcc, uint32_t pvr)
|
|
|
|
{
|
|
|
|
return pcc->pvr == pvr;
|
|
|
|
}
|
|
|
|
|
2015-12-03 20:14:41 +08:00
|
|
|
static gchar *ppc_gdb_arch_name(CPUState *cs)
|
|
|
|
{
|
|
|
|
#if defined(TARGET_PPC64)
|
|
|
|
return g_strdup("powerpc:common64");
|
|
|
|
#else
|
|
|
|
return g_strdup("powerpc:common");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2012-04-06 20:39:03 +08:00
|
|
|
static void ppc_cpu_class_init(ObjectClass *oc, void *data)
|
|
|
|
{
|
|
|
|
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
|
|
|
|
CPUClass *cc = CPU_CLASS(oc);
|
2013-01-16 10:55:14 +08:00
|
|
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
|
|
|
|
|
|
|
pcc->parent_realize = dc->realize;
|
2014-07-03 22:48:55 +08:00
|
|
|
pcc->pvr_match = ppc_pvr_match_default;
|
2014-05-20 01:59:05 +08:00
|
|
|
pcc->interrupts_big_endian = ppc_cpu_interrupts_big_endian_always;
|
2013-01-16 10:55:14 +08:00
|
|
|
dc->realize = ppc_cpu_realizefn;
|
2013-06-10 04:11:49 +08:00
|
|
|
dc->unrealize = ppc_cpu_unrealizefn;
|
2012-04-06 20:39:03 +08:00
|
|
|
|
|
|
|
pcc->parent_reset = cc->reset;
|
|
|
|
cc->reset = ppc_cpu_reset;
|
2013-01-22 01:26:21 +08:00
|
|
|
|
|
|
|
cc->class_by_name = ppc_cpu_class_by_name;
|
2013-08-26 00:53:55 +08:00
|
|
|
cc->has_work = ppc_cpu_has_work;
|
2013-02-02 17:57:51 +08:00
|
|
|
cc->do_interrupt = ppc_cpu_do_interrupt;
|
2014-09-14 00:45:32 +08:00
|
|
|
cc->cpu_exec_interrupt = ppc_cpu_exec_interrupt;
|
2013-05-27 07:33:50 +08:00
|
|
|
cc->dump_state = ppc_cpu_dump_state;
|
|
|
|
cc->dump_statistics = ppc_cpu_dump_statistics;
|
2013-06-22 01:09:18 +08:00
|
|
|
cc->set_pc = ppc_cpu_set_pc;
|
2013-06-29 10:18:45 +08:00
|
|
|
cc->gdb_read_register = ppc_cpu_gdb_read_register;
|
|
|
|
cc->gdb_write_register = ppc_cpu_gdb_write_register;
|
2013-08-26 09:01:33 +08:00
|
|
|
#ifdef CONFIG_USER_ONLY
|
|
|
|
cc->handle_mmu_fault = ppc_cpu_handle_mmu_fault;
|
|
|
|
#else
|
2013-06-30 00:55:54 +08:00
|
|
|
cc->get_phys_page_debug = ppc_cpu_get_phys_page_debug;
|
2013-07-19 03:32:54 +08:00
|
|
|
cc->vmsd = &vmstate_ppc_cpu;
|
2013-10-02 00:19:33 +08:00
|
|
|
#if defined(TARGET_PPC64)
|
|
|
|
cc->write_elf64_note = ppc64_cpu_write_elf64_note;
|
|
|
|
#endif
|
2013-06-30 00:55:54 +08:00
|
|
|
#endif
|
2014-09-14 00:45:16 +08:00
|
|
|
cc->cpu_exec_enter = ppc_cpu_exec_enter;
|
2013-06-29 05:18:47 +08:00
|
|
|
|
|
|
|
cc->gdb_num_core_regs = 71;
|
2014-06-23 21:23:08 +08:00
|
|
|
|
|
|
|
#ifdef USE_APPLE_GDB
|
|
|
|
cc->gdb_read_register = ppc_cpu_gdb_read_register_apple;
|
|
|
|
cc->gdb_write_register = ppc_cpu_gdb_write_register_apple;
|
|
|
|
cc->gdb_num_core_regs = 71 + 32;
|
|
|
|
#endif
|
|
|
|
|
2015-12-03 20:14:41 +08:00
|
|
|
cc->gdb_arch_name = ppc_gdb_arch_name;
|
2013-07-07 21:08:22 +08:00
|
|
|
#if defined(TARGET_PPC64)
|
|
|
|
cc->gdb_core_xml_file = "power64-core.xml";
|
|
|
|
#else
|
|
|
|
cc->gdb_core_xml_file = "power-core.xml";
|
|
|
|
#endif
|
2014-06-25 01:51:19 +08:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
cc->virtio_is_big_endian = ppc_cpu_is_big_endian;
|
|
|
|
#endif
|
2013-10-16 00:33:37 +08:00
|
|
|
|
|
|
|
dc->fw_name = "PowerPC,UNKNOWN";
|
2012-04-06 20:39:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static const TypeInfo ppc_cpu_type_info = {
|
|
|
|
.name = TYPE_POWERPC_CPU,
|
|
|
|
.parent = TYPE_CPU,
|
|
|
|
.instance_size = sizeof(PowerPCCPU),
|
2012-04-06 21:09:01 +08:00
|
|
|
.instance_init = ppc_cpu_initfn,
|
2013-01-06 16:31:30 +08:00
|
|
|
.abstract = true,
|
2012-04-06 20:39:03 +08:00
|
|
|
.class_size = sizeof(PowerPCCPUClass),
|
|
|
|
.class_init = ppc_cpu_class_init,
|
|
|
|
};
|
|
|
|
|
|
|
|
static void ppc_cpu_register_types(void)
|
|
|
|
{
|
|
|
|
type_register_static(&ppc_cpu_type_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
type_init(ppc_cpu_register_types)
|