From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a05:6512:e9d:0:0:0:0 with SMTP id bi29csp713455lfb; Fri, 1 Apr 2022 01:41:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKrYT21kFKcjIhJR3dBsAYvSne1tv2z6S+OEBzK2z774tJA/u6r705u2aQJBxvZhKCFq51 X-Received: by 2002:a05:622a:50b:b0:2e1:deae:22dc with SMTP id l11-20020a05622a050b00b002e1deae22dcmr7593234qtx.359.1648802483206; Fri, 01 Apr 2022 01:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648802483; cv=none; d=google.com; s=arc-20160816; b=GtXPH3iDSy/6VwG9xFOalekWB6PpWjXvjtRI9M3NqWOuJ7y1EXvT9WZoV8xmMH81Wj 2P3BV9zrFbd7XPWK/wodUuNjHqI9NO/imZNPvI6UH8OPE4WjPqNXWiCogHGiOLWbI2EM O33iMWbr926W/FgeQUw5DcGGP+N9yaVGxaA+nW9xxJV+Z+1v9j8P+0mMgsFM0Sm3aKHd DM7dzhITZI/d+m0gCHXj8/SqNImr7VycieB07eLJvtLGz+AUltCkvZze7wZXYjU5VtDG ABwNqnvPmxLrj60FJ/AgsKfH7giOZ6OO8UGi3HbhaN8I+VTvMLbD6pB9I8I++pD6bSXF JtjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from; bh=geJ6+MiGk2seSOaWkizxcB7XGiFfdo5/KnSPAk/1ZtA=; b=KLiaYKh151u05lo90RD31PvUWyVIk5NwwAymi3Lq6rL9Ys4VnJOB+6cid1Vul+LrVK r16CCGsaJSFjeEY0M3q5z/PUGjB75hv4TJdW13sD+EmT8i3S0ri7Tg2m+Bci45XT4Ee7 7iydCaYGlDiVsykvxdT3EJqraaeiWudFG1l+0v0zr+MWKTD1gH6twCVdq6mevsLoCBIS 7Pxh9kpctYgvQVLU4v+bUzXi7Wuj5PZI62Q98URb1UCwrJUj2tKu19WVURL48kF03Bkg 1NFWEbHgjqxYvnCDeBMrJe7WK8l5Ikytgrp6jlOOs1FrF3jL0Lyxm16L2EzGBYZCV9YX SJOg== 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 s4-20020a0cb304000000b00440e46a7cecsi513091qve.394.2022.04.01.01.41.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Apr 2022 01:41:23 -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]:38824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1naCqQ-00014F-JI for alex.bennee@linaro.org; Fri, 01 Apr 2022 04:41:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naCp8-00004x-BN; Fri, 01 Apr 2022 04:40:02 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:43369) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naCp4-0001Fn-4h; Fri, 01 Apr 2022 04:40:02 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 2318RrDs030500; Fri, 1 Apr 2022 16:27:53 +0800 (GMT-8) (envelope-from jamin_lin@aspeedtech.com) Received: from localhost.localdomain (192.168.70.87) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 1 Apr 2022 16:38:54 +0800 From: Jamin Lin To: Alistair Francis , Peter Maydell , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Andrew Jeffery , Joel Stanley , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Wainer dos Santos Moschetta" , Beraldo Leal , "open list:STM32F205" , "open list:All patches CC here" Subject: [PATCH v5 5/9] aspeed/timer: Add AST1030 support Date: Fri, 1 Apr 2022 16:38:46 +0800 Message-ID: <20220401083850.15266-6-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220401083850.15266-1-jamin_lin@aspeedtech.com> References: <20220401083850.15266-1-jamin_lin@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [192.168.70.87] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 2318RrDs030500 Received-SPF: pass client-ip=211.20.114.71; envelope-from=jamin_lin@aspeedtech.com; helo=twspam01.aspeedtech.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jamin_lin@aspeedtech.com, troy_lee@aspeedtech.com, steven_lee@aspeedtech.com Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: QPPihHraGsS1 From: Steven Lee ast1030 tmc(timer controller) is identical to ast2600 tmc. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Signed-off-by: Steven Lee Reviewed-by: Cédric Le Goater --- hw/timer/aspeed_timer.c | 17 +++++++++++++++++ include/hw/timer/aspeed_timer.h | 1 + 2 files changed, 18 insertions(+) diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c index 42c47d2ce6..9c20b3d6ad 100644 --- a/hw/timer/aspeed_timer.c +++ b/hw/timer/aspeed_timer.c @@ -745,12 +745,29 @@ static const TypeInfo aspeed_2600_timer_info = { .class_init = aspeed_2600_timer_class_init, }; +static void aspeed_1030_timer_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + AspeedTimerClass *awc = ASPEED_TIMER_CLASS(klass); + + dc->desc = "ASPEED 1030 Timer"; + awc->read = aspeed_2600_timer_read; + awc->write = aspeed_2600_timer_write; +} + +static const TypeInfo aspeed_1030_timer_info = { + .name = TYPE_ASPEED_1030_TIMER, + .parent = TYPE_ASPEED_TIMER, + .class_init = aspeed_1030_timer_class_init, +}; + 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_init(aspeed_timer_register_types) diff --git a/include/hw/timer/aspeed_timer.h b/include/hw/timer/aspeed_timer.h index d36034a10c..07dc6b6f2c 100644 --- a/include/hw/timer/aspeed_timer.h +++ b/include/hw/timer/aspeed_timer.h @@ -31,6 +31,7 @@ OBJECT_DECLARE_TYPE(AspeedTimerCtrlState, AspeedTimerClass, ASPEED_TIMER) #define TYPE_ASPEED_2400_TIMER TYPE_ASPEED_TIMER "-ast2400" #define TYPE_ASPEED_2500_TIMER TYPE_ASPEED_TIMER "-ast2500" #define TYPE_ASPEED_2600_TIMER TYPE_ASPEED_TIMER "-ast2600" +#define TYPE_ASPEED_1030_TIMER TYPE_ASPEED_TIMER "-ast1030" #define ASPEED_TIMER_NR_TIMERS 8 -- 2.17.1