[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 18/27] target/ppc: cpu_init: Reuse init_proc_603 for the e300
From: |
David Gibson |
Subject: |
Re: [PATCH 18/27] target/ppc: cpu_init: Reuse init_proc_603 for the e300 |
Date: |
Wed, 16 Feb 2022 13:27:24 +1100 |
On Tue, Feb 15, 2022 at 06:41:39PM -0300, Fabiano Rosas wrote:
> init_proc_603 is defined after init_proc_e300, so I had to move some
> code around to make it work.
>
> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> target/ppc/cpu_init.c | 104 +++++++++++++++++++-----------------------
> 1 file changed, 46 insertions(+), 58 deletions(-)
>
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index baf6be5b0d..8fbd205699 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -3269,64 +3269,6 @@ POWERPC_FAMILY(e200)(ObjectClass *oc, void *data)
> POWERPC_FLAG_BUS_CLK;
> }
>
> -static void init_proc_e300(CPUPPCState *env)
> -{
> - register_ne_601_sprs(env);
> - register_sdr1_sprs(env);
> - register_603_sprs(env);
> - register_e300_sprs(env);
> -
> - /* Memory management */
> - register_low_BATs(env);
> - register_high_BATs(env);
> - register_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_archcpu(env));
> -}
> -
> -POWERPC_FAMILY(e300)(ObjectClass *oc, void *data)
> -{
> - DeviceClass *dc = DEVICE_CLASS(oc);
> - PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
> -
> - dc->desc = "e300 core";
> - pcc->init_proc = init_proc_e300;
> - pcc->check_pow = check_pow_hid0;
> - 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;
> - 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);
> - pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
> - pcc->excp_model = POWERPC_EXCP_6xx;
> - 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;
> -}
> -
> enum fsl_e500_version {
> fsl_e500v1,
> fsl_e500v2,
> @@ -3882,6 +3824,52 @@ POWERPC_FAMILY(603E)(ObjectClass *oc, void *data)
> POWERPC_FLAG_BE | POWERPC_FLAG_BUS_CLK;
> }
>
> +static void init_proc_e300(CPUPPCState *env)
> +{
> + init_proc_603(env);
> + register_e300_sprs(env);
> +}
> +
> +POWERPC_FAMILY(e300)(ObjectClass *oc, void *data)
> +{
> + DeviceClass *dc = DEVICE_CLASS(oc);
> + PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
> +
> + dc->desc = "e300 core";
> + pcc->init_proc = init_proc_e300;
> + pcc->check_pow = check_pow_hid0;
> + 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;
> + 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);
> + pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
> + pcc->excp_model = POWERPC_EXCP_6xx;
> + 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;
> +}
> +
> static void init_proc_604(CPUPPCState *env)
> {
> register_ne_601_sprs(env);
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- Re: [PATCH 13/27] target/ppc: cpu_init: Deduplicate 7xx SPR registration, (continued)
- [PATCH 12/27] target/ppc: cpu_init: Deduplicate 604 SPR registration, Fabiano Rosas, 2022/02/15
- [PATCH 16/27] target/ppc: cpu_init: Move e300 SPR registration into a function, Fabiano Rosas, 2022/02/15
- [PATCH 17/27] target/ppc: cpu_init: Move 604e SPR registration into a function, Fabiano Rosas, 2022/02/15
- [PATCH 14/27] target/ppc: cpu_init: Deduplicate 755 SPR registration, Fabiano Rosas, 2022/02/15
- [PATCH 18/27] target/ppc: cpu_init: Reuse init_proc_603 for the e300, Fabiano Rosas, 2022/02/15
- Re: [PATCH 18/27] target/ppc: cpu_init: Reuse init_proc_603 for the e300,
David Gibson <=
- [PATCH 15/27] target/ppc: cpu_init: Move 755 L2 cache SPRs into a function, Fabiano Rosas, 2022/02/15
- [PATCH 21/27] target/ppc: cpu_init: Rename software TLB function, Fabiano Rosas, 2022/02/15
- [PATCH 25/27] target/ppc: cpu_init: Move SPR registration macros to a header, Fabiano Rosas, 2022/02/15
- [PATCH 23/27] target/ppc: cpu_init: Remove register_usprg3_sprs, Fabiano Rosas, 2022/02/15
- [PATCH 19/27] target/ppc: cpu_init: Reuse init_proc_604 for the 604e, Fabiano Rosas, 2022/02/15