blob: d53e46f9ead9544e3efbfae86a1a4899c36376c2 [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
Boyan Karatotev89dba822025-01-22 13:54:43 +000032cpu_reset_prologue travis
33
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050034cpu_reset_func_start travis
35 /* ----------------------------------------------------
36 * Disable speculative loads
37 * ----------------------------------------------------
38 */
39 msr SSBS, xzr
Boyan Karatotevc9f352c2024-10-16 11:36:29 +010040 /* model bug: not cleared on reset */
41 sysreg_bit_clear TRAVIS_IMP_CPUPWRCTLR_EL1, \
42 TRAVIS_IMP_CPUPWRCTLR_EL1_CORE_PWRDN_EN_BIT
Boyan Karatotev2590e812024-11-25 10:14:26 +000043 enable_mpmm
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050044cpu_reset_func_end travis
45
46func travis_core_pwr_dwn
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050047 /* ---------------------------------------------------
Boyan Karatotevbb801852025-01-21 11:41:46 +000048 * Flip CPU power down bit in power control register.
49 * It will be set on powerdown and cleared on wakeup
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050050 * ---------------------------------------------------
51 */
Boyan Karatotevbb801852025-01-21 11:41:46 +000052 sysreg_bit_toggle TRAVIS_IMP_CPUPWRCTLR_EL1, \
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050053 TRAVIS_IMP_CPUPWRCTLR_EL1_CORE_PWRDN_EN_BIT
54 isb
55 ret
56endfunc travis_core_pwr_dwn
57
Juan Pablo Condea0594ad2023-09-19 14:57:29 -050058.section .rodata.travis_regs, "aS"
59travis_regs: /* The ASCII list of register names to be reported */
60 .asciz "cpuectlr_el1", ""
61
62func travis_cpu_reg_dump
63 adr x6, travis_regs
64 mrs x8, TRAVIS_IMP_CPUECTLR_EL1
65 ret
66endfunc travis_cpu_reg_dump
67
68declare_cpu_ops travis, TRAVIS_MIDR, \
69 travis_reset_func, \
70 travis_core_pwr_dwn