lib: sbi: Fix hw a/d updating defaults

The Svade dt-binding description states that Svadu should only
be enabled at boot time when only Svadu is present in the DT.
Ensure that's the case. Also, when only Svadu is supported,
disable FWFT.PTE_AD_HW_UPDATING, as we need both to support
toggling.

Signed-off-by: Andrew Jones <andrew.jones@oss.qualcomm.com>
Reviewed-by: Radim Krčmář <radim.krcmar@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260401220845.190680-1-andrew.jones@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Andrew Jones
2026-04-01 17:08:45 -05:00
committed by Anup Patel
parent 8536a351fd
commit 5f13f9e13f
2 changed files with 19 additions and 9 deletions
+9 -1
View File
@@ -160,8 +160,16 @@ static int fwft_get_double_trap(struct fwft_config *conf, unsigned long *value)
static int fwft_adue_supported(struct fwft_config *conf)
{
/*
* FWFT.PTE_AD_HW_UPDATING is only supported when both Svade and Svadu
* are supported. We need both in order to support toggling and to
* ensure the reset value of zero is valid (it wouldn't be when only
* Svadu is supported).
*/
if (!sbi_hart_has_extension(sbi_scratch_thishart_ptr(),
SBI_HART_EXT_SVADU))
SBI_HART_EXT_SVADU) ||
!sbi_hart_has_extension(sbi_scratch_thishart_ptr(),
SBI_HART_EXT_SVADE))
return SBI_ENOTSUPP;
return SBI_OK;