blob: a575f430f2eaf17c075612738c7f7c3d41da0bea [file] [log] [blame]
Juan Pablo Condea0594ad2023-09-19 14:57:29 -05001/*
Boyan Karatotev2bef6ba2025-01-21 11:41:46 +00002 * Copyright (c) 2023-2025, Arm Limited. All rights reserved.
Juan Pablo Condea0594ad2023-09-19 14:57:29 -05003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arch.h>
8#include <asm_macros.S>
9#include <common/bl_common.h>
10#include <travis.h>
11#include <cpu_macros.S>
12#include <plat_macros.S>
13
14/* Hardware handled coherency */
15#if HW_ASSISTED_COHERENCY == 0
16#error "Travis must be compiled with HW_ASSISTED_COHERENCY enabled"
17#endif
18
19/* 64-bit only core */
20#if CTX_INCLUDE_AARCH32_REGS == 1
21#error "Travis supports only AArch64. Compile with CTX_INCLUDE_AARCH32_REGS=0"
22#endif
23
24cpu_reset_func_start travis
25 /* ----------------------------------------------------
26 * Disable speculative loads
27 * ----------------------------------------------------
28 */
29 msr SSBS, xzr
Boyan Karatotevd2ab2132024-10-16 11:36:29 +010030 /* model bug: not cleared on reset */
31 sysreg_bit_clear TRAVIS_IMP_CPUPWRCTLR_EL1, \
32 TRAVIS_IMP_CPUPWRCTLR_EL1_CORE_PWRDN_EN_BIT
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050033cpu_reset_func_end travis
34
35func travis_core_pwr_dwn
36#if ENABLE_SME_FOR_NS
37 /* ---------------------------------------------------
38 * Disable SME if enabled and supported
39 * ---------------------------------------------------
40 */
41 mrs x0, ID_AA64PFR1_EL1
42 ubfx x0, x0, #ID_AA64PFR1_EL1_SME_SHIFT, \
43 #ID_AA64PFR1_EL1_SME_WIDTH
Sona Mathew9e51f152024-03-11 15:58:15 -050044 cmp x0, #SME_NOT_IMPLEMENTED
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050045 b.eq 1f
46 msr TRAVIS_SVCRSM, xzr
47 msr TRAVIS_SVCRZA, xzr
481:
49#endif
50 /* ---------------------------------------------------
Boyan Karatotev2bef6ba2025-01-21 11:41:46 +000051 * Flip CPU power down bit in power control register.
52 * It will be set on powerdown and cleared on wakeup
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050053 * ---------------------------------------------------
54 */
Boyan Karatotev2bef6ba2025-01-21 11:41:46 +000055 sysreg_bit_toggle TRAVIS_IMP_CPUPWRCTLR_EL1, \
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050056 TRAVIS_IMP_CPUPWRCTLR_EL1_CORE_PWRDN_EN_BIT
57 isb
58 ret
59endfunc travis_core_pwr_dwn
60
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050061.section .rodata.travis_regs, "aS"
62travis_regs: /* The ASCII list of register names to be reported */
63 .asciz "cpuectlr_el1", ""
64
65func travis_cpu_reg_dump
66 adr x6, travis_regs
67 mrs x8, TRAVIS_IMP_CPUECTLR_EL1
68 ret
69endfunc travis_cpu_reg_dump
70
71declare_cpu_ops travis, TRAVIS_MIDR, \
72 travis_reset_func, \
73 travis_core_pwr_dwn