From patchwork Mon Jan 22 19:58:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10179131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 03EC960353 for ; Mon, 22 Jan 2018 20:03:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E852127CF9 for ; Mon, 22 Jan 2018 20:03:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC6B428438; Mon, 22 Jan 2018 20:03:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7D49C27CF9 for ; Mon, 22 Jan 2018 20:03:22 +0000 (UTC) Received: from localhost ([::1]:34531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ediJN-0002lf-Fq for patchwork-qemu-devel@patchwork.kernel.org; Mon, 22 Jan 2018 15:03:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ediEc-0007QV-Ks for qemu-devel@nongnu.org; Mon, 22 Jan 2018 14:58:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ediEb-00021r-Pt for qemu-devel@nongnu.org; Mon, 22 Jan 2018 14:58:26 -0500 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:35387) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ediEb-00021S-HL for qemu-devel@nongnu.org; Mon, 22 Jan 2018 14:58:25 -0500 Received: by mail-lf0-x241.google.com with SMTP id a204so12136510lfa.2 for ; Mon, 22 Jan 2018 11:58:25 -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; bh=C0BYsfJ3pYCOoWQKiAd020Cr0maIfV1l8iCFFOGvaqQ=; b=QUqfvc+NYmKFd5Ty5NPHTh/CofHXOFtwvckPei12YJkwHTEVpmlSGPHJW4SGA/Afv7 RIR09z44I1jhFTEqHn40/b4XtWzkfq+UBO+gAJLO/wo5WkeI2wfQpzY//JuB8fNegKJC l290OMp1PMBChEOeyD/LvaPCSPyst9BPuxAlY6CU7488t4vhiPLPF/YdsmesGex0KMSC KWpy1vKezZCZvZMnM6mDwwN8fQAz4mAxTbpZ815ku0D0qgJDD5ew0e40MVZGA+XmNvLI wf6B4moSrClXZokAHJN4dIve67Sb0h7W7djHwl7Ggg2Ejlk+c2YaBeCJdTP1j8OuJha4 ncuA== 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; bh=C0BYsfJ3pYCOoWQKiAd020Cr0maIfV1l8iCFFOGvaqQ=; b=n0ECkt9nu0scumFQ8oCGHA35y9Kckibl2VXSxVGcBzTSfbVzKOj3Sn5uu1MTjw1UAn NkyHxRBt1ltBE+qzr5BkEE/4lRv2Z4q0d+i+QOhuhwjhpSVliK9Rl4CuQytDfkAOeiTR 4Al8Sbp8clG7bl9+JRsHhBGtDTaqrW+LifCkvvI8w5ZJtwx0QToGXcL3Zsftyqkrb8Dl WbX5VLIKKmRRPH6a9jupnIztGu4K06QvcuxwMIruf08iMnI5+dhRADVK5o5wOHEEqUS/ 1NScw3p/8ouj7Lc0eXxPCUVErAtJqbq7ntRJtBWfEK69u5eKleU4cetMl3z/0Mbj9q0M 0XpA== X-Gm-Message-State: AKwxytdsqjbjF5ntLfdgkFqIB+ZX16guO598E80SH+9jEI2WigONL9po TFS0CEPvnM7MKVN7fBCwZ02NdQ== X-Google-Smtp-Source: AH8x225/frVSjh9E0bVeZgxDdAN5IE5z/8iKuHI1FIvM9Xy4iNHj7bBXCt0XotuzfxBG8+nK4Y2Iqw== X-Received: by 10.25.99.129 with SMTP id v1mr1731682lfi.137.1516651103526; Mon, 22 Jan 2018 11:58:23 -0800 (PST) Received: from octofox.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id t81sm2671343lff.47.2018.01.22.11.58.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Jan 2018 11:58:22 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Mon, 22 Jan 2018 11:58:03 -0800 Message-Id: <1516651083-14706-1-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::241 Subject: [Qemu-devel] [PATCH v2 08/10] target/xtensa: allow different default CPU for MMU/noMMU 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: Max Filippov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Define default core for noMMU configurations and use that core as machine default with noMMU XTFPGA machines. This is done to avoid offering non-working configuration (MMU core on a noMMU machine) as a default. Signed-off-by: Max Filippov --- Changes v1->v2: - use fsf core for both MMU and noMMU in qemu-system-xtensaeb hw/xtensa/xtfpga.c | 16 ++++++++-------- target/xtensa/cpu.h | 7 ++++++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 74ba8ba22996..76ea9702150b 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -584,10 +584,10 @@ static void xtfpga_lx60_nommu_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->desc = "lx60 noMMU EVB (" XTENSA_DEFAULT_CPU_MODEL ")"; + mc->desc = "lx60 noMMU EVB (" XTENSA_DEFAULT_CPU_NOMMU_MODEL ")"; mc->init = xtfpga_lx60_nommu_init; mc->max_cpus = 4; - mc->default_cpu_type = XTENSA_DEFAULT_CPU_TYPE; + mc->default_cpu_type = XTENSA_DEFAULT_CPU_NOMMU_TYPE; } static const TypeInfo xtfpga_lx60_nommu_type = { @@ -616,10 +616,10 @@ static void xtfpga_lx200_nommu_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->desc = "lx200 noMMU EVB (" XTENSA_DEFAULT_CPU_MODEL ")"; + mc->desc = "lx200 noMMU EVB (" XTENSA_DEFAULT_CPU_NOMMU_MODEL ")"; mc->init = xtfpga_lx200_nommu_init; mc->max_cpus = 4; - mc->default_cpu_type = XTENSA_DEFAULT_CPU_TYPE; + mc->default_cpu_type = XTENSA_DEFAULT_CPU_NOMMU_TYPE; } static const TypeInfo xtfpga_lx200_nommu_type = { @@ -648,10 +648,10 @@ static void xtfpga_ml605_nommu_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->desc = "ml605 noMMU EVB (" XTENSA_DEFAULT_CPU_MODEL ")"; + mc->desc = "ml605 noMMU EVB (" XTENSA_DEFAULT_CPU_NOMMU_MODEL ")"; mc->init = xtfpga_ml605_nommu_init; mc->max_cpus = 4; - mc->default_cpu_type = XTENSA_DEFAULT_CPU_TYPE; + mc->default_cpu_type = XTENSA_DEFAULT_CPU_NOMMU_TYPE; } static const TypeInfo xtfpga_ml605_nommu_type = { @@ -680,10 +680,10 @@ static void xtfpga_kc705_nommu_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->desc = "kc705 noMMU EVB (" XTENSA_DEFAULT_CPU_MODEL ")"; + mc->desc = "kc705 noMMU EVB (" XTENSA_DEFAULT_CPU_NOMMU_MODEL ")"; mc->init = xtfpga_kc705_nommu_init; mc->max_cpus = 4; - mc->default_cpu_type = XTENSA_DEFAULT_CPU_TYPE; + mc->default_cpu_type = XTENSA_DEFAULT_CPU_NOMMU_TYPE; } static const TypeInfo xtfpga_kc705_nommu_type = { diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index d9404aa50ab5..f300c02c07c8 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -503,10 +503,15 @@ void xtensa_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, #ifdef TARGET_WORDS_BIGENDIAN #define XTENSA_DEFAULT_CPU_MODEL "fsf" +#define XTENSA_DEFAULT_CPU_NOMMU_MODEL "fsf" #else #define XTENSA_DEFAULT_CPU_MODEL "dc232b" +#define XTENSA_DEFAULT_CPU_NOMMU_MODEL "de212" #endif -#define XTENSA_DEFAULT_CPU_TYPE XTENSA_CPU_TYPE_NAME(XTENSA_DEFAULT_CPU_MODEL) +#define XTENSA_DEFAULT_CPU_TYPE \ + XTENSA_CPU_TYPE_NAME(XTENSA_DEFAULT_CPU_MODEL) +#define XTENSA_DEFAULT_CPU_NOMMU_TYPE \ + XTENSA_CPU_TYPE_NAME(XTENSA_DEFAULT_CPU_NOMMU_MODEL) #define cpu_init(cpu_model) cpu_generic_init(TYPE_XTENSA_CPU, cpu_model)