From nobody Sun Feb 8 23:06:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511734330004733.2920729260759; Sun, 26 Nov 2017 14:12:10 -0800 (PST) Received: from localhost ([::1]:58209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJ59g-0000ac-6U for importer@patchew.org; Sun, 26 Nov 2017 17:12:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJ4y0-0007E5-Ah for qemu-devel@nongnu.org; Sun, 26 Nov 2017 17:00:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJ4xz-00031C-BS for qemu-devel@nongnu.org; Sun, 26 Nov 2017 17:00:00 -0500 Received: from mail-io0-x243.google.com ([2607:f8b0:4001:c06::243]:44915) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJ4xz-00030t-6I; Sun, 26 Nov 2017 16:59:59 -0500 Received: by mail-io0-x243.google.com with SMTP id w127so34264019iow.11; Sun, 26 Nov 2017 13:59:58 -0800 (PST) Received: from localhost.localdomain (173-29-146-33.client.mchsi.com. [173.29.146.33]) by smtp.gmail.com with ESMTPSA id n184sm6517218itg.9.2017.11.26.13.59.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Nov 2017 13:59:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=TJAJXOR/ehzfP1ww7RkAbe452LOJolfOsTRo8k3iy/c=; b=C+78g0SG4iA9n6vBgOedySPMEztC39aPnJ0606w/kZ3GeFsEKTn7psoraUi5LJT9C4 ShBSnAewbJxrf/7yU2BV0hFlRteFXLNpmFY7gWC0kAOlEcAZi9GKvTiWHtcxgrLW4uNi v/HuNi4EYlIq3p7euaJuTcqrHVgT9Hmp09Bzj9SKd18ycD+arULkDYimXkTGkzdgr2em l9If2EZmJXTY9aWsqt+4oi62YrEc7vfvWlQae8893C5TYUzU5zjCH00SyGIASUeqpyF0 GefzHzLCBOxj46mUT1M/7+mD3X+N0SRQmKu+e6lRD9S5QP2JoTHl2MiT5yX5Il0vOSBH l7BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=TJAJXOR/ehzfP1ww7RkAbe452LOJolfOsTRo8k3iy/c=; b=DwBPHGYT0hyGUkgKDy9U2LFOe5Z824MEZy9gABHGJS+oUbMxg5rdM1O2GJCV/fBvSF RH9819IOxYulXG7BM5sPPFVvay/qRMyAjFZ9OWhl7nzi8755v3zm0lGh24gRrwp9ZnO7 QoVh57uH8BNOd6maxacq9c2oi9fuOmRjcnm6ssCSxE78kiR7GLV8jn6NZRqzmhMGW7so 9vhvsWFmfw4m31bH9Hz+dr7YjKSUUKDpbdyIxShYWTg7Me8Snu3GZJ2Qg+zcXFALlgXc m3aFhXaAkEzZ5a5nZmFQtTcrgPwCO/bMlb4a6fs8r2eAYpYsVEnFQAEVd/6SHrUKOs2C /cyA== X-Gm-Message-State: AJaThX7V7LgajgswZVZQ1vsdbqdZyspZrOhSV7/tr3ZJWwSU/QR2jN/3 UE6MhlpLpYDtJnx5aN95NyU= X-Google-Smtp-Source: AGs4zMYmND0Ip068A/YT5J+6AelEDQLaZ2SRWfBUC/hEuzNsryDTNi6lQWAeUS3iFXM2IsmL5IZulA== X-Received: by 10.107.47.93 with SMTP id j90mr32579224ioo.262.1511733598530; Sun, 26 Nov 2017 13:59:58 -0800 (PST) From: Michael Davidsaver To: Alexander Graf , David Gibson Date: Sun, 26 Nov 2017 15:59:12 -0600 Message-Id: <9eb62eb9ad147fef563d259f24c1891b4b2e8511.1511731946.git.mdavidsaver@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c06::243 Subject: [Qemu-devel] [PATCH 14/17] e500: split mpc8544ds specific initialization X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Davidsaver , qemu-ppc@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" split off the remaining board specific parts of e500_init() as mpc85xx_init() which will be used by the existing mpc8544ds and generic e500 boards. Signed-off-by: Michael Davidsaver --- hw/ppc/e500.c | 49 ++++++++++++++++++++++++++++++++----------------- hw/ppc/e500.h | 3 ++- hw/ppc/e500plat.c | 2 +- hw/ppc/mpc8544ds.c | 2 +- 4 files changed, 36 insertions(+), 20 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index b0c8495aef..0ac7cdf6a1 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -690,7 +690,32 @@ static void ppce500_power_off(void *opaque, int line, = int on) } } =20 -void ppce500_init(MachineState *machine, PPCE500Params *params) + +void ppce500_init(MachineState *machine, uint32_t decrementer_freq) +{ + int i; + for (i =3D 0; i < smp_cpus; i++) { + PowerPCCPU *cpu; + CPUState *cs; + CPUPPCState *env; + + cpu =3D POWERPC_CPU(cpu_create(machine->cpu_type)); + env =3D &cpu->env; + cs =3D CPU(cpu); + + if (env->mmu_model !=3D POWERPC_MMU_BOOKE206) { + error_report("MMU model %i not supported by this machine.", + env->mmu_model); + exit(1); + } + + env->spr_cb[SPR_BOOKE_PIR].default_value =3D cs->cpu_index =3D i; + + ppc_booke_timers_init(cpu, decrementer_freq, PPC_TIMER_E500); + } +} + +void mpc85xx_init(MachineState *machine, PPCE500Params *params) { MemoryRegion *address_space_mem =3D get_system_memory(); MemoryRegion *ram =3D g_new(MemoryRegion, 1); @@ -716,31 +741,21 @@ void ppce500_init(MachineState *machine, PPCE500Param= s *params) CPUPPCState *firstenv =3D NULL; MemoryRegion *ccsr_addr_space; SysBusDevice *s; + CPUState *cs; =20 - for (i =3D 0; i < smp_cpus; i++) { + ppce500_init(machine, 400000000); + + CPU_FOREACH(cs) { PowerPCCPU *cpu; - CPUState *cs; =20 - cpu =3D POWERPC_CPU(cpu_create(machine->cpu_type)); + cpu =3D POWERPC_CPU(cs); env =3D &cpu->env; - cs =3D CPU(cpu); =20 - if (env->mmu_model !=3D POWERPC_MMU_BOOKE206) { - fprintf(stderr, "MMU model %i not supported by this machine.\n= ", - env->mmu_model); - exit(1); - } =20 + /* Register reset handler */ if (!firstenv) { firstenv =3D env; - } =20 - env->spr_cb[SPR_BOOKE_PIR].default_value =3D cs->cpu_index =3D i; - - ppc_booke_timers_init(cpu, 400000000, PPC_TIMER_E500); - - /* Register reset handler */ - if (!i) { /* Primary CPU */ struct boot_info *boot_info; boot_info =3D g_malloc0(sizeof(struct boot_info)); diff --git a/hw/ppc/e500.h b/hw/ppc/e500.h index 70ba1d8f4f..350be17462 100644 --- a/hw/ppc/e500.h +++ b/hw/ppc/e500.h @@ -24,7 +24,8 @@ typedef struct PPCE500Params { hwaddr spin_base; } PPCE500Params; =20 -void ppce500_init(MachineState *machine, PPCE500Params *params); +void ppce500_init(MachineState *machine, uint32_t decrementer_freq); +void mpc85xx_init(MachineState *machine, PPCE500Params *params); =20 hwaddr booke206_page_size_to_tlb(uint64_t size); =20 diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c index e59e80fb9e..103efc68c2 100644 --- a/hw/ppc/e500plat.c +++ b/hw/ppc/e500plat.c @@ -55,7 +55,7 @@ static void e500plat_init(MachineState *machine) params.mpic_version =3D OPENPIC_MODEL_FSL_MPIC_20; } =20 - ppce500_init(machine, ¶ms); + mpc85xx_init(machine, ¶ms); } =20 static void e500plat_machine_init(MachineClass *mc) diff --git a/hw/ppc/mpc8544ds.c b/hw/ppc/mpc8544ds.c index 1717953ec7..7de4ed8ae2 100644 --- a/hw/ppc/mpc8544ds.c +++ b/hw/ppc/mpc8544ds.c @@ -47,7 +47,7 @@ static void mpc8544ds_init(MachineState *machine) exit(1); } =20 - ppce500_init(machine, ¶ms); + mpc85xx_init(machine, ¶ms); } =20 =20 --=20 2.11.0