From patchwork Mon Mar 18 12:10:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10857521 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 5A4701669 for ; Mon, 18 Mar 2019 12:13:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37046291DA for ; Mon, 18 Mar 2019 12:13:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AE0A292C0; Mon, 18 Mar 2019 12:13:21 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 C30F8291DA for ; Mon, 18 Mar 2019 12:13:20 +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:References:In-Reply-To: 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: List-Owner; bh=1LVeSttjOCP+fAsuXNCFJLSF6aBshFpgY6aPVpzm9Gw=; b=qgD/ks5I8r1MWn m6p1qaNWvLfmfvk8jV6KzQTJLdTzpfdeVZEmbxqu9BC1i3y24JeW2YkN9DOV6RRMmaGNs3rJDjVRF BLD9lPWvOrngC3DWbdgNfRQP9VhE7BGPhwWcyNBsZswwyQki6k97pyzzV2NLDNYH/H7A1OeSZ4K+a DDQ1ZVRdaSQHw9/2Afi5A9q8Ljqz87lG5HqlR0ktDthlZzo79wh/n+JTHRe07XgDKZGsybPQymDMR 4EK8lmy9XQrQ/FhQlq264VyFHiT6OyJELFPYZo0t3bCU+ebBShEeO4mPxhrxdjyvAPovpFqYKqW07 Lv2qQX2n/GFQ+AMU9Vow==; 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 1h5r8k-00088I-HM; Mon, 18 Mar 2019 12:13:14 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5r72-0005mt-Vd for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2019 12:11:30 +0000 Received: by mail-wr1-x442.google.com with SMTP id y15so16759007wro.4 for ; Mon, 18 Mar 2019 05:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p/RL9iQ2NS2E2PHvUt/6SF66kDhBpCeVr4z3seHiKxc=; b=boFR526H1NtqYO4Xhgqx2ssi9nWJ6jXepzHDIttGVIneOflS7gp27/3F3EJQbj1IEZ 11/ATJXbohHSaC++Ni7LFwrcd2CqA2Uf15vdKgKs4COQdVWC80FC8fUZzeP7441e3M99 QVO0yZP4/H9qsLw3qxj9WSvLNFJbZwKnRhJCmFG7tPhslN/+GAX+DnHjfOpuQf5YWIgX HqPIDt2rJrZ+utZnPxSPW5gBSdt3h1zqew5b81iLL5olfls9pJAL2U0x+XBUJkapLPiO 0SB1ac7TZKRShsxwbSuaF2xkoanK/KpEemD6Ju+79QOtAyD09iG43bbZjfL0h+Bikflz qRXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p/RL9iQ2NS2E2PHvUt/6SF66kDhBpCeVr4z3seHiKxc=; b=Tn1foa+E9KH1LS4T6vkLaWENGRmNCSap8EWN2qr6abK+e9sfvtIRFwuURD1FoVch3h X90CXlbUsBkHTEEAEJHpsJn23622BouRJW0qBW6LErbENrVdY3ava3A5Mjfc91/cLgD5 zKNaUTz4A6vuWVeNNpnnQQy3CI8u9ySwwMbYR3PQaG0fJsOnhHxagyGQWJ0MLTUnf8Zu LHADl15fvo/LGi/baIUIIKW8NYYCzQ4ZLJtqvWobY1uPxcxOBei/rJT9wp/XM5/jLM3Z LKyivJ+nE5ovTXzVnTffFpQFH1bzvYJwkB5q6WuJy+NqfzlYp2KFUcyJd0bfhZTYY2xS snig== X-Gm-Message-State: APjAAAWRO5EPXeGHAycX1z2f/gDKyCKlt7NuyoGNeaBZoEQ1sHhUrQVK i84nLmiz3xr2N7PsvUc/VqxOkA== X-Google-Smtp-Source: APXvYqyzDDGHbhNqjXluluMdGNeCDOPmxCxbt7Pd3E2YWwmVOsG21Te6qRNJnMMQ9mhIfbbSHX+pOg== X-Received: by 2002:adf:dc4d:: with SMTP id m13mr12422592wrj.330.1552911087619; Mon, 18 Mar 2019 05:11:27 -0700 (PDT) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id n13sm8220132wrw.67.2019.03.18.05.11.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 05:11:26 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Daniel Lezcano , Thomas Gleixner , David Lechner Subject: [PATCH v4 10/11] ARM: davinci: dm646x: switch to using the clocksource driver Date: Mon, 18 Mar 2019 13:10:59 +0100 Message-Id: <20190318121100.28132-11-brgl@bgdev.pl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190318121100.28132-1-brgl@bgdev.pl> References: <20190318121100.28132-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190318_051129_228679_F9F8609F X-CRM114-Status: GOOD ( 15.36 ) 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: Bartosz Golaszewski , linux-kernel@vger.kernel.org, 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 From: Bartosz Golaszewski We now have a proper clocksource driver for davinci. Switch the dm646x platform to using it. Signed-off-by: Bartosz Golaszewski Reviewed-by: David Lechner --- arch/arm/mach-davinci/dm646x.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 7e5af984ed9f..281e778ba19e 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -27,7 +27,8 @@ #include #include #include -#include + +#include #include "asp.h" #include "davinci.h" @@ -500,15 +501,15 @@ static struct davinci_id dm646x_ids[] = { }; /* - * T0_BOT: Timer 0, bottom: clockevent source for hrtimers - * T0_TOP: Timer 0, top : clocksource for generic timekeeping - * T1_BOT: Timer 1, bottom: (used by DSP in TI DSPLink code) - * T1_TOP: Timer 1, top : + * Bottom half of timer0 is used for clockevent, top half is used for + * clocksource. */ -static struct davinci_timer_info dm646x_timer_info = { - .timers = davinci_timer_instance, - .clockevent_id = T0_BOT, - .clocksource_id = T0_TOP, +static const struct davinci_timer_cfg dm646x_timer_cfg = { + .reg = DEFINE_RES_IO(DAVINCI_TIMER0_BASE, SZ_4K), + .irq = { + DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT12)), + DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT34)), + }, }; static struct plat_serial8250_port dm646x_serial0_platform_data[] = { @@ -586,7 +587,6 @@ static const struct davinci_soc_info davinci_soc_info_dm646x = { .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, .pinmux_pins = dm646x_pins, .pinmux_pins_num = ARRAY_SIZE(dm646x_pins), - .timer_info = &dm646x_timer_info, .emac_pdata = &dm646x_emac_pdata, .sram_dma = 0x10010000, .sram_len = SZ_32K, @@ -651,6 +651,7 @@ void __init dm646x_init_time(unsigned long ref_clk_rate, { void __iomem *pll1, *psc; struct clk *clk; + int rv; clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, ref_clk_rate); clk_register_fixed_rate(NULL, "aux_clkin", NULL, 0, aux_clkin_rate); @@ -667,7 +668,8 @@ void __init dm646x_init_time(unsigned long ref_clk_rate, return; } - davinci_timer_init(clk); + rv = davinci_timer_register(clk, &dm646x_timer_cfg); + WARN(rv, "Unable to register the timer: %d\n", rv); } static struct resource dm646x_pll2_resources[] = {