From patchwork Wed Oct 25 08:59:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 737865 Delivered-To: patch@linaro.org Received: by 2002:ab3:1905:0:b0:23f:8cfb:5ad7 with SMTP id u5csp268372ltc; Wed, 25 Oct 2023 02:03:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGU0kI4ZTeU288kX9ybvMtfwy/USfuUTw3XTY8FwXTduviUj/8AEQprylTZy4aopcc3M2nd X-Received: by 2002:adf:e503:0:b0:319:7b66:7800 with SMTP id j3-20020adfe503000000b003197b667800mr11339177wrm.55.1698224497075; Wed, 25 Oct 2023 02:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698224497; cv=none; d=google.com; s=arc-20160816; b=SGHYw7Qhqc61qDsXJ/obpGc8uhCyO7UurgpPxSBOuBGMdB6vYR53gW6VL3iq7nt9XE LxJ7XyLVKBwSmNfjfywja1fuehp0UsGAzHg33V/CaSdq/FJ4tOv+PDyTW/zgiDd9ElkW 7bMS7oNQTWxgOp2v4eoCV5Qos3T0uQyZQaRmND0PBmnx8oMuoBQUhNGu+sbwzOPp7yac 3cFJAszvJ2rlejeAePALW8BfC5miuSN4nlFvELq70ImpOOIfn+6lDXaFkIh0ll7Jtux3 YbWSd5Vu/7s8RLyn/ffzlYf+s/646ypn6n68O4/2D2YRonOMEHo4tq4FRoHX64TieFvj 6uTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=/UijNn3QNRsRs7xnnksiIaf2wzp2CteSl15ozH5i2Mc=; fh=2AKgK1B3EYiX6882ovZW+CwIStVbar5zReCRX1lYnfY=; b=XecQS8h6HbK4p4v6ueL7xWPIY6VDFxQLX02FoOjymF2ZxrFNy+d/+ufjsBarudjyUX L1nN6UIwzA37SgvKxuTRXhf/XLZ/CqzyBjrN0kfQMMfevjXLb4y2KtNuGeUaDDHjhvwC JzIe+kLPMEK4D6kWWp14odtaH8fz3zyqNhKJKOKIcUA36B9ymK1FZQE/INV3yoFM5xxX GX8JR9qlo1qKIBtCqStspG8aPuLmFNImuuZrYPrgduFm6NmJ1AClQ6KH7eEISGGjjS6A 6hife+v9KS2iY/gKiW036ym5BoG1bHbmt6ASkuaIZZPJ78erK4h3cESrAn8YAXOWzAZv pySA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m2-20020a5d4a02000000b0032da2d7ae86si7161539wrq.1054.2023.10.25.02.01.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 02:01:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvZjx-00087L-TJ; Wed, 25 Oct 2023 04:59:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvZju-000857-13; Wed, 25 Oct 2023 04:59:46 -0400 Received: from gandalf.ozlabs.org ([150.107.74.76]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvZjr-0004OR-9A; Wed, 25 Oct 2023 04:59:44 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4SFjYB1n71z4wcM; Wed, 25 Oct 2023 19:59:42 +1100 (AEDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4SFjY856wLz4wnw; Wed, 25 Oct 2023 19:59:40 +1100 (AEDT) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= Subject: [PULL 07/12] hw/arm/aspeed: Introduce TYPE_ASPEED2600_SOC Date: Wed, 25 Oct 2023 10:59:16 +0200 Message-ID: <20231025085921.733686-8-clg@kaod.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231025085921.733686-1-clg@kaod.org> References: <20231025085921.733686-1-clg@kaod.org> MIME-Version: 1.0 Received-SPF: pass client-ip=150.107.74.76; envelope-from=SRS0=4l40=GH=kaod.org=clg@ozlabs.org; helo=gandalf.ozlabs.org X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé TYPE_ASPEED2600_SOC inherits from TYPE_ASPEED_SOC. In few commits we'll add more fields, but to keep review process simple, don't add any yet. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- include/hw/arm/aspeed_soc.h | 7 +++++++ hw/arm/aspeed_ast2600.c | 26 +++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index dcb43a4ecd7f..103b1598f64a 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -101,6 +101,13 @@ struct AspeedSoCState { #define TYPE_ASPEED_SOC "aspeed-soc" OBJECT_DECLARE_TYPE(AspeedSoCState, AspeedSoCClass, ASPEED_SOC) +struct Aspeed2600SoCState { + AspeedSoCState parent; +}; + +#define TYPE_ASPEED2600_SOC "aspeed2600-soc" +OBJECT_DECLARE_SIMPLE_TYPE(Aspeed2600SoCState, ASPEED2600_SOC) + struct Aspeed10x0SoCState { AspeedSoCState parent; }; diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index e122e1c32d42..1ee460e56c79 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -646,18 +646,18 @@ static void aspeed_soc_ast2600_class_init(ObjectClass *oc, void *data) sc->get_irq = aspeed_soc_ast2600_get_irq; } -static const TypeInfo aspeed_soc_ast2600_type_info = { - .name = "ast2600-a3", - .parent = TYPE_ASPEED_SOC, - .instance_size = sizeof(AspeedSoCState), - .instance_init = aspeed_soc_ast2600_init, - .class_init = aspeed_soc_ast2600_class_init, - .class_size = sizeof(AspeedSoCClass), +static const TypeInfo aspeed_soc_ast2600_types[] = { + { + .name = TYPE_ASPEED2600_SOC, + .parent = TYPE_ASPEED_SOC, + .instance_size = sizeof(Aspeed2600SoCState), + .abstract = true, + }, { + .name = "ast2600-a3", + .parent = TYPE_ASPEED2600_SOC, + .instance_init = aspeed_soc_ast2600_init, + .class_init = aspeed_soc_ast2600_class_init, + }, }; -static void aspeed_soc_register_types(void) -{ - type_register_static(&aspeed_soc_ast2600_type_info); -}; - -type_init(aspeed_soc_register_types) +DEFINE_TYPES(aspeed_soc_ast2600_types)