From patchwork Mon Jan 29 15:18:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 767388 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp937997wro; Mon, 29 Jan 2024 07:19:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuGWXqARzYlLiwIrtgnudiGQh80LLKG71Tv2/lTXVJjYAXE42O4sbdY1Gxr1egpBdJsqfW X-Received: by 2002:ac8:7f4b:0:b0:429:cfa7:4218 with SMTP id g11-20020ac87f4b000000b00429cfa74218mr6206195qtk.71.1706541586855; Mon, 29 Jan 2024 07:19:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706541586; cv=none; d=google.com; s=arc-20160816; b=lEGwtL2Gn5RRGu/XR5I04H513It9BIvuChqYlPIrdEd8pUH+tsSsIY1a6uMnHLj0+Y Mgp0Y7pWBPjqrrzrJEka2gfG91inrCZw49FXutFYZQhDESRo4C4hX3FrUTaaOaAMmQKw PDM1eNgA3AvfaUORl4Y8kyULin5r8UeT/aGw5hctcTS6psxUfnjVQTUxlLa0IHK1McmS FMFVoYSTLLyxIyCt5aaHglyIF5OzOezxYUo6huUJo3uKunbu6MNq8V0eO6AUHBS1crGT /gypz/QCU0rUwAfuwpL840CHDBObUbRn+tPtkXuQZiEETLIZQUo252oe78Mbhim1BIJQ wgFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=xtXJej6F9O2lSIbmdUvlDD/icBrkbUZ4loB0TQu2OEE=; fh=36wJ/nYrPLZmRQQgalgeL37C59AM5Zbikh1oCIbsvWY=; b=vPb1F+d/nnfIJqaOi6kW34Xr5YePpwdg0EnnsCtXiEnqEIkRkcQnLsCVpPqyc+XhFo oU/e4EbnRS8cxO+mmeQw4fuHgpI5OiJD76/awgcGRNZZ7CKgu/rdSVDgulQpE12AbaUZ Co0WtSWDfAUtE9oTUBGQIA1HUt0vryTQTAsphVG983L28IzMZdz8V2ueCXEVI+eHxtv3 NgNsXkUOhMo5T/SS5eKqHMMDyuQb6/kt+RtY7OIaZRFW50XlvuJHrjkLqY9It9DIJ04f nKadg0gyHdlsvBxjBQ/H+N/gC4l4p0MYlB8SGcbzHmVgOsGr/0Kn/w2erC19lNEIGxuC IOIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HiM4rDVJ; 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=pass (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 l7-20020a05622a050700b0042a74088b6dsi7755716qtx.455.2024.01.29.07.19.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jan 2024 07:19:46 -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; dkim=pass header.i=@linaro.org header.s=google header.b=HiM4rDVJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUTPy-0007zA-2I; Mon, 29 Jan 2024 10:19:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUTPw-0007uY-9I for qemu-devel@nongnu.org; Mon, 29 Jan 2024 10:19:24 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUTPu-0007XQ-Il for qemu-devel@nongnu.org; Mon, 29 Jan 2024 10:19:24 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40e8d3b29f2so38884725e9.1 for ; Mon, 29 Jan 2024 07:19:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706541561; x=1707146361; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xtXJej6F9O2lSIbmdUvlDD/icBrkbUZ4loB0TQu2OEE=; b=HiM4rDVJVvjLcYtFC5JkQE+wQzB0gXQ1yeMAQ9jgyNkK6QCqAbr8SVjas9EmOFrWll jJ6fvhWZG+SQazLgQ0vYpFOpgPcWKq6QplQ1rEuPi0EereawdDODq/CLcq2JAuEp2LR3 AdwC/mux80sBrRQ6uWE2M1omtPBQbT/Koy/qKkvVjojxMYSb7tTVja6zsi+Nrb/bDPv+ fjQJ3RZYCfp4ALGCzYHvppT51p4+OGD0VeCXdRq8IXzDLOnl01TktAazjIh5X/GaDaQc GShBEpBaIiX0epNcxeN0G1DfPJDxAVgQ99tmPsp+lAb6vH/j6UxmnnNiC07TQrUiexHO Cuag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706541561; x=1707146361; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xtXJej6F9O2lSIbmdUvlDD/icBrkbUZ4loB0TQu2OEE=; b=SyJzT5FrQWysYCHJs0Ook7LWdzN5Nh42MrmC2SdaLE3zft2Vwv+aI1uI5uUybZ6WG6 sO6YdF9jN5EH+RlxdCSr/KH7GrhZOWH3shY4LzwmxWofm+2pnXGC6SbQw3n+Q+Z/2jFG 6JnqXOlWzXL3PL7X2wk3I54BJUtJhAeyNmmtXbUMQ5K7ikSK1Gud0cDHFws1rPUHBkIG 4pn1AasrsSedCtdMykb1s+C9x5KgHmMX+TcA1+Dy/H4HgE8zYRx8fk2QnpkiogGoB5S3 r4C/8KrDEVpvLOvS8ZHdHKsd9bvkgiC472+meW+D/CSmwA8+ex3e1hXYTdwoCnZKhTu3 4eCA== X-Gm-Message-State: AOJu0YwL9e/uwbBeAYpHCUy+nf54xwlaXUbVytLcjs6AQMWJTrnhL4UN +DpYnzl08wznHrz5cto6qoR6cH1WWkHbvi7I7JOUMOLvKdZUKdNaOtM5mvDbUHpoNEpmX0HxSjx M X-Received: by 2002:a05:600c:4708:b0:40e:f69b:a9d7 with SMTP id v8-20020a05600c470800b0040ef69ba9d7mr2647959wmo.10.1706541560911; Mon, 29 Jan 2024 07:19:20 -0800 (PST) Received: from m1x-phil.lan ([176.187.219.39]) by smtp.gmail.com with ESMTPSA id r20-20020a05600c459400b0040e527602c8sm14361157wmo.9.2024.01.29.07.19.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 29 Jan 2024 07:19:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Tyrone Ting , Subbaraya Sundeep , Alistair Francis , Igor Mitsyanko , Hao Wu , "Edgar E. Iglesias" , Peter Maydell , Rob Herring , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Gavin Shan Subject: [PATCH v3 8/9] hw/arm/vexpress: Check for CPU types in machine_run_board_init() Date: Mon, 29 Jan 2024 16:18:27 +0100 Message-ID: <20240129151828.59544-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240129151828.59544-1-philmd@linaro.org> References: <20240129151828.59544-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Leverage the common code introduced in commit c9cf636d48 ("machine: Add a valid_cpu_types property") to check for the single valid CPU type. Remove the now unused MachineClass::default_cpu_type field. Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/vexpress.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index f1b45245d5..1a14c1933e 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -783,22 +783,30 @@ static void vexpress_class_init(ObjectClass *oc, void *data) static void vexpress_a9_class_init(ObjectClass *oc, void *data) { + static const char * const valid_cpu_types[] = { + ARM_CPU_TYPE_NAME("cortex-a9"), + NULL + }; MachineClass *mc = MACHINE_CLASS(oc); VexpressMachineClass *vmc = VEXPRESS_MACHINE_CLASS(oc); mc->desc = "ARM Versatile Express for Cortex-A9"; - mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a9"); + mc->valid_cpu_types = valid_cpu_types; vmc->daughterboard = &a9_daughterboard; } static void vexpress_a15_class_init(ObjectClass *oc, void *data) { + static const char * const valid_cpu_types[] = { + ARM_CPU_TYPE_NAME("cortex-a15"), + NULL + }; MachineClass *mc = MACHINE_CLASS(oc); VexpressMachineClass *vmc = VEXPRESS_MACHINE_CLASS(oc); mc->desc = "ARM Versatile Express for Cortex-A15"; - mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15"); + mc->valid_cpu_types = valid_cpu_types; vmc->daughterboard = &a15_daughterboard;