1/* SPDX-License-Identifier: BSD-2-Clause */
2/*
3 * Copyright (c) 2014, STMicroelectronics International N.V.
4 * Copyright (c) 2017, Linaro Limited
5 */
6
7#include <arm32_macros.S>
8#include <asm.S>
9
10/* void tlbi_all(void); */
11FUNC tlbi_all , :
12	dsb	ishst		/* Sync with table update */
13	write_tlbiallis 	/* Invalidate TLBs */
14	dsb	ish		/* Sync with tlb invalidation completion */
15	isb			/* Sync execution on tlb update */
16	bx	lr
17END_FUNC tlbi_all
18
19/* void tlbi_mva_allasid(vaddr_t mva); */
20FUNC tlbi_mva_allasid , :
21	dsb	ishst		/* Sync with table update */
22	write_tlbimvaais r0	/* Inval TLB by MVA all ASID Inner Sharable */
23	dsb	ish		/* Sync with tlb invalidation completion */
24	isb			/* Sync execution on tlb update */
25	bx	lr
26END_FUNC tlbi_mva_allasid
27
28/* void tlbi_asid(unsigned long asid); */
29FUNC tlbi_asid , :
30	dsb	ishst		/* Sync with table update */
31	write_tlbiasidis r0	/* Inval unified TLB by ASID Inner Sharable */
32	orr	r0, r0, #1	/* Select the kernel ASID */
33	write_tlbiasidis r0	/* Inval unified TLB by ASID Inner Sharable */
34	dsb	ish		/* Sync with tlb invalidation completion */
35	isb			/* Sync execution on tlb update */
36	bx	lr
37END_FUNC tlbi_asid
38