[PULL 04/29] hw/arm/smmuv3-common: Add NSCFG bit definition for CD

Philippe Mathieu-Daudé posted 29 patches 2 weeks, 5 days ago
Maintainers: Tao Tang <tangtao1634@phytium.com.cn>, Peter Maydell <peter.maydell@linaro.org>, Jean-Christophe Dubois <jcd@tribudubois.net>, Eric Auger <eric.auger@redhat.com>, Paul Burton <paulburton@kernel.org>, Aleksandar Rikalo <arikalo@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Gerd Hoffmann <kraxel@redhat.com>, Bernhard Beschow <shentey@gmail.com>, Bin Meng <bmeng.cn@gmail.com>, Alexander Graf <graf@amazon.com>, Dorjoy Chowdhury <dorjoychy111@gmail.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>
[PULL 04/29] hw/arm/smmuv3-common: Add NSCFG bit definition for CD
Posted by Philippe Mathieu-Daudé 2 weeks, 5 days ago
From: Tao Tang <tangtao1634@phytium.com.cn>

Add NSCFG bit definition for CD structure. This allows proper
configuration of non-secure access settings in CD.

Signed-off-by: Tao Tang <tangtao1634@phytium.com.cn>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-ID: <20260119161112.3841386-5-tangtao1634@phytium.com.cn>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/arm/smmuv3-common.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/hw/arm/smmuv3-common.h b/include/hw/arm/smmuv3-common.h
index f0e1dd85715..e8e7746d1fa 100644
--- a/include/hw/arm/smmuv3-common.h
+++ b/include/hw/arm/smmuv3-common.h
@@ -123,11 +123,13 @@ REG32(CD_1, 4)
     FIELD(CD_1, A, 14, 1)
     FIELD(CD_1, ASID, 16, 16)
 REG32(CD_2, 8)
+    FIELD(CD_2, NSCFG0, 0, 1)
     FIELD(CD_2, HAD0, 1, 1)
     FIELD(CD_2, TTB0_LO, 4, 28)
 REG32(CD_3, 12)
     FIELD(CD_3, TTB0_HI, 0, 20)
 REG32(CD_4, 16)
+    FIELD(CD_4, NSCFG1, 0, 1)
     FIELD(CD_4, HAD1, 1, 1)
     FIELD(CD_4, TTB1_LO, 4, 28)
 REG32(CD_5, 20)
@@ -155,6 +157,9 @@ REG32(CD_5, 20)
 #define CD_R(x)          FIELD_EX32((x)->word[1], CD_1, R)
 #define CD_A(x)          FIELD_EX32((x)->word[1], CD_1, A)
 #define CD_ASID(x)       FIELD_EX32((x)->word[1], CD_1, ASID)
+#define CD_NSCFG(x, sel) ((sel) ?                                         \
+    FIELD_EX32((x)->word[4], CD_4, NSCFG1) :                              \
+    FIELD_EX32((x)->word[2], CD_2, NSCFG0))
 #define CD_HAD(x, sel)   ((sel) ?                                         \
     FIELD_EX32((x)->word[4], CD_4, HAD1) :                                \
     FIELD_EX32((x)->word[2], CD_2, HAD0))
-- 
2.52.0