From patchwork Fri Mar 24 21:32:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 95970 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp236268qgd; Fri, 24 Mar 2017 14:33:23 -0700 (PDT) X-Received: by 10.99.95.136 with SMTP id t130mr11469531pgb.0.1490391203383; Fri, 24 Mar 2017 14:33:23 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o7si4209826pgf.246.2017.03.24.14.33.23; Fri, 24 Mar 2017 14:33:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967547AbdCXVdE (ORCPT + 17 others); Fri, 24 Mar 2017 17:33:04 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:33067 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966846AbdCXVc6 (ORCPT ); Fri, 24 Mar 2017 17:32:58 -0400 Received: by mail-lf0-f43.google.com with SMTP id h125so885478lfe.0 for ; Fri, 24 Mar 2017 14:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OLNGF8d4ecc8Z/ieOBbpLFGI0fUqmydPXhU0WGN22+c=; b=exuSbBw1oQnYD41HqqiE+a7sXha7WeD1GMGBoJXH8buO/bzlCXdjBR9ZZCwGdMRgA+ 12wlQD4K2vDlTcEs8upUiMELikuTJx5uQzReAaGyjDvPFvCMt5CavbUGUNNImrwUPtrR uEf6JT2nFic9d4ow7G+w00cdFbCgVZ9NHBfFw= 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; bh=OLNGF8d4ecc8Z/ieOBbpLFGI0fUqmydPXhU0WGN22+c=; b=kxK5SJHcTRIkVkSlDwuHqTDYHuPMYvwC/CuLBtdUVJgF+ZA3/0qq6yYmVPckdGEyMn vvq7jJ2ZzmEOtMcIAo1f6XNH3c1OBHu5xF7NF7X5pMoN648NjsF6a+wr0IAICGmdgFbm Zn4kCrAGvCdJX9fVh5fJxEkctoExtHEzISVp0r0/hkgBbtjYYf3S5mfbVXWRbW3RunQs 3SgHvu5PaDGXwn6nDrkZz4OLMjLSjreYeiQgZmqBqLD5tuivciaZIgRWFiXzM9hQ2WCP 1IC91E6v/+lXyRbgt0Ap9ajR8Z0zfjgzva2K2sVChWeeAl+YCcQOXdxISFhXgVcnlA2z nWrA== X-Gm-Message-State: AFeK/H12yeiI/OvAV9N6/xgCtUfowyZoXgH+XRVlzZMNArOLAc0DrIVJXUN3eh4At8vTYf80 X-Received: by 10.25.162.211 with SMTP id l202mr5361308lfe.97.1490391175265; Fri, 24 Mar 2017 14:32:55 -0700 (PDT) Received: from localhost.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id i24sm561975lfk.50.2017.03.24.14.32.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Mar 2017 14:32:54 -0700 (PDT) From: Linus Walleij To: Daniel Lezcano , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Linus Walleij Subject: [PATCH 2/3] clocksource: rename Gemini timer to Faraday Date: Fri, 24 Mar 2017 22:32:34 +0100 Message-Id: <20170324213235.16119-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170324213235.16119-1-linus.walleij@linaro.org> References: <20170324213235.16119-1-linus.walleij@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After some research it turns out that the "Gemini" timer is actually a generic IP block from Faraday Technology named FTTMR010, so as to not make things too confusing we need to rename the driver and its symbols to make sense. The implementation remains the same in this patch but we fix the copy-paste error in the timer name "nomadik_mtu" as we're at it. Signed-off-by: Linus Walleij --- drivers/clocksource/Kconfig | 7 ++-- drivers/clocksource/Makefile | 2 +- .../{timer-gemini.c => timer-fttmr010.c} | 45 +++++++++++----------- 3 files changed, 27 insertions(+), 27 deletions(-) rename drivers/clocksource/{timer-gemini.c => timer-fttmr010.c} (83%) -- 2.9.3 diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 3356ab821624..b2d98346b28b 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -67,15 +67,16 @@ config DW_APB_TIMER_OF select DW_APB_TIMER select CLKSRC_OF -config GEMINI_TIMER - bool "Cortina Gemini timer driver" if COMPILE_TEST +config FTTMR010_TIMER + bool "Faraday Technology timer driver" if COMPILE_TEST depends on GENERIC_CLOCKEVENTS depends on HAS_IOMEM select CLKSRC_MMIO select CLKSRC_OF select MFD_SYSCON help - Enables support for the Gemini timer + Enables support for the Faraday Technology timer block + FTTMR010. config ROCKCHIP_TIMER bool "Rockchip timer driver" if COMPILE_TEST diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile index d227d1314f14..2b5b56a6f00f 100644 --- a/drivers/clocksource/Makefile +++ b/drivers/clocksource/Makefile @@ -17,7 +17,7 @@ obj-$(CONFIG_CLKSRC_MMIO) += mmio.o obj-$(CONFIG_DIGICOLOR_TIMER) += timer-digicolor.o obj-$(CONFIG_DW_APB_TIMER) += dw_apb_timer.o obj-$(CONFIG_DW_APB_TIMER_OF) += dw_apb_timer_of.o -obj-$(CONFIG_GEMINI_TIMER) += timer-gemini.o +obj-$(CONFIG_FTTMR010_TIMER) += timer-fttmr010.o obj-$(CONFIG_ROCKCHIP_TIMER) += rockchip_timer.o obj-$(CONFIG_CLKSRC_NOMADIK_MTU) += nomadik-mtu.o obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o diff --git a/drivers/clocksource/timer-gemini.c b/drivers/clocksource/timer-fttmr010.c similarity index 83% rename from drivers/clocksource/timer-gemini.c rename to drivers/clocksource/timer-fttmr010.c index dda27b7bf1a1..e37ec3d69a7e 100644 --- a/drivers/clocksource/timer-gemini.c +++ b/drivers/clocksource/timer-fttmr010.c @@ -1,5 +1,5 @@ /* - * Gemini timer driver + * Faraday Technology FTTMR010 timer driver * Copyright (C) 2017 Linus Walleij * * Based on a rewrite of arch/arm/mach-gemini/timer.c: @@ -77,12 +77,12 @@ static unsigned int tick_rate; static void __iomem *base; -static u64 notrace gemini_read_sched_clock(void) +static u64 notrace fttmr010_read_sched_clock(void) { return readl(base + TIMER3_COUNT); } -static int gemini_timer_set_next_event(unsigned long cycles, +static int fttmr010_timer_set_next_event(unsigned long cycles, struct clock_event_device *evt) { u32 cr; @@ -96,7 +96,7 @@ static int gemini_timer_set_next_event(unsigned long cycles, return 0; } -static int gemini_timer_shutdown(struct clock_event_device *evt) +static int fttmr010_timer_shutdown(struct clock_event_device *evt) { u32 cr; @@ -127,7 +127,7 @@ static int gemini_timer_shutdown(struct clock_event_device *evt) return 0; } -static int gemini_timer_set_periodic(struct clock_event_device *evt) +static int fttmr010_timer_set_periodic(struct clock_event_device *evt) { u32 period = DIV_ROUND_CLOSEST(tick_rate, HZ); u32 cr; @@ -158,35 +158,35 @@ static int gemini_timer_set_periodic(struct clock_event_device *evt) } /* Use TIMER1 as clock event */ -static struct clock_event_device gemini_clockevent = { +static struct clock_event_device fttmr010_clockevent = { .name = "TIMER1", /* Reasonably fast and accurate clock event */ .rating = 300, .shift = 32, .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, - .set_next_event = gemini_timer_set_next_event, - .set_state_shutdown = gemini_timer_shutdown, - .set_state_periodic = gemini_timer_set_periodic, - .set_state_oneshot = gemini_timer_shutdown, - .tick_resume = gemini_timer_shutdown, + .set_next_event = fttmr010_timer_set_next_event, + .set_state_shutdown = fttmr010_timer_shutdown, + .set_state_periodic = fttmr010_timer_set_periodic, + .set_state_oneshot = fttmr010_timer_shutdown, + .tick_resume = fttmr010_timer_shutdown, }; /* * IRQ handler for the timer */ -static irqreturn_t gemini_timer_interrupt(int irq, void *dev_id) +static irqreturn_t fttmr010_timer_interrupt(int irq, void *dev_id) { - struct clock_event_device *evt = &gemini_clockevent; + struct clock_event_device *evt = &fttmr010_clockevent; evt->event_handler(evt); return IRQ_HANDLED; } -static struct irqaction gemini_timer_irq = { - .name = "Gemini Timer Tick", +static struct irqaction fttmr010_timer_irq = { + .name = "Faraday FTTMR010 Timer Tick", .flags = IRQF_TIMER, - .handler = gemini_timer_interrupt, + .handler = fttmr010_timer_interrupt, }; static int __init gemini_timer_of_init(struct device_node *np) @@ -255,9 +255,9 @@ static int __init gemini_timer_of_init(struct device_node *np) writel(0, base + TIMER3_MATCH1); writel(0, base + TIMER3_MATCH2); clocksource_mmio_init(base + TIMER3_COUNT, - "gemini_clocksource", tick_rate, + "fttmr010_clocksource", tick_rate, 300, 32, clocksource_mmio_readl_up); - sched_clock_register(gemini_read_sched_clock, 32, tick_rate); + sched_clock_register(fttmr010_read_sched_clock, 32, tick_rate); /* * Setup clockevent timer (interrupt-driven.) @@ -266,12 +266,11 @@ static int __init gemini_timer_of_init(struct device_node *np) writel(0, base + TIMER1_LOAD); writel(0, base + TIMER1_MATCH1); writel(0, base + TIMER1_MATCH2); - setup_irq(irq, &gemini_timer_irq); - gemini_clockevent.cpumask = cpumask_of(0); - clockevents_config_and_register(&gemini_clockevent, tick_rate, + setup_irq(irq, &fttmr010_timer_irq); + fttmr010_clockevent.cpumask = cpumask_of(0); + clockevents_config_and_register(&fttmr010_clockevent, tick_rate, 1, 0xffffffff); return 0; } -CLOCKSOURCE_OF_DECLARE(nomadik_mtu, "cortina,gemini-timer", - gemini_timer_of_init); +CLOCKSOURCE_OF_DECLARE(gemini, "cortina,gemini-timer", gemini_timer_of_init);