From nobody Tue Nov 26 16:20:29 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=1706162222; cv=none; d=zohomail.com; s=zohoarc; b=dau7TDfCHTh+0YYQygTFCy+Kn/L8iWv7Ju47jHkoQ7x8Ze2bP8fg1Ic9jIQqXYRvBEyV+baRDT+OYPfFXV5X+Fuprs8bilBgvdaWMPSd43AuvK1cHsAhrmXT3ZC7aOEQI9P1AFhnySYkhEVF1p2eaCifEpMNpEMLmEo7zLoWfWQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706162222; 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=Gkow43WWl5V6H8QLUuDhGBGmx/UArXnxCzhocw6DFQw=; b=iMqPCHAqfIKX/m62hdAWGXOUb/jC+HNktpD6QiS1Y8uHjZ8fGeN/RAIDW1WcC/Cg1HKWwCKOtWqYsWs0V7Xf5cwPJ7fhf9JkxCTp23URY0IcUipm7ClUxFdnj1ZXtz/o+6bdOnQ5/yAoBPnQikfL89gEFnS4AgjmG4xrwy1rFGc= 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 1706162222820962.7942486597317; Wed, 24 Jan 2024 21:57:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSsiW-0003I5-0m; Thu, 25 Jan 2024 00:56:00 -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 1rSsiT-0003HG-L9 for qemu-devel@nongnu.org; Thu, 25 Jan 2024 00:55:57 -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 1rSsiS-00016q-3I for qemu-devel@nongnu.org; Thu, 25 Jan 2024 00:55:57 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40eb033c1b0so44445895e9.2 for ; Wed, 24 Jan 2024 21:55:54 -0800 (PST) Received: from m1x-phil.lan (lec62-h02-176-184-19-125.dsl.sta.abo.bbox.fr. [176.184.19.125]) by smtp.gmail.com with ESMTPSA id he7-20020a05600c540700b0040ead97f70dsm1228336wmb.24.2024.01.24.21.55.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 21:55:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706162153; x=1706766953; 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=Gkow43WWl5V6H8QLUuDhGBGmx/UArXnxCzhocw6DFQw=; b=MSXfe48SzhIzxgIUwQuWi1PlbtR4vLrLSb5TL45jPhm1AZ4ruhZ9UexPQmPgu+W03s MB4fxp+ZNe2DxfK62LkxQmdtERTeaxJPc25c8wf4u8avuxT4gccBN3KmMriXuDa0Gs9v VsU2RXu7mD7mmoDrTDMArdSzFGnCpDXAPniDHSfcpUt4LvWGz4/OO4XTtAQMSXc45TQh TenmjMeXXDqNlyqMKC1xiC2jxecWQj5HeLzyCJ8ivdqCRiBL0UM3PoiGtMTC/iSh+1dR 2JshvHTADl+cJlwSzeEdmxU/RY8duAlv2IzydHy3BsduM3HogecxKH8dJIf6fqLJXQq3 pz4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706162153; x=1706766953; 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=Gkow43WWl5V6H8QLUuDhGBGmx/UArXnxCzhocw6DFQw=; b=buBS0cj2/yzbxNVIPUbyNOQUBDBOlpFXwdlQR5q8vMBb6I4HhQ+o8cBK6hWdo5B9v0 pfXoThTFtQ/bFHHnrSGkorhJ0/OjdXvZfpu9NP7gPlgyiqEr79guN3DguZ9QLG7RbzgG HfNTD2r5+XajCqJjMe7daAb2L4WvPIuPPMCCHXWdgRciAkr9LUPp7bnwJ6wvMC/u1L80 EJ3FDtar0uUkRfSEuw+ZZK5oZFtIOjjDtNgPRZE3a+TIL1Vpj1N6a/1xs1DUYLrAuXil FUG5IWTe8K1nUY93C5enGIzAP3QlxuJsn2Xgyj/Nli97E0JaQ5IVUXaJPDkytSy+J2Ng 6JpA== X-Gm-Message-State: AOJu0Ywf0aH3Ji37XXaKbn1bflhg24BaVyonzMyU0EfKZcWhwn/zOun6 cDhlssyVli3E/xX7eTopSF3SKBkayJje76ysc6VPbxzazZ3l07il9zuxU4rkdTJtALQNq95RVhk K X-Google-Smtp-Source: AGHT+IFe5t/MdXZXHR+Of8UGTWKbVarNAppkn/KAXXOoHLEafoCVOZvGvhP2Alb+8hZHsfbsIC7O9g== X-Received: by 2002:a05:600c:34ce:b0:40e:5bb8:7fb1 with SMTP id d14-20020a05600c34ce00b0040e5bb87fb1mr175548wmq.47.1706162153220; Wed, 24 Jan 2024 21:55:53 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-arm@nongnu.org, Andrew Jeffery , Joel Stanley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Gavin Shan Subject: [PATCH v3 1/5] hw/arm/aspeed: Remove dead code Date: Thu, 25 Jan 2024 06:55:40 +0100 Message-ID: <20240125055544.79405-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240125055544.79405-1-philmd@linaro.org> References: <20240125055544.79405-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::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=ham 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: 1706162224213100005 Remove copy/paste typo from commit 6c323aba40 ("hw/arm/aspeed: Adding new machine Tiogapass in QEMU"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan --- hw/arm/aspeed.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index cc59176563..4bc292ff84 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -1301,7 +1301,6 @@ static void aspeed_machine_tiogapass_class_init(Objec= tClass *oc, void *data) mc->default_ram_size =3D 1 * GiB; mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D aspeed_soc_num_cpus(amc->soc_name); - aspeed_soc_num_cpus(amc->soc_name); }; =20 static void aspeed_machine_sonorapass_class_init(ObjectClass *oc, void *da= ta) --=20 2.41.0 From nobody Tue Nov 26 16:20:29 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=1706162302; cv=none; d=zohomail.com; s=zohoarc; b=NzEZtCbWi5ZjtE8EGmT/5BxKpQ4JcvkQvL4FYbDSTKq2sDcOSix090KojASnO6FnqdPnFQwWoCWtKJfrcO6lpnYYKkIbEp9jo0+1lWNopFi/DHwGr3SLW/0D+jEernHTrrkm8J/Tw0AyjTeuk3X8vtpaefKP3ACvhJVifcKCgnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706162302; 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=LJEHUrHwrIT1rKWRwjxDbaX0Pfnq9aLQleOdaQTs5wo=; b=mDLbEbVS8KO6zMRSkZDCriyP0icZsTP7qjEW4oIj2e7WR4u2Roba7V1yi/gpdBgQarGIr+dNA11UyXYxVO7XlAFAi9stetQKGFOo307fyu85MJzKmrbb2flX26G/cFPpuh3w8AWZiit6fhiSqGXRO28Rb1XR1b6A+nj6RQiCKKk= 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 1706162302748155.73512043372853; Wed, 24 Jan 2024 21:58:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSsia-0003Io-K2; Thu, 25 Jan 2024 00:56:04 -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 1rSsiY-0003IO-P4 for qemu-devel@nongnu.org; Thu, 25 Jan 2024 00:56:02 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSsiW-00017c-LH for qemu-devel@nongnu.org; Thu, 25 Jan 2024 00:56:02 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40ed252edd7so617125e9.0 for ; Wed, 24 Jan 2024 21:56:00 -0800 (PST) Received: from m1x-phil.lan (lec62-h02-176-184-19-125.dsl.sta.abo.bbox.fr. [176.184.19.125]) by smtp.gmail.com with ESMTPSA id fk15-20020a05600c0ccf00b0040e9f7dadc6sm1246791wmb.25.2024.01.24.21.55.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 21:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706162159; x=1706766959; 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=LJEHUrHwrIT1rKWRwjxDbaX0Pfnq9aLQleOdaQTs5wo=; b=QzZS1YwBmtBz3ojbAGMurPXeDuyjSwwAegyNdVCF3farpbgdKjFSKsy/eRgwkcsUB3 Ak5G0fgXwhvjFIvODWpQeAg4yqATEwimOFucOBAf1RxzsbluoeCtQgEvF0O8jsjAXbaN BIay5ZUcfFbz/BRtwa1vLGNgs68OT/P0xRSIeVHDK5sYYPojanN3yQcajVqf5uT37bWp swvK1WkE2aSZ6SFgP7IBLRHUyXRFYcFRpL3R5CyxqP85XQ5jWA5WiJs28SCBhwd/QFJM zV3w2n+m398sszlDEcKq+b4lI2xgxlfpDDzOR/VR4lmcafle5/eoVZz5WVOPwQRbUb9h eOHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706162159; x=1706766959; 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=LJEHUrHwrIT1rKWRwjxDbaX0Pfnq9aLQleOdaQTs5wo=; b=KEfRKUC5HP9p1Ckt33fzXEVAYLqx7P+A12exg0mH0v/pd3vHYN5ns8eIekocHVAq3L A4UAx3+WHv7xxHrqbDarSHWz4EICOBuouEcWAb+EPzxq0OGz427Nf8cJtvQk3Yd61tJk /N4aNFLJoOAu9I5PyoW8Pl39rvkkkAsAiYPLgHLMv/htiGiNUud5W7LEHHK+7aV8xf1l Tf655xEd9yZTsogxeg/V7NYvR7nY2tU6OwskFZiAqg4PGiq6aweb9w5EQcwtLRA/Ex4j jv0qWzxSD/PSs7XYqegESPdutSTSlTkMmj0sUbICVaSvtyic37DEtm+OeotsvIejHkzo 8+XA== X-Gm-Message-State: AOJu0Yw2jojCWBeMMCPV/77l19Gj1g4c/4lLHjVYD7aDEoBS0A7MlAIt 3spht01mFjmeJHRg5j5yj127N/VDAwNQcqllWLGg8likomd4X2FojjW6El1t/iYVL+CeNBOzEVO 9 X-Google-Smtp-Source: AGHT+IHCvKIVJaAVJwaZtt3+7OP4zquSVFl5Cr4sh4Qp8b4dFuoMciLinvFom4nSWQ2Os8vbiFa3ew== X-Received: by 2002:a05:600c:a41:b0:40e:89fe:255b with SMTP id c1-20020a05600c0a4100b0040e89fe255bmr109927wmq.160.1706162159016; Wed, 24 Jan 2024 21:55:59 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-arm@nongnu.org, Andrew Jeffery , Joel Stanley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gavin Shan Subject: [PATCH v3 2/5] hw/arm/aspeed: Set default CPU count using aspeed_soc_num_cpus() Date: Thu, 25 Jan 2024 06:55:41 +0100 Message-ID: <20240125055544.79405-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240125055544.79405-1-philmd@linaro.org> References: <20240125055544.79405-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::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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: 1706162304303100005 Since commit b7f1a0cb76 ("arm/aspeed: Compute the number of CPUs from the SoC definition") Aspeed machines use the aspeed_soc_num_cpus() helper to set the number of CPUs. Use it for the ast1030-evb (commit 356b230ed1 "aspeed/soc: Add AST1030 support") and supermicrox11-bmc (commit 40a38df55e "hw/arm/aspeed: Add board model for Supermicro X11 BMC") machines. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Gavin Shan --- hw/arm/aspeed.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 4bc292ff84..5b01a4dd28 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -1212,6 +1212,8 @@ static void aspeed_machine_supermicrox11_bmc_class_in= it(ObjectClass *oc, amc->macs_mask =3D ASPEED_MAC0_ON | ASPEED_MAC1_ON; amc->i2c_init =3D palmetto_bmc_i2c_init; mc->default_ram_size =3D 256 * MiB; + mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D + aspeed_soc_num_cpus(amc->soc_name); } =20 static void aspeed_machine_supermicro_x11spi_bmc_class_init(ObjectClass *o= c, @@ -1586,11 +1588,12 @@ static void aspeed_minibmc_machine_ast1030_evb_clas= s_init(ObjectClass *oc, mc->init =3D aspeed_minibmc_machine_init; amc->i2c_init =3D ast1030_evb_i2c_init; mc->default_ram_size =3D 0; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D 1; amc->fmc_model =3D "sst25vf032b"; amc->spi_model =3D "sst25vf032b"; amc->num_cs =3D 2; amc->macs_mask =3D 0; + mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D + aspeed_soc_num_cpus(amc->soc_name); } =20 static void aspeed_machine_qcom_dc_scm_v1_class_init(ObjectClass *oc, --=20 2.41.0 From nobody Tue Nov 26 16:20:29 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=1706162223; cv=none; d=zohomail.com; s=zohoarc; b=AD3cihVh48r75yXqcW5fxZIbwB2Yb7EVYxPbIJ3NB1/IVj2PHg4K+eliCpkqxlFAf7h7z/XFLsLp13MPePYGImbtwjakaKynJcpsMvyVtvs+HftzSMAspw7LZNjrg/IE+CxaMKC+4BGYDKeiLEPv1iNJ2rTCmYAAN0ok5a3icX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706162223; 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=QNfhqMn/7H2JfeWtmxECGiPrj1Y1rofAyE4BiaQU4SY=; b=X4pQG6Z8v41vpDDrApdYkBsrSB/xAq5RatUuRaAJKKvaLA60zrxjVufVUX66PbNY3T2Sxn8UQ4vxZzC28XRrev6hjnREDqOTbf06KQmCrqEV3Z0UwFAnhDnk4OqsBnqvbFpIN0lCRyOeVL9uaiFi3ZEW5VVuKzaeS830qp9BjR0= 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 1706162223032519.4794314805563; Wed, 24 Jan 2024 21:57:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSsig-0003Ke-UA; Thu, 25 Jan 2024 00:56:10 -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 1rSsif-0003Jq-Mw for qemu-devel@nongnu.org; Thu, 25 Jan 2024 00:56:09 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSsic-00018I-97 for qemu-devel@nongnu.org; Thu, 25 Jan 2024 00:56:09 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40e76626170so69884135e9.2 for ; Wed, 24 Jan 2024 21:56:05 -0800 (PST) Received: from m1x-phil.lan (lec62-h02-176-184-19-125.dsl.sta.abo.bbox.fr. [176.184.19.125]) by smtp.gmail.com with ESMTPSA id je1-20020a05600c1f8100b0040e5cf9a6c7sm1277836wmb.13.2024.01.24.21.56.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 21:56:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706162165; x=1706766965; 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=QNfhqMn/7H2JfeWtmxECGiPrj1Y1rofAyE4BiaQU4SY=; b=sPc1cilOChH3JpCpyzRlp+5TeKZssyJkXjkhvvztNSeu5eHmhYfb8U+Z9hyHUTpsBr PwyTfEA4X2dwf5rgM5NSArzU3eqlKWxzhdN1Ge3bU4hnmy6Dua6Tok4usUqxDGy1LPAC ekHzvmWXndbt55uD4zL1gZtoT3HmH8tuQHFweOHAAGUvflz7i27BXldyZXiLFwWZphRs oh1ynrJf5JGzXxrsy/AKbkSW4qrJmh+fJoJhgslDQvdIGRWTvvNQnUc0i6tArLJKIrnv feDDRkMob0jdofxD+Z5AmUlksT0da9W7Vjkji/PrQY3HWSN00ZphggOeHRPc7QW/27EE z7IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706162165; x=1706766965; 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=QNfhqMn/7H2JfeWtmxECGiPrj1Y1rofAyE4BiaQU4SY=; b=v3WCdFtiyX8cbc5baPrl8FlUEkQ0UOjEH2Xez+ovDqEMIneb7jUDWLTR97kUmJqDEq Ig8sIMPGGQE7qA+VTUSUucsmyVPPLWMSI5UMeNU+9m1wnhK6Vczwamvo4sdjSX4S8NfY Pix6ZheAfDwLxgMoSeVC2jkqA0guoQREb6xjSIa3FfeTXBeLsYZ8cfLYFb6VFW37+Cip bqm876nSguBhlrR64+KI9ckjuYuW7XLE85tRfYsMaQcistel2JXqZFU9nantSsRc/c9X 0mJblTssG5vXvtTigI1H/ZDODh0W+tvGoQeyWMI3ySL6n8RwHS3n9eL8HuzDxtTq8wT7 p55w== X-Gm-Message-State: AOJu0YxhOXb3mjXwn84pvOZHsc/zN1gFBGLXJQ6lHHiy/OCVSG2MR1ey 6fqq+cLFV5zsJlRupt5fmCKtK64HN/p4ISy7gGRUWNBCTwQB/PQIEIxwMsR5cB2ZPZ1mdMgJ0iS b X-Google-Smtp-Source: AGHT+IEuhveNkoI12PxJoigU1k+xZsEFy41xe0X/ekzS4XltdkIH8YQUG7oUarPWR4x/W6q8/8LoEQ== X-Received: by 2002:a7b:cb8a:0:b0:40e:5cb5:916c with SMTP id m10-20020a7bcb8a000000b0040e5cb5916cmr156743wmi.129.1706162164694; Wed, 24 Jan 2024 21:56:04 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-arm@nongnu.org, Andrew Jeffery , Joel Stanley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Gavin Shan Subject: [PATCH v3 3/5] hw/arm/aspeed: Init CPU defaults in a common helper Date: Thu, 25 Jan 2024 06:55:42 +0100 Message-ID: <20240125055544.79405-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240125055544.79405-1-philmd@linaro.org> References: <20240125055544.79405-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: 1706162224299100007 Rework aspeed_soc_num_cpus() as a new init_cpus_defaults() helper to reduce code duplication. Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/aspeed.c | 71 +++++++++++++++++++------------------------------ 1 file changed, 28 insertions(+), 43 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 5b01a4dd28..d2d490a6d1 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -1141,10 +1141,14 @@ static void aspeed_machine_class_props_init(ObjectC= lass *oc) "Change the SPI Flash model"); } =20 -static int aspeed_soc_num_cpus(const char *soc_name) +static void aspeed_machine_class_init_cpus_defaults(MachineClass *mc) { - AspeedSoCClass *sc =3D ASPEED_SOC_CLASS(object_class_by_name(soc_name)); - return sc->num_cpus; + AspeedMachineClass *amc =3D ASPEED_MACHINE_CLASS(mc); + AspeedSoCClass *sc =3D ASPEED_SOC_CLASS(object_class_by_name(amc->soc_= name)); + + mc->default_cpus =3D sc->num_cpus; + mc->min_cpus =3D sc->num_cpus; + mc->max_cpus =3D sc->num_cpus; } =20 static void aspeed_machine_class_init(ObjectClass *oc, void *data) @@ -1176,8 +1180,7 @@ static void aspeed_machine_palmetto_class_init(Object= Class *oc, void *data) amc->num_cs =3D 1; amc->i2c_init =3D palmetto_bmc_i2c_init; mc->default_ram_size =3D 256 * MiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static void aspeed_machine_quanta_q71l_class_init(ObjectClass *oc, void *d= ata) @@ -1193,8 +1196,7 @@ static void aspeed_machine_quanta_q71l_class_init(Obj= ectClass *oc, void *data) amc->num_cs =3D 1; amc->i2c_init =3D quanta_q71l_bmc_i2c_init; mc->default_ram_size =3D 128 * MiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); } =20 static void aspeed_machine_supermicrox11_bmc_class_init(ObjectClass *oc, @@ -1212,8 +1214,7 @@ static void aspeed_machine_supermicrox11_bmc_class_in= it(ObjectClass *oc, amc->macs_mask =3D ASPEED_MAC0_ON | ASPEED_MAC1_ON; amc->i2c_init =3D palmetto_bmc_i2c_init; mc->default_ram_size =3D 256 * MiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); } =20 static void aspeed_machine_supermicro_x11spi_bmc_class_init(ObjectClass *o= c, @@ -1231,8 +1232,7 @@ static void aspeed_machine_supermicro_x11spi_bmc_clas= s_init(ObjectClass *oc, amc->macs_mask =3D ASPEED_MAC0_ON | ASPEED_MAC1_ON; amc->i2c_init =3D palmetto_bmc_i2c_init; mc->default_ram_size =3D 512 * MiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); } =20 static void aspeed_machine_ast2500_evb_class_init(ObjectClass *oc, void *d= ata) @@ -1248,8 +1248,7 @@ static void aspeed_machine_ast2500_evb_class_init(Obj= ectClass *oc, void *data) amc->num_cs =3D 1; amc->i2c_init =3D ast2500_evb_i2c_init; mc->default_ram_size =3D 512 * MiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static void aspeed_machine_yosemitev2_class_init(ObjectClass *oc, void *da= ta) @@ -1266,8 +1265,7 @@ static void aspeed_machine_yosemitev2_class_init(Obje= ctClass *oc, void *data) amc->num_cs =3D 2; amc->i2c_init =3D yosemitev2_bmc_i2c_init; mc->default_ram_size =3D 512 * MiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static void aspeed_machine_romulus_class_init(ObjectClass *oc, void *data) @@ -1283,8 +1281,7 @@ static void aspeed_machine_romulus_class_init(ObjectC= lass *oc, void *data) amc->num_cs =3D 2; amc->i2c_init =3D romulus_bmc_i2c_init; mc->default_ram_size =3D 512 * MiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static void aspeed_machine_tiogapass_class_init(ObjectClass *oc, void *dat= a) @@ -1301,8 +1298,7 @@ static void aspeed_machine_tiogapass_class_init(Objec= tClass *oc, void *data) amc->num_cs =3D 2; amc->i2c_init =3D tiogapass_bmc_i2c_init; mc->default_ram_size =3D 1 * GiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static void aspeed_machine_sonorapass_class_init(ObjectClass *oc, void *da= ta) @@ -1318,8 +1314,7 @@ static void aspeed_machine_sonorapass_class_init(Obje= ctClass *oc, void *data) amc->num_cs =3D 2; amc->i2c_init =3D sonorapass_bmc_i2c_init; mc->default_ram_size =3D 512 * MiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static void aspeed_machine_witherspoon_class_init(ObjectClass *oc, void *d= ata) @@ -1335,8 +1330,7 @@ static void aspeed_machine_witherspoon_class_init(Obj= ectClass *oc, void *data) amc->num_cs =3D 2; amc->i2c_init =3D witherspoon_bmc_i2c_init; mc->default_ram_size =3D 512 * MiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static void aspeed_machine_ast2600_evb_class_init(ObjectClass *oc, void *d= ata) @@ -1355,8 +1349,7 @@ static void aspeed_machine_ast2600_evb_class_init(Obj= ectClass *oc, void *data) ASPEED_MAC3_ON; amc->i2c_init =3D ast2600_evb_i2c_init; mc->default_ram_size =3D 1 * GiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static void aspeed_machine_tacoma_class_init(ObjectClass *oc, void *data) @@ -1374,8 +1367,7 @@ static void aspeed_machine_tacoma_class_init(ObjectCl= ass *oc, void *data) amc->macs_mask =3D ASPEED_MAC2_ON; amc->i2c_init =3D witherspoon_bmc_i2c_init; /* Same board layout */ mc->default_ram_size =3D 1 * GiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static void aspeed_machine_g220a_class_init(ObjectClass *oc, void *data) @@ -1392,8 +1384,7 @@ static void aspeed_machine_g220a_class_init(ObjectCla= ss *oc, void *data) amc->macs_mask =3D ASPEED_MAC0_ON | ASPEED_MAC1_ON; amc->i2c_init =3D g220a_bmc_i2c_init; mc->default_ram_size =3D 1024 * MiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static void aspeed_machine_fp5280g2_class_init(ObjectClass *oc, void *data) @@ -1410,8 +1401,7 @@ static void aspeed_machine_fp5280g2_class_init(Object= Class *oc, void *data) amc->macs_mask =3D ASPEED_MAC0_ON | ASPEED_MAC1_ON; amc->i2c_init =3D fp5280g2_bmc_i2c_init; mc->default_ram_size =3D 512 * MiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static void aspeed_machine_rainier_class_init(ObjectClass *oc, void *data) @@ -1429,8 +1419,7 @@ static void aspeed_machine_rainier_class_init(ObjectC= lass *oc, void *data) amc->macs_mask =3D ASPEED_MAC2_ON | ASPEED_MAC3_ON; amc->i2c_init =3D rainier_bmc_i2c_init; mc->default_ram_size =3D 1 * GiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 #define FUJI_BMC_RAM_SIZE ASPEED_RAM_SIZE(2 * GiB) @@ -1451,8 +1440,7 @@ static void aspeed_machine_fuji_class_init(ObjectClas= s *oc, void *data) amc->i2c_init =3D fuji_bmc_i2c_init; amc->uart_default =3D ASPEED_DEV_UART1; mc->default_ram_size =3D FUJI_BMC_RAM_SIZE; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 #define BLETCHLEY_BMC_RAM_SIZE ASPEED_RAM_SIZE(2 * GiB) @@ -1472,8 +1460,7 @@ static void aspeed_machine_bletchley_class_init(Objec= tClass *oc, void *data) amc->macs_mask =3D ASPEED_MAC2_ON; amc->i2c_init =3D bletchley_bmc_i2c_init; mc->default_ram_size =3D BLETCHLEY_BMC_RAM_SIZE; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); } =20 static void fby35_reset(MachineState *state, ShutdownCause reason) @@ -1515,6 +1502,7 @@ static void aspeed_machine_fby35_class_init(ObjectCla= ss *oc, void *data) amc->i2c_init =3D fby35_i2c_init; /* FIXME: Replace this macro with something more general */ mc->default_ram_size =3D FUJI_BMC_RAM_SIZE; + aspeed_machine_class_init_cpus_defaults(mc); } =20 #define AST1030_INTERNAL_FLASH_SIZE (1024 * 1024) @@ -1592,8 +1580,7 @@ static void aspeed_minibmc_machine_ast1030_evb_class_= init(ObjectClass *oc, amc->spi_model =3D "sst25vf032b"; amc->num_cs =3D 2; amc->macs_mask =3D 0; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); } =20 static void aspeed_machine_qcom_dc_scm_v1_class_init(ObjectClass *oc, @@ -1612,8 +1599,7 @@ static void aspeed_machine_qcom_dc_scm_v1_class_init(= ObjectClass *oc, amc->macs_mask =3D ASPEED_MAC2_ON | ASPEED_MAC3_ON; amc->i2c_init =3D qcom_dc_scm_bmc_i2c_init; mc->default_ram_size =3D 1 * GiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static void aspeed_machine_qcom_firework_class_init(ObjectClass *oc, @@ -1632,8 +1618,7 @@ static void aspeed_machine_qcom_firework_class_init(O= bjectClass *oc, amc->macs_mask =3D ASPEED_MAC2_ON | ASPEED_MAC3_ON; amc->i2c_init =3D qcom_dc_scm_firework_i2c_init; mc->default_ram_size =3D 1 * GiB; - mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D - aspeed_soc_num_cpus(amc->soc_name); + aspeed_machine_class_init_cpus_defaults(mc); }; =20 static const TypeInfo aspeed_machine_types[] =3D { --=20 2.41.0 From nobody Tue Nov 26 16:20:29 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=1706162254; cv=none; d=zohomail.com; s=zohoarc; b=PwbdosEfXe6IgRTlJHj83ImicUaCHvuHfq9tyPjZdtAyY0dZklBzRk4Djwual+xvBMEHzH5+vtFGaksdLFZGAGLB+NXm/90bVldW4Duz2BAvCySIRIlI+5NHID3F9Pog3OygWoAQ25pxVraTidJPeCKythYhD74p4gR4+VWtmwg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706162254; 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=34UBB3mcO7ZaMebRDdhjL43nDYc+kT1XdddwXkamjjk=; b=IFZzjHIdXYHl0p8bkWY8dYtj+axMPHbzf0hAvU4kDSAVukH/D3WhDV5+e5A3C09Amntjj0b/48jjTmSsaCX7Y7YCcBkTVTV/7FtbN/UG/gQY/sZq+jp1LEJXISpF9N0i744sXituEYhCQIoX3lftsyIv7r4gs9tFDql2JFMltnM= 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 1706162254306690.5475362482227; Wed, 24 Jan 2024 21:57:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSsil-0003Lj-61; Thu, 25 Jan 2024 00:56:15 -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 1rSsij-0003L2-N8 for qemu-devel@nongnu.org; Thu, 25 Jan 2024 00:56:13 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSsii-0001HZ-52 for qemu-devel@nongnu.org; Thu, 25 Jan 2024 00:56:13 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40e86a9fc4bso80881115e9.2 for ; Wed, 24 Jan 2024 21:56:11 -0800 (PST) Received: from m1x-phil.lan (lec62-h02-176-184-19-125.dsl.sta.abo.bbox.fr. [176.184.19.125]) by smtp.gmail.com with ESMTPSA id c6-20020a05600c0a4600b0040e621feca9sm1241668wmq.17.2024.01.24.21.56.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 21:56:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706162170; x=1706766970; 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=34UBB3mcO7ZaMebRDdhjL43nDYc+kT1XdddwXkamjjk=; b=AJOD2qsjuOMgUJiH6dXazUzrsg/oRCT1tB4R/7yEF/0RaNOzUfVjq3HOGmPNG+/WiL UdFpYJtGpUKw8fhlt43gfmC+IFFQdXQ0Jsat+XLZPizuWrWS/WEjUSVRBepwuG+10c7V ETE89q5RY163sfNKEzuuc9nm/cq9+v1hqBbPL4UdCXWOlApGzunKvB+Xkx2Sl5JXDgNH yPwRSItNdmczWqP7zP4IVwo5USpkOfONsVvKFbsW8jDu+bahKOXf665RqwaNc00ViKlL jfd5fRSefZWYIRHr0Z9Qrc3B0g+zTFJiBXH8O6d5P+Oo2IBU7vWaduJbncVhItKcstw7 PDEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706162170; x=1706766970; 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=34UBB3mcO7ZaMebRDdhjL43nDYc+kT1XdddwXkamjjk=; b=NpaUO8eznochg3qMmiwWW8oEdp42Er2KJIz6WIMrKQLoISDhj2EpM2iq3e/lGdn8Xm h8aC/17nxlA1+eIMEUpysfKDXRuG9fz72Y8gvgLtGTbjcND3wdb6yDHwYvPKXbOkD22C 87vp80tpg6H9Lk2VBBYsWt5HHOiGRh49ZNcWbEIkBiY9rGmiKRGgY823oqXAhn163dlt xgtCF7eEaSnJjpWxzbYgHBSePKWBk6sCv1CP3KFgqQRi0/5eH2m7+e7wv+THYVx/4juf hpOjPv4vevCBAZ0/BDO+ErtUGRtdO9ABiXbcu3LbpdjXmhLYPRaTVFKt5usTvBwpRtyQ k4WA== X-Gm-Message-State: AOJu0YzgANhksaBBLls5rNY5PHZHspTWkX08eK9uaB6YwWvJs/4U8c7R jCTh7uNtW2TNtTrfQox1/jLTA3/Dt6ojH3sL5OyukGeZHUnnlpeLjuc9dhhztUC1U4/aYPtM6Vm b X-Google-Smtp-Source: AGHT+IG4wrC4YnSxvl59dQy+aqildJhCP979Vzi8uh4snUGTPzCxRIQ0TgqWHarvzPh3rSFqEzR55g== X-Received: by 2002:a05:600c:3c8c:b0:40e:c4f8:bdf with SMTP id bg12-20020a05600c3c8c00b0040ec4f80bdfmr180379wmb.31.1706162170518; Wed, 24 Jan 2024 21:56:10 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-arm@nongnu.org, Andrew Jeffery , Joel Stanley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Gavin Shan Subject: [PATCH v3 4/5] hw/arm/aspeed: Introduce aspeed_soc_cpu_type() helper Date: Thu, 25 Jan 2024 06:55:43 +0100 Message-ID: <20240125055544.79405-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240125055544.79405-1-philmd@linaro.org> References: <20240125055544.79405-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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: 1706162256363100003 In order to alter AspeedSoCClass::cpu_type in the next commit, introduce the aspeed_soc_cpu_type() helper to retrieve the per-SoC CPU type from AspeedSoCClass. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan --- include/hw/arm/aspeed_soc.h | 1 + hw/arm/aspeed_ast10x0.c | 2 +- hw/arm/aspeed_ast2400.c | 3 ++- hw/arm/aspeed_ast2600.c | 3 ++- hw/arm/aspeed_soc_common.c | 5 +++++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index cb832bc1ee..a060a59918 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -143,6 +143,7 @@ struct AspeedSoCClass { qemu_irq (*get_irq)(AspeedSoCState *s, int dev); }; =20 +const char *aspeed_soc_cpu_type(AspeedSoCClass *sc); =20 enum { ASPEED_DEV_SPI_BOOT, diff --git a/hw/arm/aspeed_ast10x0.c b/hw/arm/aspeed_ast10x0.c index 8becb146a8..dca601a3f9 100644 --- a/hw/arm/aspeed_ast10x0.c +++ b/hw/arm/aspeed_ast10x0.c @@ -211,7 +211,7 @@ static void aspeed_soc_ast1030_realize(DeviceState *dev= _soc, Error **errp) /* AST1030 CPU Core */ armv7m =3D DEVICE(&a->armv7m); qdev_prop_set_uint32(armv7m, "num-irq", 256); - qdev_prop_set_string(armv7m, "cpu-type", sc->cpu_type); + qdev_prop_set_string(armv7m, "cpu-type", aspeed_soc_cpu_type(sc)); qdev_connect_clock_in(armv7m, "cpuclk", s->sysclk); object_property_set_link(OBJECT(&a->armv7m), "memory", OBJECT(s->memory), &error_abort); diff --git a/hw/arm/aspeed_ast2400.c b/hw/arm/aspeed_ast2400.c index ad76035528..3baf95916d 100644 --- a/hw/arm/aspeed_ast2400.c +++ b/hw/arm/aspeed_ast2400.c @@ -156,7 +156,8 @@ static void aspeed_ast2400_soc_init(Object *obj) } =20 for (i =3D 0; i < sc->num_cpus; i++) { - object_initialize_child(obj, "cpu[*]", &a->cpu[i], sc->cpu_type); + object_initialize_child(obj, "cpu[*]", &a->cpu[i], + aspeed_soc_cpu_type(sc)); } =20 snprintf(typename, sizeof(typename), "aspeed.scu-%s", socname); diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index 386a88d4e0..b264433cf0 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -158,7 +158,8 @@ static void aspeed_soc_ast2600_init(Object *obj) } =20 for (i =3D 0; i < sc->num_cpus; i++) { - object_initialize_child(obj, "cpu[*]", &a->cpu[i], sc->cpu_type); + object_initialize_child(obj, "cpu[*]", &a->cpu[i], + aspeed_soc_cpu_type(sc)); } =20 snprintf(typename, sizeof(typename), "aspeed.scu-%s", socname); diff --git a/hw/arm/aspeed_soc_common.c b/hw/arm/aspeed_soc_common.c index 828f61093b..36ca189ce9 100644 --- a/hw/arm/aspeed_soc_common.c +++ b/hw/arm/aspeed_soc_common.c @@ -18,6 +18,11 @@ #include "hw/char/serial.h" =20 =20 +const char *aspeed_soc_cpu_type(AspeedSoCClass *sc) +{ + return sc->cpu_type; +} + qemu_irq aspeed_soc_get_irq(AspeedSoCState *s, int dev) { return ASPEED_SOC_GET_CLASS(s)->get_irq(s, dev); --=20 2.41.0 From nobody Tue Nov 26 16:20:29 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=1706162302; cv=none; d=zohomail.com; s=zohoarc; b=TsXUtMZDL9w3VrV6KUVlRvN2dy2FJ7PDj09y8Y+0+oc2fCT852RRUtjBaBzRYDtlernlRIQze2F6/v81O3YQO5igf0K0koH/ekQ01IbGgVznkr5Wm8CnPojKH2HUm1YAfPRMM2YgEkJeNghuYhvcmE8KblzY6RJElIfykay7NVc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706162302; 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=rKDbGwEXvltki2wl7qUZU0z++HxczA7j4HHaOXKhPHg=; b=eR+a8ju9lmhSK9kvn3UCdb2zJ9k8eD3t/1q61HlFELXry3CHLuoQIaZEL0H5vvb0QVXbnS7SBguXstIenFRm6f18QgjuJtpyD2OG/+N3I1OpNvJwyjIxnFLZqpmhiPRtTQ/dPazNIU8B2iGI2FqwJRCuE4uwjsj4UuS+3sKIdDg= 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 1706162302978653.7406663199722; Wed, 24 Jan 2024 21:58:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSsis-0003Pe-By; Thu, 25 Jan 2024 00:56:22 -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 1rSsip-0003OK-So for qemu-devel@nongnu.org; Thu, 25 Jan 2024 00:56:19 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSsio-0001JH-58 for qemu-devel@nongnu.org; Thu, 25 Jan 2024 00:56:19 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40e86a9fc4bso80881935e9.2 for ; Wed, 24 Jan 2024 21:56:17 -0800 (PST) Received: from m1x-phil.lan (lec62-h02-176-184-19-125.dsl.sta.abo.bbox.fr. [176.184.19.125]) by smtp.gmail.com with ESMTPSA id fk15-20020a05600c0ccf00b0040e9f7dadc6sm1247688wmb.25.2024.01.24.21.56.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 21:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706162176; x=1706766976; 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=rKDbGwEXvltki2wl7qUZU0z++HxczA7j4HHaOXKhPHg=; b=zGc/uNZZuYA2Bv/bIf5InCq0tv4CBJGTogFrFQOZKdf+0eZZlgFN6MeXNNkhMaHlu0 WCFCEAuHH+GzmV0uCv/Vp2pSiIZFwrz2UpLLx1GQ/xB5Z1zVsM6iQgKmw+1wnCyeUxdX KyZAm15KAVuF6iSC8g5W8T4eS2eFlgWR8hsWfVjXm3VDvH2Azi3o6BNy/KcrxmZmraHA rddus7ELPQxQlS6lg8PHXUxkWYDvBZFNrI+pWjMSMLnlfi1D6jh/pUOI+1p7iAMWpH/E /7oD4R53a1tNPFoeXsNUI/zgu9Zci5KZXW/QZ+JduGbocbTxyXw+yFCujaG8YvXV3x8P lXYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706162176; x=1706766976; 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=rKDbGwEXvltki2wl7qUZU0z++HxczA7j4HHaOXKhPHg=; b=afNbXobTqIRXqnsBNCK9aFDZ0bskMUAUphP83rJhRmTANpxkahWYcbmv2mKATMoVhi a3NlyfonNN8MbMc4sqLNnAYVO9FOlOHyagZphX4N1Oo6aYeWxzO6VKGrXGIVfoMmPnXX qJ9LqlBYtYad4BPVSNy96Widf+WQy2P1JFS1ophPLO78zcaUePvV8KIYv30IBtUcEat8 kbO40Tbr+87fIVQSc+YwWtCyVzbMsxhf5mEEGlm/UhSDEd8j2Kl6q6NpBBzBQyJUT6jX i5goZggzd5qTJgNqMbSRebRZ3IDsnXcwx9dWj4NrKyzGB/bT+FPsmCUzO8O0C4HvMLzO lvcQ== X-Gm-Message-State: AOJu0Ywytqxek3JOVPWEFCcXT73ggN7KpE/YvkS26blZ9GfHQ0zAo/Gh aBUy+2p7wGJem+t8hzWy+gMFzAsUiFJLGQjXrGQ21BLhtJvIjHfnvtpVs3AsIzRmv+vNVRJUA73 k X-Google-Smtp-Source: AGHT+IEZGTKPhhwHJUJ8qCGSE69Kj7kaCV3DqfkzQCz5D5mcqBlwkQELql0u1XY8mwVpwFzTmziqvQ== X-Received: by 2002:a05:600c:3581:b0:40e:6a5c:826a with SMTP id p1-20020a05600c358100b0040e6a5c826amr182613wmq.25.1706162176449; Wed, 24 Jan 2024 21:56:16 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-arm@nongnu.org, Andrew Jeffery , Joel Stanley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Gavin Shan Subject: [PATCH v3 5/5] hw/arm/aspeed: Check for CPU types in machine_run_board_init() Date: Thu, 25 Jan 2024 06:55:44 +0100 Message-ID: <20240125055544.79405-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240125055544.79405-1-philmd@linaro.org> References: <20240125055544.79405-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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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: 1706162304321100006 Aspeed SoCs use a single CPU type (set as AspeedSoCClass::cpu_type). Convert it to a NULL-terminated array (of a single non-NULL element). Set MachineClass::valid_cpu_types[] to use the common machine code to provide hints when the requested CPU is invalid (see commit e702cbc19e ("machine: Improve is_cpu_type_supported()"). Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/arm/aspeed_soc.h | 3 ++- hw/arm/aspeed.c | 1 + hw/arm/aspeed_ast10x0.c | 6 +++++- hw/arm/aspeed_ast2400.c | 12 ++++++++++-- hw/arm/aspeed_ast2600.c | 6 +++++- hw/arm/aspeed_soc_common.c | 5 ++++- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index a060a59918..0db5a41e71 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -128,7 +128,8 @@ struct AspeedSoCClass { DeviceClass parent_class; =20 const char *name; - const char *cpu_type; + /** valid_cpu_types: NULL terminated array of a single CPU type. */ + const char * const *valid_cpu_types; uint32_t silicon_rev; uint64_t sram_size; uint64_t secsram_size; diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index d2d490a6d1..fc8355cdce 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -1149,6 +1149,7 @@ static void aspeed_machine_class_init_cpus_defaults(M= achineClass *mc) mc->default_cpus =3D sc->num_cpus; mc->min_cpus =3D sc->num_cpus; mc->max_cpus =3D sc->num_cpus; + mc->valid_cpu_types =3D sc->valid_cpu_types; } =20 static void aspeed_machine_class_init(ObjectClass *oc, void *data) diff --git a/hw/arm/aspeed_ast10x0.c b/hw/arm/aspeed_ast10x0.c index dca601a3f9..c3b5116a6a 100644 --- a/hw/arm/aspeed_ast10x0.c +++ b/hw/arm/aspeed_ast10x0.c @@ -417,13 +417,17 @@ static void aspeed_soc_ast1030_realize(DeviceState *d= ev_soc, Error **errp) =20 static void aspeed_soc_ast1030_class_init(ObjectClass *klass, void *data) { + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-m4"), /* TODO cortex-m4f */ + NULL + }; DeviceClass *dc =3D DEVICE_CLASS(klass); AspeedSoCClass *sc =3D ASPEED_SOC_CLASS(dc); =20 dc->realize =3D aspeed_soc_ast1030_realize; =20 sc->name =3D "ast1030-a1"; - sc->cpu_type =3D ARM_CPU_TYPE_NAME("cortex-m4"); /* TODO cortex-m4f */ + sc->valid_cpu_types =3D valid_cpu_types; sc->silicon_rev =3D AST1030_A1_SILICON_REV; sc->sram_size =3D 0xc0000; sc->secsram_size =3D 0x40000; /* 256 * KiB */ diff --git a/hw/arm/aspeed_ast2400.c b/hw/arm/aspeed_ast2400.c index 3baf95916d..8829561bb6 100644 --- a/hw/arm/aspeed_ast2400.c +++ b/hw/arm/aspeed_ast2400.c @@ -503,6 +503,10 @@ static void aspeed_ast2400_soc_realize(DeviceState *de= v, Error **errp) =20 static void aspeed_soc_ast2400_class_init(ObjectClass *oc, void *data) { + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("arm926"), + NULL + }; AspeedSoCClass *sc =3D ASPEED_SOC_CLASS(oc); DeviceClass *dc =3D DEVICE_CLASS(oc); =20 @@ -511,7 +515,7 @@ static void aspeed_soc_ast2400_class_init(ObjectClass *= oc, void *data) dc->user_creatable =3D false; =20 sc->name =3D "ast2400-a1"; - sc->cpu_type =3D ARM_CPU_TYPE_NAME("arm926"); + sc->valid_cpu_types =3D valid_cpu_types; sc->silicon_rev =3D AST2400_A1_SILICON_REV; sc->sram_size =3D 0x8000; sc->spis_num =3D 1; @@ -527,6 +531,10 @@ static void aspeed_soc_ast2400_class_init(ObjectClass = *oc, void *data) =20 static void aspeed_soc_ast2500_class_init(ObjectClass *oc, void *data) { + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("arm1176"), + NULL + }; AspeedSoCClass *sc =3D ASPEED_SOC_CLASS(oc); DeviceClass *dc =3D DEVICE_CLASS(oc); =20 @@ -535,7 +543,7 @@ static void aspeed_soc_ast2500_class_init(ObjectClass *= oc, void *data) dc->user_creatable =3D false; =20 sc->name =3D "ast2500-a1"; - sc->cpu_type =3D ARM_CPU_TYPE_NAME("arm1176"); + sc->valid_cpu_types =3D valid_cpu_types; sc->silicon_rev =3D AST2500_A1_SILICON_REV; sc->sram_size =3D 0x9000; sc->spis_num =3D 2; diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index b264433cf0..46baba0e41 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -629,13 +629,17 @@ static void aspeed_soc_ast2600_realize(DeviceState *d= ev, Error **errp) =20 static void aspeed_soc_ast2600_class_init(ObjectClass *oc, void *data) { + static const char * const valid_cpu_types[] =3D { + ARM_CPU_TYPE_NAME("cortex-a7"), + NULL + }; DeviceClass *dc =3D DEVICE_CLASS(oc); AspeedSoCClass *sc =3D ASPEED_SOC_CLASS(oc); =20 dc->realize =3D aspeed_soc_ast2600_realize; =20 sc->name =3D "ast2600-a3"; - sc->cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a7"); + sc->valid_cpu_types =3D valid_cpu_types; sc->silicon_rev =3D AST2600_A3_SILICON_REV; sc->sram_size =3D 0x16400; sc->spis_num =3D 2; diff --git a/hw/arm/aspeed_soc_common.c b/hw/arm/aspeed_soc_common.c index 36ca189ce9..123a0c432c 100644 --- a/hw/arm/aspeed_soc_common.c +++ b/hw/arm/aspeed_soc_common.c @@ -20,7 +20,10 @@ =20 const char *aspeed_soc_cpu_type(AspeedSoCClass *sc) { - return sc->cpu_type; + assert(sc->valid_cpu_types); + assert(sc->valid_cpu_types[0]); + assert(!sc->valid_cpu_types[1]); + return sc->valid_cpu_types[0]; } =20 qemu_irq aspeed_soc_get_irq(AspeedSoCState *s, int dev) --=20 2.41.0