All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: mediatek: add missing arch timer configuration for MT7629
@ 2019-07-10  9:35 Weijie Gao
  2019-07-18 23:59 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Weijie Gao @ 2019-07-10  9:35 UTC (permalink / raw)
  To: u-boot

This patch sets CNTVOFF of ARM CP15 timer to zero to make sure the virtual
counter is fully usable for linux kernel.

Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
---
 arch/arm/mach-mediatek/mt7629/lowlevel_init.S | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/mach-mediatek/mt7629/lowlevel_init.S b/arch/arm/mach-mediatek/mt7629/lowlevel_init.S
index 3375796b79..0a0672cbea 100644
--- a/arch/arm/mach-mediatek/mt7629/lowlevel_init.S
+++ b/arch/arm/mach-mediatek/mt7629/lowlevel_init.S
@@ -4,6 +4,7 @@
  */
 
 #include <linux/linkage.h>
+#include <asm/proc-armv/ptrace.h>
 
 #define WAIT_CODE_SRAM_BASE	0x0010ff00
 
@@ -27,6 +28,18 @@ ENTRY(lowlevel_init)
 	movt	r0, #0x131
 	mcr	p15, 0, r0, c14, c0, 0
 
+	cps	#MON_MODE
+	mrc	p15, 0, r1, c1, c1, 0	@ Get Secure Config
+	orr	r0, r1, #1
+	mcr	p15, 0, r0, c1, c1, 0	@ Set Non Secure bit
+	isb
+	mov	r0, #0
+	mcrr	p15, 4, r0, r0, c14	@ CNTVOFF = 0
+	isb
+	mcr	p15, 0, r1, c1, c1, 0	@ Set Secure bit
+	isb
+	cps	#SVC_MODE
+
 	/* enable SMP bit */
 	mrc	p15, 0, r0, c1, c0, 1
 	orr	r0, r0, #0x40
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] arm: mediatek: add missing arch timer configuration for MT7629
  2019-07-10  9:35 [U-Boot] [PATCH] arm: mediatek: add missing arch timer configuration for MT7629 Weijie Gao
@ 2019-07-18 23:59 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2019-07-18 23:59 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 10, 2019 at 05:35:42PM +0800, Weijie Gao wrote:

> This patch sets CNTVOFF of ARM CP15 timer to zero to make sure the virtual
> counter is fully usable for linux kernel.
> 
> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190718/71e9748c/attachment.sig>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-18 23:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10  9:35 [U-Boot] [PATCH] arm: mediatek: add missing arch timer configuration for MT7629 Weijie Gao
2019-07-18 23:59 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.