clk: rockchip: rk3588: Remove SECURECRU reset definitions
Subsystems (2)
PATCH 1/1 clk: rockchip: rk3588: Remove SECURECRU reset definitions
On RK3588 the SECURECRU register bank (mapped at 0xFD7D0000) is exclusively accessible to the TrustZone firmware running at EL3. Any direct MMIO read or write to these addresses from the non-secure Linux kernel (EL1) triggers an asynchronous bus fault and a fatal system panic.
The non-secure CRU driver in rst-rk3588.c currently contains 17 reset entries backed by RK3588_SECURECRU_RESET_OFFSET, which calculates offsets into this protected range. These definitions are unreachable in practice — any driver that calls reset_control_assert/deassert on one of them will fault the system — and their presence is a source of confusion and latent danger.
Remove the RK3588_SECURECRU_RESET_OFFSET macro and all 17 associated reset table entries. Peripherals whose reset lines are controlled by SECURECRU (crypto core, keyladder, TRNG, secure SDMMC, etc.) must instead obtain their resets through the SCMI firmware protocol, using the &scmi_reset phandle in device tree.
No existing in-tree driver is affected: none of the removed IDs (SRST_CRYPTO_CORE, SRST_CRYPTO_PKA, etc.) are referenced outside this file and its corresponding header.
--- drivers/clk/rockchip/rst-rk3588.c | 42 ------------------------------- 1 file changed, 42 deletions(-)
drivers/clk/rockchip/rst-rk3588.c +0 -42
@@ -16,9 +16,6 @@/* 0xFD7C8000 + 0x0A00 */ #define RK3588_PHPTOPCRU_RESET_OFFSET (id, reg, bit) [id] = (0x8000*4 + reg * 16 + bit) -/* 0xFD7D0000 + 0x0A00 */ -#define RK3588_SECURECRU_RESET_OFFSET (id, reg, bit) [id] = (0x10000*4 + reg * 16 + bit) -/* 0xFD7F0000 + 0x0A00 */ #define RK3588_PMU1CRU_RESET_OFFSET (id, reg, bit) [id] = (0x30000*4 + reg * 16 + bit)
@@ -807,45 +804,6 @@ static const int rk3588_register_offset[] = {RK3588_PMU1CRU_RESET_OFFSET (SRST_P_PMU0IOC ,5 ,4 ),RK3588_PMU1CRU_RESET_OFFSET (SRST_P_GPIO0 ,5 ,5 ), RK3588_PMU1CRU_RESET_OFFSET(SRST_GPIO0, 5, 6), - -/* SECURECRU_SOFTRST_CON00 */ -RK3588_SECURECRU_RESET_OFFSET (SRST_A_SECURE_NS_BIU ,0 ,10 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_H_SECURE_NS_BIU ,0 ,11 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_A_SECURE_S_BIU ,0 ,12 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_H_SECURE_S_BIU ,0 ,13 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_P_SECURE_S_BIU ,0 ,14 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_CRYPTO_CORE ,0 ,15 ), - -/* SECURECRU_SOFTRST_CON01 */ -RK3588_SECURECRU_RESET_OFFSET (SRST_CRYPTO_PKA ,1 ,0 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_CRYPTO_RNG ,1 ,1 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_A_CRYPTO ,1 ,2 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_H_CRYPTO ,1 ,3 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_KEYLADDER_CORE ,1 ,9 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_KEYLADDER_RNG ,1 ,10 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_A_KEYLADDER ,1 ,11 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_H_KEYLADDER ,1 ,12 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_P_OTPC_S ,1 ,13 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_OTPC_S ,1 ,14 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_WDT_S ,1 ,15 ), - -/* SECURECRU_SOFTRST_CON02 */ -RK3588_SECURECRU_RESET_OFFSET (SRST_T_WDT_S ,2 ,0 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_H_BOOTROM ,2 ,1 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_A_DCF ,2 ,2 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_P_DCF ,2 ,3 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_H_BOOTROM_NS ,2 ,5 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_P_KEYLADDER ,2 ,14 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_H_TRNG_S ,2 ,15 ), - -/* SECURECRU_SOFTRST_CON03 */ -RK3588_SECURECRU_RESET_OFFSET (SRST_H_TRNG_NS ,3 ,0 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_D_SDMMC_BUFFER ,3 ,1 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_H_SDMMC ,3 ,2 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_H_SDMMC_BUFFER ,3 ,3 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_SDMMC ,3 ,4 ), -RK3588_SECURECRU_RESET_OFFSET (SRST_P_TRNG_CHK ,3 ,5 ), - RK3588_SECURECRU_RESET_OFFSET(SRST_TRNG_S, 3, 6), };void rk3588_rst_init (struct device_node *np,void __iomem *reg_base)
Signature · 7 lines
2.47.3 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip