[PATCH 0/2] Realtek Otto timer/counter support

From: Sander Vanheule
Date: Sun Jan 16 2022 - 16:40:01 EST


Realtek's family of networking SoCs (RTL838x, RTL839x, RTL930x, RTL931x)
have a set of timers. These patches seek to provide a devicetree binding
for them, and a first implementation of the driver.

Most of these SoCs can use the MIPS clocksource and clockevent timers,
but the CEVT_R4K timer on the RTL930x series was left disconnected. This
series therefore requires these timers to be able to function.

Except for the RTL838x series, these SoCs also support some form of SMP,
but this is not yet implemented as the platform's IRQ driver does not
support this yet. The driver also implements a fixed divider for the
timer's internal clock, since this is good enough at this point.

I've tested this driver on RTL8380, RTL8393, and RTL9302 SoCs, running
in single-CPU mode. When replacing the CEVT_R4K timer, these platforms
then function as expected.

There's probably still other things that I missed, but I currently have
the following questions:
- If the internal clock is added later, should this be added to the
devicetree as a self-referenced clock? It's not possible to use this
clock outside of the timer, so I guess it would mainly be to allow the
DT code to build a complete overview of the clock hierarchy.
- When adding SMP support, what would be the best way to configure the
CPU affinity? And what does FEAT_DYNIRQ imply exactly?

Best,
Sander

Sander Vanheule (2):
dt-bindings: timer: Add realtek,otto-tc binding
clocksource/drivers: Add Realtek Otto timer driver

.../bindings/timer/realtek,otto-tc.yaml | 64 ++++++
MAINTAINERS | 6 +
drivers/clocksource/Kconfig | 8 +
drivers/clocksource/Makefile | 1 +
drivers/clocksource/timer-realtek-otto.c | 216 ++++++++++++++++++
5 files changed, 295 insertions(+)
create mode 100644 Documentation/devicetree/bindings/timer/realtek,otto-tc.yaml
create mode 100644 drivers/clocksource/timer-realtek-otto.c

--
2.34.1