From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897917; cv=none; d=zohomail.com; s=zohoarc; b=WNu53KIDkCTeX8VK7ea+vWsTc1kPVzD4i8CYAOq3fa/Il3d/Kfb7vTOWQUlA81+nMSYaRqC35J62WetpMteu56JvfvGCs11gp9KHYEgI1+HUtaNzmYs7bP3Rs7w7rjdzDDvPA3qeuiJGmom5x9jKHmERbcuq1+kkFTYCeXa2v1g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897917; 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=MwdjZWKXLxETGhhU/dXr2xDEQpIttY2UFHIiC84tea8=; b=fAUEtrmNEvC4tR8amV/z2Rg3aZGkCJinUPPPxjBaPwbFXLEYCmrJ2KlmivqsoPK07oXWg+WTqjiq7E64i9uCnuZqo0ziBOlMCLbbBpCzm4Eq52cAXefWIBUHbF/1FA0vM/WSRMvxZuZYWDtMUsCciPTa7CMbCOtBWaT/dcR43QM= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178089791793668.46159265253812; Sun, 7 Jun 2026 22:51:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSqo-0001Ez-9k; Mon, 08 Jun 2026 01:48:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqm-0001EC-Bb for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqk-0000Ja-95 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:40 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-126-PBvvE04sNr6Lm0Ik2CUuwQ-1; Mon, 08 Jun 2026 01:48:33 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B19FC18003FC; Mon, 8 Jun 2026 05:48:32 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0E8BA27A; Mon, 8 Jun 2026 05:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MwdjZWKXLxETGhhU/dXr2xDEQpIttY2UFHIiC84tea8=; b=hICydxn1LMYU5ixEmNa8+YL+mgYhnIwqF+f+Ztb4sn66mczNKkwIg4ySomwUF/fmtUGWAu fO4TbzOi7b3bxxLcjk9Be074Y7GVNDN73V9KUJYKW7m6brLIucvnClw5wIN0CNs9onisA5 PY0iwon3x15298R8uW9WL3ON+zczi/8= X-MC-Unique: PBvvE04sNr6Lm0Ik2CUuwQ-1 X-Mimecast-MFC-AGG-ID: PBvvE04sNr6Lm0Ik2CUuwQ_1780897713 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 01/37] hw/misc/aspeed_hace: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:47:50 +0200 Message-ID: <20260608054826.346488-2-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897920262158500 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 6 standalone TypeInfo variables (aspeed_hace_info as abstract base, aspeed_2400_hace_info, aspeed_2500_hace_info, aspeed_2600_hace_info, aspeed_1030_hace_info, aspeed_2700_hace_info) directly into the 'aspeed_hace_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-2-jamin_lin= @aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/misc/aspeed_hace.c | 81 ++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 47 deletions(-) diff --git a/hw/misc/aspeed_hace.c b/hw/misc/aspeed_hace.c index 4c9e913f6c66..c61efe50c4ff 100644 --- a/hw/misc/aspeed_hace.c +++ b/hw/misc/aspeed_hace.c @@ -696,14 +696,6 @@ static void aspeed_hace_class_init(ObjectClass *klass,= const void *data) dc->vmsd =3D &vmstate_aspeed_hace; } =20 -static const TypeInfo aspeed_hace_info =3D { - .name =3D TYPE_ASPEED_HACE, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedHACEState), - .class_init =3D aspeed_hace_class_init, - .class_size =3D sizeof(AspeedHACEClass) -}; - static void aspeed_ast2400_hace_class_init(ObjectClass *klass, const void = *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -718,12 +710,6 @@ static void aspeed_ast2400_hace_class_init(ObjectClass= *klass, const void *data) ahc->hash_mask =3D 0x000003ff; /* No SG or SHA512 modes */ } =20 -static const TypeInfo aspeed_ast2400_hace_info =3D { - .name =3D TYPE_ASPEED_AST2400_HACE, - .parent =3D TYPE_ASPEED_HACE, - .class_init =3D aspeed_ast2400_hace_class_init, -}; - static void aspeed_ast2500_hace_class_init(ObjectClass *klass, const void = *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -738,12 +724,6 @@ static void aspeed_ast2500_hace_class_init(ObjectClass= *klass, const void *data) ahc->hash_mask =3D 0x000003ff; /* No SG or SHA512 modes */ } =20 -static const TypeInfo aspeed_ast2500_hace_info =3D { - .name =3D TYPE_ASPEED_AST2500_HACE, - .parent =3D TYPE_ASPEED_HACE, - .class_init =3D aspeed_ast2500_hace_class_init, -}; - static void aspeed_ast2600_hace_class_init(ObjectClass *klass, const void = *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -758,12 +738,6 @@ static void aspeed_ast2600_hace_class_init(ObjectClass= *klass, const void *data) ahc->hash_mask =3D 0x00147FFF; } =20 -static const TypeInfo aspeed_ast2600_hace_info =3D { - .name =3D TYPE_ASPEED_AST2600_HACE, - .parent =3D TYPE_ASPEED_HACE, - .class_init =3D aspeed_ast2600_hace_class_init, -}; - static void aspeed_ast1030_hace_class_init(ObjectClass *klass, const void = *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -778,12 +752,6 @@ static void aspeed_ast1030_hace_class_init(ObjectClass= *klass, const void *data) ahc->hash_mask =3D 0x00147FFF; } =20 -static const TypeInfo aspeed_ast1030_hace_info =3D { - .name =3D TYPE_ASPEED_AST1030_HACE, - .parent =3D TYPE_ASPEED_HACE, - .class_init =3D aspeed_ast1030_hace_class_init, -}; - static void aspeed_ast2700_hace_class_init(ObjectClass *klass, const void = *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -823,20 +791,39 @@ static void aspeed_ast2700_hace_class_init(ObjectClas= s *klass, const void *data) ahc->has_dma64 =3D true; } =20 -static const TypeInfo aspeed_ast2700_hace_info =3D { - .name =3D TYPE_ASPEED_AST2700_HACE, - .parent =3D TYPE_ASPEED_HACE, - .class_init =3D aspeed_ast2700_hace_class_init, +static const TypeInfo aspeed_hace_types[] =3D { + { + .name =3D TYPE_ASPEED_HACE, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedHACEState), + .class_init =3D aspeed_hace_class_init, + .class_size =3D sizeof(AspeedHACEClass), + }, + { + .name =3D TYPE_ASPEED_AST1030_HACE, + .parent =3D TYPE_ASPEED_HACE, + .class_init =3D aspeed_ast1030_hace_class_init, + }, + { + .name =3D TYPE_ASPEED_AST2400_HACE, + .parent =3D TYPE_ASPEED_HACE, + .class_init =3D aspeed_ast2400_hace_class_init, + }, + { + .name =3D TYPE_ASPEED_AST2500_HACE, + .parent =3D TYPE_ASPEED_HACE, + .class_init =3D aspeed_ast2500_hace_class_init, + }, + { + .name =3D TYPE_ASPEED_AST2600_HACE, + .parent =3D TYPE_ASPEED_HACE, + .class_init =3D aspeed_ast2600_hace_class_init, + }, + { + .name =3D TYPE_ASPEED_AST2700_HACE, + .parent =3D TYPE_ASPEED_HACE, + .class_init =3D aspeed_ast2700_hace_class_init, + } }; =20 -static void aspeed_hace_register_types(void) -{ - type_register_static(&aspeed_ast2400_hace_info); - type_register_static(&aspeed_ast2500_hace_info); - type_register_static(&aspeed_ast2600_hace_info); - type_register_static(&aspeed_ast1030_hace_info); - type_register_static(&aspeed_ast2700_hace_info); - type_register_static(&aspeed_hace_info); -} - -type_init(aspeed_hace_register_types); +DEFINE_TYPES(aspeed_hace_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897778; cv=none; d=zohomail.com; s=zohoarc; b=FOqpVZE5fkchQ5Djv+HG6q2IEU5a82PCFLvx2fBdlkIy0bLopl/xJK1zZ9GRt7OI2pIR1asAmw2MQZtqRrXDUFt1BCmoLbWpT2TKNW6XXG/8r8JRJxxRAy0yDlUH7ihbmIrZzfLU4Rw91gjDdTqU7EcxHA3M0TSg7HoVh1WswbI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897778; 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=boGpSvczh80sZImx2wwnyrx/QZZbxJCFgMsk8nKlrsA=; b=NNCiDTpTpLIkUkhOf7QU4AGrJN4sNdOs1sTNnVzvJpoi1ISJRk4zYF3ql+4+1QMYthOMJwOGGsY6MyVmwHdPkT8D894CHUXJ9B2kRbG+eV4Yk/fXZWwEq5ll5aSqvYxfu0T1t0fhlTKxKn1dzCVR3ktzbkj1DgVmUeAft0tfYWg= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897778693286.6924096411867; Sun, 7 Jun 2026 22:49:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSqo-0001FR-VY; Mon, 08 Jun 2026 01:48:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqn-0001EO-MH for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSql-0000L1-V4 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:41 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-130-LAUnTroJODegFmfFuP8H2g-1; Mon, 08 Jun 2026 01:48:35 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ADEB81800473; Mon, 8 Jun 2026 05:48:34 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 389D7765; Mon, 8 Jun 2026 05:48:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=boGpSvczh80sZImx2wwnyrx/QZZbxJCFgMsk8nKlrsA=; b=NowzVR7Tt+OcsbyttZGc3tPTavkvbWL8bt+JjQfJodbRpUMZhP/Kmc7xSluFa4Y8CBpvaR oDirSoiRsFtWYTRluCJJUG3JSjewci9yoT+qJMTSQPKK/LzNrJqpipPEqYsGApt7avb0+P VU6n74K8di6h4KmaefehojmB9+pS5Ls= X-MC-Unique: LAUnTroJODegFmfFuP8H2g-1 X-Mimecast-MFC-AGG-ID: LAUnTroJODegFmfFuP8H2g_1780897714 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 02/37] hw/misc/aspeed_lpc: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:47:51 +0200 Message-ID: <20260608054826.346488-3-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897780320158500 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline the standalone 'aspeed_lpc_info' TypeInfo variable directly into the 'aspeed_lpc_types[]' array, removing the need for a separate declaration. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-3-jamin_lin= @aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/misc/aspeed_lpc.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/hw/misc/aspeed_lpc.c b/hw/misc/aspeed_lpc.c index f69c48da125c..7f7e4f1a0985 100644 --- a/hw/misc/aspeed_lpc.c +++ b/hw/misc/aspeed_lpc.c @@ -470,17 +470,14 @@ static void aspeed_lpc_class_init(ObjectClass *klass,= const void *data) device_class_set_props(dc, aspeed_lpc_properties); } =20 -static const TypeInfo aspeed_lpc_info =3D { - .name =3D TYPE_ASPEED_LPC, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedLPCState), - .class_init =3D aspeed_lpc_class_init, - .instance_init =3D aspeed_lpc_init, +static const TypeInfo aspeed_lpc_types[] =3D { + { + .name =3D TYPE_ASPEED_LPC, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedLPCState), + .class_init =3D aspeed_lpc_class_init, + .instance_init =3D aspeed_lpc_init, + } }; =20 -static void aspeed_lpc_register_types(void) -{ - type_register_static(&aspeed_lpc_info); -} - -type_init(aspeed_lpc_register_types); +DEFINE_TYPES(aspeed_lpc_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898083; cv=none; d=zohomail.com; s=zohoarc; b=lm0uK0oyIIyPiq7QhXSr4Y9UE1ogk9Z+nEZ7y7TDBucPucHr+2mwdW6KcGNPqX7FTQlzikk8OdTollt2Oi2vwnH80ubbwHoG9OXSOOb2sH0WOE+Nyp7Mauhblh5JEYWsV6lZ/shsPIFsjl0HMGA7heU1AXoM/AcOMOYkR3QLEW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898083; 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=hGfeYpuAix5wAfxjUsQQZ4i5WS2PTpyUMv2zAR6tQE0=; b=cPexWjSu3T8eemkMeWzA8JI7A48kQVq4Z3xH+e4bNjCUyI2kLcRpW3nl0N1QgiCXJlRrH4dDoJFQbN13cjo5e2tuYh+OQ3YNIi2IKdVL6Eygmi+Ik29oSMsqd0CwBhBPW5+cDURTayg4C+zDLhCWQhwv/feJwqtWHi0EhL69eWQ= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898083022294.4039372009004; Sun, 7 Jun 2026 22:54:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSqp-0001Fo-Et; Mon, 08 Jun 2026 01:48:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqo-0001Em-3M for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqm-0000LB-By for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:41 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-691-X67GyIKcPV-PRZhqxA8Kxw-1; Mon, 08 Jun 2026 01:48:37 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E106A195608A; Mon, 8 Jun 2026 05:48:36 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2BDE927A; Mon, 8 Jun 2026 05:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hGfeYpuAix5wAfxjUsQQZ4i5WS2PTpyUMv2zAR6tQE0=; b=IIrCTKr/xseJx7gozNuKafIOkW+kNyx1j3+CTfELagsf2xvpSozzQyaHW1GrJl5aotdgnF jrHxP7BIuJIHCVhyuxhh/nNzmZt4mre7tBY2eyPrSTUWfVTVErofOQfHho+Uvo8+RCzV4k 5gLXd7u+Zxf4Jh5jc0IClNuvTsXmRWM= X-MC-Unique: X67GyIKcPV-PRZhqxA8Kxw-1 X-Mimecast-MFC-AGG-ID: X67GyIKcPV-PRZhqxA8Kxw_1780897717 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 03/37] hw/misc/aspeed_ltpi: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:47:52 +0200 Message-ID: <20260608054826.346488-4-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898085168158500 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline the standalone 'aspeed_ltpi_info' TypeInfo variable directly into the 'aspeed_ltpi_types[]' array, removing the need for a separate declaration. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-4-jamin_lin= @aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/misc/aspeed_ltpi.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/misc/aspeed_ltpi.c b/hw/misc/aspeed_ltpi.c index 956e91d14361..2e413550b9fd 100644 --- a/hw/misc/aspeed_ltpi.c +++ b/hw/misc/aspeed_ltpi.c @@ -179,16 +179,13 @@ static void aspeed_ltpi_class_init(ObjectClass *klass= , const void *data) rc->phases.hold =3D aspeed_ltpi_reset_hold; } =20 -static const TypeInfo aspeed_ltpi_info =3D { - .name =3D TYPE_ASPEED_LTPI, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedLTPIState), - .class_init =3D aspeed_ltpi_class_init, +static const TypeInfo aspeed_ltpi_types[] =3D { + { + .name =3D TYPE_ASPEED_LTPI, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedLTPIState), + .class_init =3D aspeed_ltpi_class_init, + } }; =20 -static void aspeed_ltpi_register_types(void) -{ - type_register_static(&aspeed_ltpi_info); -} - -type_init(aspeed_ltpi_register_types); +DEFINE_TYPES(aspeed_ltpi_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897778; cv=none; d=zohomail.com; s=zohoarc; b=lRd1sax9+uxorJcrsxjATmuRx+nvIo1yf0VtlOCkhLo13byjhWHLqs86wo7QtNY6bxsZ23fDSDvm6Vqz8F7Lxxfv6v6+OIViUTjKqAmtQhwV68NvseVlHW7lQawY0zQDJu2BFvXfopn+pBK1w77CZ+Rvx6OsnAhC1mXiVYuwjbk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897778; 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=ADh9CRgt71Lz/GF9kAWfuhxzdG+i1in6PC0e4kbsRNI=; b=B13ha263/bWyo7KzbX/rUIsDNYpUNmYoG/mELtFVP9Ozw4wbnOOrC9xf7x4fEabpo8dCluYOxHXsNH53XDlx0nUSkhd9jRBjnq5Ri1kDg9GqjfssZp1NK4YsZof18K0R0hwtG584jv8hMaT+h2brUzBqB4vECfQtxeavrYCRY/g= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897778381820.1054308083452; Sun, 7 Jun 2026 22:49:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSqt-0001HZ-89; Mon, 08 Jun 2026 01:48:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqs-0001H6-9Z for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqq-0000MB-1X for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:46 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-632-a-uamPmFP723Iwy_av_pqg-1; Mon, 08 Jun 2026 01:48:40 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D59441956050; Mon, 8 Jun 2026 05:48:38 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4A04E765; Mon, 8 Jun 2026 05:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ADh9CRgt71Lz/GF9kAWfuhxzdG+i1in6PC0e4kbsRNI=; b=HgMXFxaqfL/f7mhQAt6xy3l1DbuCWI+sN174l167ZdmIfQBgLYPoacUM9w4/KTEtADChY+ BlgfjxopvCd9uL8dFxrA5+dsTgnCRi99OL25sTQq7yxerK9U+was+wn32sYJ91Q1qTPfPf ICJde73+EdAIg/+xyyAstRvjUK+G8lQ= X-MC-Unique: a-uamPmFP723Iwy_av_pqg-1 X-Mimecast-MFC-AGG-ID: a-uamPmFP723Iwy_av_pqg_1780897719 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 04/37] hw/misc/aspeed_pwm: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:47:53 +0200 Message-ID: <20260608054826.346488-5-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897781496154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline the standalone 'aspeed_pwm_info' TypeInfo variable directly into the 'aspeed_pwm_types[]' array, removing the need for a separate declaration. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-5-jamin_lin= @aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/misc/aspeed_pwm.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/misc/aspeed_pwm.c b/hw/misc/aspeed_pwm.c index 673a0f1346f0..dfb93ae7fb81 100644 --- a/hw/misc/aspeed_pwm.c +++ b/hw/misc/aspeed_pwm.c @@ -106,16 +106,13 @@ static void aspeed_pwm_class_init(ObjectClass *klass,= const void *data) dc->vmsd =3D &vmstate_aspeed_pwm; } =20 -static const TypeInfo aspeed_pwm_info =3D { - .name =3D TYPE_ASPEED_PWM, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedPWMState), - .class_init =3D aspeed_pwm_class_init, +static const TypeInfo aspeed_pwm_types[] =3D { + { + .name =3D TYPE_ASPEED_PWM, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedPWMState), + .class_init =3D aspeed_pwm_class_init, + } }; =20 -static void aspeed_pwm_register_types(void) -{ - type_register_static(&aspeed_pwm_info); -} - -type_init(aspeed_pwm_register_types); +DEFINE_TYPES(aspeed_pwm_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897837; cv=none; d=zohomail.com; s=zohoarc; b=gasNgy2O7caQQt49wnuAl4cciaUKlnz8Ce682vecu+cqTC608RbbIc3RFj3/aZfa2I1aeJdvaYmVl+nmyBX0kR+mSr0BjzuUPWHafLG5MhhTAbPT/H6jZHopALbNlmgzGigfEhKKF6a4ouUBhK5CwJUVadZg5GU5te1scPz2lPQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897837; 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=Ngqgxb3O6P0HTCUZfT/yNkohR5MzVE3oWr4BxItoFn4=; b=N1kqBgO6xhIJcliAEA9G5GIkwSWEOq9R2SpOqhm//Wx4nCL96WvUCNzcBGoajlZEA/x4L2zdZf68zKwd1WQG98AOWRDJFTyQjAOI1JZgchOXrbH0y/vyxK7OQf8GnETs3jfbqbCY1Sqlvg7gT4gfKk8HhEMCckOi4tHpNeMrZLw= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178089783744829.244511235646883; Sun, 7 Jun 2026 22:50:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSr9-0001MZ-5W; Mon, 08 Jun 2026 01:49:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqy-0001IS-Pm for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqw-0000Nb-UJ for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:52 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-41-lXSkYq6fPF-JEyvl7ks2QA-1; Mon, 08 Jun 2026 01:48:41 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E6B801800347; Mon, 8 Jun 2026 05:48:40 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3C6FD27A; Mon, 8 Jun 2026 05:48:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ngqgxb3O6P0HTCUZfT/yNkohR5MzVE3oWr4BxItoFn4=; b=QbL1gYgbQolkoo0NAQbI/sLWArBtdAb/GmWhBnb6h/Su7xlRG4Ks5f/fRbiyAkMfNK1P4A hApVIw3w9jsR2Qhot7S/Qk6j9lxFhzD5UuIC7dAnq6inu9gIB6Ej+/7Go+I7fTUoNCEKB9 U1yRbRr/Kz6RbM0QSYibM0gs6sL+/is= X-MC-Unique: lXSkYq6fPF-JEyvl7ks2QA-1 X-Mimecast-MFC-AGG-ID: lXSkYq6fPF-JEyvl7ks2QA_1780897721 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 05/37] hw/misc/aspeed_sbc: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:47:54 +0200 Message-ID: <20260608054826.346488-6-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897837897158500 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 3 standalone TypeInfo variables (aspeed_2600_sbc_info, aspeed_ast10x0_sbc_info, aspeed_sbc_info) directly into the 'aspeed_sbc_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-6-jamin_lin= @aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/misc/aspeed_sbc.c | 46 +++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/hw/misc/aspeed_sbc.c b/hw/misc/aspeed_sbc.c index 6125d2f134e8..1dfcf14e5ba6 100644 --- a/hw/misc/aspeed_sbc.c +++ b/hw/misc/aspeed_sbc.c @@ -338,14 +338,6 @@ static void aspeed_sbc_class_init(ObjectClass *klass, = const void *data) device_class_set_props(dc, aspeed_sbc_properties); } =20 -static const TypeInfo aspeed_sbc_info =3D { - .name =3D TYPE_ASPEED_SBC, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedSBCState), - .instance_init =3D aspeed_sbc_instance_init, - .class_init =3D aspeed_sbc_class_init, - .class_size =3D sizeof(AspeedSBCClass) -}; =20 static void aspeed_ast2600_sbc_class_init(ObjectClass *klass, const void *= data) { @@ -356,12 +348,6 @@ static void aspeed_ast2600_sbc_class_init(ObjectClass = *klass, const void *data) sc->has_otp =3D true; } =20 -static const TypeInfo aspeed_ast2600_sbc_info =3D { - .name =3D TYPE_ASPEED_AST2600_SBC, - .parent =3D TYPE_ASPEED_SBC, - .class_init =3D aspeed_ast2600_sbc_class_init, -}; - static void aspeed_ast10x0_sbc_class_init(ObjectClass *klass, const void *= data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -371,17 +357,25 @@ static void aspeed_ast10x0_sbc_class_init(ObjectClass= *klass, const void *data) sc->has_otp =3D true; } =20 -static const TypeInfo aspeed_ast10x0_sbc_info =3D { - .name =3D TYPE_ASPEED_AST10X0_SBC, - .parent =3D TYPE_ASPEED_SBC, - .class_init =3D aspeed_ast10x0_sbc_class_init, +static const TypeInfo aspeed_sbc_types[] =3D { + { + .name =3D TYPE_ASPEED_SBC, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedSBCState), + .instance_init =3D aspeed_sbc_instance_init, + .class_init =3D aspeed_sbc_class_init, + .class_size =3D sizeof(AspeedSBCClass), + }, + { + .name =3D TYPE_ASPEED_AST10X0_SBC, + .parent =3D TYPE_ASPEED_SBC, + .class_init =3D aspeed_ast10x0_sbc_class_init, + }, + { + .name =3D TYPE_ASPEED_AST2600_SBC, + .parent =3D TYPE_ASPEED_SBC, + .class_init =3D aspeed_ast2600_sbc_class_init, + } }; =20 -static void aspeed_sbc_register_types(void) -{ - type_register_static(&aspeed_ast2600_sbc_info); - type_register_static(&aspeed_ast10x0_sbc_info); - type_register_static(&aspeed_sbc_info); -} - -type_init(aspeed_sbc_register_types); +DEFINE_TYPES(aspeed_sbc_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897812; cv=none; d=zohomail.com; s=zohoarc; b=LoLgeb9wNsZiFfyXH6PfCelVnvIg0hEWjgshYsJot+UgFwlV92rhYN8gnU36KEdJGT2eEGfjdIidSKegVK8FCmxhuoy7HhcEyfpaFOeVqnBSohZs+Wn9q4CpURZYL/hXxOuWS8BCBwiym8p0S4V+5md6FP+RbdCIQAFdgqpr2RE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897812; 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=+dhiYeZ3EUQx/S9DT/nIpogqmXSlWQypDxDLdNsrqd4=; b=NJtjk2GjpBlffoIoVT9um152uQjPYHpVIckzxPixEdrcYw+q1fsUXiIkb0WuxubYhNrXH11oIcoBp0GaT7krVAE+tysrKlDjKjMQHQBVYFipEOkFC37zmOVstP/+GpQzMlsNJEflrELbKuQnA6h7JVXVhBC3uJt7JcHw8AfFvcg= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897812723553.1743638827744; Sun, 7 Jun 2026 22:50:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSr9-0001Mb-CS; Mon, 08 Jun 2026 01:49:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqx-0001IQ-Ty for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqv-0000NK-Vh for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:51 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-680-If-X9gydO2qsz7VSUwpJfQ-1; Mon, 08 Jun 2026 01:48:43 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DABE31800473; Mon, 8 Jun 2026 05:48:42 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 65B8B765; Mon, 8 Jun 2026 05:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+dhiYeZ3EUQx/S9DT/nIpogqmXSlWQypDxDLdNsrqd4=; b=Qwjgguo6x8y4ViptX6bXIt00OZyy5saP5j8pTFXrRgk+G8W7CB3/mJJz8j8eVjZj26TIf6 NXVkFzHf1Crb9wWkz2KPcyp97RAZDTJUJC/mFDTTn1tbulNuTahL+zcbnpFDvkYKT9hXyr lKc2Xa9wCaUaKz8GC2QxtbqNIaqvLS8= X-MC-Unique: If-X9gydO2qsz7VSUwpJfQ-1 X-Mimecast-MFC-AGG-ID: If-X9gydO2qsz7VSUwpJfQ_1780897723 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 06/37] hw/misc/aspeed_scu: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:47:55 +0200 Message-ID: <20260608054826.346488-7-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897814104154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 7 standalone TypeInfo variables (aspeed_scu_info as abstract base, aspeed_2400_scu_info, aspeed_2500_scu_info, aspeed_2600_scu_info, aspeed_1030_scu_info, aspeed_2700_scu_info, aspeed_2700_scuio_info) directly into the 'aspeed_scu_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-7-jamin_lin= @aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/misc/aspeed_scu.c | 107 +++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 61 deletions(-) diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c index 19da6c075fae..fe731a28bd50 100644 --- a/hw/misc/aspeed_scu.c +++ b/hw/misc/aspeed_scu.c @@ -624,15 +624,6 @@ static void aspeed_scu_class_init(ObjectClass *klass, = const void *data) device_class_set_props(dc, aspeed_scu_properties); } =20 -static const TypeInfo aspeed_scu_info =3D { - .name =3D TYPE_ASPEED_SCU, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedSCUState), - .class_init =3D aspeed_scu_class_init, - .class_size =3D sizeof(AspeedSCUClass), - .abstract =3D true, -}; - static void aspeed_2400_scu_class_init(ObjectClass *klass, const void *dat= a) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -648,13 +639,6 @@ static void aspeed_2400_scu_class_init(ObjectClass *kl= ass, const void *data) asc->ops =3D &aspeed_ast2400_scu_ops; } =20 -static const TypeInfo aspeed_2400_scu_info =3D { - .name =3D TYPE_ASPEED_2400_SCU, - .parent =3D TYPE_ASPEED_SCU, - .instance_size =3D sizeof(AspeedSCUState), - .class_init =3D aspeed_2400_scu_class_init, -}; - static void aspeed_2500_scu_class_init(ObjectClass *klass, const void *dat= a) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -670,13 +654,6 @@ static void aspeed_2500_scu_class_init(ObjectClass *kl= ass, const void *data) asc->ops =3D &aspeed_ast2500_scu_ops; } =20 -static const TypeInfo aspeed_2500_scu_info =3D { - .name =3D TYPE_ASPEED_2500_SCU, - .parent =3D TYPE_ASPEED_SCU, - .instance_size =3D sizeof(AspeedSCUState), - .class_init =3D aspeed_2500_scu_class_init, -}; - static uint64_t aspeed_ast2600_scu_read(void *opaque, hwaddr offset, unsigned size) { @@ -859,13 +836,6 @@ static void aspeed_2600_scu_class_init(ObjectClass *kl= ass, const void *data) asc->ops =3D &aspeed_ast2600_scu_ops; } =20 -static const TypeInfo aspeed_2600_scu_info =3D { - .name =3D TYPE_ASPEED_2600_SCU, - .parent =3D TYPE_ASPEED_SCU, - .instance_size =3D sizeof(AspeedSCUState), - .class_init =3D aspeed_2600_scu_class_init, -}; - static uint64_t aspeed_ast2700_scu_read(void *opaque, hwaddr offset, unsigned size) { @@ -1099,20 +1069,6 @@ static void aspeed_2700_scuio_class_init(ObjectClass= *klass, const void *data) asc->ops =3D &aspeed_ast2700_scuio_ops; } =20 -static const TypeInfo aspeed_2700_scu_info =3D { - .name =3D TYPE_ASPEED_2700_SCU, - .parent =3D TYPE_ASPEED_SCU, - .instance_size =3D sizeof(AspeedSCUState), - .class_init =3D aspeed_2700_scu_class_init, -}; - -static const TypeInfo aspeed_2700_scuio_info =3D { - .name =3D TYPE_ASPEED_2700_SCUIO, - .parent =3D TYPE_ASPEED_SCU, - .instance_size =3D sizeof(AspeedSCUState), - .class_init =3D aspeed_2700_scuio_class_init, -}; - static const uint32_t ast1030_a1_resets[ASPEED_AST2600_SCU_NR_REGS] =3D { [AST2600_SYS_RST_CTRL] =3D 0xFFC3FED8, [AST2600_SYS_RST_CTRL2] =3D 0x09FFFFFC, @@ -1158,22 +1114,51 @@ static void aspeed_1030_scu_class_init(ObjectClass = *klass, const void *data) asc->ops =3D &aspeed_ast2600_scu_ops; } =20 -static const TypeInfo aspeed_1030_scu_info =3D { - .name =3D TYPE_ASPEED_1030_SCU, - .parent =3D TYPE_ASPEED_SCU, - .instance_size =3D sizeof(AspeedSCUState), - .class_init =3D aspeed_1030_scu_class_init, +static const TypeInfo aspeed_scu_types[] =3D { + { + .name =3D TYPE_ASPEED_SCU, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedSCUState), + .class_init =3D aspeed_scu_class_init, + .class_size =3D sizeof(AspeedSCUClass), + .abstract =3D true, + }, + { + .name =3D TYPE_ASPEED_1030_SCU, + .parent =3D TYPE_ASPEED_SCU, + .instance_size =3D sizeof(AspeedSCUState), + .class_init =3D aspeed_1030_scu_class_init, + }, + { + .name =3D TYPE_ASPEED_2400_SCU, + .parent =3D TYPE_ASPEED_SCU, + .instance_size =3D sizeof(AspeedSCUState), + .class_init =3D aspeed_2400_scu_class_init, + }, + { + .name =3D TYPE_ASPEED_2500_SCU, + .parent =3D TYPE_ASPEED_SCU, + .instance_size =3D sizeof(AspeedSCUState), + .class_init =3D aspeed_2500_scu_class_init, + }, + { + .name =3D TYPE_ASPEED_2600_SCU, + .parent =3D TYPE_ASPEED_SCU, + .instance_size =3D sizeof(AspeedSCUState), + .class_init =3D aspeed_2600_scu_class_init, + }, + { + .name =3D TYPE_ASPEED_2700_SCU, + .parent =3D TYPE_ASPEED_SCU, + .instance_size =3D sizeof(AspeedSCUState), + .class_init =3D aspeed_2700_scu_class_init, + }, + { + .name =3D TYPE_ASPEED_2700_SCUIO, + .parent =3D TYPE_ASPEED_SCU, + .instance_size =3D sizeof(AspeedSCUState), + .class_init =3D aspeed_2700_scuio_class_init, + } }; =20 -static void aspeed_scu_register_types(void) -{ - type_register_static(&aspeed_scu_info); - type_register_static(&aspeed_2400_scu_info); - type_register_static(&aspeed_2500_scu_info); - type_register_static(&aspeed_2600_scu_info); - type_register_static(&aspeed_1030_scu_info); - type_register_static(&aspeed_2700_scu_info); - type_register_static(&aspeed_2700_scuio_info); -} - -type_init(aspeed_scu_register_types); +DEFINE_TYPES(aspeed_scu_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898221; cv=none; d=zohomail.com; s=zohoarc; b=YI7eW4L17naDePHCvt2PUK7HosEc6E16ZoX51UkCXPnVSAUEBCf3IsRVeGgPs840ycS37GpJxV3+cuZTNndk661GLfjETpho9PZkiQcFvyFdr4eSQRXLYr1ixP0MpTsrIH5ML39/+UURS8V7zgIMZzEQ48EvlFnefo6wZBYBUH0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898221; 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=O6gK0iKpUcHmAVtVCVtQT+7M8qJ3nFde7PqZM+fgqnY=; b=lCkOUt2fglNb7Du4a99+m0BgHUadaQIv0y+b8LgGOLDssI5bDJDnGip4gXWCWeFXaOHADAwCg0MtqDUCe+/62RkwkSFIHUE7KFFehzoQr8n2H5zCU8Z2yjF/6Ma8ZA7uYMQLMhG1iE045zCD2QvWw5Ww6ncDpSpKVjs7arsFTCs= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178089822187742.77067084797363; Sun, 7 Jun 2026 22:57:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSr8-0001L6-Cn; Mon, 08 Jun 2026 01:49:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqy-0001IR-K9 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqw-0000NN-3t for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:52 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-341-FeKF6KTjMcmjJdxRTRLXnA-1; Mon, 08 Jun 2026 01:48:45 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CD168195608C; Mon, 8 Jun 2026 05:48:44 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 59054765; Mon, 8 Jun 2026 05:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O6gK0iKpUcHmAVtVCVtQT+7M8qJ3nFde7PqZM+fgqnY=; b=dykvahT+QXWpfFHZKgh13hUuATIECESoGolMCGtxfJx2eY80HBPFZzWzuYpzN/bhDVMmR9 /Ll+tRyTxDUixak0XBfBFhSqMO5aEb8+q7rcy45i9qR4pg6WQ38C0JvscAfukgIa1FBPa+ hFblbUOxcWt7NsN2mv/+4s68OABQvZk= X-MC-Unique: FeKF6KTjMcmjJdxRTRLXnA-1 X-Mimecast-MFC-AGG-ID: FeKF6KTjMcmjJdxRTRLXnA_1780897724 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 07/37] hw/misc/aspeed_sdmc: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:47:56 +0200 Message-ID: <20260608054826.346488-8-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898223583158500 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 5 standalone TypeInfo variables (aspeed_sdmc_info as abstract base, aspeed_2400_sdmc_info, aspeed_2500_sdmc_info, aspeed_2600_sdmc_info, aspeed_2700_sdmc_info) directly into the 'aspeed_sdmc_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-8-jamin_lin= @aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/misc/aspeed_sdmc.c | 73 ++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 42 deletions(-) diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index 055abf7f50f0..f8fbaebee6ab 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -310,16 +310,6 @@ static void aspeed_sdmc_class_init(ObjectClass *klass,= const void *data) device_class_set_props(dc, aspeed_sdmc_properties); } =20 -static const TypeInfo aspeed_sdmc_info =3D { - .name =3D TYPE_ASPEED_SDMC, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedSDMCState), - .instance_init =3D aspeed_sdmc_initfn, - .class_init =3D aspeed_sdmc_class_init, - .class_size =3D sizeof(AspeedSDMCClass), - .abstract =3D true, -}; - static int aspeed_sdmc_get_ram_bits(AspeedSDMCState *s) { AspeedSDMCClass *asc =3D ASPEED_SDMC_GET_CLASS(s); @@ -393,12 +383,6 @@ static void aspeed_2400_sdmc_class_init(ObjectClass *k= lass, const void *data) asc->valid_ram_sizes =3D aspeed_2400_ram_sizes; } =20 -static const TypeInfo aspeed_2400_sdmc_info =3D { - .name =3D TYPE_ASPEED_2400_SDMC, - .parent =3D TYPE_ASPEED_SDMC, - .class_init =3D aspeed_2400_sdmc_class_init, -}; - static uint32_t aspeed_2500_sdmc_compute_conf(AspeedSDMCState *s, uint32_t= data) { uint32_t fixed_conf =3D ASPEED_SDMC_HW_VERSION(1) | @@ -461,12 +445,6 @@ static void aspeed_2500_sdmc_class_init(ObjectClass *k= lass, const void *data) asc->valid_ram_sizes =3D aspeed_2500_ram_sizes; } =20 -static const TypeInfo aspeed_2500_sdmc_info =3D { - .name =3D TYPE_ASPEED_2500_SDMC, - .parent =3D TYPE_ASPEED_SDMC, - .class_init =3D aspeed_2500_sdmc_class_init, -}; - static uint32_t aspeed_2600_sdmc_compute_conf(AspeedSDMCState *s, uint32_t= data) { uint32_t fixed_conf =3D ASPEED_SDMC_HW_VERSION(3) | @@ -555,12 +533,6 @@ static void aspeed_2600_sdmc_class_init(ObjectClass *k= lass, const void *data) asc->valid_ram_sizes =3D aspeed_2600_ram_sizes; } =20 -static const TypeInfo aspeed_2600_sdmc_info =3D { - .name =3D TYPE_ASPEED_2600_SDMC, - .parent =3D TYPE_ASPEED_SDMC, - .class_init =3D aspeed_2600_sdmc_class_init, -}; - static void aspeed_2700_sdmc_reset_hold(Object *obj, ResetType type) { AspeedSDMCState *s =3D ASPEED_SDMC(obj); @@ -690,19 +662,36 @@ static void aspeed_2700_sdmc_class_init(ObjectClass *= klass, const void *data) asc->valid_ram_sizes =3D aspeed_2700_ram_sizes; } =20 -static const TypeInfo aspeed_2700_sdmc_info =3D { - .name =3D TYPE_ASPEED_2700_SDMC, - .parent =3D TYPE_ASPEED_SDMC, - .class_init =3D aspeed_2700_sdmc_class_init, +static const TypeInfo aspeed_sdmc_types[] =3D { + { + .name =3D TYPE_ASPEED_SDMC, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedSDMCState), + .instance_init =3D aspeed_sdmc_initfn, + .class_init =3D aspeed_sdmc_class_init, + .class_size =3D sizeof(AspeedSDMCClass), + .abstract =3D true, + }, + { + .name =3D TYPE_ASPEED_2400_SDMC, + .parent =3D TYPE_ASPEED_SDMC, + .class_init =3D aspeed_2400_sdmc_class_init, + }, + { + .name =3D TYPE_ASPEED_2500_SDMC, + .parent =3D TYPE_ASPEED_SDMC, + .class_init =3D aspeed_2500_sdmc_class_init, + }, + { + .name =3D TYPE_ASPEED_2600_SDMC, + .parent =3D TYPE_ASPEED_SDMC, + .class_init =3D aspeed_2600_sdmc_class_init, + }, + { + .name =3D TYPE_ASPEED_2700_SDMC, + .parent =3D TYPE_ASPEED_SDMC, + .class_init =3D aspeed_2700_sdmc_class_init, + } }; =20 -static void aspeed_sdmc_register_types(void) -{ - type_register_static(&aspeed_sdmc_info); - type_register_static(&aspeed_2400_sdmc_info); - type_register_static(&aspeed_2500_sdmc_info); - type_register_static(&aspeed_2600_sdmc_info); - type_register_static(&aspeed_2700_sdmc_info); -} - -type_init(aspeed_sdmc_register_types); +DEFINE_TYPES(aspeed_sdmc_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897898; cv=none; d=zohomail.com; s=zohoarc; b=Y68uMpn7D1RgHmCZ2iegOilcfPKrbEW5eojxTQ2Eig7QRLcZmr+y7FxoEGlxtRHHsmTPvIdWbfzX2Z963ModBFaWJwICc9EJIJDig3Hg8lhBeUR0hs4s7v6hr6aqv6Eaadr1BdZEqr4eOpRtKVV5HWwjeFPnCWOsHZuRh4yL5X0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897898; 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=8VnaHfAzCaMJFYoW3QGdBrkrlcTvRnLe7EeeVYhYkB0=; b=Oab4oXhhMQ3zTtPqy6rWV0ybUZnifQDdpqZKH65rv/cq5UFwSSMLu7Bf3KcsWwwGSwvaLFUi7XT0juyC1qHJ/24aA4EJKvo9ZrDOUl99JNb0PRRTWnBfT9SKe+APeM8G6kpLAxUtSu+3xFU4HhtAIVZ11Br+Hv0iH/KloMCeLHA= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897898790149.26949899931913; Sun, 7 Jun 2026 22:51:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSr9-0001NH-Tt; Mon, 08 Jun 2026 01:49:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqz-0001In-JP for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSqx-0000Nv-Vt for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:53 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-673-3YgJdgEeOQuUZoUcy8WQQg-1; Mon, 08 Jun 2026 01:48:47 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EB445195608B; Mon, 8 Jun 2026 05:48:46 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4C95F765; Mon, 8 Jun 2026 05:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8VnaHfAzCaMJFYoW3QGdBrkrlcTvRnLe7EeeVYhYkB0=; b=E4byWZciqQEtjrSunFeAPLc/PeNKGs53tLOR8kPRAQwYJaXZryQVmlFUT5rucG6A2zRSW3 6HYA9eRUua1cg42IKB1uw8F5cBvJwwBTOjhwo7jHvGU4fKuSH6ausgmx6WYQCa3RQ9Ipo3 lxk5dgVRbr2HIUuekZR3oJMvYBfNAmI= X-MC-Unique: 3YgJdgEeOQuUZoUcy8WQQg-1 X-Mimecast-MFC-AGG-ID: 3YgJdgEeOQuUZoUcy8WQQg_1780897727 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 08/37] hw/misc:aspeed_sli: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:47:57 +0200 Message-ID: <20260608054826.346488-9-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897900171158500 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 3 standalone TypeInfo variables (aspeed_sli_info as abstract base, aspeed_2700_sli_info, aspeed_2700_sliio_info) directly into the 'aspeed_sli_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-9-jamin_lin= @aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/misc/aspeed_sli.c | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/hw/misc/aspeed_sli.c b/hw/misc/aspeed_sli.c index 5b4d70cdc064..74ad02faf5ea 100644 --- a/hw/misc/aspeed_sli.c +++ b/hw/misc/aspeed_sli.c @@ -132,13 +132,6 @@ static void aspeed_sli_class_init(ObjectClass *klass, = const void *data) dc->realize =3D aspeed_sli_realize; } =20 -static const TypeInfo aspeed_sli_info =3D { - .name =3D TYPE_ASPEED_SLI, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedSLIState), - .class_init =3D aspeed_sli_class_init, - .abstract =3D true, -}; =20 static void aspeed_2700_sli_class_init(ObjectClass *klass, const void *dat= a) { @@ -155,23 +148,24 @@ static void aspeed_2700_sliio_class_init(ObjectClass = *klass, const void *data) dc->realize =3D aspeed_sliio_realize; } =20 -static const TypeInfo aspeed_2700_sli_info =3D { - .name =3D TYPE_ASPEED_2700_SLI, - .parent =3D TYPE_ASPEED_SLI, - .class_init =3D aspeed_2700_sli_class_init, -}; - -static const TypeInfo aspeed_2700_sliio_info =3D { - .name =3D TYPE_ASPEED_2700_SLIIO, - .parent =3D TYPE_ASPEED_SLI, - .class_init =3D aspeed_2700_sliio_class_init, +static const TypeInfo aspeed_sli_types[] =3D { + { + .name =3D TYPE_ASPEED_SLI, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedSLIState), + .class_init =3D aspeed_sli_class_init, + .abstract =3D true, + }, + { + .name =3D TYPE_ASPEED_2700_SLI, + .parent =3D TYPE_ASPEED_SLI, + .class_init =3D aspeed_2700_sli_class_init, + }, + { + .name =3D TYPE_ASPEED_2700_SLIIO, + .parent =3D TYPE_ASPEED_SLI, + .class_init =3D aspeed_2700_sliio_class_init, + } }; =20 -static void aspeed_sli_register_types(void) -{ - type_register_static(&aspeed_sli_info); - type_register_static(&aspeed_2700_sli_info); - type_register_static(&aspeed_2700_sliio_info); -} - -type_init(aspeed_sli_register_types); +DEFINE_TYPES(aspeed_sli_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898236; cv=none; d=zohomail.com; s=zohoarc; b=mzxFW0+IDaTfQyUFVvxlzmfWgZuZqX9qiYpgzwuBzVl7nnWHpNLJQbxuJUhJaqAK0GcnIN6PQR0BD4Gx9npGn3A9fHNq8K2xQpIYM/ciptXrnp+D28V2qdqDJPWzGa/tWgJvTVH8d5+FCNzLBPd5UbHUIkoUthutuby8o4s/Qpc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898236; 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=yHcHJoucPFwsCxq4xIZR4rtiISi7bo8yUfNEI1LLM5c=; b=YmifjWgi4fKqpWvHM7w+wiX8LaPrzPtTc845iHqh9dYNsmhJeQu776kxRMiOOZtiP0z8bzXAxpMF+cgB1Oz2Rbb5bkklN/oG/SpWuJ31SDGUlUBaWH/hIX6e2Z2XvForpda2esetN7xvH/ZfQZwKxNCguAp5rTNuk1wlmKzMuO4= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898236066931.9234765999566; Sun, 7 Jun 2026 22:57:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSr8-0001LX-GI; Mon, 08 Jun 2026 01:49:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSr2-0001Jq-F8 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSr0-0000Oa-Ks for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:56 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-669-nu4G4NDHNsq8geiaFDnQcw-1; Mon, 08 Jun 2026 01:48:49 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DE2C8180059A; Mon, 8 Jun 2026 05:48:48 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 69717765; Mon, 8 Jun 2026 05:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yHcHJoucPFwsCxq4xIZR4rtiISi7bo8yUfNEI1LLM5c=; b=QFIvSmIPy4wO4UhPA5t2nLHXb1Z5hVlXbBE/koA6sXjfXbuJ2yIb6Ihr/Wn6PdrRjXJhvu A/sp4v+FWoK45hupV5ibN0lkIVETCyhKmiuEhkS0LoTVs4JQVf74wJxU5ARQeIg5T4remL efnt9S60+a8u9/z29z6L/rqsAyofeUU= X-MC-Unique: nu4G4NDHNsq8geiaFDnQcw-1 X-Mimecast-MFC-AGG-ID: nu4G4NDHNsq8geiaFDnQcw_1780897729 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 09/37] hw/misc/aspeed_xdma: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:47:58 +0200 Message-ID: <20260608054826.346488-10-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898238057154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 4 standalone TypeInfo variables (aspeed_xdma_info as abstract base, aspeed_2400_xdma_info, aspeed_2500_xdma_info, aspeed_2600_xdma_info) directly into the 'aspeed_xdma_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-10-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/misc/aspeed_xdma.c | 58 +++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/hw/misc/aspeed_xdma.c b/hw/misc/aspeed_xdma.c index 80b32593336c..58a471ee0306 100644 --- a/hw/misc/aspeed_xdma.c +++ b/hw/misc/aspeed_xdma.c @@ -167,12 +167,6 @@ static void aspeed_2600_xdma_class_init(ObjectClass *k= lass, const void *data) XDMA_AST2600_IRQ_STATUS_DS_COMP; } =20 -static const TypeInfo aspeed_2600_xdma_info =3D { - .name =3D TYPE_ASPEED_2600_XDMA, - .parent =3D TYPE_ASPEED_XDMA, - .class_init =3D aspeed_2600_xdma_class_init, -}; - static void aspeed_2500_xdma_class_init(ObjectClass *klass, const void *da= ta) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -189,12 +183,6 @@ static void aspeed_2500_xdma_class_init(ObjectClass *k= lass, const void *data) axc->intr_complete =3D XDMA_IRQ_ENG_STAT_US_COMP | XDMA_IRQ_ENG_STAT_D= S_COMP; }; =20 -static const TypeInfo aspeed_2500_xdma_info =3D { - .name =3D TYPE_ASPEED_2500_XDMA, - .parent =3D TYPE_ASPEED_XDMA, - .class_init =3D aspeed_2500_xdma_class_init, -}; - static void aspeed_2400_xdma_class_init(ObjectClass *klass, const void *da= ta) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -211,12 +199,6 @@ static void aspeed_2400_xdma_class_init(ObjectClass *k= lass, const void *data) axc->intr_complete =3D XDMA_IRQ_ENG_STAT_US_COMP | XDMA_IRQ_ENG_STAT_D= S_COMP; }; =20 -static const TypeInfo aspeed_2400_xdma_info =3D { - .name =3D TYPE_ASPEED_2400_XDMA, - .parent =3D TYPE_ASPEED_XDMA, - .class_init =3D aspeed_2400_xdma_class_init, -}; - static void aspeed_xdma_class_init(ObjectClass *classp, const void *data) { DeviceClass *dc =3D DEVICE_CLASS(classp); @@ -227,20 +209,30 @@ static void aspeed_xdma_class_init(ObjectClass *class= p, const void *data) dc->vmsd =3D &aspeed_xdma_vmstate; } =20 -static const TypeInfo aspeed_xdma_info =3D { - .name =3D TYPE_ASPEED_XDMA, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedXDMAState), - .class_init =3D aspeed_xdma_class_init, - .class_size =3D sizeof(AspeedXDMAClass), - .abstract =3D true, +static const TypeInfo aspeed_xdma_types[] =3D { + { + .name =3D TYPE_ASPEED_XDMA, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedXDMAState), + .class_init =3D aspeed_xdma_class_init, + .class_size =3D sizeof(AspeedXDMAClass), + .abstract =3D true, + }, + { + .name =3D TYPE_ASPEED_2400_XDMA, + .parent =3D TYPE_ASPEED_XDMA, + .class_init =3D aspeed_2400_xdma_class_init, + }, + { + .name =3D TYPE_ASPEED_2500_XDMA, + .parent =3D TYPE_ASPEED_XDMA, + .class_init =3D aspeed_2500_xdma_class_init, + }, + { + .name =3D TYPE_ASPEED_2600_XDMA, + .parent =3D TYPE_ASPEED_XDMA, + .class_init =3D aspeed_2600_xdma_class_init, + } }; =20 -static void aspeed_xdma_register_type(void) -{ - type_register_static(&aspeed_xdma_info); - type_register_static(&aspeed_2400_xdma_info); - type_register_static(&aspeed_2500_xdma_info); - type_register_static(&aspeed_2600_xdma_info); -} -type_init(aspeed_xdma_register_type); +DEFINE_TYPES(aspeed_xdma_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897778; cv=none; d=zohomail.com; s=zohoarc; b=DsWMfmopFORsrF6rutRHylzmcMNOQYVLm6wCG4dApLtZQTKUiQ/u7E/nvU73etBXhcsrxc39YM26IXx2HaafVjHRCITkGcxMkab0HORPboV8eaCRAJX2udMSx7CQ6Da6FHlmjc2aGjdV71FjyM2saqlk7FWGTLXdJEyFX+MXkSk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897778; 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=w4o4YBPTqaZF9lJc3VWqXAsXMM/8Ov8RoJmuGnAl/CU=; b=Bz43akaE4pfqM9n9ASzOG8VJmEUPuQ+9gzFtQaR/d+MHfNTq6MQkynkUhtD6SdM5ScW0fFUM5nyEu2qIL8dXSdc/Tuzp+YGR/kvPQvf/wmAQEGA0ajiGYz8MI9Q8IjsKbbwi7R0vtW/6fcN4Afs7KseKOFOENpznKbyoOu5YNiM= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178089777861496.48454318319284; Sun, 7 Jun 2026 22:49:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSr9-0001Mz-Lx; Mon, 08 Jun 2026 01:49:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSr2-0001Jr-Jd for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSr0-0000Ok-MV for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:48:56 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-189-gYWmfbGXN0avUA1pDkzQLQ-1; Mon, 08 Jun 2026 01:48:52 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 06F07180034C; Mon, 8 Jun 2026 05:48:51 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 88F18765; Mon, 8 Jun 2026 05:48:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w4o4YBPTqaZF9lJc3VWqXAsXMM/8Ov8RoJmuGnAl/CU=; b=hDk43XGdy14c2orFTypgrtJMC5VABvzfqtUXZEUVFfUr/yE1z4VG+HZVEpDmj3TBA/lzd9 MmaD1ob7ngW7Wlz0q/RbmlB62lMsfHsMMmuRwso0ITSYJjBQE6DP6uzCCpkGoPqMs+jUKf 9v2PUXxupcpdhdWsomGUfq05ArCbTA0= X-MC-Unique: gYWmfbGXN0avUA1pDkzQLQ-1 X-Mimecast-MFC-AGG-ID: gYWmfbGXN0avUA1pDkzQLQ_1780897731 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 10/37] hw/adc/aspeed_adc: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:47:59 +0200 Message-ID: <20260608054826.346488-11-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897780366158500 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 7 standalone TypeInfo variables (aspeed_adc_engine_info, aspeed_adc_info as abstract base, aspeed_2400_adc_info, aspeed_2500_adc_info, aspeed_2600_adc_info, aspeed_1030_adc_info, aspeed_2700_adc_info) directly into the 'aspeed_adc_types[]' array, removing the need for separate declarations. Note that aspeed_2400 and aspeed_2500 variants carry only .name and .parent with no class_init. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-11-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/adc/aspeed_adc.c | 95 +++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 55 deletions(-) diff --git a/hw/adc/aspeed_adc.c b/hw/adc/aspeed_adc.c index 18b74898e16b..70655800a4d4 100644 --- a/hw/adc/aspeed_adc.c +++ b/hw/adc/aspeed_adc.c @@ -304,13 +304,6 @@ static void aspeed_adc_engine_class_init(ObjectClass *= klass, const void *data) dc->vmsd =3D &vmstate_aspeed_adc_engine; } =20 -static const TypeInfo aspeed_adc_engine_info =3D { - .name =3D TYPE_ASPEED_ADC_ENGINE, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedADCEngineState), - .class_init =3D aspeed_adc_engine_class_init, -}; - static void aspeed_adc_instance_init(Object *obj) { AspeedADCState *s =3D ASPEED_ADC(obj); @@ -408,53 +401,45 @@ static void aspeed_2700_adc_class_init(ObjectClass *k= lass, const void *data) aac->nr_engines =3D 2; } =20 -static const TypeInfo aspeed_adc_info =3D { - .name =3D TYPE_ASPEED_ADC, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_init =3D aspeed_adc_instance_init, - .instance_size =3D sizeof(AspeedADCState), - .class_init =3D aspeed_adc_class_init, - .class_size =3D sizeof(AspeedADCClass), - .abstract =3D true, -}; - -static const TypeInfo aspeed_2400_adc_info =3D { - .name =3D TYPE_ASPEED_2400_ADC, - .parent =3D TYPE_ASPEED_ADC, -}; - -static const TypeInfo aspeed_2500_adc_info =3D { - .name =3D TYPE_ASPEED_2500_ADC, - .parent =3D TYPE_ASPEED_ADC, -}; - -static const TypeInfo aspeed_2600_adc_info =3D { - .name =3D TYPE_ASPEED_2600_ADC, - .parent =3D TYPE_ASPEED_ADC, - .class_init =3D aspeed_2600_adc_class_init, -}; - -static const TypeInfo aspeed_1030_adc_info =3D { - .name =3D TYPE_ASPEED_1030_ADC, - .parent =3D TYPE_ASPEED_ADC, - .class_init =3D aspeed_1030_adc_class_init, /* No change since AST2600= */ -}; - -static const TypeInfo aspeed_2700_adc_info =3D { - .name =3D TYPE_ASPEED_2700_ADC, - .parent =3D TYPE_ASPEED_ADC, - .class_init =3D aspeed_2700_adc_class_init, +static const TypeInfo aspeed_adc_types[] =3D { + { + .name =3D TYPE_ASPEED_ADC_ENGINE, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedADCEngineState), + .class_init =3D aspeed_adc_engine_class_init, + }, + { + .name =3D TYPE_ASPEED_ADC, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_init =3D aspeed_adc_instance_init, + .instance_size =3D sizeof(AspeedADCState), + .class_init =3D aspeed_adc_class_init, + .class_size =3D sizeof(AspeedADCClass), + .abstract =3D true, + }, + { + .name =3D TYPE_ASPEED_1030_ADC, + .parent =3D TYPE_ASPEED_ADC, + .class_init =3D aspeed_1030_adc_class_init, /* No change since AST= 2600 */ + }, + { + .name =3D TYPE_ASPEED_2400_ADC, + .parent =3D TYPE_ASPEED_ADC, + }, + { + .name =3D TYPE_ASPEED_2500_ADC, + .parent =3D TYPE_ASPEED_ADC, + }, + { + .name =3D TYPE_ASPEED_2600_ADC, + .parent =3D TYPE_ASPEED_ADC, + .class_init =3D aspeed_2600_adc_class_init, + }, + { + .name =3D TYPE_ASPEED_2700_ADC, + .parent =3D TYPE_ASPEED_ADC, + .class_init =3D aspeed_2700_adc_class_init, + } }; =20 -static void aspeed_adc_register_types(void) -{ - type_register_static(&aspeed_adc_engine_info); - type_register_static(&aspeed_adc_info); - type_register_static(&aspeed_2400_adc_info); - type_register_static(&aspeed_2500_adc_info); - type_register_static(&aspeed_2600_adc_info); - type_register_static(&aspeed_1030_adc_info); - type_register_static(&aspeed_2700_adc_info); -} - -type_init(aspeed_adc_register_types); +DEFINE_TYPES(aspeed_adc_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897881; cv=none; d=zohomail.com; s=zohoarc; b=dLOJzVyhMsaTvP2n2XVcsacByIbNB7XXxbp1SECu9fhKxwZhVaDq5IGGwYrTA+lIWnHAjIgaz0zTNUexeKFKiEYdfeEWvA3eRoVxbi5k8z/FWsXzXYkOKxiFaAdygyJr8VZtG31HRaulZcyOniAKP+tqu6GltKV0OgBLnK9S8Zg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897881; 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=sPrl4JP1fMu1Jf/dNqJ1VVy1Jjsvzj5NVwzbCq4lY8E=; b=KoZWwGDPCdwrbSjnbN3bx8cSsMgHZdRzj/9wQES5pyl7CqDyiNYyidIQrkkyv8Yx2V7PVIzrNq6CkP6Y7o6uoBdLexT6sc3UMwW2ZNcsiymzj7D+A2h8HTGrVJZ60e31/byYmlnZcsErA7zwxg+AvWB8xUkePVbtQQNaQEkA0sQ= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897881664296.55588151326333; Sun, 7 Jun 2026 22:51:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSrB-0001PJ-3M; Mon, 08 Jun 2026 01:49:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSr8-0001M6-KJ for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSr5-0000Ph-US for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:02 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-17-3Y9ptUkoMF6IZozH6hZYtA-1; Mon, 08 Jun 2026 01:48:53 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EEFF61956080; Mon, 8 Jun 2026 05:48:52 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7AF3827A; Mon, 8 Jun 2026 05:48:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sPrl4JP1fMu1Jf/dNqJ1VVy1Jjsvzj5NVwzbCq4lY8E=; b=DGuN+lGxkCHrH2q4Dm0XG8NwXhOMsPRSQHGHgID0ZuHFHPk4HNhACikPpDdP/ISSi1WmtD W7d83bB84laRo9S/kZjdoGoKnZthUc2Ek7FZ9GJWtM21hzwHZhJaipTFnHVhLL8NGDW6wM L5mCDJIZ7TFD2lDY2/nyBNQB5IkSZzI= X-MC-Unique: 3Y9ptUkoMF6IZozH6hZYtA-1 X-Mimecast-MFC-AGG-ID: 3Y9ptUkoMF6IZozH6hZYtA_1780897733 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 11/37] hw/arm/aspeed_ast1700: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:00 +0200 Message-ID: <20260608054826.346488-12-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897884722154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline the standalone TypeInfo variable directly into the 'aspeed_ast1700_types[]' array, removing the need for a separate declaration. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-12-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast1700.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/hw/arm/aspeed_ast1700.c b/hw/arm/aspeed_ast1700.c index e90302c11bcd..5af5da5b8a73 100644 --- a/hw/arm/aspeed_ast1700.c +++ b/hw/arm/aspeed_ast1700.c @@ -260,17 +260,14 @@ static void aspeed_ast1700_class_init(ObjectClass *kl= ass, const void *data) device_class_set_props(dc, aspeed_ast1700_props); } =20 -static const TypeInfo aspeed_ast1700_info =3D { - .name =3D TYPE_ASPEED_AST1700, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedAST1700SoCState), - .class_init =3D aspeed_ast1700_class_init, - .instance_init =3D aspeed_ast1700_instance_init, +static const TypeInfo aspeed_ast1700_types[] =3D { + { + .name =3D TYPE_ASPEED_AST1700, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedAST1700SoCState), + .class_init =3D aspeed_ast1700_class_init, + .instance_init =3D aspeed_ast1700_instance_init, + } }; =20 -static void aspeed_ast1700_register_types(void) -{ - type_register_static(&aspeed_ast1700_info); -} - -type_init(aspeed_ast1700_register_types); +DEFINE_TYPES(aspeed_ast1700_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897864; cv=none; d=zohomail.com; s=zohoarc; b=gB37vPODaCTBbvxBqyIPLF5bwXLZXkzNA/P2zAU39UJpQAQ4LXPD5r50f/D+hC9CDJCqk0kSdc7x+UfV/vgoN52sFsYHyR1mNElM7NsYnBCo0QFdTaOrozGYjeiK5g0cl+QFBclQ5CYgAto3xNIm4F4T63vuYVxaVqkHAy15r6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897864; 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=eTN8rNiwkrkn4z2DtG3p+A8vcPd+ijCI2gQu67LiiW4=; b=gI898HfNyxzYYNxLNPWvVhov2AjDQYTrjz0p5f/VU0vi+mKSp6fCzRg9e/cyuegNt2O/O86rwszWvGj8tI+0ukvDnkiuleS4yMRj9uGIZRts0i/ZoPDd90u5v3quDOC4bSG1oLBuPQTKj2clo7pC+EQlVYhIi70+PPwygH4ZeTk= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897864045339.95309223881907; Sun, 7 Jun 2026 22:51:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSrA-0001Ng-6O; Mon, 08 Jun 2026 01:49:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSr8-0001LZ-0j for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSr4-0000PS-Nb for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:01 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-7-n1lqtjzPPO--nh0vJhTDDQ-1; Mon, 08 Jun 2026 01:48:56 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 040B019560AA; Mon, 8 Jun 2026 05:48:55 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6DE26765; Mon, 8 Jun 2026 05:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eTN8rNiwkrkn4z2DtG3p+A8vcPd+ijCI2gQu67LiiW4=; b=QUPWMZIWjHtPcjdLBsqzMeZsIP0E7e0rSKiiuNs54daCMNEnxXjfmCLL+N2A/FG7w4+hGA 7BY7WvzY9nPJsEmUa7JNaChEhVg6Mi0KG59QBOIFTocskss0fctiFPXcncVzWaVvJ8HAe0 dCky/xtt6iKqd+Swg5xDNUkUzhtGYPw= X-MC-Unique: n1lqtjzPPO--nh0vJhTDDQ-1 X-Mimecast-MFC-AGG-ID: n1lqtjzPPO--nh0vJhTDDQ_1780897735 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 12/37] hw/gpio/aspeed_gpio: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:01 +0200 Message-ID: <20260608054826.346488-13-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897866042158500 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 7 standalone TypeInfo variables (aspeed_gpio_info as abstract base, aspeed_2400_gpio_info, aspeed_2500_gpio_info, aspeed_2600_1_8v_gpio_info, aspeed_2600_3_3v_gpio_info, aspeed_1030_gpio_info, aspeed_2700_gpio_info) directly into the 'aspeed_gpio_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-13-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/gpio/aspeed_gpio.c | 107 ++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 61 deletions(-) diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index ef321b738620..1cf6f5df5505 100644 --- a/hw/gpio/aspeed_gpio.c +++ b/hw/gpio/aspeed_gpio.c @@ -1620,66 +1620,51 @@ static void aspeed_gpio_2700_class_init(ObjectClass= *klass, const void *data) agc->reg_ops =3D &aspeed_gpio_2700_ops; } =20 -static const TypeInfo aspeed_gpio_info =3D { - .name =3D TYPE_ASPEED_GPIO, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedGPIOState), - .class_size =3D sizeof(AspeedGPIOClass), - .class_init =3D aspeed_gpio_class_init, - .abstract =3D true, -}; - -static const TypeInfo aspeed_gpio_ast2400_info =3D { - .name =3D TYPE_ASPEED_GPIO "-ast2400", - .parent =3D TYPE_ASPEED_GPIO, - .class_init =3D aspeed_gpio_ast2400_class_init, - .instance_init =3D aspeed_gpio_init, -}; - -static const TypeInfo aspeed_gpio_ast2500_info =3D { - .name =3D TYPE_ASPEED_GPIO "-ast2500", - .parent =3D TYPE_ASPEED_GPIO, - .class_init =3D aspeed_gpio_2500_class_init, - .instance_init =3D aspeed_gpio_init, -}; - -static const TypeInfo aspeed_gpio_ast2600_3_3v_info =3D { - .name =3D TYPE_ASPEED_GPIO "-ast2600", - .parent =3D TYPE_ASPEED_GPIO, - .class_init =3D aspeed_gpio_ast2600_3_3v_class_init, - .instance_init =3D aspeed_gpio_init, -}; - -static const TypeInfo aspeed_gpio_ast2600_1_8v_info =3D { - .name =3D TYPE_ASPEED_GPIO "-ast2600-1_8v", - .parent =3D TYPE_ASPEED_GPIO, - .class_init =3D aspeed_gpio_ast2600_1_8v_class_init, - .instance_init =3D aspeed_gpio_init, -}; - -static const TypeInfo aspeed_gpio_ast1030_info =3D { - .name =3D TYPE_ASPEED_GPIO "-ast1030", - .parent =3D TYPE_ASPEED_GPIO, - .class_init =3D aspeed_gpio_1030_class_init, - .instance_init =3D aspeed_gpio_init, -}; - -static const TypeInfo aspeed_gpio_ast2700_info =3D { - .name =3D TYPE_ASPEED_GPIO "-ast2700", - .parent =3D TYPE_ASPEED_GPIO, - .class_init =3D aspeed_gpio_2700_class_init, - .instance_init =3D aspeed_gpio_init, +static const TypeInfo aspeed_gpio_types[] =3D { + { + .name =3D TYPE_ASPEED_GPIO, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedGPIOState), + .class_size =3D sizeof(AspeedGPIOClass), + .class_init =3D aspeed_gpio_class_init, + .abstract =3D true, + }, + { + .name =3D TYPE_ASPEED_GPIO "-ast1030", + .parent =3D TYPE_ASPEED_GPIO, + .class_init =3D aspeed_gpio_1030_class_init, + .instance_init =3D aspeed_gpio_init, + }, + { + .name =3D TYPE_ASPEED_GPIO "-ast2400", + .parent =3D TYPE_ASPEED_GPIO, + .class_init =3D aspeed_gpio_ast2400_class_init, + .instance_init =3D aspeed_gpio_init, + }, + { + .name =3D TYPE_ASPEED_GPIO "-ast2500", + .parent =3D TYPE_ASPEED_GPIO, + .class_init =3D aspeed_gpio_2500_class_init, + .instance_init =3D aspeed_gpio_init, + }, + { + .name =3D TYPE_ASPEED_GPIO "-ast2600", + .parent =3D TYPE_ASPEED_GPIO, + .class_init =3D aspeed_gpio_ast2600_3_3v_class_init, + .instance_init =3D aspeed_gpio_init, + }, + { + .name =3D TYPE_ASPEED_GPIO "-ast2600-1_8v", + .parent =3D TYPE_ASPEED_GPIO, + .class_init =3D aspeed_gpio_ast2600_1_8v_class_init, + .instance_init =3D aspeed_gpio_init, + }, + { + .name =3D TYPE_ASPEED_GPIO "-ast2700", + .parent =3D TYPE_ASPEED_GPIO, + .class_init =3D aspeed_gpio_2700_class_init, + .instance_init =3D aspeed_gpio_init, + } }; =20 -static void aspeed_gpio_register_types(void) -{ - type_register_static(&aspeed_gpio_info); - type_register_static(&aspeed_gpio_ast2400_info); - type_register_static(&aspeed_gpio_ast2500_info); - type_register_static(&aspeed_gpio_ast2600_3_3v_info); - type_register_static(&aspeed_gpio_ast2600_1_8v_info); - type_register_static(&aspeed_gpio_ast1030_info); - type_register_static(&aspeed_gpio_ast2700_info); -} - -type_init(aspeed_gpio_register_types); +DEFINE_TYPES(aspeed_gpio_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897853; cv=none; d=zohomail.com; s=zohoarc; b=b6DsWjz9nTTX71OnXFhazEh6kxdbdn0YCh2Uz0iSsuTqj8k+bY86yDQqHok/hhARNaXmAs7ixIc7IV5Ivd1lnTTpEEOM48GqC0GAj2OLVd9ilQcS6sYRPD9aH/NhikvANybSYghRptHoM96oVxu6qBD27HVAaSb5rTQIKi0TJ4A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897853; 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=f8nn7+5MK5dYSRR9+P7Ec0CabtdONessNo0TO/ApKhI=; b=P9Xdg8OXy5Ie8vWzJuSLbBySYzTECp/QYpxnC0sAC4nNiWt5XecqXjab1b5TfV4rqzyBkr7iPu9e9CXJFapi7xPdlcePryOLftEAcQ+0JZYNKp9lTr7kzv1/dXmMrci2Es4tiQllDfO1BGiQr1TFzHWtKQ7Zne8vnwklxPKowdo= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897853570760.1863330117352; Sun, 7 Jun 2026 22:50:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSrB-0001PQ-T2; Mon, 08 Jun 2026 01:49:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrA-0001NQ-18 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSr7-0000Q3-Pr for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:03 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-32-5-N_4-SUPn6p_v9hXMFskw-1; Mon, 08 Jun 2026 01:48:57 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D380F180049F; Mon, 8 Jun 2026 05:48:56 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5ED6327A; Mon, 8 Jun 2026 05:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f8nn7+5MK5dYSRR9+P7Ec0CabtdONessNo0TO/ApKhI=; b=XxU8VcTqGHQYnENC2XeYglZ3XNqTo2OHFgxPI9YC4CQqruw/oW6vAuGUcUiXYR00qwQrxZ 3/ZZA5hUUvG5DrlRAHj/gd14y/gbv+DH0N5/Acj9OrEQJnke+5vwPDsj0i5RJoPvepDHgp awX8TcSkDXzD/jmMBRQiSiCDfbnWtqM= X-MC-Unique: 5-N_4-SUPn6p_v9hXMFskw-1 X-Mimecast-MFC-AGG-ID: 5-N_4-SUPn6p_v9hXMFskw_1780897736 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 13/37] hw/gpio/aspeed_sgpio: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:02 +0200 Message-ID: <20260608054826.346488-14-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897856625154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 2 standalone TypeInfo variables (aspeed_sgpio_info and aspeed_sgpio_ast2700_info) directly into the 'aspeed_sgpio_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-14-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/gpio/aspeed_sgpio.c | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/hw/gpio/aspeed_sgpio.c b/hw/gpio/aspeed_sgpio.c index 0c53b03464e4..7d2f73699520 100644 --- a/hw/gpio/aspeed_sgpio.c +++ b/hw/gpio/aspeed_sgpio.c @@ -321,26 +321,21 @@ static void aspeed_sgpio_2700_class_init(ObjectClass = *klass, const void *data) agc->reg_ops =3D &aspeed_sgpio_2700_ops; } =20 -static const TypeInfo aspeed_sgpio_info =3D { - .name =3D TYPE_ASPEED_SGPIO, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedSGPIOState), - .class_size =3D sizeof(AspeedSGPIOClass), - .class_init =3D aspeed_sgpio_class_init, - .abstract =3D true, -}; - -static const TypeInfo aspeed_sgpio_ast2700_info =3D { - .name =3D TYPE_ASPEED_SGPIO "-ast2700", - .parent =3D TYPE_ASPEED_SGPIO, - .class_init =3D aspeed_sgpio_2700_class_init, - .instance_init =3D aspeed_sgpio_init, +static const TypeInfo aspeed_sgpio_types[] =3D { + { + .name =3D TYPE_ASPEED_SGPIO, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedSGPIOState), + .class_size =3D sizeof(AspeedSGPIOClass), + .class_init =3D aspeed_sgpio_class_init, + .abstract =3D true, + }, + { + .name =3D TYPE_ASPEED_SGPIO "-ast2700", + .parent =3D TYPE_ASPEED_SGPIO, + .class_init =3D aspeed_sgpio_2700_class_init, + .instance_init =3D aspeed_sgpio_init, + } }; =20 -static void aspeed_sgpio_register_types(void) -{ - type_register_static(&aspeed_sgpio_info); - type_register_static(&aspeed_sgpio_ast2700_info); -} - -type_init(aspeed_sgpio_register_types); +DEFINE_TYPES(aspeed_sgpio_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897909; cv=none; d=zohomail.com; s=zohoarc; b=n+z+LSflgAdKmzqc7jCXguv5rqbbeLmP6eK+mE3dnnx57cv9SH+vJl9Ld8GXIlNo8IwTeNk9pZ4swPMpofSjwQmzJhZ9dahEK6/pxmcPntEunZenDYLRwbR1X2OwHQDPTXlxuy6IkCCjg9DyCm4mMYTjqQf6QvCi9Q3D9LUlvPQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897909; 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=OA4VTxBMv/eFsypPaw7iuNoEF9+XJvFkkQ8VRSb6QsI=; b=nTOoyk/qt9ebmH96STAL9cFYHmieEWUxYTJE7Qh20foqXFaJdp6fgtvly6hOAqANWi85nIRq+5X9MhDK3iP1bYMDjYcUMVZoBoq8kdDSVeuH1m6vFqmNFitU4UpjAXWlSNMHHfsVbXQomTXWvcmWsbSmS/YiGYblMwGLMPc0wIw= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897909509609.6991075142035; Sun, 7 Jun 2026 22:51:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSrF-0001TW-ON; Mon, 08 Jun 2026 01:49:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrE-0001SU-Js for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrC-0000SA-MK for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:08 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-375-6VP8uo9DNRK1vXQ5EnmF-g-1; Mon, 08 Jun 2026 01:49:00 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 112EF18003FC; Mon, 8 Jun 2026 05:48:59 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 507F3765; Mon, 8 Jun 2026 05:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OA4VTxBMv/eFsypPaw7iuNoEF9+XJvFkkQ8VRSb6QsI=; b=AEkpw39JlgEtHdQRSUvqNM55IuVybz1ChFRbvCbv/ZwT2ACHewl+jWMnt873Y013cYva5g r100Tg3FG4OS0wQ6eKpm+/8oTR2vA3TSLX3kTwIqxR1AfB0C/MqfgVwr/xphCw8ZaItgDT jTJ+ovg5dzaVxu/ZUJR1GcQEumx0WP4= X-MC-Unique: 6VP8uo9DNRK1vXQ5EnmF-g-1 X-Mimecast-MFC-AGG-ID: 6VP8uo9DNRK1vXQ5EnmF-g_1780897739 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 14/37] hw/intc/aspeed_intc: convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:03 +0200 Message-ID: <20260608054826.346488-15-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897913229154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 9 standalone TypeInfo variables (aspeed_intc_info as abstract base, aspeed_2700_intc_info, aspeed_2700_intcio_info, aspeed_2700_intcioexp1_info, aspeed_2700_intcioexp2_info, aspeed_2700ssp_intc_info, aspeed_2700ssp_intcio_info, aspeed_2700tsp_intc_info, aspeed_2700tsp_intcio_info) directly into the 'aspeed_intc_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-15-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/intc/aspeed_intc.c | 121 ++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 70 deletions(-) diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c index 389280943091..5a36fff52040 100644 --- a/hw/intc/aspeed_intc.c +++ b/hw/intc/aspeed_intc.c @@ -758,16 +758,6 @@ static void aspeed_intc_class_init(ObjectClass *klass,= const void *data) aic->reg_ops =3D &aspeed_intc_ops; } =20 -static const TypeInfo aspeed_intc_info =3D { - .name =3D TYPE_ASPEED_INTC, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_init =3D aspeed_intc_instance_init, - .instance_size =3D sizeof(AspeedINTCState), - .class_init =3D aspeed_intc_class_init, - .class_size =3D sizeof(AspeedINTCClass), - .abstract =3D true, -}; - static AspeedINTCIRQ aspeed_2700_intc_irqs[ASPEED_INTC_MAX_INPINS] =3D { {0, 0, 10, R_GICINT192_201_EN, R_GICINT192_201_STATUS}, }; @@ -788,12 +778,6 @@ static void aspeed_2700_intc_class_init(ObjectClass *k= lass, const void *data) aic->irq_table_count =3D ARRAY_SIZE(aspeed_2700_intc_irqs); } =20 -static const TypeInfo aspeed_2700_intc_info =3D { - .name =3D TYPE_ASPEED_2700_INTC, - .parent =3D TYPE_ASPEED_INTC, - .class_init =3D aspeed_2700_intc_class_init, -}; - static AspeedINTCIRQ aspeed_2700_intcioexp2_irqs[ASPEED_INTC_MAX_INPINS] = =3D { {0, 8, 1, R_GICINT192_EN, R_GICINT192_STATUS}, {1, 9, 1, R_GICINT193_EN, R_GICINT193_STATUS}, @@ -817,12 +801,6 @@ static void aspeed_2700_intcioexp2_class_init(ObjectCl= ass *klass, aic->irq_table_count =3D ARRAY_SIZE(aspeed_2700_intcioexp2_irqs); } =20 -static const TypeInfo aspeed_2700_intcioexp2_info =3D { - .name =3D TYPE_ASPEED_2700_INTCIOEXP2, - .parent =3D TYPE_ASPEED_INTC, - .class_init =3D aspeed_2700_intcioexp2_class_init, -}; - static AspeedINTCIRQ aspeed_2700_intcioexp1_irqs[ASPEED_INTC_MAX_INPINS] = =3D { {0, 6, 1, R_GICINT192_EN, R_GICINT192_STATUS}, {1, 7, 1, R_GICINT193_EN, R_GICINT193_STATUS}, @@ -846,12 +824,6 @@ static void aspeed_2700_intcioexp1_class_init(ObjectCl= ass *klass, aic->irq_table_count =3D ARRAY_SIZE(aspeed_2700_intcioexp1_irqs); } =20 -static const TypeInfo aspeed_2700_intcioexp1_info =3D { - .name =3D TYPE_ASPEED_2700_INTCIOEXP1, - .parent =3D TYPE_ASPEED_INTC, - .class_init =3D aspeed_2700_intcioexp1_class_init, -}; - static AspeedINTCIRQ aspeed_2700_intcio_irqs[ASPEED_INTC_MAX_INPINS] =3D { {0, 0, 1, R_GICINT192_EN, R_GICINT192_STATUS}, {1, 1, 1, R_GICINT193_EN, R_GICINT193_STATUS}, @@ -878,12 +850,6 @@ static void aspeed_2700_intcio_class_init(ObjectClass = *klass, const void *data) aic->irq_table_count =3D ARRAY_SIZE(aspeed_2700_intcio_irqs); } =20 -static const TypeInfo aspeed_2700_intcio_info =3D { - .name =3D TYPE_ASPEED_2700_INTCIO, - .parent =3D TYPE_ASPEED_INTC, - .class_init =3D aspeed_2700_intcio_class_init, -}; - static AspeedINTCIRQ aspeed_2700ssp_intc_irqs[ASPEED_INTC_MAX_INPINS] =3D { {0, 0, 10, R_SSPINT160_169_EN, R_SSPINT160_169_STATUS}, }; @@ -905,12 +871,6 @@ static void aspeed_2700ssp_intc_class_init(ObjectClass= *klass, const void *data) aic->irq_table_count =3D ARRAY_SIZE(aspeed_2700ssp_intc_irqs); } =20 -static const TypeInfo aspeed_2700ssp_intc_info =3D { - .name =3D TYPE_ASPEED_2700SSP_INTC, - .parent =3D TYPE_ASPEED_INTC, - .class_init =3D aspeed_2700ssp_intc_class_init, -}; - static AspeedINTCIRQ aspeed_2700ssp_intcio_irqs[ASPEED_INTC_MAX_INPINS] = =3D { {0, 0, 1, R_SSPINT160_EN, R_SSPINT160_STATUS}, {1, 1, 1, R_SSPINT161_EN, R_SSPINT161_STATUS}, @@ -938,12 +898,6 @@ static void aspeed_2700ssp_intcio_class_init(ObjectCla= ss *klass, aic->irq_table_count =3D ARRAY_SIZE(aspeed_2700ssp_intcio_irqs); } =20 -static const TypeInfo aspeed_2700ssp_intcio_info =3D { - .name =3D TYPE_ASPEED_2700SSP_INTCIO, - .parent =3D TYPE_ASPEED_INTC, - .class_init =3D aspeed_2700ssp_intcio_class_init, -}; - static AspeedINTCIRQ aspeed_2700tsp_intc_irqs[ASPEED_INTC_MAX_INPINS] =3D { {0, 0, 10, R_TSPINT160_169_EN, R_TSPINT160_169_STATUS}, }; @@ -965,12 +919,6 @@ static void aspeed_2700tsp_intc_class_init(ObjectClass= *klass, const void *data) aic->irq_table_count =3D ARRAY_SIZE(aspeed_2700tsp_intc_irqs); } =20 -static const TypeInfo aspeed_2700tsp_intc_info =3D { - .name =3D TYPE_ASPEED_2700TSP_INTC, - .parent =3D TYPE_ASPEED_INTC, - .class_init =3D aspeed_2700tsp_intc_class_init, -}; - static AspeedINTCIRQ aspeed_2700tsp_intcio_irqs[ASPEED_INTC_MAX_INPINS] = =3D { {0, 0, 1, R_TSPINT160_EN, R_TSPINT160_STATUS}, {1, 1, 1, R_TSPINT161_EN, R_TSPINT161_STATUS}, @@ -998,23 +946,56 @@ static void aspeed_2700tsp_intcio_class_init(ObjectCl= ass *klass, aic->irq_table_count =3D ARRAY_SIZE(aspeed_2700tsp_intcio_irqs); } =20 -static const TypeInfo aspeed_2700tsp_intcio_info =3D { - .name =3D TYPE_ASPEED_2700TSP_INTCIO, - .parent =3D TYPE_ASPEED_INTC, - .class_init =3D aspeed_2700tsp_intcio_class_init, +static const TypeInfo aspeed_intc_types[] =3D { + { + .name =3D TYPE_ASPEED_INTC, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_init =3D aspeed_intc_instance_init, + .instance_size =3D sizeof(AspeedINTCState), + .class_init =3D aspeed_intc_class_init, + .class_size =3D sizeof(AspeedINTCClass), + .abstract =3D true, + }, + { + .name =3D TYPE_ASPEED_2700_INTC, + .parent =3D TYPE_ASPEED_INTC, + .class_init =3D aspeed_2700_intc_class_init, + }, + { + .name =3D TYPE_ASPEED_2700_INTCIO, + .parent =3D TYPE_ASPEED_INTC, + .class_init =3D aspeed_2700_intcio_class_init, + }, + { + .name =3D TYPE_ASPEED_2700SSP_INTC, + .parent =3D TYPE_ASPEED_INTC, + .class_init =3D aspeed_2700ssp_intc_class_init, + }, + { + .name =3D TYPE_ASPEED_2700SSP_INTCIO, + .parent =3D TYPE_ASPEED_INTC, + .class_init =3D aspeed_2700ssp_intcio_class_init, + }, + { + .name =3D TYPE_ASPEED_2700TSP_INTC, + .parent =3D TYPE_ASPEED_INTC, + .class_init =3D aspeed_2700tsp_intc_class_init, + }, + { + .name =3D TYPE_ASPEED_2700TSP_INTCIO, + .parent =3D TYPE_ASPEED_INTC, + .class_init =3D aspeed_2700tsp_intcio_class_init, + }, + { + .name =3D TYPE_ASPEED_2700_INTCIOEXP1, + .parent =3D TYPE_ASPEED_INTC, + .class_init =3D aspeed_2700_intcioexp1_class_init, + }, + { + .name =3D TYPE_ASPEED_2700_INTCIOEXP2, + .parent =3D TYPE_ASPEED_INTC, + .class_init =3D aspeed_2700_intcioexp2_class_init, + } }; =20 -static void aspeed_intc_register_types(void) -{ - type_register_static(&aspeed_intc_info); - type_register_static(&aspeed_2700_intc_info); - type_register_static(&aspeed_2700_intcio_info); - type_register_static(&aspeed_2700_intcioexp1_info); - type_register_static(&aspeed_2700_intcioexp2_info); - type_register_static(&aspeed_2700ssp_intc_info); - type_register_static(&aspeed_2700ssp_intcio_info); - type_register_static(&aspeed_2700tsp_intc_info); - type_register_static(&aspeed_2700tsp_intcio_info); -} - -type_init(aspeed_intc_register_types); +DEFINE_TYPES(aspeed_intc_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898219; cv=none; d=zohomail.com; s=zohoarc; b=n481NKzCdBotk7gXxryd9eHr8d0iv7ifI9PIN26aBoTkfBpxl29KqOIJ+pC6RkCmXRmU+oDppdAwGnb4swQVQF5r6lFAMC+fAMF3WTsKUm0AHFqvLSpCLkZQVqhF78SYHEiZR1IsmW+fM00VlbFbV0aNkEY17p+53yhMA2tXqss= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898219; 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=S+ZsnyN6EjbBy0MH6Jj3+JhfJd/EN6CIq6apAopO5/I=; b=XDdjK/GzFw4f7fyrNqsNjBzF3UWGU6hd0f6kRaEoPLxmWim40KcpVxLahjIF1HCwTEgT7X9hfuVz9gECBMkLCVTjhxtrDFxo2Cry47/k2iNOg8mSZEnbSXvwcKZ8subsAijgA5AUHR7VCKPYwMBxdsUGSj+JjKJ2oXQB7O08Kbw= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898219837833.5572303767061; Sun, 7 Jun 2026 22:56:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSrD-0001Rm-F6; Mon, 08 Jun 2026 01:49:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrC-0001Ps-5u for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrA-0000Rf-CG for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:05 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-Ca9gM7XAPYCCs15Q21G0wQ-1; Mon, 08 Jun 2026 01:49:01 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E39C61956089; Mon, 8 Jun 2026 05:49:00 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6F76A27A; Mon, 8 Jun 2026 05:48:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S+ZsnyN6EjbBy0MH6Jj3+JhfJd/EN6CIq6apAopO5/I=; b=UuIVldxqBJx9nWTaZXJ+O2iLA90Zavbmdcn8TDajvVszjbAo2r4/HHO/IFKbPprK3Rj63H oFdcX9ec6eeQw8aItdMVO7pcrNf7nB2RSjLIh7zgUjYAbtTEm+BxaCABpUGjFTnh1q/3kQ VqtLMWvsO3WVueRVIMksDBOzw5/+8SA= X-MC-Unique: Ca9gM7XAPYCCs15Q21G0wQ-1 X-Mimecast-MFC-AGG-ID: Ca9gM7XAPYCCs15Q21G0wQ_1780897741 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 15/37] hw/intc/aspeed_vic: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:04 +0200 Message-ID: <20260608054826.346488-16-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898221490158500 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline the standalone 'aspeed_vic_info' TypeInfo variable directly into the 'aspeed_vic_types[]' array, removing the need for a separate declaration. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-16-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/intc/aspeed_vic.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/intc/aspeed_vic.c b/hw/intc/aspeed_vic.c index 13d8423d835a..bd0c87802e67 100644 --- a/hw/intc/aspeed_vic.c +++ b/hw/intc/aspeed_vic.c @@ -349,16 +349,13 @@ static void aspeed_vic_class_init(ObjectClass *klass,= const void *data) dc->vmsd =3D &vmstate_aspeed_vic; } =20 -static const TypeInfo aspeed_vic_info =3D { - .name =3D TYPE_ASPEED_VIC, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedVICState), - .class_init =3D aspeed_vic_class_init, +static const TypeInfo aspeed_vic_types[] =3D { + { + .name =3D TYPE_ASPEED_VIC, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedVICState), + .class_init =3D aspeed_vic_class_init, + } }; =20 -static void aspeed_vic_register_types(void) -{ - type_register_static(&aspeed_vic_info); -} - -type_init(aspeed_vic_register_types); +DEFINE_TYPES(aspeed_vic_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898050; cv=none; d=zohomail.com; s=zohoarc; b=bsZ7k1meZygPQukVtpook/ddF+/+RA3BZ/auMnakMlADlFT815rQh9jYDRCikd+LtKRbWq+axZvq1uSjIF+UiiniyyqkAyWA4girA6bFpogtPmTpXaao2dL8sSVjjrHmUxQMfZ2gLcFbEWsIONsRBNkj5BXtfpmb87XXXLCxOz4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898050; 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=XlUGdmd+fZ/TA2952gpeDRYYFuB19FKpw9oMK2HB2pQ=; b=V5h6fWOFki4l4Real8B/tJckx/c7j13Xz1dkNLqjVPZ2c+fRvg+4gc305trxUc5X2beLXVFubJ0XdsqpuR50CmH02Cn5Jtb5oY2Nbi08IWNo7JiNOHX4qwEU0AmmVjsZP6ddzzebkvQ7fsLppmlzwg0NIgGedWsdzp3D8pnrvLw= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898050346806.1787534110659; Sun, 7 Jun 2026 22:54:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSrH-0001UE-LK; Mon, 08 Jun 2026 01:49:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrG-0001U2-KH for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrF-0000Sm-7R for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:10 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-484-z0krKfveO4-YcTyWjzMnJA-1; Mon, 08 Jun 2026 01:49:04 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0C48A180048E; Mon, 8 Jun 2026 05:49:03 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6148C765; Mon, 8 Jun 2026 05:49:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XlUGdmd+fZ/TA2952gpeDRYYFuB19FKpw9oMK2HB2pQ=; b=OHuqBuECw4gv4TJP8m8QiKP0JnAAeL9KUHu/nnLuAUNYBRNlBHsdFDGCJv00YNvW4EkiKP Emx5EZEdv2UYOHmClCve2t0TXUhZf/1069YLezR5LeePlm19GjmoeDA17BycqMUfpEA+yu 53JfqOXHqXSuUdRZjI6Mqd/1FtnPIwQ= X-MC-Unique: z0krKfveO4-YcTyWjzMnJA-1 X-Mimecast-MFC-AGG-ID: z0krKfveO4-YcTyWjzMnJA_1780897743 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 16/37] hw/rtc/aspeed_rtc: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:05 +0200 Message-ID: <20260608054826.346488-17-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898053306154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline the standalone 'aspeed_rtc_info' TypeInfo variable directly into the 'aspeed_rtc_types[]' array, removing the need for a separate declaration. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-17-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/rtc/aspeed_rtc.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/rtc/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c index 5245f3f95633..34d9fcfa36c4 100644 --- a/hw/rtc/aspeed_rtc.c +++ b/hw/rtc/aspeed_rtc.c @@ -166,16 +166,13 @@ static void aspeed_rtc_class_init(ObjectClass *klass,= const void *data) rc->phases.hold =3D aspeed_rtc_reset_hold; } =20 -static const TypeInfo aspeed_rtc_info =3D { - .name =3D TYPE_ASPEED_RTC, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedRtcState), - .class_init =3D aspeed_rtc_class_init, +static const TypeInfo aspeed_rtc_types[] =3D { + { + .name =3D TYPE_ASPEED_RTC, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedRtcState), + .class_init =3D aspeed_rtc_class_init, + } }; =20 -static void aspeed_rtc_register_types(void) -{ - type_register_static(&aspeed_rtc_info); -} - -type_init(aspeed_rtc_register_types) +DEFINE_TYPES(aspeed_rtc_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898061; cv=none; d=zohomail.com; s=zohoarc; b=GT2ItK7tLS3rkMQZvUzm6u/xgTsUQ8AYm2xq/fPhyC+FQ3wgpwL2CSnPLAWloEvdTUtPumti2ZdaGCqHSl4Kt7Pt6Z1A4D9DmLP0RxkYPejMHn6pXKL0CwNoHc2v4DCn4cCN7ggFL4nYun1YtZyiARhgEmZz/UH3T06AokNO9uI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898061; 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=OVNxIapeP19+wx1gDjvqqWIIr+P2jHWr5RYAQhzozXc=; b=TJwC2y/g0F9oDJKF9s3TrMIVoobx+OHlEyMui2CnxRZ+MBIUORbxbU1PHlhLAjjmCV3KoYSiGbvYGj3lEfv253NJXdsezP/BcLxB11RGUJHLI5IR4HU5PSvQKliEvSAQlSEjhVCq4QuA26u0/7AyQf9xHIXVGN74ye88LHZBIgo= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178089806151510.091823696173833; Sun, 7 Jun 2026 22:54:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSrK-0001VM-Bx; Mon, 08 Jun 2026 01:49:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrH-0001UF-W2 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrG-0000Ss-6E for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:11 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-393-tDUH6tROMim-ziT8GJCmCQ-1; Mon, 08 Jun 2026 01:49:06 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 345231956096; Mon, 8 Jun 2026 05:49:05 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7FEBF765; Mon, 8 Jun 2026 05:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OVNxIapeP19+wx1gDjvqqWIIr+P2jHWr5RYAQhzozXc=; b=OlOHIdXZorU4nTmCn+xIg0v5iN2MHJS6bZAbRnWQEWuSDRzfQ+Ll95PUjYFVGXB5YHaj6M 4uy8jPP2NnWBVmtGxTGw09A417+BITy0ROl7+iWBj8V+GuPUmxwDx9n6rL999GIt0ImBnO Q1we1KuCzkI6UDkVv9H5tB4YtKP17Lc= X-MC-Unique: tDUH6tROMim-ziT8GJCmCQ-1 X-Mimecast-MFC-AGG-ID: tDUH6tROMim-ziT8GJCmCQ_1780897745 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 17/37] hw/watchdog/wdt_aspeed: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:06 +0200 Message-ID: <20260608054826.346488-18-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898063683154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 6 standalone TypeInfo variables (aspeed_wdt_info as abstract base, aspeed_2400_wdt_info, aspeed_2500_wdt_info, aspeed_2600_wdt_info, aspeed_1030_wdt_info, aspeed_2700_wdt_info) directly into the 'aspeed_wdt_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-18-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/watchdog/wdt_aspeed.c | 93 +++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 53 deletions(-) diff --git a/hw/watchdog/wdt_aspeed.c b/hw/watchdog/wdt_aspeed.c index ae411593c583..deed970c89b9 100644 --- a/hw/watchdog/wdt_aspeed.c +++ b/hw/watchdog/wdt_aspeed.c @@ -321,15 +321,6 @@ static void aspeed_wdt_class_init(ObjectClass *klass, = const void *data) dc->desc =3D "Aspeed watchdog device"; } =20 -static const TypeInfo aspeed_wdt_info =3D { - .parent =3D TYPE_SYS_BUS_DEVICE, - .name =3D TYPE_ASPEED_WDT, - .instance_size =3D sizeof(AspeedWDTState), - .class_init =3D aspeed_wdt_class_init, - .class_size =3D sizeof(AspeedWDTClass), - .abstract =3D true, -}; - static void aspeed_2400_wdt_class_init(ObjectClass *klass, const void *dat= a) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -345,13 +336,6 @@ static void aspeed_2400_wdt_class_init(ObjectClass *kl= ass, const void *data) awc->default_reload_value =3D 0x03EF1480; } =20 -static const TypeInfo aspeed_2400_wdt_info =3D { - .name =3D TYPE_ASPEED_2400_WDT, - .parent =3D TYPE_ASPEED_WDT, - .instance_size =3D sizeof(AspeedWDTState), - .class_init =3D aspeed_2400_wdt_class_init, -}; - static void aspeed_2500_wdt_reset_pulse(AspeedWDTState *s, uint32_t proper= ty) { if (property) { @@ -383,13 +367,6 @@ static void aspeed_2500_wdt_class_init(ObjectClass *kl= ass, const void *data) awc->default_reload_value =3D 0x014FB180; } =20 -static const TypeInfo aspeed_2500_wdt_info =3D { - .name =3D TYPE_ASPEED_2500_WDT, - .parent =3D TYPE_ASPEED_WDT, - .instance_size =3D sizeof(AspeedWDTState), - .class_init =3D aspeed_2500_wdt_class_init, -}; - static void aspeed_2600_wdt_class_init(ObjectClass *klass, const void *dat= a) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -406,13 +383,6 @@ static void aspeed_2600_wdt_class_init(ObjectClass *kl= ass, const void *data) awc->default_reload_value =3D 0x014FB180; } =20 -static const TypeInfo aspeed_2600_wdt_info =3D { - .name =3D TYPE_ASPEED_2600_WDT, - .parent =3D TYPE_ASPEED_WDT, - .instance_size =3D sizeof(AspeedWDTState), - .class_init =3D aspeed_2600_wdt_class_init, -}; - static void aspeed_1030_wdt_class_init(ObjectClass *klass, const void *dat= a) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -429,13 +399,6 @@ static void aspeed_1030_wdt_class_init(ObjectClass *kl= ass, const void *data) awc->default_reload_value =3D 0x014FB180; } =20 -static const TypeInfo aspeed_1030_wdt_info =3D { - .name =3D TYPE_ASPEED_1030_WDT, - .parent =3D TYPE_ASPEED_WDT, - .instance_size =3D sizeof(AspeedWDTState), - .class_init =3D aspeed_1030_wdt_class_init, -}; - static void aspeed_2700_wdt_class_init(ObjectClass *klass, const void *dat= a) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -452,21 +415,45 @@ static void aspeed_2700_wdt_class_init(ObjectClass *k= lass, const void *data) awc->default_reload_value =3D 0x014FB180; } =20 -static const TypeInfo aspeed_2700_wdt_info =3D { - .name =3D TYPE_ASPEED_2700_WDT, - .parent =3D TYPE_ASPEED_WDT, - .instance_size =3D sizeof(AspeedWDTState), - .class_init =3D aspeed_2700_wdt_class_init, +static const TypeInfo aspeed_wdt_types[] =3D { + { + .parent =3D TYPE_SYS_BUS_DEVICE, + .name =3D TYPE_ASPEED_WDT, + .instance_size =3D sizeof(AspeedWDTState), + .class_init =3D aspeed_wdt_class_init, + .class_size =3D sizeof(AspeedWDTClass), + .abstract =3D true, + }, + { + .name =3D TYPE_ASPEED_1030_WDT, + .parent =3D TYPE_ASPEED_WDT, + .instance_size =3D sizeof(AspeedWDTState), + .class_init =3D aspeed_1030_wdt_class_init, + }, + { + .name =3D TYPE_ASPEED_2400_WDT, + .parent =3D TYPE_ASPEED_WDT, + .instance_size =3D sizeof(AspeedWDTState), + .class_init =3D aspeed_2400_wdt_class_init, + }, + { + .name =3D TYPE_ASPEED_2500_WDT, + .parent =3D TYPE_ASPEED_WDT, + .instance_size =3D sizeof(AspeedWDTState), + .class_init =3D aspeed_2500_wdt_class_init, + }, + { + .name =3D TYPE_ASPEED_2600_WDT, + .parent =3D TYPE_ASPEED_WDT, + .instance_size =3D sizeof(AspeedWDTState), + .class_init =3D aspeed_2600_wdt_class_init, + }, + { + .name =3D TYPE_ASPEED_2700_WDT, + .parent =3D TYPE_ASPEED_WDT, + .instance_size =3D sizeof(AspeedWDTState), + .class_init =3D aspeed_2700_wdt_class_init, + } }; =20 -static void wdt_aspeed_register_types(void) -{ - type_register_static(&aspeed_wdt_info); - type_register_static(&aspeed_2400_wdt_info); - type_register_static(&aspeed_2500_wdt_info); - type_register_static(&aspeed_2600_wdt_info); - type_register_static(&aspeed_2700_wdt_info); - type_register_static(&aspeed_1030_wdt_info); -} - -type_init(wdt_aspeed_register_types) +DEFINE_TYPES(aspeed_wdt_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898140; cv=none; d=zohomail.com; s=zohoarc; b=kvRiPcNO56P3ae/gyYA7kbiY/ydWuPNAPSvx/CiUQWskskLGGBsK5i5XClJnYdXOvGaT3R9o7DiEuaTHY3pJO80bcsqJ3tmLDMLo8BW8JhGcxGEGnb3enRcerpawJB2/mq+RvfnH9stFpq1MIEJbdVXe82LzZuxYUEtG7fXDmWQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898140; 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=yXs4br/ZNHJMPzqzEYfadUotUW35Pi27eSmfLyn4dk8=; b=NyG4hXyOHCycoWt3V8ABHLJyX+woINcqWhuz0DaSOWL6IKo16huF7mOxZyWlrzJMsjhCs0fbLV6xLEf2lx86SaqeykOUkbVIwhijOQQSeBMMaGDsDbOwE48W9CLypaO4Z5xGMskKP4F+QnSGUKFbEN0T2vqGWSGpjl05MBqskQQ= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898140294648.0869891840711; Sun, 7 Jun 2026 22:55:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSrM-0001WF-6A; Mon, 08 Jun 2026 01:49:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrJ-0001VD-RQ for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrI-0000TY-Dd for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:13 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-hgmn7rdnMpSYst1EraZgsQ-1; Mon, 08 Jun 2026 01:49:08 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 24F4E195608B; Mon, 8 Jun 2026 05:49:07 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A5BCB1688; Mon, 8 Jun 2026 05:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yXs4br/ZNHJMPzqzEYfadUotUW35Pi27eSmfLyn4dk8=; b=LAEd3xawsfy3+WVrwEdzQMlOHQgAnEnwlHyqdvcoreGq0jVN5ySBB8XU5EIVFoAO8RG0Oe WzUhFNwwWlShLvaBIt20Fox/zW4PvjlxTzEJV4rUw7ti8pn1Rl8HdJjgRIQGC6/B9ruOkg 32uGRgFUpefBoBIkrV5Z3F+59xyV47o= X-MC-Unique: hgmn7rdnMpSYst1EraZgsQ-1 X-Mimecast-MFC-AGG-ID: hgmn7rdnMpSYst1EraZgsQ_1780897747 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 18/37] hw/nvram/aspeed_otp: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:07 +0200 Message-ID: <20260608054826.346488-19-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898142507154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline the standalone 'aspeed_otp_info' TypeInfo variable directly into the 'aspeed_otp_types[]' array, removing the need for a separate declaration. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-19-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/nvram/aspeed_otp.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/nvram/aspeed_otp.c b/hw/nvram/aspeed_otp.c index 1a9d3841b8d6..81304bda3abe 100644 --- a/hw/nvram/aspeed_otp.c +++ b/hw/nvram/aspeed_otp.c @@ -174,16 +174,13 @@ static void aspeed_otp_class_init(ObjectClass *klass,= const void *data) device_class_set_props(dc, aspeed_otp_properties); } =20 -static const TypeInfo aspeed_otp_info =3D { - .name =3D TYPE_ASPEED_OTP, - .parent =3D TYPE_DEVICE, - .instance_size =3D sizeof(AspeedOTPState), - .class_init =3D aspeed_otp_class_init, +static const TypeInfo aspeed_otp_types[] =3D { + { + .name =3D TYPE_ASPEED_OTP, + .parent =3D TYPE_DEVICE, + .instance_size =3D sizeof(AspeedOTPState), + .class_init =3D aspeed_otp_class_init, + } }; =20 -static void aspeed_otp_register_types(void) -{ - type_register_static(&aspeed_otp_info); -} - -type_init(aspeed_otp_register_types) +DEFINE_TYPES(aspeed_otp_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897855; cv=none; d=zohomail.com; s=zohoarc; b=h/V15DbyV6lnLfT4Zx6xb08S5ZDh6fx+ggm/NgMl+e/BQv9MfUN1L2G47keexiDVqtkHz4bS12EWSOP3IW+er7u3eT+QJdF8SE1W/0pMkCAMsY4NaFvEAozUnW6m8FeZXCfbi2QtVFHN7IUg7xHpnZvhZXHbNUhgJMo1MKFn820= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897855; 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=AjcBNsHVpS8wYcRjIrqUgY55TrynsFIVW0VBdmWXKbg=; b=Ui+28PeuyykUbZZ+THmYWiRuvptMKs4/Mpt/RiBbNAHcYuaea5QWbfXEUNKxRlvGu7KYA76I0mnp4E1Ix4Ky4O6jYXNGF7yBKgqpnKvTOXXFujT1Z3mCU0osnQKu9h/wRp+lOXagKrr7K/z7w+2LJRrUFPSQ+j7iMOTWHY8e1k8= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897855537753.1111498060322; Sun, 7 Jun 2026 22:50:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSrP-0001Wn-7D; Mon, 08 Jun 2026 01:49:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrL-0001WG-Rn for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrK-0000U8-5S for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:15 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-74-xwB87YvHMru76HdFXd-N5w-1; Mon, 08 Jun 2026 01:49:10 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 154A01944D26; Mon, 8 Jun 2026 05:49:09 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9681C765; Mon, 8 Jun 2026 05:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AjcBNsHVpS8wYcRjIrqUgY55TrynsFIVW0VBdmWXKbg=; b=IFDTSM6Bgd1C05+YWZwhHnHAS3DODVHwOhwKncjastr0dKMK5y1J2gtG//fa9u8LRNJkTn W3dWO8VYPFhOUC79dQnuT+7oNsiA7gAB86JL1AujBAkqdoCfQqLdlkGA4azBjpPSDW5wLg mv+tLcZc6XnqczZ+Z857R4knDhUoZ7g= X-MC-Unique: xwB87YvHMru76HdFXd-N5w-1 X-Mimecast-MFC-AGG-ID: xwB87YvHMru76HdFXd-N5w_1780897749 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 19/37] hw/timer/aspeed_timer: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:08 +0200 Message-ID: <20260608054826.346488-20-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897856026158500 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 6 standalone TypeInfo variables (aspeed_timer_info as abstract base, aspeed_2400_timer_info, aspeed_2500_timer_info, aspeed_2600_timer_info, aspeed_1030_timer_info, aspeed_2700_timer_info) directly into the 'aspeed_timer_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-20-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/timer/aspeed_timer.c | 83 +++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 48 deletions(-) diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c index 69f5c89215c5..a607736387c8 100644 --- a/hw/timer/aspeed_timer.c +++ b/hw/timer/aspeed_timer.c @@ -907,15 +907,6 @@ static void timer_class_init(ObjectClass *klass, const= void *data) device_class_set_props(dc, aspeed_timer_properties); } =20 -static const TypeInfo aspeed_timer_info =3D { - .name =3D TYPE_ASPEED_TIMER, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedTimerCtrlState), - .class_init =3D timer_class_init, - .class_size =3D sizeof(AspeedTimerClass), - .abstract =3D true, -}; - static void aspeed_2400_timer_class_init(ObjectClass *klass, const void *d= ata) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -926,12 +917,6 @@ static void aspeed_2400_timer_class_init(ObjectClass *= klass, const void *data) awc->write =3D aspeed_2400_timer_write; } =20 -static const TypeInfo aspeed_2400_timer_info =3D { - .name =3D TYPE_ASPEED_2400_TIMER, - .parent =3D TYPE_ASPEED_TIMER, - .class_init =3D aspeed_2400_timer_class_init, -}; - static void aspeed_2500_timer_class_init(ObjectClass *klass, const void *d= ata) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -942,12 +927,6 @@ static void aspeed_2500_timer_class_init(ObjectClass *= klass, const void *data) awc->write =3D aspeed_2500_timer_write; } =20 -static const TypeInfo aspeed_2500_timer_info =3D { - .name =3D TYPE_ASPEED_2500_TIMER, - .parent =3D TYPE_ASPEED_TIMER, - .class_init =3D aspeed_2500_timer_class_init, -}; - static void aspeed_2600_timer_class_init(ObjectClass *klass, const void *d= ata) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -958,12 +937,6 @@ static void aspeed_2600_timer_class_init(ObjectClass *= klass, const void *data) awc->write =3D aspeed_2600_timer_write; } =20 -static const TypeInfo aspeed_2600_timer_info =3D { - .name =3D TYPE_ASPEED_2600_TIMER, - .parent =3D TYPE_ASPEED_TIMER, - .class_init =3D aspeed_2600_timer_class_init, -}; - static void aspeed_1030_timer_class_init(ObjectClass *klass, const void *d= ata) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -974,12 +947,6 @@ static void aspeed_1030_timer_class_init(ObjectClass *= klass, const void *data) awc->write =3D aspeed_2600_timer_write; } =20 -static const TypeInfo aspeed_1030_timer_info =3D { - .name =3D TYPE_ASPEED_1030_TIMER, - .parent =3D TYPE_ASPEED_TIMER, - .class_init =3D aspeed_1030_timer_class_init, -}; - static void aspeed_2700_timer_class_init(ObjectClass *klass, const void *d= ata) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -990,20 +957,40 @@ static void aspeed_2700_timer_class_init(ObjectClass = *klass, const void *data) awc->write =3D aspeed_2700_timer_write; } =20 -static const TypeInfo aspeed_2700_timer_info =3D { - .name =3D TYPE_ASPEED_2700_TIMER, - .parent =3D TYPE_ASPEED_TIMER, - .class_init =3D aspeed_2700_timer_class_init, +static const TypeInfo aspeed_timer_types[] =3D { + { + .name =3D TYPE_ASPEED_TIMER, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedTimerCtrlState), + .class_init =3D timer_class_init, + .class_size =3D sizeof(AspeedTimerClass), + .abstract =3D true, + }, + { + .name =3D TYPE_ASPEED_1030_TIMER, + .parent =3D TYPE_ASPEED_TIMER, + .class_init =3D aspeed_1030_timer_class_init, + }, + { + .name =3D TYPE_ASPEED_2400_TIMER, + .parent =3D TYPE_ASPEED_TIMER, + .class_init =3D aspeed_2400_timer_class_init, + }, + { + .name =3D TYPE_ASPEED_2500_TIMER, + .parent =3D TYPE_ASPEED_TIMER, + .class_init =3D aspeed_2500_timer_class_init, + }, + { + .name =3D TYPE_ASPEED_2600_TIMER, + .parent =3D TYPE_ASPEED_TIMER, + .class_init =3D aspeed_2600_timer_class_init, + }, + { + .name =3D TYPE_ASPEED_2700_TIMER, + .parent =3D TYPE_ASPEED_TIMER, + .class_init =3D aspeed_2700_timer_class_init, + } }; =20 -static void aspeed_timer_register_types(void) -{ - type_register_static(&aspeed_timer_info); - type_register_static(&aspeed_2400_timer_info); - type_register_static(&aspeed_2500_timer_info); - type_register_static(&aspeed_2600_timer_info); - type_register_static(&aspeed_1030_timer_info); - type_register_static(&aspeed_2700_timer_info); -} - -type_init(aspeed_timer_register_types) +DEFINE_TYPES(aspeed_timer_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897952; cv=none; d=zohomail.com; s=zohoarc; b=YGahmkeOj9nbuNcc/vzi8vyW/5Nx02IrM5zzG0KUoGC6FhE7l6LnUsPvSCFKdbhrxXHiNOMf+liSRxVwQm5I95Q9umTxmB3pfMFUzBFGzZaN8D6+/rluTDMys7KqGXudTp0ZZ95mQutfdo1JxqtgxAleLmKcP+XqFPA6AWzXKo0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897952; 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=5x/aEvwCdlYUH821Ptfzef4F3ikbhDAN1JAeF/2l2Vw=; b=B8R7T5C8D9Tce/AB+9tBXRFoBxxtp0+AFx4maedX1Va3Cl+mXh51OvsXGlujL7ij0A7/jVZntjsvklk3nZb6fLUqFR6xBJnV3GABI4vvhZUxja6KqQta8eXkDDQV9kUSSxnuVB98WGjjTuQysvP1uxqvRd76EHjEWEFdGklmAAQ= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897952521251.8572604453617; Sun, 7 Jun 2026 22:52:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSrY-0001YU-3A; Mon, 08 Jun 2026 01:49:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrN-0001Wo-Rf for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrM-0000Uq-86 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:17 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-463-DI17jeFJOMKv3NiRSxvJjg-1; Mon, 08 Jun 2026 01:49:11 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 068A018002C2; Mon, 8 Jun 2026 05:49:11 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8762D1688; Mon, 8 Jun 2026 05:49:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5x/aEvwCdlYUH821Ptfzef4F3ikbhDAN1JAeF/2l2Vw=; b=OsfVhQFPEB5wQYt3wiRVwQxZ+wtCXcSX40T9fAHesMY1psJSPVkgNMs8dK0i8TBCkT4Tac nPlUppny1sf9aDsa1cq+yn7zdZ2fdwY/QHge+Dzi8La8Amz06yBuksav4HOoE5RRTYIsM4 ZMkeuueVpK1rEiCIMM38ySzMP1G5G8k= X-MC-Unique: DI17jeFJOMKv3NiRSxvJjg-1 X-Mimecast-MFC-AGG-ID: DI17jeFJOMKv3NiRSxvJjg_1780897751 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 20/37] hw/fsi/aspeed_apb2opb: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:09 +0200 Message-ID: <20260608054826.346488-21-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897953802154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. This file contains two independent subsystems (aspeed_apb2opb and fsi_opb), each with its own type_init() call. Both are converted to separate DEFINE_TYPES() blocks to preserve the original registration boundary. Inline the standalone 'aspeed_apb2opb_info' and 'fsi_opb_info' TypeInfo variables directly into their respective types arrays, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-21-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/fsi/aspeed_apb2opb.c | 42 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/hw/fsi/aspeed_apb2opb.c b/hw/fsi/aspeed_apb2opb.c index f2d9a9669ada..7a37770a4303 100644 --- a/hw/fsi/aspeed_apb2opb.c +++ b/hw/fsi/aspeed_apb2opb.c @@ -319,20 +319,17 @@ static void fsi_aspeed_apb2opb_class_init(ObjectClass= *klass, const void *data) rc->phases.hold =3D fsi_aspeed_apb2opb_reset_hold; } =20 -static const TypeInfo aspeed_apb2opb_info =3D { - .name =3D TYPE_ASPEED_APB2OPB, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_init =3D fsi_aspeed_apb2opb_init, - .instance_size =3D sizeof(AspeedAPB2OPBState), - .class_init =3D fsi_aspeed_apb2opb_class_init, +static const TypeInfo aspeed_apb2opb_types[] =3D { + { + .name =3D TYPE_ASPEED_APB2OPB, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_init =3D fsi_aspeed_apb2opb_init, + .instance_size =3D sizeof(AspeedAPB2OPBState), + .class_init =3D fsi_aspeed_apb2opb_class_init, + } }; =20 -static void aspeed_apb2opb_register_types(void) -{ - type_register_static(&aspeed_apb2opb_info); -} - -type_init(aspeed_apb2opb_register_types); +DEFINE_TYPES(aspeed_apb2opb_types) =20 static void fsi_opb_init(Object *o) { @@ -363,17 +360,14 @@ static void fsi_opb_class_init(ObjectClass *klass, co= nst void *data) bc->unrealize =3D fsi_opb_unrealize; } =20 -static const TypeInfo opb_info =3D { - .name =3D TYPE_OP_BUS, - .parent =3D TYPE_BUS, - .instance_init =3D fsi_opb_init, - .instance_size =3D sizeof(OPBus), - .class_init =3D fsi_opb_class_init, +static const TypeInfo fsi_opb_types[] =3D { + { + .name =3D TYPE_OP_BUS, + .parent =3D TYPE_BUS, + .instance_init =3D fsi_opb_init, + .instance_size =3D sizeof(OPBus), + .class_init =3D fsi_opb_class_init, + } }; =20 -static void fsi_opb_register_types(void) -{ - type_register_static(&opb_info); -} - -type_init(fsi_opb_register_types); +DEFINE_TYPES(fsi_opb_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898092; cv=none; d=zohomail.com; s=zohoarc; b=epSmdIliHStoDwZR4KGpM+z0xpXvR5N1epsQhxxlM/4SusxE5CPOFsW8yiGRWXzuM3vZXToNtqydrZ6gybqlHOIeixkv09+1/FU3aqp8JcOZL/VV57Wt8CNCMqgTTJfIaagvyJjqz1O7Jdwc0xMxmY72iJZSa0COW0bY/sYlK7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898092; 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=qW0f8311kd5c+oUI1hixT0UXSpuywxH8OcV1GYZi3tg=; b=fBxAzizN/vtbJnA3tIQ44FiihaUzon2pOMVRwNYeNgI9wkJbThrlFardPkQskMYg7tESCusH978DxU0FLZy+bk9MvskBJcTY0f571b5mqGbpmKiVy74eJOuOw6/iYaW9N3kzWal9t0rXGZssoR6zLRiOCwFGkWM320FSo2SSx2Y= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898092482383.73829486757984; Sun, 7 Jun 2026 22:54:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsI-0002dh-Nh; Mon, 08 Jun 2026 01:50:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrp-0001vT-6S for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrl-0000kA-V7 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:44 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-568-ubl9iv50NSCFy7Yh8Ms78Q-1; Mon, 08 Jun 2026 01:49:21 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EC8BB1956094; Mon, 8 Jun 2026 05:49:12 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7972727A; Mon, 8 Jun 2026 05:49:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qW0f8311kd5c+oUI1hixT0UXSpuywxH8OcV1GYZi3tg=; b=Gf7RpGMDgP+P7qSO2qVDK4fpgMXK3h+/4kwObtgk4t8MTs9sRf72+opkiO9QvgpcDbjLqs AZqI9/rHahw7q5Zgj9d38nZ/I8IqKWBQBuJz0k4xUOEONd8wFCdd5T9qPXXRhSzDneoXuS tPyG2UXcxAJw9TaoKl2jb7ecxfbnQAI= X-MC-Unique: ubl9iv50NSCFy7Yh8Ms78Q-1 X-Mimecast-MFC-AGG-ID: ubl9iv50NSCFy7Yh8Ms78Q_1780897753 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 21/37] hw/pci-host/aspeed_pcie: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:10 +0200 Message-ID: <20260608054826.346488-22-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898093112158500 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 6 standalone TypeInfo variables (aspeed_pcie_phy_info, aspeed_2700_p= cie_phy_info aspeed_pcie_root_port_info, aspeed_pcie_rc_info, aspeed_pcie_cfg_info and aspeed_2700_pcie_cfg_info directly into the 'aspeed_pcie_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-22-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/pci-host/aspeed_pcie.c | 94 +++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 53 deletions(-) diff --git a/hw/pci-host/aspeed_pcie.c b/hw/pci-host/aspeed_pcie.c index 186e5aeea298..b46eb74234bb 100644 --- a/hw/pci-host/aspeed_pcie.c +++ b/hw/pci-host/aspeed_pcie.c @@ -83,13 +83,6 @@ static void aspeed_pcie_root_port_class_init(ObjectClass= *klass, rpc->ssid =3D 0x1150; } =20 -static const TypeInfo aspeed_pcie_root_port_info =3D { - .name =3D TYPE_ASPEED_PCIE_ROOT_PORT, - .parent =3D TYPE_PCIE_ROOT_PORT, - .instance_size =3D sizeof(AspeedPCIERootPortState), - .class_init =3D aspeed_pcie_root_port_class_init, -}; - /* * PCIe Root Complex (RC) */ @@ -305,14 +298,6 @@ static void aspeed_pcie_rc_class_init(ObjectClass *kla= ss, const void *data) msi_nonbroken =3D true; } =20 -static const TypeInfo aspeed_pcie_rc_info =3D { - .name =3D TYPE_ASPEED_PCIE_RC, - .parent =3D TYPE_PCIE_HOST_BRIDGE, - .instance_size =3D sizeof(AspeedPCIERcState), - .instance_init =3D aspeed_pcie_rc_instance_init, - .class_init =3D aspeed_pcie_rc_class_init, -}; - /* * PCIe Config * @@ -679,15 +664,6 @@ static void aspeed_pcie_cfg_class_init(ObjectClass *kl= ass, const void *data) apc->rc_rp_addr =3D PCI_DEVFN(8, 0); } =20 -static const TypeInfo aspeed_pcie_cfg_info =3D { - .name =3D TYPE_ASPEED_PCIE_CFG, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_init =3D aspeed_pcie_cfg_instance_init, - .instance_size =3D sizeof(AspeedPCIECfgState), - .class_init =3D aspeed_pcie_cfg_class_init, - .class_size =3D sizeof(AspeedPCIECfgClass), -}; - static void aspeed_2700_pcie_cfg_write(void *opaque, hwaddr addr, uint64_t data, unsigned int size) { @@ -798,12 +774,6 @@ static void aspeed_2700_pcie_cfg_class_init(ObjectClas= s *klass, apc->rc_rp_addr =3D PCI_DEVFN(0, 0); } =20 -static const TypeInfo aspeed_2700_pcie_cfg_info =3D { - .name =3D TYPE_ASPEED_2700_PCIE_CFG, - .parent =3D TYPE_ASPEED_PCIE_CFG, - .class_init =3D aspeed_2700_pcie_cfg_class_init, -}; - /* * PCIe PHY * @@ -926,14 +896,6 @@ static void aspeed_pcie_phy_class_init(ObjectClass *kl= ass, const void *data) apc->nr_regs =3D 0x100 >> 2; } =20 -static const TypeInfo aspeed_pcie_phy_info =3D { - .name =3D TYPE_ASPEED_PCIE_PHY, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedPCIEPhyState), - .class_init =3D aspeed_pcie_phy_class_init, - .class_size =3D sizeof(AspeedPCIEPhyClass), -}; - static void aspeed_2700_pcie_phy_reset_hold(Object *obj, ResetType type) { AspeedPCIEPhyState *s =3D ASPEED_PCIE_PHY(obj); @@ -961,21 +923,47 @@ static void aspeed_2700_pcie_phy_class_init(ObjectCla= ss *klass, apc->nr_regs =3D 0x800 >> 2; } =20 -static const TypeInfo aspeed_2700_pcie_phy_info =3D { - .name =3D TYPE_ASPEED_2700_PCIE_PHY, - .parent =3D TYPE_ASPEED_PCIE_PHY, - .class_init =3D aspeed_2700_pcie_phy_class_init, -}; +static const TypeInfo aspeed_pcie_types[] =3D { + { + .name =3D TYPE_ASPEED_PCIE_RC, + .parent =3D TYPE_PCIE_HOST_BRIDGE, + .instance_size =3D sizeof(AspeedPCIERcState), + .instance_init =3D aspeed_pcie_rc_instance_init, + .class_init =3D aspeed_pcie_rc_class_init, + }, + { + .name =3D TYPE_ASPEED_PCIE_ROOT_PORT, + .parent =3D TYPE_PCIE_ROOT_PORT, + .instance_size =3D sizeof(AspeedPCIERootPortState), + .class_init =3D aspeed_pcie_root_port_class_init, + }, + { + .name =3D TYPE_ASPEED_PCIE_CFG, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_init =3D aspeed_pcie_cfg_instance_init, + .instance_size =3D sizeof(AspeedPCIECfgState), + .class_init =3D aspeed_pcie_cfg_class_init, + .class_size =3D sizeof(AspeedPCIECfgClass), + }, + { + .name =3D TYPE_ASPEED_PCIE_PHY, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedPCIEPhyState), + .class_init =3D aspeed_pcie_phy_class_init, + .class_size =3D sizeof(AspeedPCIEPhyClass), + }, + { + .name =3D TYPE_ASPEED_2700_PCIE_PHY, + .parent =3D TYPE_ASPEED_PCIE_PHY, + .class_init =3D aspeed_2700_pcie_phy_class_init, + }, + { + .name =3D TYPE_ASPEED_2700_PCIE_CFG, + .parent =3D TYPE_ASPEED_PCIE_CFG, + .class_init =3D aspeed_2700_pcie_cfg_class_init, + } =20 -static void aspeed_pcie_register_types(void) -{ - type_register_static(&aspeed_pcie_rc_info); - type_register_static(&aspeed_pcie_root_port_info); - type_register_static(&aspeed_pcie_cfg_info); - type_register_static(&aspeed_2700_pcie_cfg_info); - type_register_static(&aspeed_pcie_phy_info); - type_register_static(&aspeed_2700_pcie_phy_info); -} +}; =20 -type_init(aspeed_pcie_register_types); +DEFINE_TYPES(aspeed_pcie_types) =20 --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898149; cv=none; d=zohomail.com; s=zohoarc; b=NFW63s1Fal9ZMmjzC9/rWESQ90zzwwHl/nsYTfngPEJZ7cl6D6kN/hBFCq2ezW59r8IUz0Ml9ze20OQV4uze0YtJqJTACcB90VCuODdqIykHrxFweUv3eBi4grkZa6eZRkDpJyenoQJOBIG6vUF4ZkApp7UmQr/IvKU7B9wilFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898149; 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=0gj6devSdvGtSJwO1GoRjihnYYTQEc2hzqsdTXSyTwU=; b=KEsWvLGAR0dO+yqyl44x6Gnc1ZGaqxoPrBzu39YXDT3qtRRdoWJ+X0SUhp3dAaYc0f2fFmTBbxsJUFLp+BMUzHk2JDLglske23lW3xf1D1C1YSjZWKvPggi1+DYb5h1q93xQdXaKXnZCpMUC++ktT58QKSIMyrjEtv8iB1JLqPI= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898149856998.0230324600012; Sun, 7 Jun 2026 22:55:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSrs-0001sr-Dz; Mon, 08 Jun 2026 01:49:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrR-0001Xk-QX for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrQ-0000Vd-00 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:21 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-365-OoG4FNVOMeO20xr87lJTLw-1; Mon, 08 Jun 2026 01:49:15 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DEEBE1800473; Mon, 8 Jun 2026 05:49:14 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6B63527A; Mon, 8 Jun 2026 05:49:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0gj6devSdvGtSJwO1GoRjihnYYTQEc2hzqsdTXSyTwU=; b=PxnAkfvz3FqT98pAHsqrcTSzXGrIvqJ03Cw1W1rnLkrQS7bVW/haJyUZS6gJ5tMddlpdqY +O/9LjdQprqEwV/2M0oFDdXPFRgj8Zjur4cMc18WtAsCp6V6jIk7CEi5SNSl38m3DjwiPG lUIF5fj8mOJVfwOV3kEj5R1TbsjUM/4= X-MC-Unique: OoG4FNVOMeO20xr87lJTLw-1 X-Mimecast-MFC-AGG-ID: OoG4FNVOMeO20xr87lJTLw_1780897755 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 22/37] hw/i2c/aspeed_i2c: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:11 +0200 Message-ID: <20260608054826.346488-23-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898150969154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 9 standalone TypeInfo variables (aspeed_i2c_bus_info, aspeed_i2c_bus_slave_info, aspeed_i2c_info as abstract base, aspeed_2400_i2c_info, aspeed_2500_i2c_info, aspeed_2600_i2c_info, aspeed_1030_i2c_info and aspeed_2700_i2c_info) directly into the 'aspeed_i2c_types[]' array, removing the need for separate declarations. No functional change. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-23-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/i2c/aspeed_i2c.c | 113 +++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 65 deletions(-) diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c index 80c445750059..4a6732a18554 100644 --- a/hw/i2c/aspeed_i2c.c +++ b/hw/i2c/aspeed_i2c.c @@ -1372,16 +1372,6 @@ static void aspeed_i2c_class_init(ObjectClass *klass= , const void *data) dc->desc =3D "Aspeed I2C Controller"; } =20 -static const TypeInfo aspeed_i2c_info =3D { - .name =3D TYPE_ASPEED_I2C, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_init =3D aspeed_i2c_instance_init, - .instance_size =3D sizeof(AspeedI2CState), - .class_init =3D aspeed_i2c_class_init, - .class_size =3D sizeof(AspeedI2CClass), - .abstract =3D true, -}; - static int aspeed_i2c_bus_new_slave_event(AspeedI2CBus *bus, enum i2c_event event) { @@ -1500,13 +1490,6 @@ static void aspeed_i2c_bus_slave_class_init(ObjectCl= ass *klass, sc->send_async =3D aspeed_i2c_bus_slave_send_async; } =20 -static const TypeInfo aspeed_i2c_bus_slave_info =3D { - .name =3D TYPE_ASPEED_I2C_BUS_SLAVE, - .parent =3D TYPE_I2C_SLAVE, - .instance_size =3D sizeof(AspeedI2CBusSlave), - .class_init =3D aspeed_i2c_bus_slave_class_init, -}; - static void aspeed_i2c_bus_reset_hold(Object *obj, ResetType type) { AspeedI2CBus *s =3D ASPEED_I2C_BUS(obj); @@ -1565,13 +1548,6 @@ static void aspeed_i2c_bus_class_init(ObjectClass *k= lass, const void *data) device_class_set_props(dc, aspeed_i2c_bus_properties); } =20 -static const TypeInfo aspeed_i2c_bus_info =3D { - .name =3D TYPE_ASPEED_I2C_BUS, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedI2CBus), - .class_init =3D aspeed_i2c_bus_class_init, -}; - static qemu_irq aspeed_2400_i2c_bus_get_irq(AspeedI2CBus *bus) { return bus->controller->irq; @@ -1605,12 +1581,6 @@ static void aspeed_2400_i2c_class_init(ObjectClass *= klass, const void *data) aic->mem_size =3D 0x1000; } =20 -static const TypeInfo aspeed_2400_i2c_info =3D { - .name =3D TYPE_ASPEED_2400_I2C, - .parent =3D TYPE_ASPEED_I2C, - .class_init =3D aspeed_2400_i2c_class_init, -}; - static qemu_irq aspeed_2500_i2c_bus_get_irq(AspeedI2CBus *bus) { return bus->controller->irq; @@ -1640,12 +1610,6 @@ static void aspeed_2500_i2c_class_init(ObjectClass *= klass, const void *data) aic->mem_size =3D 0x1000; } =20 -static const TypeInfo aspeed_2500_i2c_info =3D { - .name =3D TYPE_ASPEED_2500_I2C, - .parent =3D TYPE_ASPEED_I2C, - .class_init =3D aspeed_2500_i2c_class_init, -}; - static qemu_irq aspeed_2600_i2c_bus_get_irq(AspeedI2CBus *bus) { return bus->irq; @@ -1669,12 +1633,6 @@ static void aspeed_2600_i2c_class_init(ObjectClass *= klass, const void *data) aic->mem_size =3D 0x1000; } =20 -static const TypeInfo aspeed_2600_i2c_info =3D { - .name =3D TYPE_ASPEED_2600_I2C, - .parent =3D TYPE_ASPEED_I2C, - .class_init =3D aspeed_2600_i2c_class_init, -}; - static void aspeed_1030_i2c_class_init(ObjectClass *klass, const void *dat= a) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -1693,12 +1651,6 @@ static void aspeed_1030_i2c_class_init(ObjectClass *= klass, const void *data) aic->mem_size =3D 0x10000; } =20 -static const TypeInfo aspeed_1030_i2c_info =3D { - .name =3D TYPE_ASPEED_1030_I2C, - .parent =3D TYPE_ASPEED_I2C, - .class_init =3D aspeed_1030_i2c_class_init, -}; - static void aspeed_2700_i2c_class_init(ObjectClass *klass, const void *dat= a) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -1720,25 +1672,56 @@ static void aspeed_2700_i2c_class_init(ObjectClass = *klass, const void *data) aic->has_dma64 =3D true; } =20 -static const TypeInfo aspeed_2700_i2c_info =3D { - .name =3D TYPE_ASPEED_2700_I2C, - .parent =3D TYPE_ASPEED_I2C, - .class_init =3D aspeed_2700_i2c_class_init, +static const TypeInfo aspeed_i2c_types[] =3D { + { + .name =3D TYPE_ASPEED_I2C_BUS, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedI2CBus), + .class_init =3D aspeed_i2c_bus_class_init, + }, + { + .name =3D TYPE_ASPEED_I2C_BUS_SLAVE, + .parent =3D TYPE_I2C_SLAVE, + .instance_size =3D sizeof(AspeedI2CBusSlave), + .class_init =3D aspeed_i2c_bus_slave_class_init, + }, + { + .name =3D TYPE_ASPEED_I2C, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_init =3D aspeed_i2c_instance_init, + .instance_size =3D sizeof(AspeedI2CState), + .class_init =3D aspeed_i2c_class_init, + .class_size =3D sizeof(AspeedI2CClass), + .abstract =3D true, + }, + { + .name =3D TYPE_ASPEED_1030_I2C, + .parent =3D TYPE_ASPEED_I2C, + .class_init =3D aspeed_1030_i2c_class_init, + }, + { + .name =3D TYPE_ASPEED_2400_I2C, + .parent =3D TYPE_ASPEED_I2C, + .class_init =3D aspeed_2400_i2c_class_init, + }, + { + .name =3D TYPE_ASPEED_2500_I2C, + .parent =3D TYPE_ASPEED_I2C, + .class_init =3D aspeed_2500_i2c_class_init, + }, + { + .name =3D TYPE_ASPEED_2600_I2C, + .parent =3D TYPE_ASPEED_I2C, + .class_init =3D aspeed_2600_i2c_class_init, + }, + { + .name =3D TYPE_ASPEED_2700_I2C, + .parent =3D TYPE_ASPEED_I2C, + .class_init =3D aspeed_2700_i2c_class_init, + } }; =20 -static void aspeed_i2c_register_types(void) -{ - type_register_static(&aspeed_i2c_bus_info); - type_register_static(&aspeed_i2c_bus_slave_info); - type_register_static(&aspeed_i2c_info); - type_register_static(&aspeed_2400_i2c_info); - type_register_static(&aspeed_2500_i2c_info); - type_register_static(&aspeed_2600_i2c_info); - type_register_static(&aspeed_1030_i2c_info); - type_register_static(&aspeed_2700_i2c_info); -} - -type_init(aspeed_i2c_register_types) +DEFINE_TYPES(aspeed_i2c_types) =20 =20 I2CBus *aspeed_i2c_get_bus(AspeedI2CState *s, int busnr) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897888; cv=none; d=zohomail.com; s=zohoarc; b=Te1K/m2bsYOptk9HBclePZUIqJfykLzvVgKpRd2WZbYH04uDVQGiSBthbH+sUXEIYD+T5EIvx9mD4GnOyP+tyA1Cjw44xJygZNS+Rb/7B5eg98k6rmREOUMzM7M8PJD9sgtq1y1ssL4JYmTLpHrqLaWs/6cxY8tfSKjVBw5cf6w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897888; 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=MXmUhA3gQLASTOz62jAZDxuN/8QqLB/kGw07hGz1IXM=; b=Ti4NzIhXmv1Unbfdo5VcfBqaQAGMfUnfLn5TihSnEPha7YwDnvcGHDG4MBIfgB728wgas0nttdbx2qCl6mVRwYd6PbH5uijkaHqRT9L3DY5K5G1Zt4DjOD5zu5hUYWRKH0e2OjghPnMKIeY56JsEj+2tNaPPyzxoYPOxZsel8Fw= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897888425702.0703840857577; Sun, 7 Jun 2026 22:51:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSrd-0001g3-OZ; Mon, 08 Jun 2026 01:49:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrT-0001Xo-8h for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrR-0000XA-MC for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:23 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-372-X3tFSyuEOZe-yD-BSzvQlA-1; Mon, 08 Jun 2026 01:49:17 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D0B2F1800347; Mon, 8 Jun 2026 05:49:16 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5C47B1688; Mon, 8 Jun 2026 05:49:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MXmUhA3gQLASTOz62jAZDxuN/8QqLB/kGw07hGz1IXM=; b=QXQ9gQHuxBrYaHl5fiSaSskBao9VB6+PANGUISOPW9G2376yzP9/BwH9pmdaBnPCf+pTmM 6exE71vjpXEOvfsbTus9s29IMKwWMdspWTpHAI7NRXhMYGVVDdE0VNPKzUuIWKYaO/yDWQ wZRVJ9on6EGOjmJI/oWkDt0k366J/H8= X-MC-Unique: X3tFSyuEOZe-yD-BSzvQlA-1 X-Mimecast-MFC-AGG-ID: X3tFSyuEOZe-yD-BSzvQlA_1780897756 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 23/37] hw/net/ftgmac100: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:12 +0200 Message-ID: <20260608054826.346488-24-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897890816154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 2 standalone TypeInfo variables (ftgmac100_info, aspeed_mii_info) directly into the 'ftgmac100_types[]' array, removing the need for separate declarations. Note that this file covers both the Faraday FTGMAC100 Gigabit Ethernet controller and the Aspeed MII controller, which share the same type registration. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-24-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/net/ftgmac100.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 2bec817b9dec..a53c840c3725 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -1279,12 +1279,6 @@ static void ftgmac100_class_init(ObjectClass *klass,= const void *data) dc->desc =3D "Faraday FTGMAC100 Gigabit Ethernet emulation"; } =20 -static const TypeInfo ftgmac100_info =3D { - .name =3D TYPE_FTGMAC100, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(FTGMAC100State), - .class_init =3D ftgmac100_class_init, -}; =20 /* * AST2600 MII controller @@ -1438,17 +1432,19 @@ static void aspeed_mii_class_init(ObjectClass *klas= s, const void *data) device_class_set_props(dc, aspeed_mii_properties); } =20 -static const TypeInfo aspeed_mii_info =3D { - .name =3D TYPE_ASPEED_MII, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedMiiState), - .class_init =3D aspeed_mii_class_init, +static const TypeInfo ftgmac100_types[] =3D { + { + .name =3D TYPE_FTGMAC100, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(FTGMAC100State), + .class_init =3D ftgmac100_class_init, + }, + { + .name =3D TYPE_ASPEED_MII, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedMiiState), + .class_init =3D aspeed_mii_class_init, + } }; =20 -static void ftgmac100_register_types(void) -{ - type_register_static(&ftgmac100_info); - type_register_static(&aspeed_mii_info); -} - -type_init(ftgmac100_register_types) +DEFINE_TYPES(ftgmac100_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898130; cv=none; d=zohomail.com; s=zohoarc; b=m/KyaPq/ndvkYgl1zg3dX512dq2KEU90lWpRjhb0hIe8hI6Bn2ssSIHjOH2anNd+XDBQjoKBVAaGuNoZy0ixv+nmmGtpr1ldy+lQd6BjOCqG3X+kFpTTASpxEnbNU3eyhlvSYk9sbHi3elb7VKh2hAyDbSd0H3AzkvXa60/cBe4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898130; 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=sEjZ/uidbnSpokxNLxjtJNU0rw4LKVtvkjl/yUDH/B4=; b=E5/rG+w/2wTurlLNpt7KBmmmBnpdLc095OI9Q/lgfJIV7AKCdhRtrRx1pf92u6Z+/cd3HonnIwqYuTRFNsApzEy5KNLElodRqPQxdIrneCcxS/4vQ640auwAj8tOmt8EjS/oiJPSJ2hYUjsahIwSpXP+xzwQzbwVo4vP5i6jXvk= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178089813007777.90926585640113; Sun, 7 Jun 2026 22:55:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSs2-0001yu-D9; Mon, 08 Jun 2026 01:50:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSra-0001dR-0N for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrW-0000Z8-Fg for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:29 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-608-lAy0ledVN7GaH2VKZ3EmFA-1; Mon, 08 Jun 2026 01:49:20 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EBBEA180061D; Mon, 8 Jun 2026 05:49:18 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4DF78765; Mon, 8 Jun 2026 05:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sEjZ/uidbnSpokxNLxjtJNU0rw4LKVtvkjl/yUDH/B4=; b=CxIbYxXoVY8BZ1AXSHWrpyFmjUTwT28arORaQ+t7ESF72YGQTAyD5p/U3imnNdzaqCcbCZ 9CHSpq+kZXcYgGEsVlG0wmsGfvZqu9/UDgYlbKdSOah5+Um1VKnh0uKQTSkWLjeBNp4o1W /ffjsL+pBiHqex5t1sxcAMPnyL1zsNk= X-MC-Unique: lAy0ledVN7GaH2VKZ3EmFA-1 X-Mimecast-MFC-AGG-ID: lAy0ledVN7GaH2VKZ3EmFA_1780897759 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 24/37] hw/ssi/aspeed_smc: Convert to DEFINE_TYPES() with inlined TypeInfo Date: Mon, 8 Jun 2026 07:48:13 +0200 Message-ID: <20260608054826.346488-25-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898132446154100 From: Jamin Lin Replace the legacy type_register_static()/type_init() registration pattern with the modern DEFINE_TYPES() macro. Inline 18 standalone TypeInfo variables (aspeed_smc_flash_info, aspeed_smc_info as abstract base, aspeed_2400_smc_info, aspeed_2400_fmc_info, aspeed_2400_spi1_info, aspeed_2500_fmc_info, aspeed_2500_spi1_info, aspeed_2500_spi2_info, aspeed_2600_fmc_info, aspeed_2600_spi1_info, aspeed_2600_spi2_info, aspeed_1030_fmc_info, aspeed_1030_spi1_info, aspeed_1030_spi2_info, aspeed_2700_fmc_info, aspeed_2700_spi0_info, aspeed_2700_spi1_info, aspeed_2700_spi2_info) directly into the 'aspeed_smc_types[]' array, removing the need for separate declarations. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260601024959.2347639-25-jamin_li= n@aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/ssi/aspeed_smc.c | 228 +++++++++++++++++++------------------------- 1 file changed, 96 insertions(+), 132 deletions(-) diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c index 3767ad0c7a3e..d87fbd798c62 100644 --- a/hw/ssi/aspeed_smc.c +++ b/hw/ssi/aspeed_smc.c @@ -1312,16 +1312,6 @@ static void aspeed_smc_class_init(ObjectClass *klass= , const void *data) dc->vmsd =3D &vmstate_aspeed_smc; } =20 -static const TypeInfo aspeed_smc_info =3D { - .name =3D TYPE_ASPEED_SMC, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_init =3D aspeed_smc_instance_init, - .instance_size =3D sizeof(AspeedSMCState), - .class_size =3D sizeof(AspeedSMCClass), - .class_init =3D aspeed_smc_class_init, - .abstract =3D true, -}; - static void aspeed_smc_flash_realize(DeviceState *dev, Error **errp) { AspeedSMCFlash *s =3D ASPEED_SMC_FLASH(dev); @@ -1358,13 +1348,6 @@ static void aspeed_smc_flash_class_init(ObjectClass = *klass, const void *data) device_class_set_props(dc, aspeed_smc_flash_properties); } =20 -static const TypeInfo aspeed_smc_flash_info =3D { - .name =3D TYPE_ASPEED_SMC_FLASH, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(AspeedSMCFlash), - .class_init =3D aspeed_smc_flash_class_init, -}; - /* * The Segment Registers of the AST2400 and AST2500 have a 8MB * unit. The address range of a flash SPI peripheral is encoded with @@ -1415,12 +1398,6 @@ static void aspeed_2400_smc_class_init(ObjectClass *= klass, const void *data) asc->reg_ops =3D &aspeed_smc_flash_ops; } =20 -static const TypeInfo aspeed_2400_smc_info =3D { - .name =3D "aspeed.smc-ast2400", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_2400_smc_class_init, -}; - static const uint32_t aspeed_2400_fmc_resets[ASPEED_SMC_R_MAX] =3D { /* * CE0 and CE1 types are HW strapped in SCU70. Do it here to @@ -1466,12 +1443,6 @@ static void aspeed_2400_fmc_class_init(ObjectClass *= klass, const void *data) asc->reg_ops =3D &aspeed_smc_flash_ops; } =20 -static const TypeInfo aspeed_2400_fmc_info =3D { - .name =3D "aspeed.fmc-ast2400", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_2400_fmc_class_init, -}; - static const AspeedSegments aspeed_2400_spi1_segments[] =3D { { 0x30000000, 64 * MiB }, }; @@ -1506,12 +1477,6 @@ static void aspeed_2400_spi1_class_init(ObjectClass = *klass, const void *data) asc->reg_ops =3D &aspeed_smc_flash_ops; } =20 -static const TypeInfo aspeed_2400_spi1_info =3D { - .name =3D "aspeed.spi1-ast2400", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_2400_spi1_class_init, -}; - static const uint32_t aspeed_2500_fmc_resets[ASPEED_SMC_R_MAX] =3D { [R_CONF] =3D (CONF_FLASH_TYPE_SPI << CONF_FLASH_TYPE0 | CONF_FLASH_TYPE_SPI << CONF_FLASH_TYPE1), @@ -1552,12 +1517,6 @@ static void aspeed_2500_fmc_class_init(ObjectClass *= klass, const void *data) asc->reg_ops =3D &aspeed_smc_flash_ops; } =20 -static const TypeInfo aspeed_2500_fmc_info =3D { - .name =3D "aspeed.fmc-ast2500", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_2500_fmc_class_init, -}; - static const AspeedSegments aspeed_2500_spi1_segments[] =3D { { 0x30000000, 32 * MiB }, /* start address is readonly */ { 0x32000000, 96 * MiB }, /* end address is readonly */ @@ -1588,12 +1547,6 @@ static void aspeed_2500_spi1_class_init(ObjectClass = *klass, const void *data) asc->reg_ops =3D &aspeed_smc_flash_ops; } =20 -static const TypeInfo aspeed_2500_spi1_info =3D { - .name =3D "aspeed.spi1-ast2500", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_2500_spi1_class_init, -}; - static const AspeedSegments aspeed_2500_spi2_segments[] =3D { { 0x38000000, 32 * MiB }, /* start address is readonly */ { 0x3A000000, 96 * MiB }, /* end address is readonly */ @@ -1624,12 +1577,6 @@ static void aspeed_2500_spi2_class_init(ObjectClass = *klass, const void *data) asc->reg_ops =3D &aspeed_smc_flash_ops; } =20 -static const TypeInfo aspeed_2500_spi2_info =3D { - .name =3D "aspeed.spi2-ast2500", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_2500_spi2_class_init, -}; - /* * The Segment Registers of the AST2600 have a 1MB unit. The address * range of a flash SPI peripheral is encoded with offsets in the overall @@ -1712,12 +1659,6 @@ static void aspeed_2600_fmc_class_init(ObjectClass *= klass, const void *data) asc->reg_ops =3D &aspeed_smc_flash_ops; } =20 -static const TypeInfo aspeed_2600_fmc_info =3D { - .name =3D "aspeed.fmc-ast2600", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_2600_fmc_class_init, -}; - static const AspeedSegments aspeed_2600_spi1_segments[] =3D { { 0x0, 128 * MiB }, /* start address is readonly */ { 0x0, 0 }, /* disabled */ @@ -1752,12 +1693,6 @@ static void aspeed_2600_spi1_class_init(ObjectClass = *klass, const void *data) asc->reg_ops =3D &aspeed_smc_flash_ops; } =20 -static const TypeInfo aspeed_2600_spi1_info =3D { - .name =3D "aspeed.spi1-ast2600", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_2600_spi1_class_init, -}; - static const AspeedSegments aspeed_2600_spi2_segments[] =3D { { 0x0, 128 * MiB }, /* start address is readonly */ { 0x0, 0 }, /* disabled */ @@ -1793,12 +1728,6 @@ static void aspeed_2600_spi2_class_init(ObjectClass = *klass, const void *data) asc->reg_ops =3D &aspeed_smc_flash_ops; } =20 -static const TypeInfo aspeed_2600_spi2_info =3D { - .name =3D "aspeed.spi2-ast2600", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_2600_spi2_class_init, -}; - /* * The FMC Segment Registers of the AST1030 have a 512KB unit. * Only bits [27:19] are used for decoding. @@ -1877,12 +1806,6 @@ static void aspeed_1030_fmc_class_init(ObjectClass *= klass, const void *data) asc->reg_ops =3D &aspeed_smc_flash_ops; } =20 -static const TypeInfo aspeed_1030_fmc_info =3D { - .name =3D "aspeed.fmc-ast1030", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_1030_fmc_class_init, -}; - static const AspeedSegments aspeed_1030_spi1_segments[] =3D { { 0x0, 128 * MiB }, /* start address is readonly */ { 0x0, 0 }, /* disabled */ @@ -1916,11 +1839,6 @@ static void aspeed_1030_spi1_class_init(ObjectClass = *klass, const void *data) asc->reg_ops =3D &aspeed_smc_flash_ops; } =20 -static const TypeInfo aspeed_1030_spi1_info =3D { - .name =3D "aspeed.spi1-ast1030", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_1030_spi1_class_init, -}; static const AspeedSegments aspeed_1030_spi2_segments[] =3D { { 0x0, 128 * MiB }, /* start address is readonly */ { 0x0, 0 }, /* disabled */ @@ -1954,12 +1872,6 @@ static void aspeed_1030_spi2_class_init(ObjectClass = *klass, const void *data) asc->reg_ops =3D &aspeed_smc_flash_ops; } =20 -static const TypeInfo aspeed_1030_spi2_info =3D { - .name =3D "aspeed.spi2-ast1030", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_1030_spi2_class_init, -}; - /* * The FMC Segment Registers of the AST2700 have a 64KB unit. * Only bits [31:16] are used for decoding. @@ -2061,12 +1973,6 @@ static void aspeed_2700_fmc_class_init(ObjectClass *= klass, const void *data) asc->reg_ops =3D &aspeed_2700_smc_flash_ops; } =20 -static const TypeInfo aspeed_2700_fmc_info =3D { - .name =3D "aspeed.fmc-ast2700", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_2700_fmc_class_init, -}; - static const AspeedSegments aspeed_2700_spi0_segments[] =3D { { 0x0, 128 * MiB }, /* start address is readonly */ { 128 * MiB, 128 * MiB }, /* start address is readonly */ @@ -2102,12 +2008,6 @@ static void aspeed_2700_spi0_class_init(ObjectClass = *klass, const void *data) asc->reg_ops =3D &aspeed_2700_smc_flash_ops; } =20 -static const TypeInfo aspeed_2700_spi0_info =3D { - .name =3D "aspeed.spi0-ast2700", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_2700_spi0_class_init, -}; - static const AspeedSegments aspeed_2700_spi1_segments[] =3D { { 0x0, 128 * MiB }, /* start address is readonly */ { 0x0, 0 }, /* disabled */ @@ -2142,12 +2042,6 @@ static void aspeed_2700_spi1_class_init(ObjectClass = *klass, const void *data) asc->reg_ops =3D &aspeed_2700_smc_flash_ops; } =20 -static const TypeInfo aspeed_2700_spi1_info =3D { - .name =3D "aspeed.spi1-ast2700", - .parent =3D TYPE_ASPEED_SMC, - .class_init =3D aspeed_2700_spi1_class_init, -}; - static const AspeedSegments aspeed_2700_spi2_segments[] =3D { { 0x0, 128 * MiB }, /* start address is readonly */ { 0x0, 0 }, /* disabled */ @@ -2182,32 +2076,102 @@ static void aspeed_2700_spi2_class_init(ObjectClas= s *klass, const void *data) asc->reg_ops =3D &aspeed_2700_smc_flash_ops; } =20 -static const TypeInfo aspeed_2700_spi2_info =3D { - .name =3D "aspeed.spi2-ast2700", - .parent =3D TYPE_ASPEED_SMC, +static const TypeInfo aspeed_smc_types[] =3D { + { + .name =3D TYPE_ASPEED_SMC_FLASH, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AspeedSMCFlash), + .class_init =3D aspeed_smc_flash_class_init, + }, + { + .name =3D TYPE_ASPEED_SMC, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_init =3D aspeed_smc_instance_init, + .instance_size =3D sizeof(AspeedSMCState), + .class_size =3D sizeof(AspeedSMCClass), + .class_init =3D aspeed_smc_class_init, + .abstract =3D true, + }, + { + .name =3D "aspeed.fmc-ast1030", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_1030_fmc_class_init, + }, + { + .name =3D "aspeed.spi1-ast1030", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_1030_spi1_class_init, + }, + { + .name =3D "aspeed.spi2-ast1030", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_1030_spi2_class_init, + }, + { + .name =3D "aspeed.smc-ast2400", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_2400_smc_class_init, + }, + { + .name =3D "aspeed.fmc-ast2400", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_2400_fmc_class_init, + }, + { + .name =3D "aspeed.spi1-ast2400", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_2400_spi1_class_init, + }, + { + .name =3D "aspeed.fmc-ast2500", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_2500_fmc_class_init, + }, + { + .name =3D "aspeed.spi1-ast2500", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_2500_spi1_class_init, + }, + { + .name =3D "aspeed.spi2-ast2500", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_2500_spi2_class_init, + }, + { + .name =3D "aspeed.fmc-ast2600", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_2600_fmc_class_init, + }, + { + .name =3D "aspeed.spi1-ast2600", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_2600_spi1_class_init, + }, + { + .name =3D "aspeed.spi2-ast2600", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_2600_spi2_class_init, + }, + { + .name =3D "aspeed.fmc-ast2700", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_2700_fmc_class_init, + }, + { + .name =3D "aspeed.spi0-ast2700", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_2700_spi0_class_init, + }, + { + .name =3D "aspeed.spi1-ast2700", + .parent =3D TYPE_ASPEED_SMC, + .class_init =3D aspeed_2700_spi1_class_init, + }, + { + .name =3D "aspeed.spi2-ast2700", + .parent =3D TYPE_ASPEED_SMC, .class_init =3D aspeed_2700_spi2_class_init, + } }; =20 -static void aspeed_smc_register_types(void) -{ - type_register_static(&aspeed_smc_flash_info); - type_register_static(&aspeed_smc_info); - type_register_static(&aspeed_2400_smc_info); - type_register_static(&aspeed_2400_fmc_info); - type_register_static(&aspeed_2400_spi1_info); - type_register_static(&aspeed_2500_fmc_info); - type_register_static(&aspeed_2500_spi1_info); - type_register_static(&aspeed_2500_spi2_info); - type_register_static(&aspeed_2600_fmc_info); - type_register_static(&aspeed_2600_spi1_info); - type_register_static(&aspeed_2600_spi2_info); - type_register_static(&aspeed_1030_fmc_info); - type_register_static(&aspeed_1030_spi1_info); - type_register_static(&aspeed_1030_spi2_info); - type_register_static(&aspeed_2700_fmc_info); - type_register_static(&aspeed_2700_spi0_info); - type_register_static(&aspeed_2700_spi1_info); - type_register_static(&aspeed_2700_spi2_info); -} - -type_init(aspeed_smc_register_types) +DEFINE_TYPES(aspeed_smc_types) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898145; cv=none; d=zohomail.com; s=zohoarc; b=ChXANdwhCJ9wlI/3r24npNKheXDuYHBMef5ZVXYjJJ5xFIOtAEIRWg6SKoiehEUzX5+rr0AD/oJb3ksE8fh0ScfIaJPi5he2riQCvJHbRc4PYHX8YollvEMpa7YMYKkAg6e+wTlHRHYnSmOp3qG+Ug/owtxM6qHkfQVvmlwyKgs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898145; 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=XNFTDEPSBh1l3YPKlbVUkDCbt8f5ZgobdVJy0qtAba0=; b=Yzar4+dA0aiWy/b9Tf+b2xpsOFN82etHMimZT1cbM2+CPr4pDo1XDJE0VPX2FTC4goj0XewRM+L6YZ9u52kr68ZHbnvRKpL+gmC926vQ3EF9mo7haQ/x/BeKsj5SlHKe5tX5AMN+SzV3qgNdOmFVv5Bi2Bt1jTcpedCVErY/f4w= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898145389958.0070104472335; Sun, 7 Jun 2026 22:55:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsH-0002YV-JX; Mon, 08 Jun 2026 01:50:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSra-0001ed-FZ for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrX-0000ZP-VQ for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:30 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-492-UtrajwuoO0qrx_toBFBasQ-1; Mon, 08 Jun 2026 01:49:21 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E26591944D3B; Mon, 8 Jun 2026 05:49:20 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6AD4C27A; Mon, 8 Jun 2026 05:49:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XNFTDEPSBh1l3YPKlbVUkDCbt8f5ZgobdVJy0qtAba0=; b=hJ7evqgw3wGVSHgTWIbNtkh5suqPKVMAqVDnJ2FL8NUUh/QUIJ+HcDpBgb477zDYbUweCq js5qT7Uktg8gj8bn2rOO94PPkWUMjbtRh1BvyooBk2Jy7R1A0qwUCzOtjWrzL7/fWQ6vG8 YEaBjKopk1K0FBuasnPMeiNyVpN/Y1Q= X-MC-Unique: UtrajwuoO0qrx_toBFBasQ-1 X-Mimecast-MFC-AGG-ID: UtrajwuoO0qrx_toBFBasQ_1780897761 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 25/37] hw/i2c/aspeed_i2c: Introduce dma_addr_lo_mask to unify DMA address handling Date: Mon, 8 Jun 2026 07:48:14 +0200 Message-ID: <20260608054826.346488-26-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898146630154100 From: Jamin Lin The Aspeed I2C controller has two register layouts. The AST2500 uses the old mode with a single DMA address register (I2CD_DMA_= ADDR) where the address is 4-byte aligned and masked to 0x3ffffffc. >From AST2600 onwards, the new mode provides separate master TX/RX and slav= e RX DMA address registers (I2CM_DMA_TX_ADDR, I2CM_DMA_RX_ADDR, I2CS_DMA_RX_ADDR) with different address widths per SoC: AST2600 (new mode): 0x7fffffff - bits[30:0] AST1030 (new mode): 0x7fffffff - bits[30:0] AST1060 (new mode): 0x7fffffff - bits[30:0] AST2700 (new mode): 0xffffffff - bits[31:0] Introduce dma_addr_lo_mask as a per-class attribute and apply it uniformly when storing DMA address register writes and when loading the address into dma_dram_offset for both master and slave paths. This replaces the previous FIELD_EX32 extractions (which incorrectly stripped bit 31 on AST2700) and the hardcoded 0x3ffffffc literal in the old-mode path. Fixes: 1809ab6a67359e0876981cd05d2a50b2843eabad ("hw/i2c/aspeed: Add AST270= 0 support") Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260603040027.938816-2-jamin_lin@= aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- include/hw/i2c/aspeed_i2c.h | 5 +---- hw/i2c/aspeed_i2c.c | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h index d42cb4865aa5..1fc229f69919 100644 --- a/include/hw/i2c/aspeed_i2c.h +++ b/include/hw/i2c/aspeed_i2c.h @@ -209,13 +209,9 @@ REG32(I2CS_DMA_LEN, 0x2c) FIELD(I2CS_DMA_LEN, TX_BUF_LEN_W1T, 15, 1) FIELD(I2CS_DMA_LEN, TX_BUF_LEN, 0, 11) REG32(I2CM_DMA_TX_ADDR, 0x30) - FIELD(I2CM_DMA_TX_ADDR, ADDR, 0, 31) REG32(I2CM_DMA_RX_ADDR, 0x34) - FIELD(I2CM_DMA_RX_ADDR, ADDR, 0, 31) REG32(I2CS_DMA_TX_ADDR, 0x38) - FIELD(I2CS_DMA_TX_ADDR, ADDR, 0, 31) REG32(I2CS_DMA_RX_ADDR, 0x3c) - FIELD(I2CS_DMA_RX_ADDR, ADDR, 0, 31) REG32(I2CS_DEV_ADDR, 0x40) REG32(I2CM_DMA_LEN_STS, 0x48) FIELD(I2CM_DMA_LEN_STS, RX_LEN, 16, 13) @@ -303,6 +299,7 @@ struct AspeedI2CClass { bool has_share_pool; uint64_t mem_size; bool has_dma64; + uint32_t dma_addr_lo_mask; }; =20 static inline bool aspeed_i2c_is_new_mode(AspeedI2CState *s) diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c index 4a6732a18554..9d4e72c8585e 100644 --- a/hw/i2c/aspeed_i2c.c +++ b/hw/i2c/aspeed_i2c.c @@ -236,7 +236,7 @@ static void aspeed_i2c_set_tx_dma_dram_offset(AspeedI2C= Bus *bus) value =3D bus->regs[R_I2CM_DMA_TX_ADDR]; bus->dma_dram_offset =3D deposit64(bus->dma_dram_offset, 0, 32, - FIELD_EX32(value, I2CM_DMA_TX_ADDR, ADDR)); + value & aic->dma_addr_lo_mask); if (aic->has_dma64) { value =3D bus->regs[R_I2CM_DMA_TX_ADDR_HI]; bus->dma_dram_offset =3D @@ -246,7 +246,7 @@ static void aspeed_i2c_set_tx_dma_dram_offset(AspeedI2C= Bus *bus) } else { value =3D bus->regs[R_I2CD_DMA_ADDR]; bus->dma_dram_offset =3D deposit64(bus->dma_dram_offset, 0, 32, - value & 0x3ffffffc); + value & aic->dma_addr_lo_mask); } } =20 @@ -261,7 +261,7 @@ static void aspeed_i2c_set_rx_dma_dram_offset(AspeedI2C= Bus *bus) value =3D bus->regs[R_I2CM_DMA_RX_ADDR]; bus->dma_dram_offset =3D deposit64(bus->dma_dram_offset, 0, 32, - FIELD_EX32(value, I2CM_DMA_RX_ADDR, ADDR)); + value & aic->dma_addr_lo_mask); if (aic->has_dma64) { value =3D bus->regs[R_I2CM_DMA_RX_ADDR_HI]; bus->dma_dram_offset =3D @@ -271,7 +271,7 @@ static void aspeed_i2c_set_rx_dma_dram_offset(AspeedI2C= Bus *bus) } else { value =3D bus->regs[R_I2CD_DMA_ADDR]; bus->dma_dram_offset =3D deposit64(bus->dma_dram_offset, 0, 32, - value & 0x3ffffffc); + value & aic->dma_addr_lo_mask); } } =20 @@ -735,12 +735,10 @@ static void aspeed_i2c_bus_new_write(AspeedI2CBus *bu= s, hwaddr offset, aspeed_i2c_bus_raise_interrupt(bus); break; case A_I2CM_DMA_TX_ADDR: - bus->regs[R_I2CM_DMA_TX_ADDR] =3D FIELD_EX32(value, I2CM_DMA_TX_AD= DR, - ADDR); + bus->regs[R_I2CM_DMA_TX_ADDR] =3D value & aic->dma_addr_lo_mask; break; case A_I2CM_DMA_RX_ADDR: - bus->regs[R_I2CM_DMA_RX_ADDR] =3D FIELD_EX32(value, I2CM_DMA_RX_AD= DR, - ADDR); + bus->regs[R_I2CM_DMA_RX_ADDR] =3D value & aic->dma_addr_lo_mask; break; case A_I2CM_DMA_LEN: w1t =3D FIELD_EX32(value, I2CM_DMA_LEN, RX_BUF_LEN_W1T) || @@ -777,7 +775,7 @@ static void aspeed_i2c_bus_new_write(AspeedI2CBus *bus,= hwaddr offset, bus->regs[R_I2CS_DEV_ADDR] =3D value; break; case A_I2CS_DMA_RX_ADDR: - bus->regs[R_I2CS_DMA_RX_ADDR] =3D value; + bus->regs[R_I2CS_DMA_RX_ADDR] =3D value & aic->dma_addr_lo_mask; break; case A_I2CS_DMA_LEN: if (FIELD_EX32(value, I2CS_DMA_LEN, RX_BUF_LEN_W1T)) { @@ -1375,6 +1373,8 @@ static void aspeed_i2c_class_init(ObjectClass *klass,= const void *data) static int aspeed_i2c_bus_new_slave_event(AspeedI2CBus *bus, enum i2c_event event) { + AspeedI2CClass *aic =3D ASPEED_I2C_GET_CLASS(bus->controller); + switch (event) { case I2C_START_SEND_ASYNC: if (!SHARED_ARRAY_FIELD_EX32(bus->regs, R_I2CS_CMD, RX_DMA_EN)) { @@ -1385,7 +1385,7 @@ static int aspeed_i2c_bus_new_slave_event(AspeedI2CBu= s *bus, ARRAY_FIELD_DP32(bus->regs, I2CS_DMA_LEN_STS, RX_LEN, 0); bus->dma_dram_offset =3D deposit64(bus->dma_dram_offset, 0, 32, - ARRAY_FIELD_EX32(bus->regs, I2CS_DMA_RX_ADDR, ADDR)); + bus->regs[R_I2CS_DMA_RX_ADDR] & aic->dma_addr_lo_mas= k); bus->regs[R_I2CC_DMA_LEN] =3D ARRAY_FIELD_EX32(bus->regs, I2CS_DMA_LEN, RX_BUF_LEN) + 1; i2c_ack(bus->bus); @@ -1608,6 +1608,7 @@ static void aspeed_2500_i2c_class_init(ObjectClass *k= lass, const void *data) aic->check_sram =3D true; aic->has_dma =3D true; aic->mem_size =3D 0x1000; + aic->dma_addr_lo_mask =3D 0x3ffffffc; } =20 static qemu_irq aspeed_2600_i2c_bus_get_irq(AspeedI2CBus *bus) @@ -1631,6 +1632,7 @@ static void aspeed_2600_i2c_class_init(ObjectClass *k= lass, const void *data) aic->bus_pool_base =3D aspeed_2500_i2c_bus_pool_base; aic->has_dma =3D true; aic->mem_size =3D 0x1000; + aic->dma_addr_lo_mask =3D 0x7fffffff; } =20 static void aspeed_1030_i2c_class_init(ObjectClass *klass, const void *dat= a) @@ -1649,6 +1651,7 @@ static void aspeed_1030_i2c_class_init(ObjectClass *k= lass, const void *data) aic->bus_pool_base =3D aspeed_2500_i2c_bus_pool_base; aic->has_dma =3D true; aic->mem_size =3D 0x10000; + aic->dma_addr_lo_mask =3D 0x7fffffff; } =20 static void aspeed_2700_i2c_class_init(ObjectClass *klass, const void *dat= a) @@ -1670,6 +1673,7 @@ static void aspeed_2700_i2c_class_init(ObjectClass *k= lass, const void *data) aic->has_dma =3D true; aic->mem_size =3D 0x2000; aic->has_dma64 =3D true; + aic->dma_addr_lo_mask =3D 0xffffffff; } =20 static const TypeInfo aspeed_i2c_types[] =3D { --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897821; cv=none; d=zohomail.com; s=zohoarc; b=NiwaA1a3uWJclMxVhEOW7rEg8jtnLpZYj44OrdsU2+CJVoBlUg/kXeZs/xgXFofjBRWCd91K8dyjhoxAZ/SiNlz9zQvtlnjAPIz+WvNDnymM+IeunW/esfLO+ZEUX6iD7fjnCPIta8yfDJf+1KVTqppNpFwkc5Q2vhSrLhvDgqI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897821; 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=NNdM16FWNbr7TVbxZ52lQx341yc8VjhPTKPcYHWqqDg=; b=MUKJSurdbhaWrKuxXGw+zLcpKIqAvSgl+bk4VXNPeh73GABmTT0siXB9xJ4ei3QjEKpWY/ZhjBNZi0M4AtA3GlMqNRqic/TfR/xx+UinBv2oINwwoCnsHqQnxj6uNofsVAAKweFJiQtu3rjL0njQjsHmQsyvKIjxVUM724g9CEQ= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897821839352.8665052910578; Sun, 7 Jun 2026 22:50:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSs6-000211-8j; Mon, 08 Jun 2026 01:50:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrX-0001YY-Qs for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrV-0000Z2-Vs for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:27 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-544-kOOmblXtP7Sql1cr-AeMcw-1; Mon, 08 Jun 2026 01:49:24 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ECA261956059; Mon, 8 Jun 2026 05:49:22 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6099427A; Mon, 8 Jun 2026 05:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NNdM16FWNbr7TVbxZ52lQx341yc8VjhPTKPcYHWqqDg=; b=Kxg1eZSp7Hx/fdBah8GXH8l8nF/9yZ21BTS/ovzdejKoKuCkTUCe0A0bdmiVTi6mIOz0Sl s1sG7xYN+xZNftBXg9J7XSENOS8ju4FCxBZCN802X1jCJWObE1VUnXBaPqm4zPVhxTPS0A FtA2pr/7gdYJQs+XVT4zakWFLxpVWZ8= X-MC-Unique: kOOmblXtP7Sql1cr-AeMcw-1 X-Mimecast-MFC-AGG-ID: kOOmblXtP7Sql1cr-AeMcw_1780897763 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 26/37] hw/i2c/aspeed_i2c: Increase AST2700 buffer mode size and adjust offset Date: Mon, 8 Jun 2026 07:48:15 +0200 Message-ID: <20260608054826.346488-27-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897823966154100 From: Jamin Lin Update the AST2700 I2C buffer mode configuration to match the latest firmware definition: - Increase buffer mode pool size from 0x20 to 0x40 - Adjust buffer mode base offset to 0x1c0 Since the buffer mode region size changes, the migration state layout is also modified. Bump the VMState version numbers to prevent incompatible migration between old and new machine states. Fixes: 1809ab6a67359e0876981cd05d2a50b2843eabad ("hw/i2c/aspeed: Add AST270= 0 support") Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260603040027.938816-3-jamin_lin@= aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- include/hw/i2c/aspeed_i2c.h | 2 +- hw/i2c/aspeed_i2c.c | 46 ++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h index 1fc229f69919..b2e4d2fb9dcb 100644 --- a/include/hw/i2c/aspeed_i2c.h +++ b/include/hw/i2c/aspeed_i2c.h @@ -35,7 +35,7 @@ OBJECT_DECLARE_TYPE(AspeedI2CState, AspeedI2CClass, ASPEE= D_I2C) =20 #define ASPEED_I2C_NR_BUSSES 16 #define ASPEED_I2C_SHARE_POOL_SIZE 0x800 -#define ASPEED_I2C_BUS_POOL_SIZE 0x20 +#define ASPEED_I2C_BUS_POOL_SIZE 0x40 #define ASPEED_I2C_NEW_NUM_REG (0xa0 >> 2) =20 #define A_I2CD_M_STOP_CMD BIT(5) diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c index 9d4e72c8585e..856d5dc1db64 100644 --- a/hw/i2c/aspeed_i2c.c +++ b/hw/i2c/aspeed_i2c.c @@ -1132,8 +1132,8 @@ static const MemoryRegionOps aspeed_i2c_bus_pool_ops = =3D { =20 static const VMStateDescription aspeed_i2c_bus_vmstate =3D { .name =3D TYPE_ASPEED_I2C, - .version_id =3D 7, - .minimum_version_id =3D 6, + .version_id =3D 8, + .minimum_version_id =3D 8, .fields =3D (const VMStateField[]) { VMSTATE_UINT32_ARRAY(regs, AspeedI2CBus, ASPEED_I2C_NEW_NUM_REG), VMSTATE_UINT32_V(pending_intr_sts, AspeedI2CBus, 7), @@ -1145,8 +1145,8 @@ static const VMStateDescription aspeed_i2c_bus_vmstat= e =3D { =20 static const VMStateDescription aspeed_i2c_vmstate =3D { .name =3D TYPE_ASPEED_I2C, - .version_id =3D 3, - .minimum_version_id =3D 3, + .version_id =3D 4, + .minimum_version_id =3D 4, .fields =3D (const VMStateField[]) { VMSTATE_UINT32(intr_status, AspeedI2CState), VMSTATE_STRUCT_ARRAY(busses, AspeedI2CState, @@ -1250,37 +1250,37 @@ static void aspeed_i2c_instance_init(Object *obj) * Address Definitions (AST2700) * 0x000 ... 0x0FF: Global Register * 0x100 ... 0x19F: Device 0 - * 0x1A0 ... 0x1BF: Device 0 buffer + * 0x1C0 ... 0x1FF: Device 0 buffer * 0x200 ... 0x29F: Device 1 - * 0x2A0 ... 0x2BF: Device 1 buffer + * 0x2C0 ... 0x2FF: Device 1 buffer * 0x300 ... 0x39F: Device 2 - * 0x3A0 ... 0x3BF: Device 2 buffer + * 0x3C0 ... 0x3FF: Device 2 buffer * 0x400 ... 0x49F: Device 3 - * 0x4A0 ... 0x4BF: Device 3 buffer + * 0x4C0 ... 0x4FF: Device 3 buffer * 0x500 ... 0x59F: Device 4 - * 0x5A0 ... 0x5BF: Device 4 buffer + * 0x5C0 ... 0x5FF: Device 4 buffer * 0x600 ... 0x69F: Device 5 - * 0x6A0 ... 0x6BF: Device 5 buffer + * 0x6C0 ... 0x6FF: Device 5 buffer * 0x700 ... 0x79F: Device 6 - * 0x7A0 ... 0x7BF: Device 6 buffer + * 0x7C0 ... 0x7FF: Device 6 buffer * 0x800 ... 0x89F: Device 7 - * 0x8A0 ... 0x8BF: Device 7 buffer + * 0x8C0 ... 0x8FF: Device 7 buffer * 0x900 ... 0x99F: Device 8 - * 0x9A0 ... 0x9BF: Device 8 buffer + * 0x9C0 ... 0x9FF: Device 8 buffer * 0xA00 ... 0xA9F: Device 9 - * 0xAA0 ... 0xABF: Device 9 buffer + * 0xAC0 ... 0xAFF: Device 9 buffer * 0xB00 ... 0xB9F: Device 10 - * 0xBA0 ... 0xBBF: Device 10 buffer + * 0xBC0 ... 0xBFF: Device 10 buffer * 0xC00 ... 0xC9F: Device 11 - * 0xCA0 ... 0xCBF: Device 11 buffer + * 0xCC0 ... 0xCFF: Device 11 buffer * 0xD00 ... 0xD9F: Device 12 - * 0xDA0 ... 0xDBF: Device 12 buffer + * 0xDC0 ... 0xDFF: Device 12 buffer * 0xE00 ... 0xE9F: Device 13 - * 0xEA0 ... 0xEBF: Device 13 buffer + * 0xEC0 ... 0xEFF: Device 13 buffer * 0xF00 ... 0xF9F: Device 14 - * 0xFA0 ... 0xFBF: Device 14 buffer + * 0xFC0 ... 0xFFF: Device 14 buffer * 0x1000 ... 0x109F: Device 15 - * 0x10A0 ... 0x10BF: Device 15 buffer + * 0x10C0 ... 0x10BF: Device 15 buffer */ static void aspeed_i2c_realize(DeviceState *dev, Error **errp) { @@ -1666,9 +1666,9 @@ static void aspeed_2700_i2c_class_init(ObjectClass *k= lass, const void *data) aic->reg_gap_size =3D 0x60; aic->gap =3D -1; /* no gap */ aic->bus_get_irq =3D aspeed_2600_i2c_bus_get_irq; - aic->pool_size =3D 0x20; - aic->pool_gap_size =3D 0xe0; - aic->pool_base =3D 0x1a0; + aic->pool_size =3D 0x40; + aic->pool_gap_size =3D 0xc0; + aic->pool_base =3D 0x1c0; aic->bus_pool_base =3D aspeed_2500_i2c_bus_pool_base; aic->has_dma =3D true; aic->mem_size =3D 0x2000; --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898215; cv=none; d=zohomail.com; s=zohoarc; b=C0pT7pi8zi/bDj0pYuGqF5mOwtErpMwF2JI+E7hWZiv6ZBN8TRtSHFvtoGWPwNHI2a+jON3i5AUmHkTdJhnW/fbqFU5wHzQDxYxLoYIlvNMT0IrQmX6vwctyrIvOvVvxyPeM/Nfy3H6EzBCNMJ/tDiqAksDswAjyf1ukIajSvnY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898215; 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=hnOF6BGo/PmB2WCw2IUldWkktybHIynxkPpkI/OZkdU=; b=mjmgX0YtXeiWhIlBU54Avr4kUErRGPwHXuhdqqauHvZBjJn00UAd6grOUIMr/UPKE7PZ1O/B6JMlNlyH/MiqJ3CpfCvCOi4iMJB808KxIoiy6mK6oAKD2yesFWQD0SHb4l1XvCOjMGgXcttK5t/svsQ++8Bg5H3yG6AOhqGsJeY= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898215244249.2007585744717; Sun, 7 Jun 2026 22:56:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsE-0002Im-W3; Mon, 08 Jun 2026 01:50:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrh-0001lr-35 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSre-0000g6-MM for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:35 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-330-ajyLfgI4M8isghmqyJ14VA-1; Mon, 08 Jun 2026 01:49:25 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DE05A18005BC; Mon, 8 Jun 2026 05:49:24 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 53B8C765; Mon, 8 Jun 2026 05:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hnOF6BGo/PmB2WCw2IUldWkktybHIynxkPpkI/OZkdU=; b=HkMTrGFlkthdIWG5R6e7JyV9OKU2ogaLHVDCuxW4PQKMMwvzc78+gCEFKAFxtdmBbTKheN ZqzjugihkT2I5NfpVwxP73XWFuksYFTlEIjV5wzGHjxwqNR28gQPKV2bb5/FdPZvBVaOka J1yhDFSk65iCVxuFL3Bc8B8YdnT6cxc= X-MC-Unique: ajyLfgI4M8isghmqyJ14VA-1 X-Mimecast-MFC-AGG-ID: ajyLfgI4M8isghmqyJ14VA_1780897765 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 27/37] hw/arm/aspeed_ast1040: Reuse AST2700 ADC model Date: Mon, 8 Jun 2026 07:48:16 +0200 Message-ID: <20260608054826.346488-28-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898217809154100 From: Jamin Lin Instead of introducing a dedicated TYPE_ASPEED_1040_ADC model, initialize the existing AST2700 ADC device directly for AST1040. This avoids unnecessary duplication and keeps the codebase simpler and easier to maintain. Add ADC device initialization and realization support to the AST1040 SoC model using TYPE_ASPEED_2700_ADC. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260603040027.938816-4-jamin_lin@= aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast1040.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/arm/aspeed_ast1040.c b/hw/arm/aspeed_ast1040.c index 8efcdad8f6a0..b736e690e5e2 100644 --- a/hw/arm/aspeed_ast1040.c +++ b/hw/arm/aspeed_ast1040.c @@ -107,6 +107,8 @@ static void aspeed_soc_ast1040_init(Object *obj) object_initialize_child(obj, "uart[*]", &s->uart[i], TYPE_SERIAL_M= M); } =20 + object_initialize_child(obj, "adc", &s->adc, TYPE_ASPEED_2700_ADC); + object_initialize_child(obj, "pwm", &s->pwm, TYPE_UNIMPLEMENTED_DEVICE= ); object_initialize_child(obj, "espi", &s->espi, TYPE_UNIMPLEMENTED_DEVI= CE); object_initialize_child(obj, "udc", &s->udc, TYPE_UNIMPLEMENTED_DEVICE= ); @@ -188,6 +190,15 @@ static void aspeed_soc_ast1040_realize(DeviceState *de= v_soc, Error **errp) aspeed_soc_ast1040_get_irq(s, uart)); } =20 + /* ADC */ + if (!sysbus_realize(SYS_BUS_DEVICE(&s->adc), errp)) { + return; + } + aspeed_mmio_map(s->memory, SYS_BUS_DEVICE(&s->adc), 0, + sc->memmap[ASPEED_DEV_ADC]); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->adc), 0, + aspeed_soc_ast1040_get_irq(s, ASPEED_DEV_ADC)); + /* Unimplemented peripherals */ aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->pwm), "aspeed.pwm", --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898206; cv=none; d=zohomail.com; s=zohoarc; b=cl5ARRyH0whdXnlwsOAzUfi/hVLOhvt3YnZ5/ZnbwUhyEYawb7vebT4xpjavzVd6hurCHdInkIVoUwI+1bbVA5hmY8FmTK2FkLj9XpyXkl83VkyQVopE0CjgLM85qTZE6JS0NDJuDsBexxFHJvOF2medG6E4jHRTr6oGL7YWbfM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898206; 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=ZfVBhAkKSFXr5nO8islHlQFJb52F9RvRM2gwOrdIIQ4=; b=I0I7G2B+hbwJnPiOMRSJND4k6EglWpoB3EpqzQTASpzOSkA6d5JuKiBDSyfL7mgoFBxUUNfFvmu/76ZSgBCWApbUmyjU8wIVCNKtDKe5X99zwYoLTDf6VzugzFFrsViP+TJVLJWfB8N6yIqMXkFl4F/yfv442A28aGv1Ir8gJJE= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898206904714.2529822054279; Sun, 7 Jun 2026 22:56:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsD-00029U-GM; Mon, 08 Jun 2026 01:50:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrd-0001hU-SN for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrc-0000cf-27 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:33 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-103-1TB_7Lz6Nr2TEF_LQlnUnA-1; Mon, 08 Jun 2026 01:49:27 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B88791800473; Mon, 8 Jun 2026 05:49:26 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4612D1686; Mon, 8 Jun 2026 05:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZfVBhAkKSFXr5nO8islHlQFJb52F9RvRM2gwOrdIIQ4=; b=ECdlhCcM7a7n+Xy5HdeqTOFM0RUrU4rszj7aBuS4SMgmU6Vd4rkNNFNuBdtzbqocje0I8t JKFxPBZUu45JloYq/zGWh5M7PVmzJ/FwHnQZoJZjHCbr1SmflWecnG+yjaCZXatDBVq22Q yvjpgSw1rIetAxfxDxEmGDNuzoD8wNo= X-MC-Unique: 1TB_7Lz6Nr2TEF_LQlnUnA-1 X-Mimecast-MFC-AGG-ID: 1TB_7Lz6Nr2TEF_LQlnUnA_1780897766 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 28/37] hw/arm/aspeed_ast1040: Introduce PECI support Date: Mon, 8 Jun 2026 07:48:17 +0200 Message-ID: <20260608054826.346488-29-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898209563154100 From: Jamin Lin Introduce PECI support for the AST1040 SoC model. This change adds the PECI MMIO region and IRQ mapping, initializes the PECI device instance, and realizes the controller during SoC initialization. The PECI controller is mapped at 0x74C1F000 and connected to IRQ 164. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260603040027.938816-5-jamin_lin@= aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast1040.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/arm/aspeed_ast1040.c b/hw/arm/aspeed_ast1040.c index b736e690e5e2..9ae0a0e7a4a1 100644 --- a/hw/arm/aspeed_ast1040.c +++ b/hw/arm/aspeed_ast1040.c @@ -31,6 +31,7 @@ static const hwaddr aspeed_soc_ast1040_memmap[] =3D { [ASPEED_DEV_SGPIOM0] =3D 0x74C0C000, [ASPEED_DEV_SGPIOM1] =3D 0x74C0D000, [ASPEED_DEV_I2C] =3D 0x74C0F000, + [ASPEED_DEV_PECI] =3D 0x74C1F000, [ASPEED_DEV_I3C] =3D 0x74C20000, [ASPEED_DEV_UART0] =3D 0x74C33000, [ASPEED_DEV_UART1] =3D 0x74C33100, @@ -76,6 +77,7 @@ static const int aspeed_soc_ast1040_irqmap[] =3D { [ASPEED_DEV_UART11] =3D 146, [ASPEED_DEV_UART12] =3D 147, [ASPEED_DEV_JTAG0] =3D 162, + [ASPEED_DEV_PECI] =3D 164, }; =20 static qemu_irq aspeed_soc_ast1040_get_irq(AspeedSoCState *s, int dev) @@ -108,6 +110,7 @@ static void aspeed_soc_ast1040_init(Object *obj) } =20 object_initialize_child(obj, "adc", &s->adc, TYPE_ASPEED_2700_ADC); + object_initialize_child(obj, "peci", &s->peci, TYPE_ASPEED_PECI); =20 object_initialize_child(obj, "pwm", &s->pwm, TYPE_UNIMPLEMENTED_DEVICE= ); object_initialize_child(obj, "espi", &s->espi, TYPE_UNIMPLEMENTED_DEVI= CE); @@ -199,6 +202,15 @@ static void aspeed_soc_ast1040_realize(DeviceState *de= v_soc, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->adc), 0, aspeed_soc_ast1040_get_irq(s, ASPEED_DEV_ADC)); =20 + /* PECI */ + if (!sysbus_realize(SYS_BUS_DEVICE(&s->peci), errp)) { + return; + } + aspeed_mmio_map(s->memory, SYS_BUS_DEVICE(&s->peci), 0, + sc->memmap[ASPEED_DEV_PECI]); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->peci), 0, + aspeed_soc_ast1040_get_irq(s, ASPEED_DEV_PECI)); + /* Unimplemented peripherals */ aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->pwm), "aspeed.pwm", --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780897941; cv=none; d=zohomail.com; s=zohoarc; b=LazU+gP8Qnk/msIruNKXYsNRuU9y0WDkCAdXlKFOqUE4n+lPgii6ECFoKUPmA97rLAeigyBG5or6N52cY4m3Wt3NQelMDrvqDyJNtWH+imKIKnuPITdX21HDzcRF3pmEOxMXGh/KU8H0aDy0mPQ02UaNohwdbxIIP9jjezEEkBc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780897941; 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=hVUKR86rIINCjBerj/Wsw6Jo4BwrxCSBlhynYVk8Q5w=; b=JkojVXyt9obWRktAKYyksFiSvcAoCOV0ZyNFUd8LZr5Z4n6A0xJgSPONsJdJrNVjtIkHxZ8nPtXtWi42RwNryQuTsVDFp0GPVTxea0Di9fymxH6aN1MKAjZKNDHcUd3KZztWeMOa3QNQYJy1SnGbnoNy4/6jYTMgJOxqiOfPMW8= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780897941352856.6815250526253; Sun, 7 Jun 2026 22:52:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsF-0002JR-1w; Mon, 08 Jun 2026 01:50:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrf-0001kS-P0 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSre-0000fG-1d for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:35 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-83-lckQ-JfGOhichfnKfLwNCA-1; Mon, 08 Jun 2026 01:49:29 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AB3F019560A1; Mon, 8 Jun 2026 05:49:28 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 372A127A; Mon, 8 Jun 2026 05:49:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hVUKR86rIINCjBerj/Wsw6Jo4BwrxCSBlhynYVk8Q5w=; b=EVEjmgdl2xztfvIymWkhWyAOTyu022BzqJOGx0H7kn3yOzC7A0qh02jm8MMXAVwIjgL/Gb OxTZt1rNsalGJT+YK4O6HhNxhQocAFWe+luOQBqtjgfTvCnUb/HXTZfZKaRs58O3Gc5bbS pzZwCA52YEmYn4d7E4o5nZwsoQx0qUI= X-MC-Unique: lckQ-JfGOhichfnKfLwNCA-1 X-Mimecast-MFC-AGG-ID: lckQ-JfGOhichfnKfLwNCA_1780897768 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 29/37] hw/arm/aspeed_ast1040: Reuse AST2700 GPIO controller model Date: Mon, 8 Jun 2026 07:48:18 +0200 Message-ID: <20260608054826.346488-30-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780897942299158500 From: Jamin Lin The AST1040 GPIO controller is compatible with the AST2700 GPIO controller implementation. Reuse the existing "aspeed.gpio-ast2700" device model for AST1040 instead of introducing a separate implementation. Add the GPIO device initialization, MMIO mapping, and IRQ wiring for the AST1040 SoC model. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260603040027.938816-6-jamin_lin@= aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast1040.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/arm/aspeed_ast1040.c b/hw/arm/aspeed_ast1040.c index 9ae0a0e7a4a1..c6b22186ce72 100644 --- a/hw/arm/aspeed_ast1040.c +++ b/hw/arm/aspeed_ast1040.c @@ -111,6 +111,7 @@ static void aspeed_soc_ast1040_init(Object *obj) =20 object_initialize_child(obj, "adc", &s->adc, TYPE_ASPEED_2700_ADC); object_initialize_child(obj, "peci", &s->peci, TYPE_ASPEED_PECI); + object_initialize_child(obj, "gpio", &s->gpio, "aspeed.gpio-ast2700"); =20 object_initialize_child(obj, "pwm", &s->pwm, TYPE_UNIMPLEMENTED_DEVICE= ); object_initialize_child(obj, "espi", &s->espi, TYPE_UNIMPLEMENTED_DEVI= CE); @@ -211,6 +212,15 @@ static void aspeed_soc_ast1040_realize(DeviceState *de= v_soc, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->peci), 0, aspeed_soc_ast1040_get_irq(s, ASPEED_DEV_PECI)); =20 + /* GPIO */ + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), errp)) { + return; + } + aspeed_mmio_map(s->memory, SYS_BUS_DEVICE(&s->gpio), 0, + sc->memmap[ASPEED_DEV_GPIO]); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio), 0, + aspeed_soc_ast1040_get_irq(s, ASPEED_DEV_GPIO)); + /* Unimplemented peripherals */ aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->pwm), "aspeed.pwm", --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898081; cv=none; d=zohomail.com; s=zohoarc; b=np4SheeUFTDrxBpj7IYWNT9tTEzjWsJ7JbgzfH+f8ySx0UmX+e3QMWOLP1NcuaCaCA3QdUcv2YwnUCpVyW+ZD2QSh4PoRcndNlNEecSh19ec3hQYDBRkJ7AJQgEO9iSux8t6Y8dWAhn5roZgpvHtrx+SEKAKT9o8wyU3IIeXED8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898081; 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=eDZtwZRXZZCr66ELqoFMvh5WzweIfksK+cS5qV8a/lY=; b=fRehi2ClkQSCGMV8hC+0b4113zXCL6xSZWEklmN0/RNkRc0L7oFElKlSYq28usuG1QBlKZ5uWNmlU5DuZEVIPM/lIXg2JG3J5FUa7QcImr3D6iROc6Z0ZeBBoa1pfRHAre34+dZD/gEaM7yvYc7xmh2WJ/eNdD40kBlOUCh5Ve4= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898081453990.9394785184836; Sun, 7 Jun 2026 22:54:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsJ-0002gh-7g; Mon, 08 Jun 2026 01:50:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrj-0001r3-D9 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrf-0000hB-Oi for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:38 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-323-tEG4Y8XUNHGlmxHjRLN5Bg-1; Mon, 08 Jun 2026 01:49:31 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9CE361800599; Mon, 8 Jun 2026 05:49:30 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 28D961624; Mon, 8 Jun 2026 05:49:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eDZtwZRXZZCr66ELqoFMvh5WzweIfksK+cS5qV8a/lY=; b=EgZiQb7Xc37pTvRsf5qCGFpdQXCdUXSOtPMtZDTi3PNW/fx6FvCy+j+wdy6AFMrdauxl7Z FZitaLyKkf6URW0YmYYSp3MHhfh7dbh1j2TEQjudlZw17izvqUQOkoOHXcK9KMF27V/aKp jUrWjRMwdn1Tp84P9pRTKX7abGbfoKk= X-MC-Unique: tEG4Y8XUNHGlmxHjRLN5Bg-1 X-Mimecast-MFC-AGG-ID: tEG4Y8XUNHGlmxHjRLN5Bg_1780897770 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 30/37] hw/arm/aspeed_ast1040: Add SGPIO controller support Date: Mon, 8 Jun 2026 07:48:19 +0200 Message-ID: <20260608054826.346488-31-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898084165154100 From: Jamin Lin The AST1040 SGPIO controller is compatible with the AST2700 SGPIO controller implementation. AST1040 contains two SGPIO controllers, so reuse the existing "aspeed.sgpio-ast2700" device model instead of keeping them as unimplemented devices. MMIO mapping: - SGPIOM0 : 0x74C0C000 - SGPIOM1 : 0x74C0D000 IRQ mapping: - SGPIOM0 : IRQ 85 - SGPIOM1 : IRQ 88 Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260603040027.938816-7-jamin_lin@= aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast1040.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/hw/arm/aspeed_ast1040.c b/hw/arm/aspeed_ast1040.c index c6b22186ce72..77211ce1f362 100644 --- a/hw/arm/aspeed_ast1040.c +++ b/hw/arm/aspeed_ast1040.c @@ -56,6 +56,7 @@ static const int aspeed_soc_ast1040_irqmap[] =3D { [ASPEED_DEV_ADC] =3D 80, [ASPEED_DEV_GPIO] =3D 82, [ASPEED_DEV_SGPIOM0] =3D 85, + [ASPEED_DEV_SGPIOM1] =3D 88, [ASPEED_DEV_TIMER1] =3D 92, [ASPEED_DEV_I3C] =3D 96, /* 96 ~ 103 */ [ASPEED_DEV_WDT] =3D 112, @@ -112,14 +113,14 @@ static void aspeed_soc_ast1040_init(Object *obj) object_initialize_child(obj, "adc", &s->adc, TYPE_ASPEED_2700_ADC); object_initialize_child(obj, "peci", &s->peci, TYPE_ASPEED_PECI); object_initialize_child(obj, "gpio", &s->gpio, "aspeed.gpio-ast2700"); + for (i =3D 0; i < sc->sgpio_num; i++) { + object_initialize_child(obj, "sgpio[*]", &s->sgpiom[i], + "aspeed.sgpio-ast2700"); + } =20 object_initialize_child(obj, "pwm", &s->pwm, TYPE_UNIMPLEMENTED_DEVICE= ); object_initialize_child(obj, "espi", &s->espi, TYPE_UNIMPLEMENTED_DEVI= CE); object_initialize_child(obj, "udc", &s->udc, TYPE_UNIMPLEMENTED_DEVICE= ); - object_initialize_child(obj, "sgpiom[0]", &s->sgpiom[0], - TYPE_UNIMPLEMENTED_DEVICE); - object_initialize_child(obj, "sgpiom[1]", &s->sgpiom[1], - TYPE_UNIMPLEMENTED_DEVICE); object_initialize_child(obj, "jtag[0]", &s->jtag[0], TYPE_UNIMPLEMENTED_DEVICE); object_initialize_child(obj, "jtag[1]", &s->jtag[1], @@ -221,6 +222,17 @@ static void aspeed_soc_ast1040_realize(DeviceState *de= v_soc, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio), 0, aspeed_soc_ast1040_get_irq(s, ASPEED_DEV_GPIO)); =20 + /* SGPIO */ + for (i =3D 0; i < sc->sgpio_num; i++) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->sgpiom[i]), errp)) { + return; + } + aspeed_mmio_map(s->memory, SYS_BUS_DEVICE(&s->sgpiom[i]), 0, + sc->memmap[ASPEED_DEV_SGPIOM0 + i]); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->sgpiom[i]), 0, + aspeed_soc_ast1040_get_irq(s, ASPEED_DEV_SGPIOM0 + = i)); + } + /* Unimplemented peripherals */ aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->pwm), "aspeed.pwm", @@ -234,14 +246,6 @@ static void aspeed_soc_ast1040_realize(DeviceState *de= v_soc, Error **errp) "aspeed.udc", sc->memmap[ASPEED_DEV_UDC], 0x4000); =20 - aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->sgpiom[0]), - "aspeed.sgpiom0", - sc->memmap[ASPEED_DEV_SGPIOM0], 0x1000); - - aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->sgpiom[1]), - "aspeed.sgpiom1", - sc->memmap[ASPEED_DEV_SGPIOM1], 0x1000); - aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->jtag[0]), "aspeed.jtag0", sc->memmap[ASPEED_DEV_JTAG0], 0x100); @@ -269,6 +273,7 @@ static void aspeed_soc_ast1040_class_init(ObjectClass *= klass, const void *data) sc->sram_size[0] =3D 128 * KiB; sc->sram_size[1] =3D 16 * MiB; /* Hyper RAM */ sc->uarts_num =3D 13; + sc->sgpio_num =3D 2; sc->uarts_base =3D ASPEED_DEV_UART0; sc->irqmap =3D aspeed_soc_ast1040_irqmap; sc->memmap =3D aspeed_soc_ast1040_memmap; --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898096; cv=none; d=zohomail.com; s=zohoarc; b=Urw3WdIy7BwxLwB0By6bHdyRO//YGoz1sQEVoTyfYa20PScW3eGtsGAqlKK4/wlXJNVUTBPO5epH8af0TesbjeFoRaNs/0c/QwBEvTGCCrEX8UBb/mWQbQBe7DmbWmS6M4+3pOUB44QTQkSI+T0DpdMl2Ac7Wn8njrqablns32c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898096; 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=wMNvVJ7iJrL/5zHrO8QbpJsc8b209aVkYqUV2dm0o2g=; b=WbgqIrJHDp51UdedzpOSi7ZfhGN7GIgJSpJpWQR5j+gXdTOHw2c57He2Dr2i5LJVqJvKwUEfO6tKbq2BxEKzN1FtcRZ4rrLjvu9K7Xo/QrO/vZmRtpWUMCoNXn3nFAtHscbfOvOditEI0z3CFDuzbuiYsM2nOJVmu+hRuVDnBWE= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898096094394.46158606965605; Sun, 7 Jun 2026 22:54:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsG-0002SE-Cn; Mon, 08 Jun 2026 01:50:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrj-0001r4-Eg for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrh-0000hj-NQ for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:39 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-576-AqKZQIggMcihedJzXfWqyA-1; Mon, 08 Jun 2026 01:49:33 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8F4D11800473; Mon, 8 Jun 2026 05:49:32 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1A9FB27A; Mon, 8 Jun 2026 05:49:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wMNvVJ7iJrL/5zHrO8QbpJsc8b209aVkYqUV2dm0o2g=; b=I+9q4SZvc+RRFngFX9xaSfY9sm8jdjZvELioSeDGdnRsy1XCgXtcRr1XnkyrVfrg8ngy4l bFv3TYKXICH2Zgo3R3FyobnfMacj+Hmt5LIL4a+0R9Lf8fofn+CHRZQrcIKv8u3VfniDpv NOtdI53P6r/DpMUX1K2RMd6RmlmxvBM= X-MC-Unique: AqKZQIggMcihedJzXfWqyA-1 X-Mimecast-MFC-AGG-ID: AqKZQIggMcihedJzXfWqyA_1780897772 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 31/37] hw/i2c/aspeed_i2c: Introduce AST1040 I2C model Date: Mon, 8 Jun 2026 07:48:20 +0200 Message-ID: <20260608054826.346488-32-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898096963158500 From: Jamin Lin Introduce the AST1040 I2C controller model. The AST1040 I2C controller is compatible with the AST2700 I2C controller, including DMA support and the 64-bit DMA address registers. Set has_dma64 so firmware can access the high address register and program it to zero, as the CM4 CPU only supports 32-bit addressing. AST1040 has 14 I2C buses and its HyperRAM is limited to 16 MiB, so restrict the DMA low address mask to 0x00ffffff. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260603040027.938816-8-jamin_lin@= aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- include/hw/i2c/aspeed_i2c.h | 1 + hw/i2c/aspeed_i2c.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h index b2e4d2fb9dcb..156998e7c14e 100644 --- a/include/hw/i2c/aspeed_i2c.h +++ b/include/hw/i2c/aspeed_i2c.h @@ -30,6 +30,7 @@ #define TYPE_ASPEED_2500_I2C TYPE_ASPEED_I2C "-ast2500" #define TYPE_ASPEED_2600_I2C TYPE_ASPEED_I2C "-ast2600" #define TYPE_ASPEED_1030_I2C TYPE_ASPEED_I2C "-ast1030" +#define TYPE_ASPEED_1040_I2C TYPE_ASPEED_I2C "-ast1040" #define TYPE_ASPEED_2700_I2C TYPE_ASPEED_I2C "-ast2700" OBJECT_DECLARE_TYPE(AspeedI2CState, AspeedI2CClass, ASPEED_I2C) =20 diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c index 856d5dc1db64..27afcaeceedc 100644 --- a/hw/i2c/aspeed_i2c.c +++ b/hw/i2c/aspeed_i2c.c @@ -1654,6 +1654,34 @@ static void aspeed_1030_i2c_class_init(ObjectClass *= klass, const void *data) aic->dma_addr_lo_mask =3D 0x7fffffff; } =20 +static void aspeed_1040_i2c_class_init(ObjectClass *klass, const void *dat= a) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + AspeedI2CClass *aic =3D ASPEED_I2C_CLASS(klass); + + dc->desc =3D "ASPEED 1040 I2C Controller"; + + /* + * AST1040 reuses the AST2700 I2C controller implementation since + * the AST1040 is compatible with AST2700. AST1040 has 14 I2C buses, + * and its HyperRAM is limited to 16 MiB, so the DMA low address + * mask is restricted accordingly. + */ + aic->num_busses =3D 14; + aic->reg_size =3D 0xa0; + aic->reg_gap_size =3D 0x60; + aic->gap =3D -1; /* no gap */ + aic->bus_get_irq =3D aspeed_2600_i2c_bus_get_irq; + aic->pool_size =3D 0x40; + aic->pool_gap_size =3D 0xc0; + aic->pool_base =3D 0x1c0; + aic->bus_pool_base =3D aspeed_2500_i2c_bus_pool_base; + aic->has_dma =3D true; + aic->mem_size =3D 0x2000; + aic->has_dma64 =3D true; + aic->dma_addr_lo_mask =3D 0x00ffffff; +} + static void aspeed_2700_i2c_class_init(ObjectClass *klass, const void *dat= a) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -1703,6 +1731,11 @@ static const TypeInfo aspeed_i2c_types[] =3D { .parent =3D TYPE_ASPEED_I2C, .class_init =3D aspeed_1030_i2c_class_init, }, + { + .name =3D TYPE_ASPEED_1040_I2C, + .parent =3D TYPE_ASPEED_I2C, + .class_init =3D aspeed_1040_i2c_class_init, + }, { .name =3D TYPE_ASPEED_2400_I2C, .parent =3D TYPE_ASPEED_I2C, --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898081; cv=none; d=zohomail.com; s=zohoarc; b=glxa7Qvz6KLRto/7kEYQRCLINd4Jqs/ZTn2SQvnq7WBbkNFkqoFrlXtu48psq9a9hFWK5ZKYjktzSybBYJLgzMVz4eBBmmQZ851uuKO8kLsnLb7n8kJyUIIpcJ6pq4oQLkI4BIhz6xGcREb+ELE58yiIBm2vq2ZHn69eUfABDKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898081; 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=dzPcXMjJVMFZRcH4S5AUyUHbZ/WOYXon1snH6e5CcnY=; b=bNkM9S0isDUoN2bLeQcRqfHNxCajcf6RSyBaUxCs2j7J3shE4PUzCXKLun/fSrRs6uzjqR1k7aDMDZGzW0B8QniqL0AOgWf45HtBpKig7HpLs9dMOAM16NiQx6zESnTyCEoUUpj639DU83iGTPQHWJbZ2FN/j7mczVUSXYe6L5U= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898081453443.75474502334896; Sun, 7 Jun 2026 22:54:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsK-0002kI-5o; Mon, 08 Jun 2026 01:50:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrx-0001zM-4b for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSru-0000nR-Ew for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:52 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-369-tMxI7h_6NDamWSY6B7aFuw-1; Mon, 08 Jun 2026 01:49:35 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 976F71956089; Mon, 8 Jun 2026 05:49:34 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0D1AD765; Mon, 8 Jun 2026 05:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dzPcXMjJVMFZRcH4S5AUyUHbZ/WOYXon1snH6e5CcnY=; b=CK/577BkmTVtEOIh9dWWlqSkMep/Vw25EXLVSkQapP5kP9Ai/Yd1DgrWoF1iShtfpsoxSz P0bxoAY4vhLGNjpVsWQK28VRWdW85SUdafHq0G43cILjAHXkI7/cQXXS/oQlwcUrQ0B+rk UEIesBKF1e8Yc7Y6SWsGH0MjzFygS04= X-MC-Unique: tMxI7h_6NDamWSY6B7aFuw-1 X-Mimecast-MFC-AGG-ID: tMxI7h_6NDamWSY6B7aFuw_1780897774 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 32/37] hw/arm/aspeed_ast1040: Introduce I2C support Date: Mon, 8 Jun 2026 07:48:21 +0200 Message-ID: <20260608054826.346488-33-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898084139154100 From: Jamin Lin Introduce I2C controller support for the AST1040 SoC model. The I2C model type is selected from the SoC type name, allowing the AST1040 SoC to use the corresponding aspeed.i2c-ast1040 model. The I2C controller is mapped at 0x74C0F000 and uses IRQs 64 - 77, with one IRQ assigned per I2C bus. The controller DRAM link is connected to SRAM1 (HyperRAM) for DMA support. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260603040027.938816-9-jamin_lin@= aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast1040.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hw/arm/aspeed_ast1040.c b/hw/arm/aspeed_ast1040.c index 77211ce1f362..6d1cb9b102d5 100644 --- a/hw/arm/aspeed_ast1040.c +++ b/hw/arm/aspeed_ast1040.c @@ -117,6 +117,7 @@ static void aspeed_soc_ast1040_init(Object *obj) object_initialize_child(obj, "sgpio[*]", &s->sgpiom[i], "aspeed.sgpio-ast2700"); } + object_initialize_child(obj, "i2c", &s->i2c, TYPE_ASPEED_1040_I2C); =20 object_initialize_child(obj, "pwm", &s->pwm, TYPE_UNIMPLEMENTED_DEVICE= ); object_initialize_child(obj, "espi", &s->espi, TYPE_UNIMPLEMENTED_DEVI= CE); @@ -233,6 +234,21 @@ static void aspeed_soc_ast1040_realize(DeviceState *de= v_soc, Error **errp) aspeed_soc_ast1040_get_irq(s, ASPEED_DEV_SGPIOM0 + = i)); } =20 + /* I2C */ + object_property_set_link(OBJECT(&s->i2c), "dram", OBJECT(&s->sram[1]), + &error_abort); + if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c), errp)) { + return; + } + aspeed_mmio_map(s->memory, SYS_BUS_DEVICE(&s->i2c), 0, + sc->memmap[ASPEED_DEV_I2C]); + for (i =3D 0; i < ASPEED_I2C_GET_CLASS(&s->i2c)->num_busses; i++) { + qemu_irq irq =3D qdev_get_gpio_in(DEVICE(&a->armv7m), + sc->irqmap[ASPEED_DEV_I2C] + i); + /* The AST1040 I2C controller has one IRQ per bus. */ + sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c.busses[i]), 0, irq); + } + /* Unimplemented peripherals */ aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->pwm), "aspeed.pwm", --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898206; cv=none; d=zohomail.com; s=zohoarc; b=m+B5B0bneJrEFboAU+uAApUXbNuIOwphyi/Df+7XUFBAysSFctkpg8Rci+gQBU8Y+Uus3H4PW/4rPyrwSQRS8u5CtLomNP8ggcnjz09FihZGni5u9FkymdO/ObnIOt6NLMzrCg17RtwmAmQpGF8w8dYIqUrfgJAfYMxrI/IBF0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898206; 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=j5hjdZg/w+5+A9cNFmEN4Et5mITlWaoRbp5aiFQt7a0=; b=E+s89tNBkCvZoShHssO5qkEN25fCvXZveQu4c87FF4Yx5z6NfpkqHKNTZMGC34KcArgqh6Ym2+bFbYOFHI7v7VegaiYivM1jhFLeTgAuAGQ1bzXArmWgo+LwXgb8p4KSRiEHBGdMVOfi9nKLXFQhe0B4X5iEcUJabsDlf4e74cE= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17808982068321007.4001114425062; Sun, 7 Jun 2026 22:56:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsE-0002G1-Hq; Mon, 08 Jun 2026 01:50:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrp-0001vU-7I for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrn-0000kN-06 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:44 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-194-VhruMntrNBycFalkG5-gcg-1; Mon, 08 Jun 2026 01:49:37 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B3326195608F; Mon, 8 Jun 2026 05:49:36 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F26C527A; Mon, 8 Jun 2026 05:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j5hjdZg/w+5+A9cNFmEN4Et5mITlWaoRbp5aiFQt7a0=; b=COJ31QmAmtHqbzzQ0WU5E6wnotosibtbMLpe8rqp+FZxtHP/KMqXzgYz+L0vP4MrKRg8Xk +oJkFbRpuzsm38Sr+qUXxSK412pNYv5/ogiy4XuMuAIvftcwo3CSDjCExbLb7tzvb2JzTS OZXFVd+4ullavDe7XXZZyFFRX1OWgFA= X-MC-Unique: VhruMntrNBycFalkG5-gcg-1 X-Mimecast-MFC-AGG-ID: VhruMntrNBycFalkG5-gcg_1780897776 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 33/37] hw/arm/aspeed_ast1040_evb: Introduce onboard I2C device Date: Mon, 8 Jun 2026 07:48:22 +0200 Message-ID: <20260608054826.346488-34-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898209556154100 From: Jamin Lin Introduce onboard I2C device initialization for the AST1040 EVB model. Instantiate: - A 24C08-compatible EEPROM at address 0x50 on I2C bus 0 - A TMP105 temperature sensor at address 0x4d on I2C bus 1 Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260603040027.938816-10-jamin_lin= @aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast1040_evb.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/arm/aspeed_ast1040_evb.c b/hw/arm/aspeed_ast1040_evb.c index 1d9b55247f07..2b93d4dfbc55 100644 --- a/hw/arm/aspeed_ast1040_evb.c +++ b/hw/arm/aspeed_ast1040_evb.c @@ -14,6 +14,7 @@ #include "hw/arm/aspeed_soc.h" #include "hw/core/qdev-clock.h" #include "system/system.h" +#include "hw/i2c/smbus_eeprom.h" =20 #define AST1040_INTERNAL_FLASH_SIZE (4 * MiB) /* Main SYSCLK frequency in Hz (400MHz) */ @@ -38,12 +39,25 @@ static void aspeed_bic_machine_init(MachineState *machi= ne) aspeed_connect_serial_hds_to_uarts(bmc); qdev_realize(DEVICE(bmc->soc), NULL, &error_abort); =20 + if (amc->i2c_init) { + amc->i2c_init(bmc); + } + armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename, 0, AST1040_INTERNAL_FLASH_SIZE); } =20 +static void ast1040_evb_i2c_init(AspeedMachineState *bmc) +{ + AspeedSoCState *soc =3D bmc->soc; + uint8_t *eeprom_buf =3D g_malloc0(256); + + smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 0), 0x50, eeprom_b= uf); + i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 1), "tmp105", 0x= 4d); +} + static void aspeed_machine_ast1040_evb_class_init(ObjectClass *oc, const void *data) { @@ -55,6 +69,7 @@ static void aspeed_machine_ast1040_evb_class_init(ObjectC= lass *oc, amc->hw_strap1 =3D 0; amc->hw_strap2 =3D 0; mc->init =3D aspeed_bic_machine_init; + amc->i2c_init =3D ast1040_evb_i2c_init; mc->default_ram_size =3D 0; amc->macs_mask =3D 0; amc->uart_default =3D ASPEED_DEV_UART12; --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898103; cv=none; d=zohomail.com; s=zohoarc; b=VMAOeDIlEDi/uoPbo93YZJl/XYTVKCrrF6hr6/CRcoYKVm6Qt/xXexClS9wBw6TJtMq0I4+yCkpHDRCpvU/4XyNd2ExuMV/Kzy+nYnhvXnageuClyajAFyhAVWA5gaHPf1BhsjJ998XEtWnTAPYTyorpbPsNpVCydV/gbqKadaA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898103; 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=SSUvNO9W+5Js9bcLGiZp5dMbvbLWfDEK7WlzONfr4Fs=; b=Yz8aqVXhx4AV29x20Cz5IXR0ShXCdYENKU4g9+Lo6YTOp5pQpywxPYLB4mhVZK/8ZAIRJIJMAFwuWs0IeKsE0D3mKOni0nmlh5Z3eBEeVCYkR0bsy3DAefZp+Z0nS1ZjgWKvLF0AmKvb9RCDBxqJv9BamOOgctBOsjadsNd8L7g= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898103690978.0210512746957; Sun, 7 Jun 2026 22:55:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsI-0002em-TL; Mon, 08 Jun 2026 01:50:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrs-0001wx-Rk for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrr-0000ls-7a for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:48 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-92-0IVpvVGcPdq2Uq1WsNUY9Q-1; Mon, 08 Jun 2026 01:49:39 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 90A861800473; Mon, 8 Jun 2026 05:49:38 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1BB401624; Mon, 8 Jun 2026 05:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SSUvNO9W+5Js9bcLGiZp5dMbvbLWfDEK7WlzONfr4Fs=; b=W3xmX/wsIcDsT+4lbQbGELruAu1MJWKVC3LF4wmOEQrtHvb42YkTfHArSQUWA8yV249mvN 9zD91oZPUhyiaMOOYaVqy2qYlbwQj/dlimkLcnvOdQFzaqu4CREMAWgP64LEJBtn9rom72 EEunMj0XXdXlXxwmabWTmmGO3qVtX7A= X-MC-Unique: 0IVpvVGcPdq2Uq1WsNUY9Q-1 X-Mimecast-MFC-AGG-ID: 0IVpvVGcPdq2Uq1WsNUY9Q_1780897778 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 34/37] hw/arm/aspeed_ast1040: Reuse AST2700 watchdog models Date: Mon, 8 Jun 2026 07:48:23 +0200 Message-ID: <20260608054826.346488-35-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898105004158500 From: Jamin Lin Instantiate and realize the watchdog models for the AST1040 SoC. The AST1040 watchdog controller is compatible with the AST2700 watchdog controller, so reuse the existing AST2700 watchdog model. Configure the AST1040 SoC with 8 watchdog instances and map them to their corresponding MMIO regions. The first watchdog controller (WDT0) is located at 0x74c37000, with subsequent watchdogs placed according to the controller register space size. Each watchdog is linked to the SCU device before realization to provide the required reset and system control interactions. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260603040027.938816-11-jamin_lin= @aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast1040.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hw/arm/aspeed_ast1040.c b/hw/arm/aspeed_ast1040.c index 6d1cb9b102d5..57ffc0807ab7 100644 --- a/hw/arm/aspeed_ast1040.c +++ b/hw/arm/aspeed_ast1040.c @@ -119,6 +119,11 @@ static void aspeed_soc_ast1040_init(Object *obj) } object_initialize_child(obj, "i2c", &s->i2c, TYPE_ASPEED_1040_I2C); =20 + for (i =3D 0; i < sc->wdts_num; i++) { + object_initialize_child(obj, "wdt[*]", &s->wdt[i], + "aspeed.wdt-ast2700"); + } + object_initialize_child(obj, "pwm", &s->pwm, TYPE_UNIMPLEMENTED_DEVICE= ); object_initialize_child(obj, "espi", &s->espi, TYPE_UNIMPLEMENTED_DEVI= CE); object_initialize_child(obj, "udc", &s->udc, TYPE_UNIMPLEMENTED_DEVICE= ); @@ -249,6 +254,19 @@ static void aspeed_soc_ast1040_realize(DeviceState *de= v_soc, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c.busses[i]), 0, irq); } =20 + /* Watch dog */ + for (i =3D 0; i < sc->wdts_num; i++) { + AspeedWDTClass *awc =3D ASPEED_WDT_GET_CLASS(&s->wdt[i]); + hwaddr wdt_offset =3D sc->memmap[ASPEED_DEV_WDT] + i * awc->iosize; + + object_property_set_link(OBJECT(&s->wdt[i]), "scu", OBJECT(&s->scu= ), + &error_abort); + if (!sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), errp)) { + return; + } + aspeed_mmio_map(s->memory, SYS_BUS_DEVICE(&s->wdt[i]), 0, wdt_offs= et); + } + /* Unimplemented peripherals */ aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->pwm), "aspeed.pwm", @@ -290,6 +308,7 @@ static void aspeed_soc_ast1040_class_init(ObjectClass *= klass, const void *data) sc->sram_size[1] =3D 16 * MiB; /* Hyper RAM */ sc->uarts_num =3D 13; sc->sgpio_num =3D 2; + sc->wdts_num =3D 8; sc->uarts_base =3D ASPEED_DEV_UART0; sc->irqmap =3D aspeed_soc_ast1040_irqmap; sc->memmap =3D aspeed_soc_ast1040_memmap; --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898188; cv=none; d=zohomail.com; s=zohoarc; b=jSXqyxa518nTdBzSHpl14uhM71ApYKyWyqOSGRsOO7529TP9zwyOlxU8WusPUeDyDoo9mQNV407QnPpjrU+LkEnHJeMGa6Apxo0DK0kqobYTNnt0WZx8DCXQVTy6w3lDdLmr3xLxbXyMOgl9rsiVeNcI/1PxP1P3msYaEg0sGDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898188; 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=j/5HFTRLDPkHsIdT2BYat17qb86KTE+d98kCJwLRRjE=; b=i1WwFG6HGYV7Rqkb89fJ08IbdpyTWkd8BDC9xgzNtfuuAS7okmYG0KcxBUeZq9YYzH43FAYKubEkEaCZhVhp+DORFKz0i7b1tJSfzTwbF+Zxi0WaqIPaOINqncpPNz3k1VSMBXFMgVVzZO+jrZcwXAcm3U+Q06WFcmmgtAjxilk= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17808981882001000.8264179842382; Sun, 7 Jun 2026 22:56:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsN-0002x2-IC; Mon, 08 Jun 2026 01:50:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrs-0001w6-J3 for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrq-0000lc-DB for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:48 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-513-1jSkFZF5Ms2-5CMle0vByA-1; Mon, 08 Jun 2026 01:49:42 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 06CE5195608A; Mon, 8 Jun 2026 05:49:41 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0EDCB27A; Mon, 8 Jun 2026 05:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j/5HFTRLDPkHsIdT2BYat17qb86KTE+d98kCJwLRRjE=; b=XmIXcMzcNDCh4h6fU8AJGpoGyWcMiEcZiNv6CaO+KpYPfAWrvoJDqtGg1+pVEcxTEP295F IB+7doP0qStRjrL2IXyeZUko2zkoW71CYwqpjjemIqU3U9C0rZm2Ib8ed+Pryms458L4nI Hb3hz+d9U81Tc1l4vQ9BvFsgaFIA5VY= X-MC-Unique: 1jSkFZF5Ms2-5CMle0vByA-1 X-Mimecast-MFC-AGG-ID: 1jSkFZF5Ms2-5CMle0vByA_1780897781 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jithu Joseph , qemu-stable@nongnu.org, Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 35/37] hw/i3c: fix CMD/data FIFO depth reset values to match real silicon Date: Mon, 8 Jun 2026 07:48:24 +0200 Message-ID: <20260608054826.346488-36-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898189258154100 From: Jithu Joseph The Linux DW-I3C master driver infers controller queue depths at probe by reading two status registers that report free queue slots, which at probe (queues empty) equals the full depth. It then uses those values to gate every I3C transfer -- any batch whose word count exceeds the advertised depth is rejected with -EOPNOTSUPP. QUEUE_STATUS_LEVEL (0x4c) [7:0] -> cmdfifodepth (cmd slots) DATA_BUFFER_STATUS_LEVEL (0x50) [7:0] -> datafifodepth (32-bit words) Per the AST2600 datasheet the reset values are 0x10 and 0x40 (16 cmd slots, 64 words =3D 256 B). QEMU was advertising 0x02 and 0x10, making the kernel believe the controller can only do 64-byte transfers. The visible symptom was -EOPNOTSUPP on any I3C transfer whose payload exceeded 64 B (datafifodepth =3D 0x10 =3D 16 words =3D 64 B). The underlying FIFOs in QEMU were already allocated at the right size (fifo32_create takes word counts; the existing defaults give 16 cmd slots and 64 data words). Only the advertised reset values were wrong. Correct the reset values in dw_i3c_resets[], and additionally drive the advertised depths from the queue-capacity configs in the reset handlers (as is already done for the device/char table pointers), so a configured override is reflected in what the guest reads instead of being silently ignored. The advertised fields are 8-bit, so the depth saturates at 255 regardless of the wider capacity configs. With this fix the guest sees datafifodepth=3D64 words and accepts transfers up to 256 B. Fixes: e974c6957576 ("hw/i3c/dw-i3c: Add more reset values") Cc: qemu-stable@nongnu.org Signed-off-by: Jithu Joseph Reviewed-by: Jamin Lin Link: https://lore.kernel.org/qemu-devel/20260604142207.2118098-2-jithu.jos= eph@oss.qualcomm.com Signed-off-by: C=C3=A9dric Le Goater --- hw/i3c/dw-i3c.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/i3c/dw-i3c.c b/hw/i3c/dw-i3c.c index 17ff484c5df1..06c2d55f5958 100644 --- a/hw/i3c/dw-i3c.c +++ b/hw/i3c/dw-i3c.c @@ -282,8 +282,8 @@ static const uint32_t dw_i3c_resets[DW_I3C_NR_REGS] =3D= { [R_QUEUE_THLD_CTRL] =3D 0x01000101, [R_DATA_BUFFER_THLD_CTRL] =3D 0x01010100, [R_SLV_EVENT_CTRL] =3D 0x0000000b, - [R_QUEUE_STATUS_LEVEL] =3D 0x00000002, - [R_DATA_BUFFER_STATUS_LEVEL] =3D 0x00000010, + [R_QUEUE_STATUS_LEVEL] =3D 0x00000010, + [R_DATA_BUFFER_STATUS_LEVEL] =3D 0x00000040, [R_PRESENT_STATE] =3D 0x00000003, [R_I3C_VER_ID] =3D 0x3130302a, [R_I3C_VER_TYPE] =3D 0x6c633033, @@ -947,6 +947,10 @@ static void dw_i3c_reset(DeviceState *dev) s->cfg.dev_char_table_pointer); ARRAY_FIELD_DP32(s->regs, DEV_CHAR_TABLE_POINTER, DEV_CHAR_TABLE_DEPTH, s->cfg.dev_char_table_depth); + ARRAY_FIELD_DP32(s->regs, QUEUE_STATUS_LEVEL, CMD_QUEUE_EMPTY_LOC, + s->cfg.cmd_resp_queue_capacity_bytes); + ARRAY_FIELD_DP32(s->regs, DATA_BUFFER_STATUS_LEVEL, TX_BUF_EMPTY_LOC, + s->cfg.tx_rx_queue_capacity_bytes); =20 dw_i3c_cmd_queue_reset(s); dw_i3c_resp_queue_reset(s); @@ -1793,6 +1797,10 @@ static void dw_i3c_reset_enter(Object *obj, ResetTyp= e type) s->cfg.dev_char_table_pointer); ARRAY_FIELD_DP32(s->regs, DEV_CHAR_TABLE_POINTER, DEV_CHAR_TABLE_DEPTH, s->cfg.dev_char_table_depth); + ARRAY_FIELD_DP32(s->regs, QUEUE_STATUS_LEVEL, CMD_QUEUE_EMPTY_LOC, + s->cfg.cmd_resp_queue_capacity_bytes); + ARRAY_FIELD_DP32(s->regs, DATA_BUFFER_STATUS_LEVEL, TX_BUF_EMPTY_LOC, + s->cfg.tx_rx_queue_capacity_bytes); } =20 static void dw_i3c_realize(DeviceState *dev, Error **errp) --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898252; cv=none; d=zohomail.com; s=zohoarc; b=OyjmFuNvvrthRA/wjF/MEAWwCdMZ6IHvSE3R4HClubbsPFFgtjeS2V+pIKi496gbFmIqiEYDuBHiMZZNAGZLEkVyrRAEGv2pVs/T3jdHXReCL3v2O9vGepTtiVUG8yLgJ3NIfFr0UIQJcIN/5UgyI1OHIM1uayXVT0YuFp2KQPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898252; 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=Qbw3fOX5gATbYU/cclDLa2EHYWUMqv0Bw3auFmr7jBg=; b=S6f1PSArKXk7CvrpYMQX2JjU829Rw/7g9OmaXyOgHAuDWwqftJj8mAVrkxG8J9A9GEtY0Xd1TCLVG1m2oHAUvt3Hsu6EcOkGXBrJuG71KTFu/ZIHXs3KclaeDS8LFS1RdVRCgpE86AMRo6e4U5WK8vqLCOkGfd21PnRkH+k9Q+s= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178089825273959.041459455627546; Sun, 7 Jun 2026 22:57:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsO-00032k-Qf; Mon, 08 Jun 2026 01:50:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSs6-00022d-Fm for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:50:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSs0-0000oO-Ik for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:50:01 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-468-goGjb7VBOGqIggGf7s56NA-1; Mon, 08 Jun 2026 01:49:44 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3371E180049F; Mon, 8 Jun 2026 05:49:43 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 797EC765; Mon, 8 Jun 2026 05:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qbw3fOX5gATbYU/cclDLa2EHYWUMqv0Bw3auFmr7jBg=; b=YvobVpH2Rg64otDpHGhrWVIZuZGjeVdlJE70yI2Js9dI3+BtVvwK5mDnu1DQ7GOIJkkyur LSympUDWwLD33n4w4WgqE1BGSDkSHL/mMXoxGZNi8B4WLPIzCn4dirfLRa69gKahxqoANx lpw8og3nTu74hhgVfpeXsPuk8GGmh3w= X-MC-Unique: goGjb7VBOGqIggGf7s56NA-1 X-Mimecast-MFC-AGG-ID: goGjb7VBOGqIggGf7s56NA_1780897783 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jithu Joseph , Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 36/37] hw/i3c: rename DW-I3C queue capacity fields from _bytes to _words Date: Mon, 8 Jun 2026 07:48:25 +0200 Message-ID: <20260608054826.346488-37-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898253689158500 From: Jithu Joseph The cmd/resp, tx/rx, and IBI queue capacity values are passed straight to fifo32_create(), which interprets its capacity argument as a 32-bit word count. The fields and device properties were therefore misnamed: setting e.g. tx-rx-queue-capacity-bytes=3DN sized the backing FIFO to N words, not N bytes. Rename the three struct fields and matching device-property strings: cmd_resp_queue_capacity_bytes -> cmd_resp_queue_capacity_words tx_rx_queue_capacity_bytes -> tx_rx_queue_capacity_words ibi_queue_capacity_bytes -> ibi_queue_capacity_words Defaults are unchanged (0x10 / 0x40 / 0x10) -- they were being interpreted as word counts by fifo32_create() all along, just under a misleading label. No behavioral change. Signed-off-by: Jithu Joseph Reviewed-by: Jamin Lin Link: https://lore.kernel.org/qemu-devel/20260604142207.2118098-3-jithu.jos= eph@oss.qualcomm.com Signed-off-by: C=C3=A9dric Le Goater --- include/hw/i3c/dw-i3c.h | 6 +++--- hw/i3c/dw-i3c.c | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/hw/i3c/dw-i3c.h b/include/hw/i3c/dw-i3c.h index d26f60580f02..391470207c43 100644 --- a/include/hw/i3c/dw-i3c.h +++ b/include/hw/i3c/dw-i3c.h @@ -181,9 +181,9 @@ struct DWI3C { =20 struct { uint8_t id; - uint8_t cmd_resp_queue_capacity_bytes; - uint16_t tx_rx_queue_capacity_bytes; - uint8_t ibi_queue_capacity_bytes; + uint8_t cmd_resp_queue_capacity_words; + uint16_t tx_rx_queue_capacity_words; + uint8_t ibi_queue_capacity_words; uint8_t num_addressable_devices; uint16_t dev_addr_table_pointer; uint16_t dev_addr_table_depth; diff --git a/hw/i3c/dw-i3c.c b/hw/i3c/dw-i3c.c index 06c2d55f5958..0d32d9ce78a0 100644 --- a/hw/i3c/dw-i3c.c +++ b/hw/i3c/dw-i3c.c @@ -948,9 +948,9 @@ static void dw_i3c_reset(DeviceState *dev) ARRAY_FIELD_DP32(s->regs, DEV_CHAR_TABLE_POINTER, DEV_CHAR_TABLE_DEPTH, s->cfg.dev_char_table_depth); ARRAY_FIELD_DP32(s->regs, QUEUE_STATUS_LEVEL, CMD_QUEUE_EMPTY_LOC, - s->cfg.cmd_resp_queue_capacity_bytes); + s->cfg.cmd_resp_queue_capacity_words); ARRAY_FIELD_DP32(s->regs, DATA_BUFFER_STATUS_LEVEL, TX_BUF_EMPTY_LOC, - s->cfg.tx_rx_queue_capacity_bytes); + s->cfg.tx_rx_queue_capacity_words); =20 dw_i3c_cmd_queue_reset(s); dw_i3c_resp_queue_reset(s); @@ -1798,9 +1798,9 @@ static void dw_i3c_reset_enter(Object *obj, ResetType= type) ARRAY_FIELD_DP32(s->regs, DEV_CHAR_TABLE_POINTER, DEV_CHAR_TABLE_DEPTH, s->cfg.dev_char_table_depth); ARRAY_FIELD_DP32(s->regs, QUEUE_STATUS_LEVEL, CMD_QUEUE_EMPTY_LOC, - s->cfg.cmd_resp_queue_capacity_bytes); + s->cfg.cmd_resp_queue_capacity_words); ARRAY_FIELD_DP32(s->regs, DATA_BUFFER_STATUS_LEVEL, TX_BUF_EMPTY_LOC, - s->cfg.tx_rx_queue_capacity_bytes); + s->cfg.tx_rx_queue_capacity_words); } =20 static void dw_i3c_realize(DeviceState *dev, Error **errp) @@ -1814,14 +1814,14 @@ static void dw_i3c_realize(DeviceState *dev, Error = **errp) DW_I3C_NR_REGS << 2); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mr); =20 - fifo32_create(&s->cmd_queue, s->cfg.cmd_resp_queue_capacity_bytes); - fifo32_create(&s->resp_queue, s->cfg.cmd_resp_queue_capacity_bytes); - fifo32_create(&s->tx_queue, s->cfg.tx_rx_queue_capacity_bytes); - fifo32_create(&s->rx_queue, s->cfg.tx_rx_queue_capacity_bytes); - fifo32_create(&s->ibi_queue, s->cfg.ibi_queue_capacity_bytes); + fifo32_create(&s->cmd_queue, s->cfg.cmd_resp_queue_capacity_words); + fifo32_create(&s->resp_queue, s->cfg.cmd_resp_queue_capacity_words); + fifo32_create(&s->tx_queue, s->cfg.tx_rx_queue_capacity_words); + fifo32_create(&s->rx_queue, s->cfg.tx_rx_queue_capacity_words); + fifo32_create(&s->ibi_queue, s->cfg.ibi_queue_capacity_words); /* Arbitrarily large enough to not be an issue. */ fifo8_create(&s->ibi_data.ibi_intermediate_queue, - s->cfg.ibi_queue_capacity_bytes * 8); + s->cfg.ibi_queue_capacity_words * 8); =20 s->bus =3D i3c_init_bus(DEVICE(s), name); I3CBusClass *bc =3D I3C_BUS_GET_CLASS(s->bus); @@ -1832,12 +1832,12 @@ static void dw_i3c_realize(DeviceState *dev, Error = **errp) =20 static const Property dw_i3c_properties[] =3D { DEFINE_PROP_UINT8("device-id", DWI3C, cfg.id, 0), - DEFINE_PROP_UINT8("command-response-queue-capacity-bytes", DWI3C, - cfg.cmd_resp_queue_capacity_bytes, 0x10), - DEFINE_PROP_UINT16("tx-rx-queue-capacity-bytes", DWI3C, - cfg.tx_rx_queue_capacity_bytes, 0x40), - DEFINE_PROP_UINT8("ibi-queue-capacity-bytes", DWI3C, - cfg.ibi_queue_capacity_bytes, 0x10), + DEFINE_PROP_UINT8("command-response-queue-capacity-words", DWI3C, + cfg.cmd_resp_queue_capacity_words, 0x10), + DEFINE_PROP_UINT16("tx-rx-queue-capacity-words", DWI3C, + cfg.tx_rx_queue_capacity_words, 0x40), + DEFINE_PROP_UINT8("ibi-queue-capacity-words", DWI3C, + cfg.ibi_queue_capacity_words, 0x10), DEFINE_PROP_UINT8("num-addressable-devices", DWI3C, cfg.num_addressable_devices, 8), DEFINE_PROP_UINT16("dev-addr-table-pointer", DWI3C, --=20 2.54.0 From nobody Tue Jun 9 01:37:17 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1780898103; cv=none; d=zohomail.com; s=zohoarc; b=WjpVnTIWy9qB5+TJ5TPTjnlXDB2DZZqvkVVPc5SPgHaJYImc3R+2wzg8wKivkqjnxPQVVUYiGfwO9GhCWWF+ZO80ZzP4kvdoV8WHQ4KUQ9tzlRcX6Hn8etSQRaf4lIfr7yMG2NhX3INaFTaUVG9Tlgd8v2v+uj9bdors6mhNMOI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780898103; 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=kORBPmEZIJMSQMsLcMufTbzpddl7gyDqe5MbRYQmXCc=; b=cNXRrY2GfGbM3lNAz0iZ5v3M03FKXM/KlpV27sQeEGL3Fi3V3hJofARglp4FJR8Ks7eZdDmTknvrnd4S+rZxNGvtqzlv16K676pPz6Q5SYdFpmC0r4TFLZoedG12fYChdZOPL0TPJh45mIbrhq+UJKgvOoux7tFZ+u+1oDGZ4as= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1780898103343662.6062444808844; Sun, 7 Jun 2026 22:55:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wWSsL-0002oR-5i; Mon, 08 Jun 2026 01:50:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrw-0001z0-Jq for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wWSrt-0000mC-2v for qemu-devel@nongnu.org; Mon, 08 Jun 2026 01:49:51 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-635-51yx0cAzMV6QHh7417WJIA-1; Mon, 08 Jun 2026 01:49:46 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6777C195608B; Mon, 8 Jun 2026 05:49:45 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.33]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A71FD765; Mon, 8 Jun 2026 05:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780897788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kORBPmEZIJMSQMsLcMufTbzpddl7gyDqe5MbRYQmXCc=; b=X4SDGp2QrwGwkldNprVlVF11qyBFjzXXJ+UFduD7vsqvJKHxvGuwFldevFxrTPfZ+Mylri GtVU4ibDVup+Gmz6/BDLikmGowOyFPj5ALNuIRiAyVngbVrUv4B/vqiHzZkwNALMizXlLt sF8HwwHp+ERiOf88f7BCaIZ1ab740yo= X-MC-Unique: 51yx0cAzMV6QHh7417WJIA-1 X-Mimecast-MFC-AGG-ID: 51yx0cAzMV6QHh7417WJIA_1780897785 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jithu Joseph , Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 37/37] hw/i3c: keep _bytes aliases for renamed queue-capacity properties Date: Mon, 8 Jun 2026 07:48:26 +0200 Message-ID: <20260608054826.346488-38-clg@redhat.com> In-Reply-To: <20260608054826.346488-1-clg@redhat.com> References: <20260608054826.346488-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1780898104998158500 From: Jithu Joseph The command-response/tx-rx/ibi queue-capacity properties were renamed from "-bytes" to "-words". The "-bytes" names are user-visible and shipped in v11.0.0 (reachable via e.g. -global driver=3Ddw.i3c,property=3Dtx-rx-queue-capacity-bytes,...), so register them as aliases of the new names to keep existing command lines working. object_property_add_alias() forwards both reads and writes to the target property, so the old names behave exactly as before; introspection and qom-get/qom-set continue to work under either name. Signed-off-by: Jithu Joseph Reviewed-by: Jamin Lin Link: https://lore.kernel.org/qemu-devel/20260604142207.2118098-4-jithu.jos= eph@oss.qualcomm.com Signed-off-by: C=C3=A9dric Le Goater --- hw/i3c/dw-i3c.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/hw/i3c/dw-i3c.c b/hw/i3c/dw-i3c.c index 0d32d9ce78a0..6386499dd9fc 100644 --- a/hw/i3c/dw-i3c.c +++ b/hw/i3c/dw-i3c.c @@ -1830,6 +1830,27 @@ static void dw_i3c_realize(DeviceState *dev, Error *= *errp) bc->ibi_finish =3D dw_i3c_ibi_finish; } =20 +/* + * The *-queue-capacity-bytes properties shipped in v11.0.0 under names th= at + * implied a byte count, but the values are 32-bit word counts (they are p= assed + * straight to fifo32_create()). They were renamed to *-queue-capacity-wo= rds; + * keep the old names working as aliases so existing command lines using e= .g. + * -global driver=3Ddw.i3c,property=3Dtx-rx-queue-capacity-bytes,... don't= break. + */ +static void dw_i3c_init(Object *obj) +{ + static const char *const alias[][2] =3D { + { "command-response-queue-capacity-bytes", + "command-response-queue-capacity-words" }, + { "tx-rx-queue-capacity-bytes", "tx-rx-queue-capacity-words" }, + { "ibi-queue-capacity-bytes", "ibi-queue-capacity-words" }, + }; + + for (int i =3D 0; i < ARRAY_SIZE(alias); i++) { + object_property_add_alias(obj, alias[i][0], obj, alias[i][1]); + } +} + static const Property dw_i3c_properties[] =3D { DEFINE_PROP_UINT8("device-id", DWI3C, cfg.id, 0), DEFINE_PROP_UINT8("command-response-queue-capacity-words", DWI3C, @@ -1868,6 +1889,7 @@ static const TypeInfo dw_i3c_types[] =3D { .name =3D TYPE_DW_I3C, .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(DWI3C), + .instance_init =3D dw_i3c_init, .class_init =3D dw_i3c_class_init, }, }; --=20 2.54.0