blob: e5ca1ba313645020b34dd6964681bcb2d2af9ea4 [file] [log] [blame]
David Wang805c2c72016-11-09 16:29:02 +00001/*
Antonio Nino Diaz96f16312019-02-11 13:34:54 +00002 * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
David Wang805c2c72016-11-09 16:29:02 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Antonio Nino Diaz9fe40fd2018-10-25 17:11:02 +01007#ifndef CORTEX_A75_H
8#define CORTEX_A75_H
9
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <lib/utils_def.h>
David Wang805c2c72016-11-09 16:29:02 +000011
12/* Cortex-A75 MIDR */
Antonio Nino Diaz9fe40fd2018-10-25 17:11:02 +010013#define CORTEX_A75_MIDR U(0x410fd0a0)
David Wang805c2c72016-11-09 16:29:02 +000014
15/*******************************************************************************
16 * CPU Extended Control register specific definitions.
17 ******************************************************************************/
18#define CORTEX_A75_CPUPWRCTLR_EL1 S3_0_C15_C2_7
19#define CORTEX_A75_CPUECTLR_EL1 S3_0_C15_C1_4
20
Dimitris Papastamose6625ec2018-04-05 14:38:26 +010021/*******************************************************************************
22 * CPU Auxiliary Control register specific definitions.
23 ******************************************************************************/
24#define CORTEX_A75_CPUACTLR_EL1 S3_0_C15_C1_0
25
Antonio Nino Diaz96f16312019-02-11 13:34:54 +000026#define CORTEX_A75_CPUACTLR_EL1_DISABLE_LOAD_PASS_STORE (ULL(1) << 35)
Dimitris Papastamose6625ec2018-04-05 14:38:26 +010027
David Wang805c2c72016-11-09 16:29:02 +000028/* Definitions of register field mask in CORTEX_A75_CPUPWRCTLR_EL1 */
Antonio Nino Diaz9fe40fd2018-10-25 17:11:02 +010029#define CORTEX_A75_CORE_PWRDN_EN_MASK U(0x1)
David Wang805c2c72016-11-09 16:29:02 +000030
Antonio Nino Diaz5e79cfe2019-02-11 13:34:15 +000031#define CORTEX_A75_ACTLR_AMEN_BIT (ULL(1) << 4)
Dimitris Papastamosfcedb692017-10-16 11:40:10 +010032
33/*
34 * The Cortex-A75 core implements five counters, 0-4. Events 0, 1, 2, are
35 * fixed and are enabled (Group 0). Events 3 and 4 (Group 1) are
36 * programmable by programming the appropriate Event count bits in
37 * CPUAMEVTYPER<n> register and are disabled by default. Platforms may
38 * enable this with suitable programming.
39 */
Dimitris Papastamos864364a2018-02-27 10:55:39 +000040#define CORTEX_A75_AMU_NR_COUNTERS U(5)
41#define CORTEX_A75_AMU_GROUP0_MASK U(0x7)
42#define CORTEX_A75_AMU_GROUP1_MASK (U(0) << 3)
Dimitris Papastamosfcedb692017-10-16 11:40:10 +010043
Julius Werner53456fc2019-07-09 13:49:11 -070044#ifndef __ASSEMBLER__
Dimitris Papastamosd7e2e9e2017-12-11 11:45:35 +000045#include <stdint.h>
46
47uint64_t cortex_a75_amu_cnt_read(int idx);
48void cortex_a75_amu_cnt_write(int idx, uint64_t val);
49unsigned int cortex_a75_amu_read_cpuamcntenset_el0(void);
50unsigned int cortex_a75_amu_read_cpuamcntenclr_el0(void);
51void cortex_a75_amu_write_cpuamcntenset_el0(unsigned int mask);
52void cortex_a75_amu_write_cpuamcntenclr_el0(unsigned int mask);
Julius Werner53456fc2019-07-09 13:49:11 -070053#endif /* __ASSEMBLER__ */
Dimitris Papastamosd7e2e9e2017-12-11 11:45:35 +000054
Antonio Nino Diaz9fe40fd2018-10-25 17:11:02 +010055#endif /* CORTEX_A75_H */