Received: by 2002:a19:3859:0:0:0:0:0 with SMTP id d25csp1226861lfj; Tue, 3 May 2022 00:05:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXgLjQ9CL6EPRfm3+mhWvQ6S34Ail5idxJUGwAcS8qVPZQyAB7XrP3VfhKIoBYLpW7Npap X-Received: by 2002:a05:620a:198a:b0:6a0:6a9:aa9c with SMTP id bm10-20020a05620a198a00b006a006a9aa9cmr313708qkb.8.1651561533745; Tue, 03 May 2022 00:05:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651561533; cv=none; d=google.com; s=arc-20160816; b=mbe3UWEZyNusIitsQbBNMjiqaSxPPV0elkDSUfkQVjgjBXEC1K7f5Sa+xL0p3qm0Wr 0ZeTu963nOnFZUTaHZdXoGOc2aH9igI+P+S4ru3syo+Fayq4eayfQWIiPEykj0ybhLFB b3hZOmUcxy1xAlMfGTwnYtX/WSNKJMQ3/E1cKyDsAHtesuKoywFJ2BKb0uiMfwJieETI 6/oPt7WjeTgyUL6f6HJdG3xO4g3IKozaAc2fH1CS+g44KxUoi6IKGHpY6MLmkN8vA+C2 MqyDr6eV3L7OCd2c2m8I4l2X7boOnWuTwKxY+GyqCAXtC3p+Cphea4EGYtpJbIBz4Wuj mWwg== 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=lM37n8p+nLJ8NdgddvUS2NYxdmBMbS0jujviXtY7ssE=; b=UCG9qL02Uhax/wml6/W0vQiMLl9jGIYr5EsIykG9bRKiJCD6XvMllJxyVPEaDIWKZm 6p5vTQ0TEIK2jQC0zU24y6Dd3pIgJ+nCRbFKOHqr5Qf/FKWwBH3qhSxOkuMJ1dkJQWm2 4/I9qqw46njvfYFCF5x9YDdoufZyzbvPre9IHNm0SQoIsoEiDuPh04G4HXBcSXKZWVv1 Miud7d6eMHldc0RDUr1JrqIzZUFqG6qxCWqqi4+XDan+y/epTY+76IYbXJT7O6DXuQbB rlckSxgC30TEgzVDy2wHWLmGv4FpJdAW/6OyojzU6j/9pRcqFSfebKilNCD2U9+S1lot jxhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=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 t2-20020a05622a180200b002f3b1e0a843si24928qtc.206.2022.05.03.00.05.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 May 2022 00:05:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=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-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1]:44214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlmb0-00069A-1d for alex.bennee@linaro.org; Tue, 03 May 2022 03:05:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlmV3-000365-P8; Tue, 03 May 2022 02:59:12 -0400 Received: from gandalf.ozlabs.org ([150.107.74.76]:54367) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlmV1-0007TF-UR; Tue, 03 May 2022 02:59:09 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4KsrRF3jN7z4xXh; Tue, 3 May 2022 16:59:05 +1000 (AEST) 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 4KsrRC1Ykpz4yST; Tue, 3 May 2022 16:59:02 +1000 (AEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Peter Maydell , Steven Lee , Troy Lee , Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 05/19] aspeed/adc: Add AST1030 support Date: Tue, 3 May 2022 08:58:34 +0200 Message-Id: <20220503065848.125215-6-clg@kaod.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220503065848.125215-1-clg@kaod.org> References: <20220503065848.125215-1-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=150.107.74.76; envelope-from=SRS0=XF6a=VL=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.249, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@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-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: QRfFLeaH+V+G From: Steven Lee Per ast1030_v7.pdf, AST1030 ADC engine is identical to AST2600's ADC. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Signed-off-by: Steven Lee Reviewed-by: Cédric Le Goater Message-Id: <20220401083850.15266-2-jamin_lin@aspeedtech.com> Signed-off-by: Cédric Le Goater --- include/hw/adc/aspeed_adc.h | 1 + hw/adc/aspeed_adc.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/hw/adc/aspeed_adc.h b/include/hw/adc/aspeed_adc.h index 2f166e8be111..ff1d06ea91de 100644 --- a/include/hw/adc/aspeed_adc.h +++ b/include/hw/adc/aspeed_adc.h @@ -17,6 +17,7 @@ #define TYPE_ASPEED_2400_ADC TYPE_ASPEED_ADC "-ast2400" #define TYPE_ASPEED_2500_ADC TYPE_ASPEED_ADC "-ast2500" #define TYPE_ASPEED_2600_ADC TYPE_ASPEED_ADC "-ast2600" +#define TYPE_ASPEED_1030_ADC TYPE_ASPEED_ADC "-ast1030" OBJECT_DECLARE_TYPE(AspeedADCState, AspeedADCClass, ASPEED_ADC) #define TYPE_ASPEED_ADC_ENGINE "aspeed.adc.engine" diff --git a/hw/adc/aspeed_adc.c b/hw/adc/aspeed_adc.c index c5fcae29f635..0d2966312954 100644 --- a/hw/adc/aspeed_adc.c +++ b/hw/adc/aspeed_adc.c @@ -389,6 +389,15 @@ static void aspeed_2600_adc_class_init(ObjectClass *klass, void *data) aac->nr_engines = 2; } +static void aspeed_1030_adc_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + AspeedADCClass *aac = ASPEED_ADC_CLASS(klass); + + dc->desc = "ASPEED 1030 ADC Controller"; + aac->nr_engines = 2; +} + static const TypeInfo aspeed_adc_info = { .name = TYPE_ASPEED_ADC, .parent = TYPE_SYS_BUS_DEVICE, @@ -415,6 +424,12 @@ static const TypeInfo aspeed_2600_adc_info = { .class_init = aspeed_2600_adc_class_init, }; +static const TypeInfo aspeed_1030_adc_info = { + .name = TYPE_ASPEED_1030_ADC, + .parent = TYPE_ASPEED_ADC, + .class_init = aspeed_1030_adc_class_init, /* No change since AST2600 */ +}; + static void aspeed_adc_register_types(void) { type_register_static(&aspeed_adc_engine_info); @@ -422,6 +437,7 @@ static void aspeed_adc_register_types(void) 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_init(aspeed_adc_register_types); -- 2.35.1