linux/drivers/soc
Andre Przywara f8cfe02a53 soc: sunxi: sram: export register 0 for THS on H616
The Allwinner H616 SoC contains a mysterious bit at register offset 0x0
in the SRAM control block. If bit 16 is set (the reset value), the
temperature readings of the THS are way off, leading to reports about
200C, at normal ambient temperatures. Clearing this bits brings the
reported values down to the expected values.
The BSP code clears this bit in firmware (U-Boot), and has an explicit
comment about this, but offers no real explanation.

Experiments in U-Boot show that register 0x0 has no effect on the SRAM C
visibility: all tested bit settings still allow full read and write
access by the CPU to the whole of SRAM C. Only bit 24 of the register at
offset 0x4 makes all of SRAM C inaccessible by the CPU. So modelling
the THS switch functionality as an SRAM region would not reflect reality.

Since we should not rely on firmware settings, allow other code (the THS
driver) to access this register, by exporting it through the already
existing regmap. This mimics what we already do for the LDO control and
the EMAC register.

To avoid concurrent accesses to the same register at the same time, by
the SRAM switch code and the regmap code, use the same lock to protect
the access. The regmap subsystem allows to use an existing lock, so we
just need to hook in there.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20240219153639.179814-2-andre.przywara@arm.com
2024-03-11 17:14:46 +01:00
..
amlogic
apple soc: apple: mailbox: error pointers are negative integers 2024-01-30 11:34:49 -08:00
aspeed
atmel
bcm SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
canaan
dove
fsl soc: fsl: cpm1: qmc: Introduce functions to change timeslots at runtime 2023-12-12 10:29:20 +01:00
fujitsu
gemini
hisilicon soc: hisilicon: kunpeng_hccs: Support the platform with PCC type3 and interrupt ack 2023-12-07 06:16:35 +00:00
imx - Move Kconfig files into the pmdomain subsystem 2023-11-01 13:09:46 -10:00
ixp4xx
lantiq
litex
loongson Convert drivers/soc to struct platform_driver::remove_new() 2023-10-16 22:51:31 +02:00
mediatek soc: mediatek: mtk-svs: Constify runtime-immutable members of svs_bank 2023-12-11 11:36:15 +01:00
microchip soc: microchip: mpfs: add auto-update subdev to system controller 2023-12-06 12:06:18 +00:00
nuvoton
pxa soc: pxa: ssp: fix casts 2024-01-09 08:25:29 +01:00
qcom drm-next for 6.8: 2024-01-12 11:32:19 -08:00
renesas soc: renesas: Make RZ/Five depend on !DMA_DIRECT_REMAP 2023-12-13 17:23:28 +01:00
rockchip SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
samsung soc: samsung: exynos-chipid: add exynosautov920 SoC support 2023-11-15 13:42:50 +01:00
sunxi soc: sunxi: sram: export register 0 for THS on H616 2024-03-11 17:14:46 +01:00
tegra SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
ti soc: ti: k3-socinfo: Add JTAG ID for J722S 2023-12-13 07:52:32 -06:00
ux500
versatile
xilinx Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
Kconfig soc: sifive: shunt ccache driver to drivers/cache 2023-11-22 11:49:25 +00:00
Makefile soc: sifive: shunt ccache driver to drivers/cache 2023-11-22 11:49:25 +00:00