realtek: clock driver: simplify magic register values
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Tue, 6 Sep 2022 07:22:11 +0000 (09:22 +0200)
committerSander Vanheule <sander@svanheule.net>
Mon, 26 Dec 2022 19:29:36 +0000 (20:29 +0100)
commit0b35b0dd56de95040b4991563d669a543fd7f267
treea28a9615bb8b6e7f5edef42e845aca1f2a9627fb
parent6dbc48ad11169e1fcc0d3184c2766f277de92ee3
realtek: clock driver: simplify magic register values

For simplicity we use register magic values. We simply read/write full registers
but only some of the bits are relevant. So we might overwrite data that is
different depending on the vendor. For simplification we will handle constants
as follows:

- constants are right shifted and contain only relevant bits
- the code will left shift the values as needed
- the code will run a read-modify-write cycle
- As syncs are not needed for registers we can drop that part

Btw. SRAM can be access cached/uncached. When using parts of it make clear that
we access the cached part.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
[svanheule: remove reflowed comments]
target/linux/realtek/files-5.10/drivers/clk/realtek/clk-rtl838x-sram.S
target/linux/realtek/files-5.10/drivers/clk/realtek/clk-rtl839x-sram.S
target/linux/realtek/files-5.10/drivers/clk/realtek/clk-rtl83xx.c
target/linux/realtek/files-5.10/drivers/clk/realtek/clk-rtl83xx.h