From nobody Thu May 2 05:11:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1606222914; cv=none; d=zohomail.com; s=zohoarc; b=W+GnLukSDdWmjaZu3F2S5hWhWNqSIqnT6zjXd10Pi8ML+rBDDAW0gnwnUvrNEquriYeXcxvMjNO3YKz57wSik+C439jpEQuxnnnNXX08ppdXKaIIjfXO4opirk+7fXuo4D07te77Sb3DPDUfc8HNuyTWewF+9gZ7B4DhWdIb4VY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606222914; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tsokdVPyR0Osi/tkKsJyjpQGEsEzVkuzOC4YH1h/lQk=; b=CJ/RI06HgcmNTU/pzM5rqPvmf9jMlwhr1D2fKvr/sUS1mQRc2T8ea+wXbILft8WXxjJ+oaRgoLdO/f6yDKOTWT5z1EHT8HCcQKwrdegOV16kuzukvWShCsoTPg/SHROmx2bnDqkzX8V4Bm77zBihdEWDEBRw9JZsZx2ILuiS9Xw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606222914784591.6546182588341; Tue, 24 Nov 2020 05:01:54 -0800 (PST) Received: from localhost ([::1]:34750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khXx9-0008EC-Fi for importer@patchew.org; Tue, 24 Nov 2020 08:01:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khXum-0006Wz-M2; Tue, 24 Nov 2020 07:59:25 -0500 Received: from muminek.juszkiewicz.com.pl ([213.251.184.221]:48592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khXuj-0006v9-E4; Tue, 24 Nov 2020 07:59:24 -0500 Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 03042260374; Tue, 24 Nov 2020 13:59:18 +0100 (CET) Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WsSyoJWW_Mgt; Tue, 24 Nov 2020 13:59:15 +0100 (CET) Received: from puchatek.local (89-67-26-161.dynamic.chello.pl [89.67.26.161]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 7367026026F; Tue, 24 Nov 2020 13:59:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at juszkiewicz.com.pl From: Marcin Juszkiewicz To: qemu-arm@nongnu.org Subject: [PATCH] sbsa-ref: allow to use Cortex-A53/57/72 cpus Date: Tue, 24 Nov 2020 13:59:12 +0100 Message-Id: <20201124125912.1108631-1-marcin.juszkiewicz@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: softfail client-ip=213.251.184.221; envelope-from=marcin.juszkiewicz@linaro.org; helo=muminek.juszkiewicz.com.pl X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcin Juszkiewicz , Peter Maydell , Leif Lindholm , =?UTF-8?q?Rados=C5=82aw=20Biernacki?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Trusted Firmware now supports A72 on sbsa-ref by default [1] so enable it for QEMU as well. A53 was already enabled there. 1. https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/7117 Signed-off-by: Marcin Juszkiewicz --- hw/arm/sbsa-ref.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git hw/arm/sbsa-ref.c hw/arm/sbsa-ref.c index 7d9e180c0d..4a5ea42938 100644 --- hw/arm/sbsa-ref.c +++ hw/arm/sbsa-ref.c @@ -143,6 +143,24 @@ static const int sbsa_ref_irqmap[] =3D { [SBSA_GWDT] =3D 16, }; =20 +static const char * const valid_cpus[] =3D { + ARM_CPU_TYPE_NAME("cortex-a53"), + ARM_CPU_TYPE_NAME("cortex-a57"), + ARM_CPU_TYPE_NAME("cortex-a72"), +}; + +static bool cpu_type_valid(const char *cpu) +{ + int i; + + for (i =3D 0; i < ARRAY_SIZE(valid_cpus); i++) { + if (strcmp(cpu, valid_cpus[i]) =3D=3D 0) { + return true; + } + } + return false; +} + static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx) { uint8_t clustersz =3D ARM_DEFAULT_CPUS_PER_CLUSTER; @@ -649,9 +667,8 @@ static void sbsa_ref_init(MachineState *machine) const CPUArchIdList *possible_cpus; int n, sbsa_max_cpus; =20 - if (strcmp(machine->cpu_type, ARM_CPU_TYPE_NAME("cortex-a57"))) { - error_report("sbsa-ref: CPU type other than the built-in " - "cortex-a57 not supported"); + if (!cpu_type_valid(machine->cpu_type)) { + error_report("mach-virt: CPU type %s not supported", machine->cpu_= type); exit(1); } =20 --=20 2.28.0