From patchwork Tue Nov 24 12:59:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Juszkiewicz X-Patchwork-Id: 331390 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp486671ilb; Tue, 24 Nov 2020 04:59:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzE2bq4zP7RJqH7ToZB7wf9foAi6n9M4EAxOv5D0XYmEjRexJsjWOB6NpwN262+dJV+6KzO X-Received: by 2002:a25:cc0c:: with SMTP id l12mr6921006ybf.90.1606222789946; Tue, 24 Nov 2020 04:59:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606222789; cv=none; d=google.com; s=arc-20160816; b=a7JYZrvsi+1MksffQpxUkwQgf+KWM0sQzDyY3aAOskTmNzpDzdAVE+tpeRXNFitixs CjqIE1JY6MVdWrpHC1/UA/qni1l/y9rhEMgbdtkbMML6njoL+Rglj1rOWgQbMfYPf+Yq zUTbKhJ+sNbZfRKyMEXTs2+b9to6KGvx7NyWtgJLGN8HQE1B3IARJPAlpX2FdakdNx9i uzQYi6Slc69CGiVI5Kf/mm5A1BsyLytEMJ8G6Qvv4W8k5CU4maI0foYn44jovbu+DklF 0tn1Lta0V9uriQT9ROVwnGQ+QAxf3EimXbokegP1rHRQnHAOJoaIfVLzQACIboxslfsW hB/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=tsokdVPyR0Osi/tkKsJyjpQGEsEzVkuzOC4YH1h/lQk=; b=f/SzQikZgYWSZNAUfToogPVwGWiKBx6kKISPkg0UmAOR8HjE7AsuLqi0V/eViE7JGi 2ky+85wgmNMwdNTi9vugQsXX86EBS5eipwi0rrr6wtS8J4UfI+Kdt9H/+tAlOXL0ipJU sXHe1xHX5C/3ZLr5DB0zTiUJK9szAidcTgJu1v9VIY5Ipo7NIPImqLS3pfw4hAI/CA44 qKNx7a0fiQJigVU5/aw3y4/oISPVjHh2sLK+UZ008yr49p1j5dzNFvKA06wjJzplSXn1 ihH0Vz3zxxFAzZOt6CiJriVPn40dWH+evQsC8RJ8Zp2kkYTP1/kw8pBgzP3rQ3yLuwhy IT5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p18si17200363ybl.48.2020.11.24.04.59.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Nov 2020 04:59:49 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khXvB-0006Xv-AV for patch@linaro.org; Tue, 24 Nov 2020 07:59:49 -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) X-Virus-Scanned: Debian amavisd-new at juszkiewicz.com.pl 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) 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 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_Biernacki?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.28.0 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[] = { [SBSA_GWDT] = 16, }; +static const char * const valid_cpus[] = { + 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 = 0; i < ARRAY_SIZE(valid_cpus); i++) { + if (strcmp(cpu, valid_cpus[i]) == 0) { + return true; + } + } + return false; +} + static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx) { uint8_t clustersz = 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; - 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); }