realtek: add RTL83XX clock driver
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Thu, 25 Aug 2022 06:22:01 +0000 (08:22 +0200)
committerSander Vanheule <sander@svanheule.net>
Sun, 28 Aug 2022 09:30:58 +0000 (11:30 +0200)
commit4850bd887c3aeac10cee3cd6e96bf2418dd98c93
tree6a170552af39fda42ac6cf2df04eea4e5b93c033
parent1efaad03bb20e9aee458d30427cf00170fbe8fa2
realtek: add RTL83XX clock driver

Add a new self-contained combined clock & platform driver that allows to
access the PLL hardware clocks of RTL83XX devices. Currently it provides
info about CPU, MEM and LXB clocks on RTL838X and RTL839X devices and
additionally allows to change the CPU clocks. Changing the clocks
multiple times on a DGS-1210-20 and a DGS-1210-52 already works well and
is multithreading safe on the RTL839X. Even a cpufreq initiated change
of the CPU clock works fine. Loading the driver will add some meaningful
logging.

[0.000000] rtl83xx-clk: initialized, CPU 500 MHz, MEM 300 MHz (8 Bit DDR3), LXB 200 MHz
[0.279456] rtl83xx-clk soc:clock-controller: rate setting enabled, CPU 325-600 MHz,
           MEM 300-300 MHz, LXB 200-200 MHz, OVERCLOCK AT OWN RISK

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
[remove trailing whitespaces, C-style SPDX comments for ASM and headers]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
target/linux/realtek/files-5.10/drivers/clk/realtek/Kconfig [new file with mode: 0644]
target/linux/realtek/files-5.10/drivers/clk/realtek/Makefile [new file with mode: 0644]
target/linux/realtek/files-5.10/drivers/clk/realtek/clk-rtl838x-sram.S [new file with mode: 0644]
target/linux/realtek/files-5.10/drivers/clk/realtek/clk-rtl839x-sram.S [new file with mode: 0644]
target/linux/realtek/files-5.10/drivers/clk/realtek/clk-rtl83xx.c [new file with mode: 0644]
target/linux/realtek/files-5.10/drivers/clk/realtek/clk-rtl83xx.h [new file with mode: 0644]