target/ppc: cpu_init: Deduplicate 440 SPR registration
Move some of the 440 registers that are being repeated in the 440* CPUs to register_440_sprs. Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20220216162426.1885923-11-farosas@linux.ibm.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
This commit is contained in:
parent
674f45096f
commit
49ed82b29a
@ -1396,6 +1396,32 @@ static void register_440_sprs(CPUPPCState *env)
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
/* Processor identification */
|
||||
spr_register(env, SPR_BOOKE_PIR, "PIR",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_pir,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_IAC3, "IAC3",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_IAC4, "IAC4",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_DVC1, "DVC1",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_DVC2, "DVC2",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
}
|
||||
|
||||
/* SPR shared between PowerPC 40x implementations */
|
||||
@ -2513,31 +2539,6 @@ static void init_proc_440EP(CPUPPCState *env)
|
||||
register_BookE_sprs(env, 0x000000000000FFFFULL);
|
||||
register_440_sprs(env);
|
||||
register_usprgh_sprs(env);
|
||||
/* Processor identification */
|
||||
spr_register(env, SPR_BOOKE_PIR, "PIR",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_pir,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_IAC3, "IAC3",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_IAC4, "IAC4",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_DVC1, "DVC1",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_DVC2, "DVC2",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_MCSR, "MCSR",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
@ -2653,31 +2654,7 @@ static void init_proc_440GP(CPUPPCState *env)
|
||||
register_BookE_sprs(env, 0x000000000000FFFFULL);
|
||||
register_440_sprs(env);
|
||||
register_usprgh_sprs(env);
|
||||
/* Processor identification */
|
||||
spr_register(env, SPR_BOOKE_PIR, "PIR",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_pir,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_IAC3, "IAC3",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_IAC4, "IAC4",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_DVC1, "DVC1",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
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;
|
||||
@ -2734,31 +2711,6 @@ static void init_proc_440x5(CPUPPCState *env)
|
||||
register_BookE_sprs(env, 0x000000000000FFFFULL);
|
||||
register_440_sprs(env);
|
||||
register_usprgh_sprs(env);
|
||||
/* Processor identification */
|
||||
spr_register(env, SPR_BOOKE_PIR, "PIR",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_pir,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_IAC3, "IAC3",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_IAC4, "IAC4",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_DVC1, "DVC1",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_DVC2, "DVC2",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
&spr_read_generic, &spr_write_generic,
|
||||
0x00000000);
|
||||
|
||||
spr_register(env, SPR_BOOKE_MCSR, "MCSR",
|
||||
SPR_NOACCESS, SPR_NOACCESS,
|
||||
|
Loading…
Reference in New Issue
Block a user