/* SPDX-License-Identifier: GPL-2.0 */1/*2* Copyright (C) 2014 Renesas Electronics Corporation3*4* Initialization of CNTVOFF register from secure mode5*6*/78#include <linux/linkage.h>9#include <asm/assembler.h>1011ENTRY(secure_cntvoff_init)12.arch armv7-a13/*14* CNTVOFF has to be initialized either from non-secure Hypervisor15* mode or secure Monitor mode with SCR.NS==1. If TrustZone is enabled16* then it should be handled by the secure code. The CPU must implement17* the virtualization extensions.18*/19cps #MON_MODE20mrc p15, 0, r1, c1, c1, 0 /* Get Secure Config */21orr r0, r1, #122mcr p15, 0, r0, c1, c1, 0 /* Set Non Secure bit */23isb24mov r0, #025mcrr p15, 4, r0, r0, c14 /* CNTVOFF = 0 */26isb27mcr p15, 0, r1, c1, c1, 0 /* Set Secure bit */28isb29cps #SVC_MODE30ret lr31ENDPROC(secure_cntvoff_init)323334