Commit cd537561 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Daniel Lezcano
Browse files

clocksource/drivers/ralink: Add Ralink System Tick Counter driver



System Tick Counter is present on Ralink SoCs RT3352 and MT7620. This
driver has been in 'arch/mips/ralink' directory since the beggining of
Ralink architecture support. However, it can be moved into a more proper
place in 'drivers/clocksource'. Hence add it here adding also support for
compile test targets and reducing LOC in architecture code folder.

Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20241028203643.191268-2-sergio.paracuellos@gmail.com


Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent dfe101bc
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
if RALINK

config CLKEVT_RT3352
	bool
	depends on SOC_RT305X || SOC_MT7620
	default y
	select TIMER_OF
	select CLKSRC_MMIO

config RALINK_ILL_ACC
	bool
	depends on SOC_RT305X
+0 −2
Original line number Diff line number Diff line
@@ -10,8 +10,6 @@ ifndef CONFIG_MIPS_GIC
	obj-y += clk.o timer.o
endif

obj-$(CONFIG_CLKEVT_RT3352) += cevt-rt3352.o

obj-$(CONFIG_RALINK_ILL_ACC) += ill_acc.o

obj-$(CONFIG_IRQ_INTC) += irq.o
+9 −0
Original line number Diff line number Diff line
@@ -754,4 +754,13 @@ config EP93XX_TIMER
	  Enables support for the Cirrus Logic timer block
	  EP93XX.

config RALINK_TIMER
	bool "Ralink System Tick Counter"
	depends on SOC_RT305X || SOC_MT7620 || COMPILE_TEST
	select CLKSRC_MMIO
	select TIMER_OF
	help
	  Enables support for system tick counter present on
	  Ralink SoCs RT3352 and MT7620.

endmenu
+1 −0
Original line number Diff line number Diff line
@@ -91,3 +91,4 @@ obj-$(CONFIG_GOLDFISH_TIMER) += timer-goldfish.o
obj-$(CONFIG_GXP_TIMER)			+= timer-gxp.o
obj-$(CONFIG_CLKSRC_LOONGSON1_PWM)	+= timer-loongson1-pwm.o
obj-$(CONFIG_EP93XX_TIMER)		+= timer-ep93xx.o
obj-$(CONFIG_RALINK_TIMER)		+= timer-ralink.o
+4 −7
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/*
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 * Ralink System Tick Counter driver present on RT3352 and MT7620 SoCs.
 *
 * Copyright (C) 2013 by John Crispin <john@phrozen.org>
 */
@@ -16,8 +15,6 @@
#include <linux/of_irq.h>
#include <linux/of_address.h>

#include <asm/mach-ralink/ralink_regs.h>

#define SYSTICK_FREQ		(50 * 1000)

#define SYSTICK_CONFIG		0x00