From patchwork Tue Jan 23 06:38:38 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: 765183 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1460771wrx; Mon, 22 Jan 2024 22:40:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKCFjAnrwyXjdjZESdCcd6F64//uQ8eaTov9aku+hYSq1e6leJP3o1Qe+u41PzoY2S5dRB X-Received: by 2002:a05:622a:4:b0:429:d600:e94f with SMTP id x4-20020a05622a000400b00429d600e94fmr301990qtw.127.1705992037484; Mon, 22 Jan 2024 22:40:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705992037; cv=none; d=google.com; s=arc-20160816; b=vl3dAC/FvE8kPYX5PdX2UJ0Q5zhQaY7LYa72mBFfBUDT/8vlpqQ/Aoh5pkmnj2zytP a3V31tkxcjkpwxAK7LAswIbhFoK+Z4WZPkPdB7hjMIBc8N5KvKfHFX3D9GQuo8R+Qztm LWUx3kGxhN3fVQK0acTVg/cympQoo9vPMDYZVg1IaLBbFmH0bzaDV35jAUfjPMJBmGT5 wFnHNWm2nLpYbLn18KwFKnUX1nmL+G/UIMS0tQt0Ale3qLme7N9P//PVIfqeC1bVA1+c zk5TI2o0V56OReIfrBLg0K9hEFBQLKefYTvpTwFXdrLcO6tw8l6W9ZPJOq4WOOdFdyYR 422A== 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=TGD5FLvwAQGOZbUBjumYjpCbltGmL2kWHmZW0fC4bQw=; fh=HVoLZTw5hlqqes9L9DSbvdhxOE62q72aEHLq82QYnRw=; b=cmvu/4rGVZPl1t8hHzjlbohoID1Ons15XBTMdn+UiD9/dUaPGEPMGLhTe8oL1LFZuM A6kEqr/w/Be6QiqoYo6k6zPQmDVVMPc3EDCe5RhVD/2XhKP1C0ypqq8/XWg1uoUA9Yvk gfCKHx0hSF6Bt68slB2XeDsxyzujYhD+wE5g9vU24SQx767igvodaj7H/LD0gbZO3gSO QTKWtzD1lMcZyhPJNe4VQjhuEzVWI3BuHFDC0QJ/3JzNC2o+1jKc0XHTc4KpH4x13OLZ 7+fmp4+3TrusKQ608vrg4SgtUzsH5E0QrWytcykMaDFH86+WFcRFrsEfswrzv43eleI8 L59w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wx3QmEKN; 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 g18-20020ac85812000000b0042a39f5125asi4662273qtg.366.2024.01.22.22.40.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jan 2024 22:40:37 -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=Wx3QmEKN; 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 1rSARP-0003lm-83; Tue, 23 Jan 2024 01:39:23 -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 1rSARE-0003YF-Ba for qemu-devel@nongnu.org; Tue, 23 Jan 2024 01:39:12 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSARC-00085H-R0 for qemu-devel@nongnu.org; Tue, 23 Jan 2024 01:39:12 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a308db01df6so131907166b.0 for ; Mon, 22 Jan 2024 22:39:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705991949; x=1706596749; 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=TGD5FLvwAQGOZbUBjumYjpCbltGmL2kWHmZW0fC4bQw=; b=Wx3QmEKNfmy5DWwig7dxnedD/Y67Z+1/RP6+05kDmz+x3XPwmMgDn6eRhP95++Mch5 tGkqY6OVS4SWk1M2XCCvJi87c+qje9O4bNGPFWkyKeyd+naSN22w4SwAfsKruQD2xe5F bCk7J6V8qKGnn0p5Gb8ErCEku6rtWCzccqdg+cKChc8fg6CGBudxyFcrAzyQwho8Quy/ aczH9Lu7Oo3mXwbF17oODeyPh0eIkOCmDmgNZkg8M6b1Z8KcUHRVCsvzVNY/aMmGE8QW EOz5rppqAlf7dC8Pn0JC0AbhLsB8JmR9K2irBHbfZoXyHam5BdeotwZr4ctYWrql1wGj 8fsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705991949; x=1706596749; 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=TGD5FLvwAQGOZbUBjumYjpCbltGmL2kWHmZW0fC4bQw=; b=iwmC5XMew3YTh02JGBfZ6dUrzxXzLBp4FoEYQvO4PofQIFg8k9qm9CEM2ernhZYP2h rHr3iTRLpm8aQhEEuviG3wog6eDhl1OGAqmgToK79+Q55+VY0Gp2onctYDD411EP9Wib 3HO/DAplJxzI6sBLFUtduIH8ZAdLwSn2AJ4e75RSBdhGgpM4C+IzfKYRi1tNWaNEOoee SRtolMzw9WduJ5nFVcDcAjlmK39TDEaIN2PVjUAuB0tDRY62U0w2E8fnU0Mkq46UmVY2 mPV/yv5EaNflV5wCc0yuiQquZajekYop3kAojACEMSrOZEBuZrgJHdh8tNKqh4YEjAKX Y0TA== X-Gm-Message-State: AOJu0Yy/qScclHDrKTU1pOLHpxCwfTIco5NX2NzgmpBg4VsJLwVs+F30 xjmWo/m+Mol7Fh96qWEbOlPnSa3GNh8zUk4VtSQVM47r9ZRuQrcyw+VDKKYRZJPzVPHwxGcGjVd oGek= X-Received: by 2002:a17:906:1748:b0:a28:d1d7:c255 with SMTP id d8-20020a170906174800b00a28d1d7c255mr1280066eje.204.1705991949062; Mon, 22 Jan 2024 22:39:09 -0800 (PST) Received: from m1x-phil.lan ([176.187.194.78]) by smtp.gmail.com with ESMTPSA id tj3-20020a170907c24300b00a30982ea105sm796938ejc.42.2024.01.22.22.39.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 22 Jan 2024 22:39:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Alistair Francis , Gavin Shan , Andrew Jeffery , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , qemu-arm@nongnu.org, Igor Mitsyanko , Joel Stanley , "Edgar E. Iglesias" , Rob Herring , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/8] hw/arm/aspeed/2400: Check for CPU types in machine_run_board_init() Date: Tue, 23 Jan 2024 07:38:38 +0100 Message-ID: <20240123063842.35255-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240123063842.35255-1-philmd@linaro.org> References: <20240123063842.35255-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=philmd@linaro.org; helo=mail-ej1-x632.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 Restrict MachineClass::valid_cpu_types[] to the single valid CPU type. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater --- hw/arm/aspeed.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index cc59176563..e0e0877b1d 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -1147,6 +1147,11 @@ static int aspeed_soc_num_cpus(const char *soc_name) return sc->num_cpus; } +static const char * const ast2400_a1_valid_cpu_types[] = { + ARM_CPU_TYPE_NAME("arm926"), + NULL +}; + static void aspeed_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -1175,6 +1180,7 @@ static void aspeed_machine_palmetto_class_init(ObjectClass *oc, void *data) amc->spi_model = "mx25l25635f"; amc->num_cs = 1; amc->i2c_init = palmetto_bmc_i2c_init; + mc->valid_cpu_types = ast2400_a1_valid_cpu_types; mc->default_ram_size = 256 * MiB; mc->default_cpus = mc->min_cpus = mc->max_cpus = aspeed_soc_num_cpus(amc->soc_name); @@ -1192,6 +1198,7 @@ static void aspeed_machine_quanta_q71l_class_init(ObjectClass *oc, void *data) amc->spi_model = "mx25l25635e"; amc->num_cs = 1; amc->i2c_init = quanta_q71l_bmc_i2c_init; + mc->valid_cpu_types = ast2400_a1_valid_cpu_types; mc->default_ram_size = 128 * MiB; mc->default_cpus = mc->min_cpus = mc->max_cpus = aspeed_soc_num_cpus(amc->soc_name); @@ -1211,6 +1218,7 @@ static void aspeed_machine_supermicrox11_bmc_class_init(ObjectClass *oc, amc->num_cs = 1; amc->macs_mask = ASPEED_MAC0_ON | ASPEED_MAC1_ON; amc->i2c_init = palmetto_bmc_i2c_init; + mc->valid_cpu_types = ast2400_a1_valid_cpu_types; mc->default_ram_size = 256 * MiB; }