Newer
Older
buildroot-MynaPlayer / board / myna-player-odyssey / initramfs_patches / arm-trusted-firmware / 0003-aarch32-add-virtual-timer-control-support.patch
@Xogium Xogium on 5 Aug 2020 1 KB Initial commit.
From 7e3d16e5f993271e20136e732cebc78fd90adddb Mon Sep 17 00:00:00 2001
From: Yann Gautier <yann.gautier@st.com>
Date: Tue, 21 May 2019 18:46:27 +0200
Subject: [PATCH 3/7] aarch32: add virtual timer control support

Define virtual timer resources for a platform to be able to control
virtual timers, even if TF-A does not enable them.
This is required for example when the secure world wants to reset
the system. Virtual timers enabled from non-secure world can
jeopardize the reset sequence due to pending interrupts.

Change-Id: Ieb0ce4819809ae9c4ab11f9244a6cacf9437d6b4
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
---
 include/arch/aarch32/arch.h         | 3 +++
 include/arch/aarch32/arch_helpers.h | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/include/arch/aarch32/arch.h b/include/arch/aarch32/arch.h
index 047770e4f..edf12873d 100644
--- a/include/arch/aarch32/arch.h
+++ b/include/arch/aarch32/arch.h
@@ -522,6 +522,9 @@
 #define HSTR		p15, 4, c1, c1, 3
 #define CNTHCTL		p15, 4, c14, c1, 0
 #define CNTKCTL		p15, 0, c14, c1, 0
+#define CNTP_TVAL	p15, 0, c14, c2, 0
+#define CNTP_CTL	p15, 0, c14, c2, 1
+#define CNTV_CTL	p15, 0, c14, c3, 1
 #define VPIDR		p15, 4, c0, c0, 0
 #define VMPIDR		p15, 4, c0, c0, 5
 #define ISR		p15, 0, c12, c1, 0
diff --git a/include/arch/aarch32/arch_helpers.h b/include/arch/aarch32/arch_helpers.h
index cbac84b93..b060f855c 100644
--- a/include/arch/aarch32/arch_helpers.h
+++ b/include/arch/aarch32/arch_helpers.h
@@ -246,6 +246,9 @@ DEFINE_COPROCR_RW_FUNCS_64(ttbr1, TTBR1_64)
 DEFINE_COPROCR_RW_FUNCS_64(cntvoff, CNTVOFF_64)
 DEFINE_COPROCR_RW_FUNCS(csselr, CSSELR)
 DEFINE_COPROCR_RW_FUNCS(hstr, HSTR)
+DEFINE_COPROCR_RW_FUNCS(cntp_tval, CNTP_TVAL)
+DEFINE_COPROCR_RW_FUNCS(cntp_ctl, CNTP_CTL)
+DEFINE_COPROCR_RW_FUNCS(cntv_ctl, CNTV_CTL)
 DEFINE_COPROCR_RW_FUNCS(cnthp_ctl_el2, CNTHP_CTL)
 DEFINE_COPROCR_RW_FUNCS(cnthp_tval_el2, CNTHP_TVAL)
 DEFINE_COPROCR_RW_FUNCS_64(cnthp_cval_el2, CNTHP_CVAL_64)
-- 
2.27.0