1/* 2 * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6#include <arch.h> 7#include <asm_macros.S> 8#include <bl_common.h> 9#include <cortex_a73.h> 10#include <cpu_macros.S> 11#include <plat_macros.S> 12 13 /* --------------------------------------------- 14 * Disable L1 data cache 15 * --------------------------------------------- 16 */ 17func cortex_a73_disable_dcache 18 mrs x1, sctlr_el3 19 bic x1, x1, #SCTLR_C_BIT 20 msr sctlr_el3, x1 21 isb 22 ret 23endfunc cortex_a73_disable_dcache 24 25 /* --------------------------------------------- 26 * Disable intra-cluster coherency 27 * --------------------------------------------- 28 */ 29func cortex_a73_disable_smp 30 mrs x0, CORTEX_A73_CPUECTLR_EL1 31 bic x0, x0, #CORTEX_A73_CPUECTLR_SMP_BIT 32 msr CORTEX_A73_CPUECTLR_EL1, x0 33 isb 34 dsb sy 35 ret 36endfunc cortex_a73_disable_smp 37 38func cortex_a73_reset_func 39#if IMAGE_BL31 && WORKAROUND_CVE_2017_5715 40 adr x0, workaround_bpiall_vbar0_runtime_exceptions 41 msr vbar_el3, x0 42#endif 43 44 /* --------------------------------------------- 45 * Enable the SMP bit. 46 * Clobbers : x0 47 * --------------------------------------------- 48 */ 49 mrs x0, CORTEX_A73_CPUECTLR_EL1 50 orr x0, x0, #CORTEX_A73_CPUECTLR_SMP_BIT 51 msr CORTEX_A73_CPUECTLR_EL1, x0 52 isb 53 ret 54endfunc cortex_a73_reset_func 55 56func cortex_a73_core_pwr_dwn 57 mov x18, x30 58 59 /* --------------------------------------------- 60 * Turn off caches. 61 * --------------------------------------------- 62 */ 63 bl cortex_a73_disable_dcache 64 65 /* --------------------------------------------- 66 * Flush L1 caches. 67 * --------------------------------------------- 68 */ 69 mov x0, #DCCISW 70 bl dcsw_op_level1 71 72 /* --------------------------------------------- 73 * Come out of intra cluster coherency 74 * --------------------------------------------- 75 */ 76 mov x30, x18 77 b cortex_a73_disable_smp 78endfunc cortex_a73_core_pwr_dwn 79 80func cortex_a73_cluster_pwr_dwn 81 mov x18, x30 82 83 /* --------------------------------------------- 84 * Turn off caches. 85 * --------------------------------------------- 86 */ 87 bl cortex_a73_disable_dcache 88 89 /* --------------------------------------------- 90 * Flush L1 caches. 91 * --------------------------------------------- 92 */ 93 mov x0, #DCCISW 94 bl dcsw_op_level1 95 96 /* --------------------------------------------- 97 * Disable the optional ACP. 98 * --------------------------------------------- 99 */ 100 bl plat_disable_acp 101 102 /* --------------------------------------------- 103 * Flush L2 caches. 104 * --------------------------------------------- 105 */ 106 mov x0, #DCCISW 107 bl dcsw_op_level2 108 109 /* --------------------------------------------- 110 * Come out of intra cluster coherency 111 * --------------------------------------------- 112 */ 113 mov x30, x18 114 b cortex_a73_disable_smp 115endfunc cortex_a73_cluster_pwr_dwn 116 117 /* --------------------------------------------- 118 * This function provides cortex_a73 specific 119 * register information for crash reporting. 120 * It needs to return with x6 pointing to 121 * a list of register names in ascii and 122 * x8 - x15 having values of registers to be 123 * reported. 124 * --------------------------------------------- 125 */ 126.section .rodata.cortex_a73_regs, "aS" 127cortex_a73_regs: /* The ascii list of register names to be reported */ 128 .asciz "cpuectlr_el1", "l2merrsr_el1", "" 129 130func cortex_a73_cpu_reg_dump 131 adr x6, cortex_a73_regs 132 mrs x8, CORTEX_A73_CPUECTLR_EL1 133 mrs x9, CORTEX_A73_L2MERRSR_EL1 134 ret 135endfunc cortex_a73_cpu_reg_dump 136 137declare_cpu_ops cortex_a73, CORTEX_A73_MIDR, \ 138 cortex_a73_reset_func, \ 139 cortex_a73_core_pwr_dwn, \ 140 cortex_a73_cluster_pwr_dwn 141