From patchwork Tue Oct 24 16:24:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 737544 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp2124816wrl; Tue, 24 Oct 2023 09:26:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHudK2mAYLgQ4ZuAuOrYbQaNp/epM204LmZnvRx3KR1HeCeABc4QcTerq0kokRVGI+Go5DH X-Received: by 2002:a05:6808:1141:b0:3b2:f557:666e with SMTP id u1-20020a056808114100b003b2f557666emr17084185oiu.19.1698164770584; Tue, 24 Oct 2023 09:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698164770; cv=none; d=google.com; s=arc-20160816; b=ZUQytR19ePs0ZsmUtfnbGzNwLCgE7DRW3armu9eIyDVd9hX5sRohhMeBEj+GMOikTy k/vGEpirpuABc5Ep1PS1XpdwzQQvj4O5A2T/InC3sUt7ed0YdO9ZKbJbp+NWKd7xBmSa 4R+0BrvZnlmu0KH4lWFKq+DiA2RtH64M7DsApyML5SsfYTcfQtGqTQHT/FVJ9FtiW0Z6 fM5b/t+3a6KHYY5EmWFIKrTK+d4y2V0lxO06thvyF22xMeXkmtC9j0Q0AkRbLfeoMssf vFtstnbzcpjf0EqY9pcPg0MZMjEA8+tjiDXSKSnSBR9GQC2QiDrprq2a6VB1kHrbGgQd VKUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xkEV+IyfDvCnmDFdMkKu1PQgF2STgTXQmjG0ZR7mnhw=; fh=WVEKgOIyTrr8n58k2pegoTwEDRNm1XlZWphDTwgTwzs=; b=pS/T+4niGKJiio47seRPGZk9lkBauCFsOHavn0c1NGnqG7oPkL9s5i3AeOF+fKDa7Z HlJHDGkrGes109iZc1uPzq37YMsQZ8ZJSMadCvAMr9YVa+Q4eIQjb56bukoj9XzreVOI wlVmDUN1u0nJSTANgxRgBJ4xl+FHywK9LIJak9yXuLschzSY6x69urCX5XWoFxlQCIki uFnpGrMtKckcT3FNFd0BPRXJx5RRQtEvhAeWZmXTla+icihepxd1cSTMRt7e9ClcyqOZ /E+klOOGfKkYe9iOy67V723ZYKio4VbHlNGKhLhMV9FHJzaKaUKeuf+fPqmVPirXvBhz kRUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QQcKG4f8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w9-20020a0562140b2900b0066d0bd0cf46si7385154qvj.592.2023.10.24.09.26.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2023 09:26:10 -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; dkim=pass header.i=@linaro.org header.s=google header.b=QQcKG4f8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvKDM-0001IE-Oy; Tue, 24 Oct 2023 12:25:08 -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 1qvKDJ-0001AS-F3 for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:25:05 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvKDH-00010h-NX for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:25:05 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40790b0a224so36812665e9.0 for ; Tue, 24 Oct 2023 09:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698164701; x=1698769501; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xkEV+IyfDvCnmDFdMkKu1PQgF2STgTXQmjG0ZR7mnhw=; b=QQcKG4f8twIdpWL11KreVBG9RqaGezBIMFvKVa6wDMJUVq1UbdRbqDWFeHZBQe+E6i oDsmanSItJhwrbLpImQhKAGOT161yWjUZkFrGaChw7FrfFJd1Q/HIXUKQvQgEuxmXTOY BSOKTN2eJCrK6HLrahBYIkrofuNvEuqbVmSf12jPn6XYitbL5avTnLi3U7FGE+VSQnWx 3Ft9WklLAiGUvYIHQYzeNTVYVUUky7EQWUxkSAhVIJh/cg+SziKBugVEC8I+WapDsPT9 NlxbtH4wSr9RlJgUaFunRIXQ62n024ruaA4kVtPT2Yur+RFCk71rYG+Pui4cvlfSRJRh i+QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698164701; x=1698769501; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xkEV+IyfDvCnmDFdMkKu1PQgF2STgTXQmjG0ZR7mnhw=; b=Cy+eO33KBOtRQN3MH5hkW7GO3elkvYM2owkPBpa0Gry8L7jzVVPNiih4cQma8Mbvpb kaamwXlkcftwv3uP1LijGI0PJE7ZSB+yi8wuRd/erl20HOO0IGpH/5CNlZXVQUihpx// uqpovlR5R23JJw7VCrSq8rDSfTHdbQaF+kbYI0MbfT5i9ZKmtQ3XWTvEP/mk/RsqMxQK EBdFI4+h/hnoHpV/TdATq4QV+3Cu/2A4duPT3xz33CVbNFuyHp9RxOmX1z6WxYB4CfmZ q8dV3PRcHDQKhRkij/hcw1nhheoKYi7awqaAiCDyoVehF5ulYvrcH2SiqLKMHUfjCGxN oGxw== X-Gm-Message-State: AOJu0Yw8H9t+MPEB733jZ8LZp5/8p0oyQ1X1sUpzBpmnyvT4IHAah6u3 wzRHq+ekb9/uxeXzvVwi7GzAl4nus+gXSFfQZO4= X-Received: by 2002:a05:600c:3b90:b0:408:37aa:4766 with SMTP id n16-20020a05600c3b9000b0040837aa4766mr9639614wms.5.1698164701071; Tue, 24 Oct 2023 09:25:01 -0700 (PDT) Received: from m1x-phil.lan (sem44-h01-176-172-55-165.dsl.sta.abo.bbox.fr. [176.172.55.165]) by smtp.gmail.com with ESMTPSA id b24-20020a05600c06d800b004064e3b94afsm17039497wmn.4.2023.10.24.09.24.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 09:25:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Joel Stanley , Peter Maydell , Andrew Jeffery , qemu-arm@nongnu.org, =?utf-8?q?C=C3=A9dri?= =?utf-8?q?c_Le_Goater?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 06/11] hw/arm/aspeed: Introduce TYPE_ASPEED2600_SOC Date: Tue, 24 Oct 2023 18:24:17 +0200 Message-ID: <20231024162423.40206-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231024162423.40206-1-philmd@linaro.org> References: <20231024162423.40206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 --- 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 dcb43a4ecd..103b1598f6 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 e122e1c32d..1ee460e56c 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)