From patchwork Wed Nov 6 06:02:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 178605 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp161094ilf; Tue, 5 Nov 2019 22:03:20 -0800 (PST) X-Google-Smtp-Source: APXvYqxYUTegAMIY2PB7fcA5WVes7/W6Sq3vs/FAHNoEQUNhO0cJJddXClOt+ZkPgEOySXtYaVgT X-Received: by 2002:a17:906:e82:: with SMTP id p2mr32725382ejf.237.1573020200705; Tue, 05 Nov 2019 22:03:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573020200; cv=none; d=google.com; s=arc-20160816; b=PUGWBXFEgWDEFKIifA6vtfN73HNouKaVSJ9shT5mPp3GsjdLgOV0z/kpcfJuSVzUMQ WQmTF2cGMsD3ZYwHO/GpsW8M9j+Ax2U9dPQDcXqx3QvX3AfL9xjSnAgIzpe+/tUFRPIm 4RHpsSSCrWgUUUWqnz8BVfhQtIHF4w4IHGuXdQXM84UqEB8lYYqqjrc7QOTgcpk1bUw7 Kw/gBYtg5jaE/OyvzB2MxX8AInkQff2HqvdIJlRt63bgrJCj2kZWVkgPcJUmoGNKSotQ 2R/LhrxeRisG6H3CJV1TfYWhXOGNAEOObReY+DReUNDh6a1JG3FPSFN95mkFyLThadar fQ2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3naVDG9c+hz6/Z7X8/ImB3hSE5w7Qy3YFszuHTpM04M=; b=bdIvaepYVsFjoMsdB/qo5IJSEDtHGxA/BbRqfjhbntzoVvZIpGCyCpx5Rxf60WcV6h gMX9JSHn5SlUYsQBkiu3TWfZIyCXXdpjsbL7arZSfevUSDPrN7I+FLSMDbsVR49ayDxM qyQK33elZzh+MmnW4NjNt4HO4e3GGq35U25pxiFfnHyZmaNl7JX3NYoZ/pMKs3xX5BbR 8H/ii2wHP70oy1y7z3c7I8h3cim4uvaWdCBp8X3SYq7DFYRmKI0+8caYGJI7ZJbA2NFj o7sVden64ysHd0wFKQC1k4H6MLxO3iV73OTu19FgWsP57AgpdfPYS5h7wiyJkSwPFCO4 rT5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=XmK+NQsT; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si11585944edj.107.2019.11.05.22.03.20; Tue, 05 Nov 2019 22:03:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=XmK+NQsT; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730995AbfKFGDT (ORCPT + 8 others); Wed, 6 Nov 2019 01:03:19 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:35553 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725616AbfKFGDT (ORCPT ); Wed, 6 Nov 2019 01:03:19 -0500 Received: by mail-pl1-f193.google.com with SMTP id s10so75586plp.2; Tue, 05 Nov 2019 22:03:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3naVDG9c+hz6/Z7X8/ImB3hSE5w7Qy3YFszuHTpM04M=; b=XmK+NQsTBFz9CKETkjVznn+1L7EJ3D0imyScMrlzjZGY24V0ctvPQ8rSOEh5WJSxUe DPXmr71CtdiTRjvn6gMe//mlJHA5/vcz/LegSIQDBYPhUn/ac28TNy5neIxysCl9LFFg PL32Sn7Qdiwfan/pSlCbLptCJ0C17zjw7JnN0BliGactrdqt5OHt0uqVsOFXnB8OeQtE DDm0+31LNk10vvmXA+/5OyTnoBykiwCngSYstfdHiXEHD0zyh2A9OVHQaeLeiVxz+P4q FN/hYZN5cy1DhveKhQVoZtpmU95hEObtFVu+vXBtWbGA7UFoaw9Ir0aKI+jxIJQnjF2a Hz/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3naVDG9c+hz6/Z7X8/ImB3hSE5w7Qy3YFszuHTpM04M=; b=nQDh5bqKRWmfxyCwXAPKrzfqZ8wWbeLvwM8zwZuY6HKDDronLwnCY0C991R6JR+pH5 AFSyPm7X/zFmgVariY7bzFbbCiPuVFPaWoYZgVN6nWHEQp29wKyfGb9sVLpIqhR2yXLr g105BOK82I77K4jK64UtqRWsoS2jykvPDzocCN/LWYEhg7nICbmLp+3m2TYLsmhut33J a30M6dAxDZqZ8Tp1d3HXUOmsYlK+YJLzjHUti5jfT7HNBYyHRteoWnxBMzTs/RbqBPnk PMfZ5MWfSWgPirWoGgzCLVFUnaLCrAw45t6BdJbcOG0erk+J9mhQkCvMg7ojuRB/WkuY 0iaw== X-Gm-Message-State: APjAAAWp/lu61a5A9D8UDpUfo6KCRhRsPExKsgaIvVKABxgLiyrNbK+V yf3WDQRK02vCqoswuxsnHqY= X-Received: by 2002:a17:902:9a88:: with SMTP id w8mr828498plp.129.1573020198544; Tue, 05 Nov 2019 22:03:18 -0800 (PST) Received: from voyager.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id u65sm23177676pfb.35.2019.11.05.22.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 22:03:17 -0800 (PST) From: Joel Stanley To: Daniel Lezcano , Rob Herring Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Linus Walleij , Andrew Jeffery Subject: [PATCH 1/4] clocksource: fttmr010: Parametrise shutdown Date: Wed, 6 Nov 2019 16:32:58 +1030 Message-Id: <20191106060301.17408-2-joel@jms.id.au> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191106060301.17408-1-joel@jms.id.au> References: <20191106060301.17408-1-joel@jms.id.au> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org In preparation for supporting the ast2600 which uses a different method to clear bits in the control register, use a callback for performing the shutdown sequence. Signed-off-by: Joel Stanley --- drivers/clocksource/timer-fttmr010.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) -- 2.24.0.rc1 Reviewed-by: Linus Walleij diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index fadff7915dd9..c2d30eb9dc72 100644 --- a/drivers/clocksource/timer-fttmr010.c +++ b/drivers/clocksource/timer-fttmr010.c @@ -97,6 +97,7 @@ struct fttmr010 { bool is_aspeed; u32 t1_enable_val; struct clock_event_device clkevt; + int (*timer_shutdown)(struct clock_event_device *evt); #ifdef CONFIG_ARM struct delay_timer delay_timer; #endif @@ -140,9 +141,7 @@ static int fttmr010_timer_set_next_event(unsigned long cycles, u32 cr; /* Stop */ - cr = readl(fttmr010->base + TIMER_CR); - cr &= ~fttmr010->t1_enable_val; - writel(cr, fttmr010->base + TIMER_CR); + fttmr010->timer_shutdown(evt); if (fttmr010->is_aspeed) { /* @@ -183,9 +182,7 @@ static int fttmr010_timer_set_oneshot(struct clock_event_device *evt) u32 cr; /* Stop */ - cr = readl(fttmr010->base + TIMER_CR); - cr &= ~fttmr010->t1_enable_val; - writel(cr, fttmr010->base + TIMER_CR); + fttmr010->timer_shutdown(evt); /* Setup counter start from 0 or ~0 */ writel(0, fttmr010->base + TIMER1_COUNT); @@ -211,9 +208,7 @@ static int fttmr010_timer_set_periodic(struct clock_event_device *evt) u32 cr; /* Stop */ - cr = readl(fttmr010->base + TIMER_CR); - cr &= ~fttmr010->t1_enable_val; - writel(cr, fttmr010->base + TIMER_CR); + fttmr010->timer_shutdown(evt); /* Setup timer to fire at 1/HZ intervals. */ if (fttmr010->is_aspeed) { @@ -350,6 +345,8 @@ static int __init fttmr010_common_init(struct device_node *np, bool is_aspeed) fttmr010->tick_rate); } + fttmr010->timer_shutdown = fttmr010_timer_shutdown; + /* * Setup clockevent timer (interrupt-driven) on timer 1. */ @@ -370,10 +367,10 @@ static int __init fttmr010_common_init(struct device_node *np, bool is_aspeed) fttmr010->clkevt.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; fttmr010->clkevt.set_next_event = fttmr010_timer_set_next_event; - fttmr010->clkevt.set_state_shutdown = fttmr010_timer_shutdown; + fttmr010->clkevt.set_state_shutdown = fttmr010->timer_shutdown; fttmr010->clkevt.set_state_periodic = fttmr010_timer_set_periodic; fttmr010->clkevt.set_state_oneshot = fttmr010_timer_set_oneshot; - fttmr010->clkevt.tick_resume = fttmr010_timer_shutdown; + fttmr010->clkevt.tick_resume = fttmr010->timer_shutdown; fttmr010->clkevt.cpumask = cpumask_of(0); fttmr010->clkevt.irq = irq; clockevents_config_and_register(&fttmr010->clkevt, From patchwork Wed Nov 6 06:02:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 178606 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp161175ilf; Tue, 5 Nov 2019 22:03:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxFcT/2GwMt31xw78GN/NpdWE06R6lZ2bMLoJJreM996a+F+lATWk+g5OmbKJBeUmQo7aVb X-Received: by 2002:a17:906:a38d:: with SMTP id k13mr21014895ejz.213.1573020205489; Tue, 05 Nov 2019 22:03:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573020205; cv=none; d=google.com; s=arc-20160816; b=g8THPpNwRK5Bn1zWlx7XO0n3/YlAU+/13UzkcVZuHlto3kC8GJO4nh5RqJ6xqy7p7K D5lLqUJQAPo3KDQQA6SvWqZf3E8Dc1vs4z2S5a5ngplfGrwDQHwNiicL2DKJZAXKjFRu jVqXB74jtJN7GpOsnyPUhC84QbzIhhUMsbKHtyNBx2hoQEXyv/7zXIqXmOra/R69R10o lga+gbD1SBpX98RrvMS59/wjMDXRVmOT7n784eN9Od1I+WXyOZU5OYjli0KOOA59sJ8S lJu7o4PGK9/cKS4eIb9cukuF+aOpQcY2Srt+3v9iF/WH9DEUZt9j8gLYfUS5C5yTxxYq zhSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wigKnx55CwbHshgUiFaVzzGEeLAYy1kZhbF9mN3t1iQ=; b=0jwTFcOsqNYUznL/LXM5HlaLZhlv7Jxf16rOmRP+gxj0U5149IoBTINfd1CuhaPOCz HOYHnYSC3jHR2C0AFdwqPUCswj4xQd2Vw8GT8NntzuJIkLx1Mys9F26FjvNI4asQzdCN W2nm0qFKNkJowSoF2HcvZJJw3Dk1HzOpmwVCiqFm69OnMCTM3cNgbNSjaLnFRQWGKdJY iogs+EQEGLNvGpEJnL9HGIPQbU4Eaf4Mqu0bvr7Bf+sMjMJLfZ4sfvGbp7gs6/FPwDoN Nf6CliBexFFcq8nLyZGoGNvn9vYzWEZrH5ABcQEtGyXNwgcyPyy8DxrF4j+wIwSvfux4 I9/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=fSwNEiMf; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb6si5424768ejb.359.2019.11.05.22.03.25; Tue, 05 Nov 2019 22:03:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=fSwNEiMf; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731068AbfKFGDX (ORCPT + 8 others); Wed, 6 Nov 2019 01:03:23 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44106 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725616AbfKFGDX (ORCPT ); Wed, 6 Nov 2019 01:03:23 -0500 Received: by mail-pf1-f194.google.com with SMTP id q26so18000842pfn.11; Tue, 05 Nov 2019 22:03:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wigKnx55CwbHshgUiFaVzzGEeLAYy1kZhbF9mN3t1iQ=; b=fSwNEiMfRyxD2QUPGH3qIOL5nKZap+JEIPRAGtKhA3RJzY9bg8Uuq7XUaoWms/U+J3 M1YNO82g7kQQPkUk6Cbblv0pPq5zTQ3bFnhoWz8p1OGz3UX+oa0BzgfgyLdAK0KMm/Re RUuI1408xJq+t32sZnOy4uwYUSHZ97zVG71FEQgomtA7ApGNz1RAFAORbumiBXhwv+E1 s6bZT6YjEtZ927HiDEya7hsToW40MDOTep8u4VXCgCb3c9LHOXo//4yfkiQoR+jw26QO yV8RuT05L7iM4XsLAZjLMQsGwRnnUJ5ilywOu5BiNEc8zozxBrO+TJrM3ymdz6kEfqUW GDNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wigKnx55CwbHshgUiFaVzzGEeLAYy1kZhbF9mN3t1iQ=; b=BxQivh38wysNRyG9C00d95vR65DmkKVI8BC20ZaFs0shZAYqvHDFJVzr0sjUf9lDU0 QFXhgMIFQAlxpGE2jFuXlUtoXWoKjw7x8rTh/bieV+c4o7tY9PQgbaWIggVTr7z980Bm UJgh6+ydZLL9z3zG14AwaMBiEJdYv9qjAU3mceXIH4WRpXZvRCOiI4TK5epqQQTMg/Ug sLN4L3nauM6nLr8NtqVedzd5BKcBHH7OuIQmb9kBnblMGdPJhMbnKzVXvwMHCuAondO5 17cWBw97mwM4oEquAR0u4p00+fMKNVuCCtrA5l9IVaMAwa/zA2zYnYw6eyOwz/kXUhzC 4vDw== X-Gm-Message-State: APjAAAVf9oTNPw7O5D6nWJanKLWYm/NzPjXMyz3MjE17hiQgfeihTKXn zesOsWd0W+jzid66UoAst0w= X-Received: by 2002:a65:5a06:: with SMTP id y6mr911719pgs.9.1573020202371; Tue, 05 Nov 2019 22:03:22 -0800 (PST) Received: from voyager.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id u65sm23177676pfb.35.2019.11.05.22.03.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 22:03:21 -0800 (PST) From: Joel Stanley To: Daniel Lezcano , Rob Herring Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Linus Walleij , Andrew Jeffery Subject: [PATCH 2/4] clocksource: fttmr010: Set interrupt and shutdown Date: Wed, 6 Nov 2019 16:32:59 +1030 Message-Id: <20191106060301.17408-3-joel@jms.id.au> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191106060301.17408-1-joel@jms.id.au> References: <20191106060301.17408-1-joel@jms.id.au> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org In preparation for supporting the ast2600, pass the shutdown and interrupt functions to the common init callback. Signed-off-by: Joel Stanley --- drivers/clocksource/timer-fttmr010.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) -- 2.24.0.rc1 Reviewed-by: Linus Walleij diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index c2d30eb9dc72..8a79025339d0 100644 --- a/drivers/clocksource/timer-fttmr010.c +++ b/drivers/clocksource/timer-fttmr010.c @@ -244,7 +244,10 @@ static irqreturn_t fttmr010_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static int __init fttmr010_common_init(struct device_node *np, bool is_aspeed) +static int __init fttmr010_common_init(struct device_node *np, + bool is_aspeed, + int (*timer_shutdown)(struct clock_event_device *), + irq_handler_t handler) { struct fttmr010 *fttmr010; int irq; @@ -345,7 +348,7 @@ static int __init fttmr010_common_init(struct device_node *np, bool is_aspeed) fttmr010->tick_rate); } - fttmr010->timer_shutdown = fttmr010_timer_shutdown; + fttmr010->timer_shutdown = timer_shutdown; /* * Setup clockevent timer (interrupt-driven) on timer 1. @@ -354,7 +357,7 @@ static int __init fttmr010_common_init(struct device_node *np, bool is_aspeed) writel(0, fttmr010->base + TIMER1_LOAD); writel(0, fttmr010->base + TIMER1_MATCH1); writel(0, fttmr010->base + TIMER1_MATCH2); - ret = request_irq(irq, fttmr010_timer_interrupt, IRQF_TIMER, + ret = request_irq(irq, handler, IRQF_TIMER, "FTTMR010-TIMER1", &fttmr010->clkevt); if (ret) { pr_err("FTTMR010-TIMER1 no IRQ\n"); @@ -403,12 +406,16 @@ static int __init fttmr010_common_init(struct device_node *np, bool is_aspeed) static __init int aspeed_timer_init(struct device_node *np) { - return fttmr010_common_init(np, true); + return fttmr010_common_init(np, true, + fttmr010_timer_shutdown, + fttmr010_timer_interrupt); } static __init int fttmr010_timer_init(struct device_node *np) { - return fttmr010_common_init(np, false); + return fttmr010_common_init(np, false, + fttmr010_timer_shutdown, + fttmr010_timer_interrupt); } TIMER_OF_DECLARE(fttmr010, "faraday,fttmr010", fttmr010_timer_init); From patchwork Wed Nov 6 06:03:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 178607 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp161215ilf; Tue, 5 Nov 2019 22:03:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxi7UJnFf/sfgqGXosmcN2mUgEVPjd1YDNgfaLDIuxym4ASwfpOR9to+tQxlJAUBbyO1SU/ X-Received: by 2002:a17:906:fc6:: with SMTP id c6mr10645038ejk.153.1573020207886; Tue, 05 Nov 2019 22:03:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573020207; cv=none; d=google.com; s=arc-20160816; b=WE3qMcmall9UIi1yPuyN+aYLzu5nurDTwjZpAswx7Vhz7GxVQ85uLElOKhjC1h70Fy y7gBMPvIlF/G71Uyx9VaJ1mTzDO/feGQ52HXZbw5PsCeC5DGjxacAmaoqHXz1J+nDoZ+ 1y5rr7ydao7y17LaiENUw4zVQL5o5W1SzWARz0TgiXKvWSwfBiF1kBnQ1fbodnsexe/J 6R8FyvdOy+szQTwueSfcbl9mwSZqt+7aClxxNojv1Sso9rvuO9n3q5WjP8/3Qc2SWi7P LrNLq2llxgWfOh+79wl6eKx6F0g/lggsQafcqTNHxFGgnm10pnbBiA59vhFGCUmwpuUn cffA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pvETq++L0sfvJDo0Ujf7rGASfz2pwG/aDIcZe0oPC2w=; b=d+PqpdgBSftHaLrnZ4uyIAaGq+ezVU3zh8FGS4bn3eRlcQepZ4s2Jmi+VEVRl/EQ86 RCD+DMPt2yheFt4Qa0nhNeUR/6nMysBRtaD5YIas38uc9CKaFlCx1QiizyWUU/8H6gJQ 6WqKLpiBP4dDXxgE8HZWW5LI6EnDw7wvxRvgsSKBfRdX+zTmj2+SiDi9y76gmmoqK1Q/ ubK4dD1+mKtPvTczIXcgZjy1NO1oFuF1LxvrNmHKQked9Nd9xdp7+G93SPUA1xg4OBw3 I0Fhn4N2xqBSqTBt3rDtl/NF8+jLP+N9LjVatCVtlj/TYzqdR0MctUVrEs2WZDlKpJ52 XdAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=qpmoyKx4; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb6si5424768ejb.359.2019.11.05.22.03.27; Tue, 05 Nov 2019 22:03:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=qpmoyKx4; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731125AbfKFGD1 (ORCPT + 8 others); Wed, 6 Nov 2019 01:03:27 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:38657 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725616AbfKFGD1 (ORCPT ); Wed, 6 Nov 2019 01:03:27 -0500 Received: by mail-pf1-f193.google.com with SMTP id c13so18017394pfp.5; Tue, 05 Nov 2019 22:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pvETq++L0sfvJDo0Ujf7rGASfz2pwG/aDIcZe0oPC2w=; b=qpmoyKx4Cj9u60GOe3E+wR8joIEGdfPOyRI2Pht9E/19kymCpZadHv/V0Lzsuw6/BD tp8MkjdGkY2/10DD/vNT+2uMwxV3Q3dN4PNQGEqXbrvTVuEzgwEg/zvSkugvqryjQSkl 8DaTRNFEA1U1F8J87X0CYbidhvCH0Pb/y5c36Xk4pZLdAvpQQKBfWvICJGrr6BpaW8JM KjC9GdK5uWWzTJKVhD0C8goiJDJUpJ3r4w/NBwh3vL1GkyLGLad7+3TF8nYWFFveTF8M K5o8M7LRdGtcbDSPhvtlhUr/DZy3r51j0tzmYFpaVWdie0zBOsoE6yRc2AqYlIKBWacS 8oEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=pvETq++L0sfvJDo0Ujf7rGASfz2pwG/aDIcZe0oPC2w=; b=OcD+/QkThKGjqUWgnE29WGTbRX/LevIBxkH2FylrnoFMuTLMpDDeveHZGvmAcQi8Ej J8rYEeirKVwBIUKYJZJBfqka+kN8GLlxaEvqTBkUdrhhcpPKp2VXDpZbjOFvYQnGLHXA Rqe5j7gydxXeb0n/38DPik4XW1Bwm0G6xS5+WBCuOq0dQlAT/mALnTPFzzcbP9j0ICpW AihjSrHw2OO/n9rLpuXrJXy8pvO27ch89WzNOpzCUoLuNfMGWWMKnaSYkgSVRNFK+ZnL LRbWCHRhR7/ZL8Q/K92gF+EM/cT1KqpNFiMia+L2t0qN4hffAn3MMpzJ3dc21xTytOdK 8+Ww== X-Gm-Message-State: APjAAAXwgDZ+n5+Cq1xReTG+MaoQsLRwYrn/Iyq8zu7T+bBEGVmVXCKY z5J61ogXWhRCKoi0p+YYRV0= X-Received: by 2002:a17:90a:d818:: with SMTP id a24mr1461626pjv.40.1573020206005; Tue, 05 Nov 2019 22:03:26 -0800 (PST) Received: from voyager.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id u65sm23177676pfb.35.2019.11.05.22.03.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 22:03:25 -0800 (PST) From: Joel Stanley To: Daniel Lezcano , Rob Herring Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Linus Walleij , Andrew Jeffery Subject: [PATCH 3/4] clocksource: fttmr010: Add support for ast2600 Date: Wed, 6 Nov 2019 16:33:00 +1030 Message-Id: <20191106060301.17408-4-joel@jms.id.au> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191106060301.17408-1-joel@jms.id.au> References: <20191106060301.17408-1-joel@jms.id.au> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The ast2600 has some minor differences to previous versions. The interrupt handler must acknowledge the timer interrupt in a status register. Secondly the control register becomes write to set only, requiring the use of a separate set to clear register. Signed-off-by: Joel Stanley --- drivers/clocksource/timer-fttmr010.c | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) -- 2.24.0.rc1 Reviewed-by: Linus Walleij diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index 8a79025339d0..688d540ebddd 100644 --- a/drivers/clocksource/timer-fttmr010.c +++ b/drivers/clocksource/timer-fttmr010.c @@ -37,6 +37,11 @@ #define TIMER3_MATCH2 (0x2c) #define TIMER_CR (0x30) +/* + Control register set to clear for ast2600 only. + */ +#define TIMER_CR_CLR (0x3c) + /* * Control register (TMC30) bit fields for fttmr010/gemini/moxart timers. */ @@ -163,6 +168,16 @@ static int fttmr010_timer_set_next_event(unsigned long cycles, return 0; } +static int ast2600_timer_shutdown(struct clock_event_device *evt) +{ + struct fttmr010 *fttmr010 = to_fttmr010(evt); + + /* Stop */ + writel(fttmr010->t1_enable_val, fttmr010->base + TIMER_CR_CLR); + + return 0; +} + static int fttmr010_timer_shutdown(struct clock_event_device *evt) { struct fttmr010 *fttmr010 = to_fttmr010(evt); @@ -244,6 +259,17 @@ static irqreturn_t fttmr010_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } +static irqreturn_t ast2600_timer_interrupt(int irq, void *dev_id) +{ + struct clock_event_device *evt = dev_id; + struct fttmr010 *fttmr010 = to_fttmr010(evt); + + writel(0x1, fttmr010->base + TIMER_INTR_STATE); + + evt->event_handler(evt); + return IRQ_HANDLED; +} + static int __init fttmr010_common_init(struct device_node *np, bool is_aspeed, int (*timer_shutdown)(struct clock_event_device *), @@ -404,6 +430,13 @@ static int __init fttmr010_common_init(struct device_node *np, return ret; } +static __init int ast2600_timer_init(struct device_node *np) +{ + return fttmr010_common_init(np, true, + ast2600_timer_shutdown, + ast2600_timer_interrupt); +} + static __init int aspeed_timer_init(struct device_node *np) { return fttmr010_common_init(np, true, @@ -423,3 +456,4 @@ TIMER_OF_DECLARE(gemini, "cortina,gemini-timer", fttmr010_timer_init); TIMER_OF_DECLARE(moxart, "moxa,moxart-timer", fttmr010_timer_init); TIMER_OF_DECLARE(ast2400, "aspeed,ast2400-timer", aspeed_timer_init); TIMER_OF_DECLARE(ast2500, "aspeed,ast2500-timer", aspeed_timer_init); +TIMER_OF_DECLARE(ast2600, "aspeed,ast2600-timer", ast2600_timer_init); From patchwork Wed Nov 6 06:03:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 178608 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp161315ilf; Tue, 5 Nov 2019 22:03:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzOWRMHcxISbFUQWT5gSJ78gvE7hDePvUZBOwK2Bnw4i6kQHaM3HVuqqJznCRWCbUg+iPAX X-Received: by 2002:aa7:c145:: with SMTP id r5mr807211edp.102.1573020213637; Tue, 05 Nov 2019 22:03:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573020213; cv=none; d=google.com; s=arc-20160816; b=H+MA5Ezy7I1OeYGO0lGSn3m8VdGyFNEMgKzJpgpFNET7PkYunF91Po9MdoJPQLj9DT wkitUSw7xukgDYvBz8UeaZ47jDSHJokDDB0FhYn5yLEx1aP6/yNBVA4dcKoUnTYbwBEP OHmw691HYCd7d2Qp34tNRPECunyFRO/DifDA06w0qEyd87MTBBufhqZ5uJKlcwkckzAh 0drDNKy247V4IkTzxhDwpYJMw0EiIbpACvw7LJSIHsMTBQk0ISgLRxgVVcQBEPwsb9dV Zua5mV8trRLSV4hs6cl3xDq2LylPRUV7bAQdRb6hMjyrzZOqVdujyFF+DIrB0RtJ7XMS RYfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5/6ILvar/Vc1NMB4f7GrkmfjN1HObi4yraIRhPcFGto=; b=lCTNYr+wnW2OawKk/Dsuxbb9RRsP4HDp9/5acP4KhlE6Ubz4/KycXjOm/MmkcPdDs5 Hu3eZVzgoSlM+akITk+pHzjaNsXY5h6Jjl1IuylLrfRBs9naImCjVzYFHdH1qiXpOgTI yas6lknQtyhleOUnRRLO4kt2M6JClp95GJDniUWUxniQMNZYzEY2IgFuIWw4R2hPL0K9 wtL029ZmBIj/xJg9j+ZCt6/Spl0UvQmLrfV3mXe8EqaRFpzBllEgxNUnjJUpDkL91yKe Y/57cgfmicltxgy0VU4f/2Ad+RM55tL3R0KMug4SwvBNm/+7KQOpwKOP9y60bEwQFdAu 49LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=BuATidBj; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z16si11864992edd.314.2019.11.05.22.03.33; Tue, 05 Nov 2019 22:03:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=BuATidBj; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725913AbfKFGDc (ORCPT + 8 others); Wed, 6 Nov 2019 01:03:32 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41461 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731190AbfKFGDc (ORCPT ); Wed, 6 Nov 2019 01:03:32 -0500 Received: by mail-pg1-f194.google.com with SMTP id l3so16377468pgr.8; Tue, 05 Nov 2019 22:03:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5/6ILvar/Vc1NMB4f7GrkmfjN1HObi4yraIRhPcFGto=; b=BuATidBjIts5hHmDKKZlujEP41wcqVP7Yk5A6SBb/teaPz7lWYAWq7vnCRk1LcWiXE YjkhzUwRVWbDxPdLyCYJGkmGcBkaT3joD0mY71d5nMoXyDsuZf+axhR23/pUX9HB7tYC ccVmjKURstvC5U+pQqN49oH4avpatxMn8cpZ26bbTfMlfd/Z1LwTYQD2YsvjS3IlgXye d10ADmqdU+G2ckLyYY7P8KpRz5b/U/vMkTg8I4PEk51+knjsAVEqGzrEtrfGoQ67UQHU T/EKR9FVNAHHOzSAY9IYC1ZOXTAkPpCUS2KOu4T/mc0ichdJdwL3mCAFwFdeeZWM+0vQ z5xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5/6ILvar/Vc1NMB4f7GrkmfjN1HObi4yraIRhPcFGto=; b=b+PynbWxEojGRwVsr0+3F82LG50wCLb+Ef/v97hk/9cSRx6OdWuO3Eo1iBhPlM5h2g Y9OKJXcMMo4SHVyQ7f7ia0NRWDyaiBvqodNBPaSukZ2mpIP+ZRa/JSZhY8pIeQrR+Pax Q8zBgVG4ypgup2DiBi1TRlknNTgT6PFDfE5+ISG6M54s3vvrnC4zg6+/5hqKicz17E/f z7zXaVLIBO4lGn2+mZjJA3Li5zCdmn05SyY5CAHBfysb+ty08gAP7bRCZ5d508JIKiND 7V1YxJarlDak6ipvBI3lnpljVO2TeqjTCK0E8Dnj7IFooU+ggw5wPqgRxQ2xOPKHkKi8 5BaA== X-Gm-Message-State: APjAAAXI27GtHHqhfRUu7iR98Zo2jj2QG/echQr3JlFlsqlAXOFXeJvh jZgqCMsRYPeEl6VR/9DKySg= X-Received: by 2002:aa7:8197:: with SMTP id g23mr1161202pfi.247.1573020209675; Tue, 05 Nov 2019 22:03:29 -0800 (PST) Received: from voyager.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id u65sm23177676pfb.35.2019.11.05.22.03.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 22:03:29 -0800 (PST) From: Joel Stanley To: Daniel Lezcano , Rob Herring Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Linus Walleij , Andrew Jeffery Subject: [PATCH 4/4] dt-bindings: fttmr010: Add ast2600 compatible Date: Wed, 6 Nov 2019 16:33:01 +1030 Message-Id: <20191106060301.17408-5-joel@jms.id.au> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191106060301.17408-1-joel@jms.id.au> References: <20191106060301.17408-1-joel@jms.id.au> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The ast2600 contains a fttmr010 derivative. Signed-off-by: Joel Stanley --- Documentation/devicetree/bindings/timer/faraday,fttmr010.txt | 1 + 1 file changed, 1 insertion(+) -- 2.24.0.rc1 Acked-by: Rob Herring Reviewed-by: Linus Walleij diff --git a/Documentation/devicetree/bindings/timer/faraday,fttmr010.txt b/Documentation/devicetree/bindings/timer/faraday,fttmr010.txt index 195792270414..3cb2f4c98d64 100644 --- a/Documentation/devicetree/bindings/timer/faraday,fttmr010.txt +++ b/Documentation/devicetree/bindings/timer/faraday,fttmr010.txt @@ -11,6 +11,7 @@ Required properties: "moxa,moxart-timer", "faraday,fttmr010" "aspeed,ast2400-timer" "aspeed,ast2500-timer" + "aspeed,ast2600-timer" - reg : Should contain registers location and length - interrupts : Should contain the three timer interrupts usually with