Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 1 | /* |
Dan Handley | e83b0ca | 2014-01-14 18:17:09 +0000 | [diff] [blame] | 2 | * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions are met: |
| 6 | * |
| 7 | * Redistributions of source code must retain the above copyright notice, this |
| 8 | * list of conditions and the following disclaimer. |
| 9 | * |
| 10 | * Redistributions in binary form must reproduce the above copyright notice, |
| 11 | * this list of conditions and the following disclaimer in the documentation |
| 12 | * and/or other materials provided with the distribution. |
| 13 | * |
| 14 | * Neither the name of ARM nor the names of its contributors may be used |
| 15 | * to endorse or promote products derived from this software without specific |
| 16 | * prior written permission. |
| 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 28 | * POSSIBILITY OF SUCH DAMAGE. |
| 29 | */ |
| 30 | |
Dan Handley | 2bd4ef2 | 2014-04-09 13:14:54 +0100 | [diff] [blame] | 31 | #include <arch.h> |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 32 | #include <asm_macros.S> |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 33 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 34 | .globl read_vbar_el1 |
| 35 | .globl read_vbar_el2 |
| 36 | .globl read_vbar_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 37 | .globl write_vbar_el1 |
| 38 | .globl write_vbar_el2 |
| 39 | .globl write_vbar_el3 |
| 40 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 41 | .globl read_sctlr_el1 |
| 42 | .globl read_sctlr_el2 |
| 43 | .globl read_sctlr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 44 | .globl write_sctlr_el1 |
| 45 | .globl write_sctlr_el2 |
| 46 | .globl write_sctlr_el3 |
| 47 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 48 | .globl read_actlr_el1 |
| 49 | .globl read_actlr_el2 |
| 50 | .globl read_actlr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 51 | .globl write_actlr_el1 |
| 52 | .globl write_actlr_el2 |
| 53 | .globl write_actlr_el3 |
| 54 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 55 | .globl read_esr_el1 |
| 56 | .globl read_esr_el2 |
| 57 | .globl read_esr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 58 | .globl write_esr_el1 |
| 59 | .globl write_esr_el2 |
| 60 | .globl write_esr_el3 |
| 61 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 62 | .globl read_afsr0_el1 |
| 63 | .globl read_afsr0_el2 |
| 64 | .globl read_afsr0_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 65 | .globl write_afsr0_el1 |
| 66 | .globl write_afsr0_el2 |
| 67 | .globl write_afsr0_el3 |
| 68 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 69 | .globl read_afsr1_el1 |
| 70 | .globl read_afsr1_el2 |
| 71 | .globl read_afsr1_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 72 | .globl write_afsr1_el1 |
| 73 | .globl write_afsr1_el2 |
| 74 | .globl write_afsr1_el3 |
| 75 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 76 | .globl read_far_el1 |
| 77 | .globl read_far_el2 |
| 78 | .globl read_far_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 79 | .globl write_far_el1 |
| 80 | .globl write_far_el2 |
| 81 | .globl write_far_el3 |
| 82 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 83 | .globl read_mair_el1 |
| 84 | .globl read_mair_el2 |
| 85 | .globl read_mair_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 86 | .globl write_mair_el1 |
| 87 | .globl write_mair_el2 |
| 88 | .globl write_mair_el3 |
| 89 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 90 | .globl read_amair_el1 |
| 91 | .globl read_amair_el2 |
| 92 | .globl read_amair_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 93 | .globl write_amair_el1 |
| 94 | .globl write_amair_el2 |
| 95 | .globl write_amair_el3 |
| 96 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 97 | .globl read_rvbar_el1 |
| 98 | .globl read_rvbar_el2 |
| 99 | .globl read_rvbar_el3 |
| 100 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 101 | .globl read_rmr_el1 |
| 102 | .globl read_rmr_el2 |
| 103 | .globl read_rmr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 104 | .globl write_rmr_el1 |
| 105 | .globl write_rmr_el2 |
| 106 | .globl write_rmr_el3 |
| 107 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 108 | .globl read_tcr_el1 |
| 109 | .globl read_tcr_el2 |
| 110 | .globl read_tcr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 111 | .globl write_tcr_el1 |
| 112 | .globl write_tcr_el2 |
| 113 | .globl write_tcr_el3 |
| 114 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 115 | .globl read_cptr_el2 |
| 116 | .globl read_cptr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 117 | .globl write_cptr_el2 |
| 118 | .globl write_cptr_el3 |
| 119 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 120 | .globl read_ttbr0_el1 |
| 121 | .globl read_ttbr0_el2 |
| 122 | .globl read_ttbr0_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 123 | .globl write_ttbr0_el1 |
| 124 | .globl write_ttbr0_el2 |
| 125 | .globl write_ttbr0_el3 |
| 126 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 127 | .globl read_ttbr1_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 128 | .globl write_ttbr1_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 129 | |
| 130 | .globl read_cpacr |
| 131 | .globl write_cpacr |
| 132 | |
| 133 | .globl read_cntfrq |
| 134 | .globl write_cntfrq |
| 135 | |
| 136 | .globl read_cpuectlr |
| 137 | .globl write_cpuectlr |
| 138 | |
| 139 | .globl read_cnthctl_el2 |
| 140 | .globl write_cnthctl_el2 |
| 141 | |
| 142 | .globl read_cntfrq_el0 |
| 143 | .globl write_cntfrq_el0 |
| 144 | |
| 145 | .globl read_scr |
| 146 | .globl write_scr |
| 147 | |
| 148 | .globl read_hcr |
| 149 | .globl write_hcr |
| 150 | |
| 151 | .globl read_midr |
| 152 | .globl read_mpidr |
| 153 | |
| 154 | .globl read_current_el |
| 155 | .globl read_id_pfr1_el1 |
| 156 | .globl read_id_aa64pfr0_el1 |
| 157 | |
| 158 | #if SUPPORT_VFP |
| 159 | .globl enable_vfp |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 160 | #endif |
| 161 | |
| 162 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 163 | func read_current_el |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 164 | mrs x0, CurrentEl |
| 165 | ret |
| 166 | |
| 167 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 168 | func read_id_pfr1_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 169 | mrs x0, id_pfr1_el1 |
| 170 | ret |
| 171 | |
| 172 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 173 | func read_id_aa64pfr0_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 174 | mrs x0, id_aa64pfr0_el1 |
| 175 | ret |
| 176 | |
| 177 | |
| 178 | /* ----------------------------------------------------- |
| 179 | * VBAR accessors |
| 180 | * ----------------------------------------------------- |
| 181 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 182 | func read_vbar_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 183 | mrs x0, vbar_el1 |
| 184 | ret |
| 185 | |
| 186 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 187 | func read_vbar_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 188 | mrs x0, vbar_el2 |
| 189 | ret |
| 190 | |
| 191 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 192 | func read_vbar_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 193 | mrs x0, vbar_el3 |
| 194 | ret |
| 195 | |
| 196 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 197 | func write_vbar_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 198 | msr vbar_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 199 | ret |
| 200 | |
| 201 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 202 | func write_vbar_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 203 | msr vbar_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 204 | ret |
| 205 | |
| 206 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 207 | func write_vbar_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 208 | msr vbar_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 209 | ret |
| 210 | |
| 211 | |
| 212 | /* ----------------------------------------------------- |
| 213 | * AFSR0 accessors |
| 214 | * ----------------------------------------------------- |
| 215 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 216 | func read_afsr0_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 217 | mrs x0, afsr0_el1 |
| 218 | ret |
| 219 | |
| 220 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 221 | func read_afsr0_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 222 | mrs x0, afsr0_el2 |
| 223 | ret |
| 224 | |
| 225 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 226 | func read_afsr0_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 227 | mrs x0, afsr0_el3 |
| 228 | ret |
| 229 | |
| 230 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 231 | func write_afsr0_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 232 | msr afsr0_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 233 | ret |
| 234 | |
| 235 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 236 | func write_afsr0_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 237 | msr afsr0_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 238 | ret |
| 239 | |
| 240 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 241 | func write_afsr0_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 242 | msr afsr0_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 243 | ret |
| 244 | |
| 245 | |
| 246 | /* ----------------------------------------------------- |
| 247 | * FAR accessors |
| 248 | * ----------------------------------------------------- |
| 249 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 250 | func read_far_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 251 | mrs x0, far_el1 |
| 252 | ret |
| 253 | |
| 254 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 255 | func read_far_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 256 | mrs x0, far_el2 |
| 257 | ret |
| 258 | |
| 259 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 260 | func read_far_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 261 | mrs x0, far_el3 |
| 262 | ret |
| 263 | |
| 264 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 265 | func write_far_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 266 | msr far_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 267 | ret |
| 268 | |
| 269 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 270 | func write_far_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 271 | msr far_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 272 | ret |
| 273 | |
| 274 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 275 | func write_far_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 276 | msr far_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 277 | ret |
| 278 | |
| 279 | |
| 280 | /* ----------------------------------------------------- |
| 281 | * MAIR accessors |
| 282 | * ----------------------------------------------------- |
| 283 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 284 | func read_mair_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 285 | mrs x0, mair_el1 |
| 286 | ret |
| 287 | |
| 288 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 289 | func read_mair_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 290 | mrs x0, mair_el2 |
| 291 | ret |
| 292 | |
| 293 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 294 | func read_mair_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 295 | mrs x0, mair_el3 |
| 296 | ret |
| 297 | |
| 298 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 299 | func write_mair_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 300 | msr mair_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 301 | ret |
| 302 | |
| 303 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 304 | func write_mair_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 305 | msr mair_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 306 | ret |
| 307 | |
| 308 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 309 | func write_mair_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 310 | msr mair_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 311 | ret |
| 312 | |
| 313 | |
| 314 | /* ----------------------------------------------------- |
| 315 | * AMAIR accessors |
| 316 | * ----------------------------------------------------- |
| 317 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 318 | func read_amair_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 319 | mrs x0, amair_el1 |
| 320 | ret |
| 321 | |
| 322 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 323 | func read_amair_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 324 | mrs x0, amair_el2 |
| 325 | ret |
| 326 | |
| 327 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 328 | func read_amair_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 329 | mrs x0, amair_el3 |
| 330 | ret |
| 331 | |
| 332 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 333 | func write_amair_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 334 | msr amair_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 335 | ret |
| 336 | |
| 337 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 338 | func write_amair_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 339 | msr amair_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 340 | ret |
| 341 | |
| 342 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 343 | func write_amair_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 344 | msr amair_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 345 | ret |
| 346 | |
| 347 | |
| 348 | /* ----------------------------------------------------- |
| 349 | * RVBAR accessors |
| 350 | * ----------------------------------------------------- |
| 351 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 352 | func read_rvbar_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 353 | mrs x0, rvbar_el1 |
| 354 | ret |
| 355 | |
| 356 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 357 | func read_rvbar_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 358 | mrs x0, rvbar_el2 |
| 359 | ret |
| 360 | |
| 361 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 362 | func read_rvbar_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 363 | mrs x0, rvbar_el3 |
| 364 | ret |
| 365 | |
| 366 | |
| 367 | /* ----------------------------------------------------- |
| 368 | * RMR accessors |
| 369 | * ----------------------------------------------------- |
| 370 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 371 | func read_rmr_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 372 | mrs x0, rmr_el1 |
| 373 | ret |
| 374 | |
| 375 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 376 | func read_rmr_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 377 | mrs x0, rmr_el2 |
| 378 | ret |
| 379 | |
| 380 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 381 | func read_rmr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 382 | mrs x0, rmr_el3 |
| 383 | ret |
| 384 | |
| 385 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 386 | func write_rmr_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 387 | msr rmr_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 388 | ret |
| 389 | |
| 390 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 391 | func write_rmr_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 392 | msr rmr_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 393 | ret |
| 394 | |
| 395 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 396 | func write_rmr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 397 | msr rmr_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 398 | ret |
| 399 | |
| 400 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 401 | /* ----------------------------------------------------- |
| 402 | * AFSR1 accessors |
| 403 | * ----------------------------------------------------- |
| 404 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 405 | func read_afsr1_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 406 | mrs x0, afsr1_el1 |
| 407 | ret |
| 408 | |
| 409 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 410 | func read_afsr1_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 411 | mrs x0, afsr1_el2 |
| 412 | ret |
| 413 | |
| 414 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 415 | func read_afsr1_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 416 | mrs x0, afsr1_el3 |
| 417 | ret |
| 418 | |
| 419 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 420 | func write_afsr1_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 421 | msr afsr1_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 422 | ret |
| 423 | |
| 424 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 425 | func write_afsr1_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 426 | msr afsr1_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 427 | ret |
| 428 | |
| 429 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 430 | func write_afsr1_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 431 | msr afsr1_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 432 | ret |
| 433 | |
| 434 | |
| 435 | /* ----------------------------------------------------- |
| 436 | * SCTLR accessors |
| 437 | * ----------------------------------------------------- |
| 438 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 439 | func read_sctlr_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 440 | mrs x0, sctlr_el1 |
| 441 | ret |
| 442 | |
| 443 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 444 | func read_sctlr_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 445 | mrs x0, sctlr_el2 |
| 446 | ret |
| 447 | |
| 448 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 449 | func read_sctlr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 450 | mrs x0, sctlr_el3 |
| 451 | ret |
| 452 | |
| 453 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 454 | func write_sctlr_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 455 | msr sctlr_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 456 | ret |
| 457 | |
| 458 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 459 | func write_sctlr_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 460 | msr sctlr_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 461 | ret |
| 462 | |
| 463 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 464 | func write_sctlr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 465 | msr sctlr_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 466 | ret |
| 467 | |
| 468 | |
| 469 | /* ----------------------------------------------------- |
| 470 | * ACTLR accessors |
| 471 | * ----------------------------------------------------- |
| 472 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 473 | func read_actlr_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 474 | mrs x0, actlr_el1 |
| 475 | ret |
| 476 | |
| 477 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 478 | func read_actlr_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 479 | mrs x0, actlr_el2 |
| 480 | ret |
| 481 | |
| 482 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 483 | func read_actlr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 484 | mrs x0, actlr_el3 |
| 485 | ret |
| 486 | |
| 487 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 488 | func write_actlr_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 489 | msr actlr_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 490 | ret |
| 491 | |
| 492 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 493 | func write_actlr_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 494 | msr actlr_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 495 | ret |
| 496 | |
| 497 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 498 | func write_actlr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 499 | msr actlr_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 500 | ret |
| 501 | |
| 502 | |
| 503 | /* ----------------------------------------------------- |
| 504 | * ESR accessors |
| 505 | * ----------------------------------------------------- |
| 506 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 507 | func read_esr_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 508 | mrs x0, esr_el1 |
| 509 | ret |
| 510 | |
| 511 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 512 | func read_esr_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 513 | mrs x0, esr_el2 |
| 514 | ret |
| 515 | |
| 516 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 517 | func read_esr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 518 | mrs x0, esr_el3 |
| 519 | ret |
| 520 | |
| 521 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 522 | func write_esr_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 523 | msr esr_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 524 | ret |
| 525 | |
| 526 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 527 | func write_esr_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 528 | msr esr_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 529 | ret |
| 530 | |
| 531 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 532 | func write_esr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 533 | msr esr_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 534 | ret |
| 535 | |
| 536 | |
| 537 | /* ----------------------------------------------------- |
| 538 | * TCR accessors |
| 539 | * ----------------------------------------------------- |
| 540 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 541 | func read_tcr_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 542 | mrs x0, tcr_el1 |
| 543 | ret |
| 544 | |
| 545 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 546 | func read_tcr_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 547 | mrs x0, tcr_el2 |
| 548 | ret |
| 549 | |
| 550 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 551 | func read_tcr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 552 | mrs x0, tcr_el3 |
| 553 | ret |
| 554 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 555 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 556 | func write_tcr_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 557 | msr tcr_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 558 | ret |
| 559 | |
| 560 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 561 | func write_tcr_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 562 | msr tcr_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 563 | ret |
| 564 | |
| 565 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 566 | func write_tcr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 567 | msr tcr_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 568 | ret |
| 569 | |
| 570 | |
| 571 | /* ----------------------------------------------------- |
| 572 | * CPTR accessors |
| 573 | * ----------------------------------------------------- |
| 574 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 575 | func read_cptr_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 576 | mrs x0, cptr_el2 |
| 577 | ret |
| 578 | |
| 579 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 580 | func read_cptr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 581 | mrs x0, cptr_el3 |
| 582 | ret |
| 583 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 584 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 585 | func write_cptr_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 586 | msr cptr_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 587 | ret |
| 588 | |
| 589 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 590 | func write_cptr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 591 | msr cptr_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 592 | ret |
| 593 | |
| 594 | |
| 595 | /* ----------------------------------------------------- |
| 596 | * TTBR0 accessors |
| 597 | * ----------------------------------------------------- |
| 598 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 599 | func read_ttbr0_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 600 | mrs x0, ttbr0_el1 |
| 601 | ret |
| 602 | |
| 603 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 604 | func read_ttbr0_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 605 | mrs x0, ttbr0_el2 |
| 606 | ret |
| 607 | |
| 608 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 609 | func read_ttbr0_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 610 | mrs x0, ttbr0_el3 |
| 611 | ret |
| 612 | |
| 613 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 614 | func write_ttbr0_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 615 | msr ttbr0_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 616 | ret |
| 617 | |
| 618 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 619 | func write_ttbr0_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 620 | msr ttbr0_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 621 | ret |
| 622 | |
| 623 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 624 | func write_ttbr0_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 625 | msr ttbr0_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 626 | ret |
| 627 | |
| 628 | |
| 629 | /* ----------------------------------------------------- |
| 630 | * TTBR1 accessors |
| 631 | * ----------------------------------------------------- |
| 632 | */ |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 633 | func read_ttbr1_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 634 | mrs x0, ttbr1_el1 |
| 635 | ret |
| 636 | |
| 637 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 638 | func write_ttbr1_el1 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 639 | msr ttbr1_el1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 640 | ret |
| 641 | |
| 642 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 643 | func read_hcr |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 644 | mrs x0, hcr_el2 |
| 645 | ret |
| 646 | |
| 647 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 648 | func write_hcr |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 649 | msr hcr_el2, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 650 | ret |
| 651 | |
| 652 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 653 | func read_cpacr |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 654 | mrs x0, cpacr_el1 |
| 655 | ret |
| 656 | |
| 657 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 658 | func write_cpacr |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 659 | msr cpacr_el1, x0 |
| 660 | ret |
| 661 | |
| 662 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 663 | func read_cntfrq_el0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 664 | mrs x0, cntfrq_el0 |
| 665 | ret |
| 666 | |
| 667 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 668 | func write_cntfrq_el0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 669 | msr cntfrq_el0, x0 |
| 670 | ret |
| 671 | |
| 672 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 673 | func read_cpuectlr |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 674 | mrs x0, CPUECTLR_EL1 |
| 675 | ret |
| 676 | |
| 677 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 678 | func write_cpuectlr |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 679 | msr CPUECTLR_EL1, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 680 | ret |
| 681 | |
| 682 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 683 | func read_cnthctl_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 684 | mrs x0, cnthctl_el2 |
| 685 | ret |
| 686 | |
| 687 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 688 | func write_cnthctl_el2 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 689 | msr cnthctl_el2, x0 |
| 690 | ret |
| 691 | |
| 692 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 693 | func read_cntfrq |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 694 | mrs x0, cntfrq_el0 |
| 695 | ret |
| 696 | |
| 697 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 698 | func write_cntfrq |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 699 | msr cntfrq_el0, x0 |
| 700 | ret |
| 701 | |
| 702 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 703 | func write_scr |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 704 | msr scr_el3, x0 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 705 | ret |
| 706 | |
| 707 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 708 | func read_scr |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 709 | mrs x0, scr_el3 |
| 710 | ret |
| 711 | |
| 712 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 713 | func read_midr |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 714 | mrs x0, midr_el1 |
| 715 | ret |
| 716 | |
| 717 | |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 718 | func read_mpidr |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 719 | mrs x0, mpidr_el1 |
| 720 | ret |
| 721 | |
| 722 | |
| 723 | #if SUPPORT_VFP |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 724 | func enable_vfp |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 725 | mrs x0, cpacr_el1 |
| 726 | orr x0, x0, #CPACR_VFP_BITS |
| 727 | msr cpacr_el1, x0 |
| 728 | mrs x0, cptr_el3 |
| 729 | mov x1, #AARCH64_CPTR_TFP |
| 730 | bic x0, x0, x1 |
| 731 | msr cptr_el3, x0 |
Andrew Thoelke | 42e75a7 | 2014-04-28 12:28:39 +0100 | [diff] [blame] | 732 | isb |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 733 | ret |
| 734 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 735 | #endif |