Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 1 | /* |
Soby Mathew | e364a8a | 2015-04-13 16:57:12 +0100 | [diff] [blame] | 2 | * Copyright (c) 2014-2015, ARM Limited and Contributors. All rights reserved. |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 5 | */ |
Soby Mathew | 8e2f287 | 2014-08-14 12:49:05 +0100 | [diff] [blame] | 6 | #include <aem_generic.h> |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 7 | #include <arch.h> |
Andrew Thoelke | 38bde41 | 2014-03-18 13:46:55 +0000 | [diff] [blame] | 8 | #include <asm_macros.S> |
Soby Mathew | c704cbc | 2014-08-14 11:33:56 +0100 | [diff] [blame] | 9 | #include <cpu_macros.S> |
| 10 | |
Soby Mathew | 8e2f287 | 2014-08-14 12:49:05 +0100 | [diff] [blame] | 11 | func aem_generic_core_pwr_dwn |
| 12 | /* --------------------------------------------- |
| 13 | * Disable the Data Cache. |
| 14 | * --------------------------------------------- |
| 15 | */ |
| 16 | mrs x1, sctlr_el3 |
| 17 | bic x1, x1, #SCTLR_C_BIT |
| 18 | msr sctlr_el3, x1 |
| 19 | isb |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 20 | |
Soby Mathew | 8e2f287 | 2014-08-14 12:49:05 +0100 | [diff] [blame] | 21 | mov x0, #DCCISW |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 22 | |
Soby Mathew | 8e2f287 | 2014-08-14 12:49:05 +0100 | [diff] [blame] | 23 | /* --------------------------------------------- |
| 24 | * Flush L1 cache to PoU. |
| 25 | * --------------------------------------------- |
| 26 | */ |
| 27 | b dcsw_op_louis |
Kévin Petit | a877c25 | 2015-03-24 14:03:57 +0000 | [diff] [blame] | 28 | endfunc aem_generic_core_pwr_dwn |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 29 | |
Soby Mathew | 8e2f287 | 2014-08-14 12:49:05 +0100 | [diff] [blame] | 30 | |
| 31 | func aem_generic_cluster_pwr_dwn |
| 32 | /* --------------------------------------------- |
| 33 | * Disable the Data Cache. |
| 34 | * --------------------------------------------- |
| 35 | */ |
| 36 | mrs x1, sctlr_el3 |
| 37 | bic x1, x1, #SCTLR_C_BIT |
| 38 | msr sctlr_el3, x1 |
| 39 | isb |
| 40 | |
| 41 | /* --------------------------------------------- |
| 42 | * Flush L1 and L2 caches to PoC. |
| 43 | * --------------------------------------------- |
| 44 | */ |
| 45 | mov x0, #DCCISW |
| 46 | b dcsw_op_all |
Kévin Petit | a877c25 | 2015-03-24 14:03:57 +0000 | [diff] [blame] | 47 | endfunc aem_generic_cluster_pwr_dwn |
Soby Mathew | 8e2f287 | 2014-08-14 12:49:05 +0100 | [diff] [blame] | 48 | |
Soby Mathew | 38b4bc9 | 2014-08-14 13:36:41 +0100 | [diff] [blame] | 49 | /* --------------------------------------------- |
| 50 | * This function provides cpu specific |
| 51 | * register information for crash reporting. |
| 52 | * It needs to return with x6 pointing to |
| 53 | * a list of register names in ascii and |
| 54 | * x8 - x15 having values of registers to be |
| 55 | * reported. |
| 56 | * --------------------------------------------- |
| 57 | */ |
Soby Mathew | e364a8a | 2015-04-13 16:57:12 +0100 | [diff] [blame] | 58 | .section .rodata.aem_generic_regs, "aS" |
| 59 | aem_generic_regs: /* The ascii list of register names to be reported */ |
| 60 | .asciz "" /* no registers to report */ |
| 61 | |
Soby Mathew | 38b4bc9 | 2014-08-14 13:36:41 +0100 | [diff] [blame] | 62 | func aem_generic_cpu_reg_dump |
Soby Mathew | e364a8a | 2015-04-13 16:57:12 +0100 | [diff] [blame] | 63 | adr x6, aem_generic_regs |
Soby Mathew | 38b4bc9 | 2014-08-14 13:36:41 +0100 | [diff] [blame] | 64 | ret |
Kévin Petit | a877c25 | 2015-03-24 14:03:57 +0000 | [diff] [blame] | 65 | endfunc aem_generic_cpu_reg_dump |
Soby Mathew | 38b4bc9 | 2014-08-14 13:36:41 +0100 | [diff] [blame] | 66 | |
Soby Mathew | 8e2f287 | 2014-08-14 12:49:05 +0100 | [diff] [blame] | 67 | |
| 68 | /* cpu_ops for Base AEM FVP */ |
Jeenu Viswambharan | ee5eb80 | 2016-11-18 12:58:28 +0000 | [diff] [blame] | 69 | declare_cpu_ops aem_generic, BASE_AEM_MIDR, CPU_NO_RESET_FUNC, \ |
| 70 | aem_generic_core_pwr_dwn, \ |
| 71 | aem_generic_cluster_pwr_dwn |
Soby Mathew | c704cbc | 2014-08-14 11:33:56 +0100 | [diff] [blame] | 72 | |
Soby Mathew | 8e2f287 | 2014-08-14 12:49:05 +0100 | [diff] [blame] | 73 | /* cpu_ops for Foundation FVP */ |
Jeenu Viswambharan | ee5eb80 | 2016-11-18 12:58:28 +0000 | [diff] [blame] | 74 | declare_cpu_ops aem_generic, FOUNDATION_AEM_MIDR, CPU_NO_RESET_FUNC, \ |
| 75 | aem_generic_core_pwr_dwn, \ |
| 76 | aem_generic_cluster_pwr_dwn |