From nobody Wed Nov 27 08:30:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700090599; cv=none; d=zohomail.com; s=zohoarc; b=CkopGk331pyPcJG3VKakt0TuIyQ5PXUZbHfQT+RKjS+vRyb90oS4OhBowfXL6vvqqJ8hzTN/LwZsxYIOYsyt79Em981O2wcfS5LkExt9ASWg3f+lmSBtQRCOif/sjuDeQSGsU7+iFOO1gS3GXOk3L2zi+81agXd+Q01uX1EH2Dk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700090599; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2b/fiTOaFIPayjBXev06ScNhrp2HmeigNrv9VMh5ovk=; b=JpOfaOk++FgNxcRbTcfQvzpCc5ptzeMl7d13xb2FnJaOdOMA4LXTapi7+1IividkIaryjO1GgWBDFvyeFbcF+ibm+tPSjmgImhPEuIPz/kPAEBovFHiVd1RMcAvgtufSUKtJfCpLSTXFmXV/8/hOVQy5ei1dadHfSqZiMPNJeIQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17000905991741005.559129126515; Wed, 15 Nov 2023 15:23:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3PDQ-0007cF-BT; Wed, 15 Nov 2023 18:22:36 -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 1r3PDN-0007bX-0a for qemu-devel@nongnu.org; Wed, 15 Nov 2023 18:22:33 -0500 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3PDL-0003T0-DK for qemu-devel@nongnu.org; Wed, 15 Nov 2023 18:22:32 -0500 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2c83ffcdbe3so2446821fa.1 for ; Wed, 15 Nov 2023 15:22:30 -0800 (PST) Received: from m1x-phil.lan ([176.176.130.62]) by smtp.gmail.com with ESMTPSA id o23-20020a17090611d700b009829d2e892csm7773426eja.15.2023.11.15.15.22.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Nov 2023 15:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700090549; x=1700695349; 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=2b/fiTOaFIPayjBXev06ScNhrp2HmeigNrv9VMh5ovk=; b=kSp+JYLMDgnYLsCdGO7WBL65O7ChFMPwz8VB9cx+lWlsLPMB9Ts3cmKbTSnS+mQSZt irk5nrlWHbU52C4lbdrci5G8EPqzxuOkTPbvUTHszKyPWyojkiHIPdwsRO8EKPKO1td7 G85j8GFXrwcYhKmQ8Kn5HbZaXCGGdkGwwqopTX5nIFFRsy6ZQ2RrlbG4ozVLYbves/7i iYJ9yi0OjqakQC3wstKLkRAskBaBXw+UKD2XAgdw3m0oQVdo0m0ebiRibKdx0kvZ/CZ9 l4n/Py+UL42c/hrdSAbuCR/I4jHmTe4yOpdk1G9wmueufanK2aOpQYWGuXWi2lKaDv7y 9RlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700090549; x=1700695349; 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=2b/fiTOaFIPayjBXev06ScNhrp2HmeigNrv9VMh5ovk=; b=dpH2DLMEtiTyuMT+rplgxm9XSLYo+pt3u+Zu8XaDnX5gKy96PPJNsdX85LbfHPoSB8 OOle0qMH0hBhrXPH5GN/XItmZHmyaOG7PQAIp0NJ1CLdmldlmkVD8tsosnAJLS0OU56m mQPYV/FaEp+xqxmSb1WG5aLEsH0z3pjEq76akxYXsPlHysjg/Wgw42rWKHjHPbUrOGYc W8VexHlgcGDqQQxGM2y5TXLeFE8IEDsY22z6WmjfSid50LpYq0S9q8BvRcxICrOsBcxk fwpk5TSXVHObO6eKSntDkAt6ByngZ/i5MBhFpPbtakFtVUB/FHumImLTggEgurLfBoLY sflg== X-Gm-Message-State: AOJu0YzGfE6u6RtpRur8RzZKT9bI81tCS0YNI65XVpykinUnzW7vbyjd qKuqHQvB4o5HW/sGVClpH82LZy10AOZmQP0UAdI= X-Google-Smtp-Source: AGHT+IHEbeePqx0jQtu88QOZNtD+dZ9Ms5p6Swi3vNEO+Zb/Qjl7zdx+dHncO06iF/Yw51YlPKFDBQ== X-Received: by 2002:a2e:be28:0:b0:2c0:20e3:990f with SMTP id z40-20020a2ebe28000000b002c020e3990fmr5655014ljq.10.1700090549239; Wed, 15 Nov 2023 15:22:29 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Arnaud Minier , =?UTF-8?q?In=C3=A8s=20Varhol?= , Tyrone Ting , Subbaraya Sundeep , Hao Wu , Felipe Balbi , Gavin Shan , Igor Mammedov , Subbaraya Sundeep , Peter Maydell , Eduardo Habkost , Alistair Francis , Alexandre Iooss , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 5/6] hw/arm/npcm7xx_boards: Simplify setting MachineClass::valid_cpu_types[] Date: Thu, 16 Nov 2023 00:21:52 +0100 Message-ID: <20231115232154.4515-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231115232154.4515-1-philmd@linaro.org> References: <20231115232154.4515-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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: pass client-ip=2a00:1450:4864:20::230; envelope-from=philmd@linaro.org; helo=mail-lj1-x230.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700090600670100005 The npcm7xx Soc is created with a Cortex-A9 core, see in hw/arm/npcm7xx.c: static void npcm7xx_init(Object *obj) { NPCM7xxState *s =3D NPCM7XX(obj); for (int i =3D 0; i < NPCM7XX_MAX_NUM_CPUS; i++) { object_initialize_child(obj, "cpu[*]", &s->cpu[i], ARM_CPU_TYPE_NAME("cortex-a9")); } The MachineClass::default_cpu_type field is ignored: delete it. Use the common code introduced in commit c9cf636d48 ("machine: Add a valid_cpu_types property") to check for valid CPU type at the board level. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/npcm7xx_boards.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index 2aef579aac..98f9af27e7 100644 --- a/hw/arm/npcm7xx_boards.c +++ b/hw/arm/npcm7xx_boards.c @@ -121,15 +121,8 @@ static NPCM7xxState *npcm7xx_create_soc(MachineState *= machine, uint32_t hw_straps) { NPCM7xxMachineClass *nmc =3D NPCM7XX_MACHINE_GET_CLASS(machine); - MachineClass *mc =3D MACHINE_CLASS(nmc); Object *obj; =20 - if (strcmp(machine->cpu_type, mc->default_cpu_type) !=3D 0) { - error_report("This board can only be used with %s", - mc->default_cpu_type); - exit(1); - } - obj =3D object_new_with_props(nmc->soc_type, OBJECT(machine), "soc", &error_abort, NULL); object_property_set_uint(obj, "power-on-straps", hw_straps, &error_abo= rt); @@ -462,13 +455,17 @@ static void npcm7xx_set_soc_type(NPCM7xxMachineClass = *nmc, const char *type) =20 static void npcm7xx_machine_class_init(ObjectClass *oc, void *data) { + static const char *machine_valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-a9"), + NULL + }; MachineClass *mc =3D MACHINE_CLASS(oc); =20 mc->no_floppy =3D 1; mc->no_cdrom =3D 1; mc->no_parallel =3D 1; mc->default_ram_id =3D "ram"; - mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a9"); + mc->valid_cpu_types =3D machine_valid_cpu_types; } =20 /* --=20 2.41.0