From patchwork Thu Sep 13 11:30:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 10599265 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC3BA6CB for ; Thu, 13 Sep 2018 11:31:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA1122A77B for ; Thu, 13 Sep 2018 11:31:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C3842A7DF; Thu, 13 Sep 2018 11:31:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 646CC2A77B for ; Thu, 13 Sep 2018 11:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JywCRQoKGOiYtYZElOVOWSzUPonuYwjvlNb1EXXym0c=; b=H9zwfVFao+ZH/u HCmX6t6HZXGMKerr67veKb/CjwizWBWbWCkJwJEWuApIs6IB2CyonC8IQKATcm3aniJ03dLNfIB6l xYGDbWxNwEJ5+4ovl4vY1eA6vXP8dbDswT06L/EFclDEgWyWrxlcE2uqZud2tiNqYVht+XBlCrfnM S7brb8hPL1oLyCLowGQP09LdK6bKfqDYd7RhHEShEUumPIXteJMidN+kkaIb5AmzbISRAUX8QU4PO IF1ZdkVUr2py3GO93wCR4C9sIEtj1fmN6zqVWStSJUNg+iorKaowPbm/VJ3FE6HjKZAlWjsI+34kx KTS3NsHfU0Hk7yl6GGuA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0PqR-0004JR-3b; Thu, 13 Sep 2018 11:31:35 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0Ppi-0003zq-1s for linux-arm-kernel@lists.infradead.org; Thu, 13 Sep 2018 11:30:52 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 2B470208F4; Thu, 13 Sep 2018 13:30:36 +0200 (CEST) Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id 997DF208CE; Thu, 13 Sep 2018 13:30:25 +0200 (CEST) From: Alexandre Belloni To: Daniel Lezcano Subject: [PATCH v7 0/7] clocksource: rework Atmel TCB timer driver Date: Thu, 13 Sep 2018 13:30:17 +0200 Message-Id: <20180913113024.3571-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180913_043050_248735_B0AB9A57 X-CRM114-Status: GOOD ( 15.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Alexander Dahl , Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Thomas Gleixner , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, This series reworks the Atmel TCB drivers. It introduces a new driver to handle the clocksource and clockevent devices. This is necessary because: - the current tcb_clksrc driver is probed too late to be able to be used at boot and we now have SoCs that don't have a PIT. They currently are not able to boot a mainline kernel. - using the PIT doesn't work well with preempt-rt because its interrupt is shared (in particular with the UART and their interrupt flags are incompatible) - the current solution is wasting some TCB channels The plan is to get this driver upstream, then convert the TCB PWM driver to be able to get rid of the tcb_clksrc driver along with atmel_tclib now that AVR32 is gone. changes in v7: - fixed a warning when building on 64 bit platforms changes in v6: - rebased on v4.19-rc1 - separated the clocksource/clockevent and the single clockevent in two different patches - removed struct tc_clkevt_device and simply use struct atmel_tcb_clksrc - removed struct atmel_tcb_info - moved tcb_clk_get and tcb_irq_get to users changes in v5: - rebased on v4.18-rc1 - fixed the clock enabling/disabling in atomic context under preempt-rt Changes in v4: - rebased on top of v4.17-rc1 - fixed an issue when setting max_delta for clockevents_config_and_register Alexandre Belloni (7): ARM: at91: add TCB registers definitions clocksource/drivers: Add a new driver for the Atmel ARM TC blocks clocksource/drivers: timer-atmel-tcb: add clockevent device on separate channel clocksource/drivers: atmel-pit: make option silent ARM: at91: Implement clocksource selection ARM: configs: at91: use new TCB timer driver ARM: configs: at91: unselect PIT arch/arm/configs/at91_dt_defconfig | 2 +- arch/arm/configs/sama5_defconfig | 2 +- arch/arm/mach-at91/Kconfig | 25 ++ drivers/clocksource/Kconfig | 13 +- drivers/clocksource/Makefile | 3 +- drivers/clocksource/timer-atmel-tcb.c | 617 ++++++++++++++++++++++++++ include/soc/at91/atmel_tcb.h | 183 ++++++++ 7 files changed, 841 insertions(+), 4 deletions(-) create mode 100644 drivers/clocksource/timer-atmel-tcb.c create mode 100644 include/soc/at91/atmel_tcb.h