blob: 2e41668f4358bcc1e4fab8964dbb250887543c4b [file] [log] [blame]
Juan Pablo Condea0594ad2023-09-19 14:57:29 -05001/*
Boyan Karatotevbb801852025-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
Boyan Karatotev2b5e00d2024-12-19 16:07:29 +000024#if FEAT_PABANDON == 0
25#error "Travis must be compiled with FEAT_PABANDON enabled"
26#endif
27
Boyan Karatotev45c73282024-09-20 13:37:51 +010028#if ERRATA_SME_POWER_DOWN == 0
29#error "Travis needs ERRATA_SME_POWER_DOWN=1 to powerdown correctly"
30#endif
31
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050032cpu_reset_func_start travis
33 /* ----------------------------------------------------
34 * Disable speculative loads
35 * ----------------------------------------------------
36 */
37 msr SSBS, xzr
Boyan Karatotevc9f352c2024-10-16 11:36:29 +010038 /* model bug: not cleared on reset */
39 sysreg_bit_clear TRAVIS_IMP_CPUPWRCTLR_EL1, \
40 TRAVIS_IMP_CPUPWRCTLR_EL1_CORE_PWRDN_EN_BIT
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050041cpu_reset_func_end travis
42
43func travis_core_pwr_dwn
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050044 /* ---------------------------------------------------
Boyan Karatotevbb801852025-01-21 11:41:46 +000045 * Flip CPU power down bit in power control register.
46 * It will be set on powerdown and cleared on wakeup
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050047 * ---------------------------------------------------
48 */
Boyan Karatotevbb801852025-01-21 11:41:46 +000049 sysreg_bit_toggle TRAVIS_IMP_CPUPWRCTLR_EL1, \
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050050 TRAVIS_IMP_CPUPWRCTLR_EL1_CORE_PWRDN_EN_BIT
51 isb
52 ret
53endfunc travis_core_pwr_dwn
54
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050055.section .rodata.travis_regs, "aS"
56travis_regs: /* The ASCII list of register names to be reported */
57 .asciz "cpuectlr_el1", ""
58
59func travis_cpu_reg_dump
60 adr x6, travis_regs
61 mrs x8, TRAVIS_IMP_CPUECTLR_EL1
62 ret
63endfunc travis_cpu_reg_dump
64
65declare_cpu_ops travis, TRAVIS_MIDR, \
66 travis_reset_func, \
67 travis_core_pwr_dwn