From patchwork Fri Nov 20 14:17:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Juszkiewicz X-Patchwork-Id: 329155 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp1349360ejb; Fri, 20 Nov 2020 07:11:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8I+DbwWv8aARBY6ejt4/QtlzgoMox+uCrgq5RCBxVnfPjsV+XzFXjSL8Bd8bZAXz0w952 X-Received: by 2002:a67:31d2:: with SMTP id x201mr13392256vsx.24.1605885086915; Fri, 20 Nov 2020 07:11:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605885086; cv=none; d=google.com; s=arc-20160816; b=P5L6v+dNDZOv3vSNdq9kLPWg3vbH3dSSRw9F1P/AXlYjEgxzju+zLKzWZzle5epnUt 1q1bvG4nz2j0D8MMsc5C7tNRTpePk04SbmNtii9M6/6Vlu7LDSvpjtFJlG3CAVVjARZA f6ON1UunuH2/VrN/1Yhp63oSboxUN8FYk6LiVJVwwaonisIArW7xm3xvh/h5stMxNqAH 7XhJj4n0CGI3EC/iwB97cf/lxzViPUp8zCHfZFOdHov5/Ux2mfjTlZuYq3E1MbiD0TKj PSbzgymGfGu9sSV0YhYm4F4cFF9QuiZMq50r2T6fqaTfcg1J51xwk3nbKsB6x+dcZWAG ykug== 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:message-id:date:subject:to:from; bh=OtoAX/fDCEUBE7DL6XMej4vk4ZkRaIZuFHNwbvb4sB8=; b=ArIvrcz5XHC1m2c1igdZ9p33lWY4NVeLCYDDIG6y2vXItE2c94VamwKUTaloGss86a yeHrDjHibAGBxLYCdhbxh5F98699vBm6qwH67fER1zGbmpGwmROa9fRrPcebyOitwZh7 g9dnAdJHQoDOJ8y+j29dm7P4t1PMqHXcm09XFHfSghLNF2sDUxdj8b2TkGlx6F38bE0G bqVC+ihuxBFO8qWmfe564Eg+lxTZzVwUFbqxPQBplaYYIYjMHIHdPwtSYOi6XHuNc8lt HiUBQZyYzt2J0rIHdsqpoqwdBuuEvbiElQCkU4jepsSpLeJgE0a2o9SUNDRvtDcuM8o5 p7Iw== 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 y16si595681vsn.195.2020.11.20.07.11.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Nov 2020 07:11:26 -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]:46962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kg84M-0006Wh-AL for patch@linaro.org; Fri, 20 Nov 2020 10:11:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kg7E9-0002tW-5h; Fri, 20 Nov 2020 09:17:29 -0500 Received: from muminek.juszkiewicz.com.pl ([213.251.184.221]:35314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kg7E7-0002iK-1D; Fri, 20 Nov 2020 09:17:28 -0500 Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id A652226036D; Fri, 20 Nov 2020 15:17:22 +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 Ol5HqVUr2XQl; Fri, 20 Nov 2020 15:17:20 +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 09EC026026E; Fri, 20 Nov 2020 15:17:19 +0100 (CET) From: Marcin Juszkiewicz To: qemu-arm@nongnu.org Subject: [PATCH] sbsa-ref: allow to use Cortex-A53/57/72 cpus Date: Fri, 20 Nov 2020 15:17:05 +0100 Message-Id: <20201120141705.246690-1-marcin.juszkiewicz@linaro.org> X-Mailer: git-send-email 2.28.0 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-Mailman-Approved-At: Fri, 20 Nov 2020 10:11:12 -0500 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 -- 2.28.0 Reviewed-by: Richard Henderson diff --git hw/arm/sbsa-ref.c hw/arm/sbsa-ref.c index 7d9e180c0d..b9909279f1 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -143,6 +143,24 @@ static const int sbsa_ref_irqmap[] = { [SBSA_GWDT] = 16, }; +static const char *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); }