xref: /rk3399_rockchip-uboot/arch/xtensa/lib/misc.S (revision c978b52410016b0ab5a213f235596340af8d45f7)
1*c978b524SChris Zankel/*
2*c978b524SChris Zankel * Miscellaneous assembly functions.
3*c978b524SChris Zankel *
4*c978b524SChris Zankel * Copyright (C) 2001 - 2007 Tensilica Inc.
5*c978b524SChris Zankel * Copyright (C) 2014 - 2016 Cadence Design Systems Inc.
6*c978b524SChris Zankel *
7*c978b524SChris Zankel * Chris Zankel	<chris@zankel.net>
8*c978b524SChris Zankel *
9*c978b524SChris Zankel * SPDX-License-Identifier:	GPL-2.0+
10*c978b524SChris Zankel */
11*c978b524SChris Zankel
12*c978b524SChris Zankel
13*c978b524SChris Zankel#include <linux/linkage.h>
14*c978b524SChris Zankel#include <asm/asmmacro.h>
15*c978b524SChris Zankel#include <asm/cacheasm.h>
16*c978b524SChris Zankel
17*c978b524SChris Zankel/*
18*c978b524SChris Zankel * void __invalidate_icache_page(ulong start)
19*c978b524SChris Zankel */
20*c978b524SChris Zankel
21*c978b524SChris ZankelENTRY(__invalidate_icache_page)
22*c978b524SChris Zankel
23*c978b524SChris Zankel	abi_entry
24*c978b524SChris Zankel
25*c978b524SChris Zankel	___invalidate_icache_page a2 a3
26*c978b524SChris Zankel	isync
27*c978b524SChris Zankel
28*c978b524SChris Zankel	abi_ret
29*c978b524SChris Zankel
30*c978b524SChris ZankelENDPROC(__invalidate_icache_page)
31*c978b524SChris Zankel
32*c978b524SChris Zankel/*
33*c978b524SChris Zankel * void __invalidate_dcache_page(ulong start)
34*c978b524SChris Zankel */
35*c978b524SChris Zankel
36*c978b524SChris ZankelENTRY(__invalidate_dcache_page)
37*c978b524SChris Zankel
38*c978b524SChris Zankel	abi_entry
39*c978b524SChris Zankel
40*c978b524SChris Zankel	___invalidate_dcache_page a2 a3
41*c978b524SChris Zankel	dsync
42*c978b524SChris Zankel
43*c978b524SChris Zankel	abi_ret
44*c978b524SChris Zankel
45*c978b524SChris ZankelENDPROC(__invalidate_dcache_page)
46*c978b524SChris Zankel
47*c978b524SChris Zankel/*
48*c978b524SChris Zankel * void __flush_invalidate_dcache_page(ulong start)
49*c978b524SChris Zankel */
50*c978b524SChris Zankel
51*c978b524SChris ZankelENTRY(__flush_invalidate_dcache_page)
52*c978b524SChris Zankel
53*c978b524SChris Zankel	abi_entry
54*c978b524SChris Zankel
55*c978b524SChris Zankel	___flush_invalidate_dcache_page a2 a3
56*c978b524SChris Zankel
57*c978b524SChris Zankel	dsync
58*c978b524SChris Zankel	abi_ret
59*c978b524SChris Zankel
60*c978b524SChris ZankelENDPROC(__flush_invalidate_dcache_page)
61*c978b524SChris Zankel
62*c978b524SChris Zankel/*
63*c978b524SChris Zankel * void __flush_dcache_page(ulong start)
64*c978b524SChris Zankel */
65*c978b524SChris Zankel
66*c978b524SChris ZankelENTRY(__flush_dcache_page)
67*c978b524SChris Zankel
68*c978b524SChris Zankel	abi_entry
69*c978b524SChris Zankel
70*c978b524SChris Zankel	___flush_dcache_page a2 a3
71*c978b524SChris Zankel
72*c978b524SChris Zankel	dsync
73*c978b524SChris Zankel	abi_ret
74*c978b524SChris Zankel
75*c978b524SChris ZankelENDPROC(__flush_dcache_page)
76*c978b524SChris Zankel
77*c978b524SChris Zankel/*
78*c978b524SChris Zankel * void __invalidate_icache_range(ulong start, ulong size)
79*c978b524SChris Zankel */
80*c978b524SChris Zankel
81*c978b524SChris ZankelENTRY(__invalidate_icache_range)
82*c978b524SChris Zankel
83*c978b524SChris Zankel	abi_entry
84*c978b524SChris Zankel
85*c978b524SChris Zankel	___invalidate_icache_range a2 a3 a4
86*c978b524SChris Zankel	isync
87*c978b524SChris Zankel
88*c978b524SChris Zankel	abi_ret
89*c978b524SChris Zankel
90*c978b524SChris ZankelENDPROC(__invalidate_icache_range)
91*c978b524SChris Zankel
92*c978b524SChris Zankel/*
93*c978b524SChris Zankel * void __flush_invalidate_dcache_range(ulong start, ulong size)
94*c978b524SChris Zankel */
95*c978b524SChris Zankel
96*c978b524SChris ZankelENTRY(__flush_invalidate_dcache_range)
97*c978b524SChris Zankel
98*c978b524SChris Zankel	abi_entry
99*c978b524SChris Zankel
100*c978b524SChris Zankel	___flush_invalidate_dcache_range a2 a3 a4
101*c978b524SChris Zankel	dsync
102*c978b524SChris Zankel
103*c978b524SChris Zankel	abi_ret
104*c978b524SChris Zankel
105*c978b524SChris ZankelENDPROC(__flush_invalidate_dcache_range)
106*c978b524SChris Zankel
107*c978b524SChris Zankel/*
108*c978b524SChris Zankel * void _flush_dcache_range(ulong start, ulong size)
109*c978b524SChris Zankel */
110*c978b524SChris Zankel
111*c978b524SChris ZankelENTRY(__flush_dcache_range)
112*c978b524SChris Zankel
113*c978b524SChris Zankel	abi_entry
114*c978b524SChris Zankel
115*c978b524SChris Zankel	___flush_dcache_range a2 a3 a4
116*c978b524SChris Zankel	dsync
117*c978b524SChris Zankel
118*c978b524SChris Zankel	abi_ret
119*c978b524SChris Zankel
120*c978b524SChris ZankelENDPROC(__flush_dcache_range)
121*c978b524SChris Zankel
122*c978b524SChris Zankel/*
123*c978b524SChris Zankel * void _invalidate_dcache_range(ulong start, ulong size)
124*c978b524SChris Zankel */
125*c978b524SChris Zankel
126*c978b524SChris ZankelENTRY(__invalidate_dcache_range)
127*c978b524SChris Zankel
128*c978b524SChris Zankel	abi_entry
129*c978b524SChris Zankel
130*c978b524SChris Zankel	___invalidate_dcache_range a2 a3 a4
131*c978b524SChris Zankel
132*c978b524SChris Zankel	abi_ret
133*c978b524SChris Zankel
134*c978b524SChris ZankelENDPROC(__invalidate_dcache_range)
135*c978b524SChris Zankel
136*c978b524SChris Zankel/*
137*c978b524SChris Zankel * void _invalidate_icache_all(void)
138*c978b524SChris Zankel */
139*c978b524SChris Zankel
140*c978b524SChris ZankelENTRY(__invalidate_icache_all)
141*c978b524SChris Zankel
142*c978b524SChris Zankel	abi_entry
143*c978b524SChris Zankel
144*c978b524SChris Zankel	___invalidate_icache_all a2 a3
145*c978b524SChris Zankel	isync
146*c978b524SChris Zankel
147*c978b524SChris Zankel	abi_ret
148*c978b524SChris Zankel
149*c978b524SChris ZankelENDPROC(__invalidate_icache_all)
150*c978b524SChris Zankel
151*c978b524SChris Zankel/*
152*c978b524SChris Zankel * void _flush_invalidate_dcache_all(void)
153*c978b524SChris Zankel */
154*c978b524SChris Zankel
155*c978b524SChris ZankelENTRY(__flush_invalidate_dcache_all)
156*c978b524SChris Zankel
157*c978b524SChris Zankel	abi_entry
158*c978b524SChris Zankel
159*c978b524SChris Zankel	___flush_invalidate_dcache_all a2 a3
160*c978b524SChris Zankel	dsync
161*c978b524SChris Zankel
162*c978b524SChris Zankel	abi_ret
163*c978b524SChris Zankel
164*c978b524SChris ZankelENDPROC(__flush_invalidate_dcache_all)
165*c978b524SChris Zankel
166*c978b524SChris Zankel/*
167*c978b524SChris Zankel * void _invalidate_dcache_all(void)
168*c978b524SChris Zankel */
169*c978b524SChris Zankel
170*c978b524SChris ZankelENTRY(__invalidate_dcache_all)
171*c978b524SChris Zankel
172*c978b524SChris Zankel	abi_entry
173*c978b524SChris Zankel
174*c978b524SChris Zankel	___invalidate_dcache_all a2 a3
175*c978b524SChris Zankel	dsync
176*c978b524SChris Zankel
177*c978b524SChris Zankel	abi_ret
178*c978b524SChris Zankel
179*c978b524SChris ZankelENDPROC(__invalidate_dcache_all)
180