From d21ee6331e18c768fc141540912ec871e3bea393 Mon Sep 17 00:00:00 2001 From: KONRAD Frederic Date: Mon, 7 Aug 2017 17:50:47 +0200 Subject: booke206: allow to specify an mmucfg value at the init This allows to init the MMUCFG SPR with a non NULL value. Signed-off-by: KONRAD Frederic Signed-off-by: David Gibson --- target/ppc/translate_init.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'target/ppc') diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c index 1586e28055..4104629df7 100644 --- a/target/ppc/translate_init.c +++ b/target/ppc/translate_init.c @@ -1842,7 +1842,7 @@ static inline uint32_t gen_tlbncfg(uint32_t assoc, uint32_t minsize, /* BookE 2.06 storage control registers */ static void gen_spr_BookE206(CPUPPCState *env, uint32_t mas_mask, - uint32_t *tlbncfg) + uint32_t *tlbncfg, uint32_t mmucfg) { #if !defined(CONFIG_USER_ONLY) const char *mas_names[8] = { @@ -1886,7 +1886,7 @@ static void gen_spr_BookE206(CPUPPCState *env, uint32_t mas_mask, spr_register(env, SPR_MMUCFG, "MMUCFG", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, SPR_NOACCESS, - 0x00000000); /* TOFIX */ + mmucfg); switch (env->nb_ways) { case 4: spr_register(env, SPR_BOOKE_TLB3CFG, "TLB3CFG", @@ -4615,7 +4615,7 @@ static void init_proc_e200(CPUPPCState *env) &spr_read_spefscr, &spr_write_spefscr, 0x00000000); /* Memory management */ - gen_spr_BookE206(env, 0x0000005D, NULL); + gen_spr_BookE206(env, 0x0000005D, NULL, 0); /* XXX : not implemented */ spr_register(env, SPR_HID0, "HID0", SPR_NOACCESS, SPR_NOACCESS, @@ -4900,6 +4900,7 @@ static void init_proc_e500(CPUPPCState *env, int version) | 0x0020; /* 32 kb */ uint32_t l1cfg1 = 0x3800 /* 8 ways */ | 0x0020; /* 32 kb */ + uint32_t mmucfg = 0; #if !defined(CONFIG_USER_ONLY) int i; #endif @@ -4974,7 +4975,7 @@ static void init_proc_e500(CPUPPCState *env, int version) default: cpu_abort(CPU(cpu), "Unknown CPU: " TARGET_FMT_lx "\n", env->spr[SPR_PVR]); } - gen_spr_BookE206(env, 0x000000DF, tlbncfg); + gen_spr_BookE206(env, 0x000000DF, tlbncfg, mmucfg); /* XXX : not implemented */ spr_register(env, SPR_HID0, "HID0", SPR_NOACCESS, SPR_NOACCESS, -- cgit v1.2.3