blob: 78b3e7f1c83df0f67b976ebc8f257051ec20e0ea [file] [log] [blame]
John Tsichritzis8a677182018-07-23 09:11:59 +01001/*
Boyan Karatotevb62673c2025-01-23 15:27:30 +00002 * Copyright (c) 2018-2025, Arm Limited and Contributors. All rights reserved.
John Tsichritzis8a677182018-07-23 09:11:59 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef DSU_DEF_H
8#define DSU_DEF_H
9
Antonio Nino Diaz09d40e02018-12-14 00:18:21 +000010#include <lib/utils_def.h>
John Tsichritzis8a677182018-07-23 09:11:59 +010011
12/********************************************************************
Louis Mayencourt2c3b76c2019-04-09 14:11:06 +010013 * DSU Cluster Configuration registers definitions
John Tsichritzis8a677182018-07-23 09:11:59 +010014 ********************************************************************/
15#define CLUSTERCFR_EL1 S3_0_C15_C3_0
Louis Mayencourt2c3b76c2019-04-09 14:11:06 +010016
17#define CLUSTERCFR_ACP_SHIFT U(11)
John Tsichritzis8a677182018-07-23 09:11:59 +010018
19/********************************************************************
Louis Mayencourt2c3b76c2019-04-09 14:11:06 +010020 * DSU Cluster Main Revision ID registers definitions
John Tsichritzis8a677182018-07-23 09:11:59 +010021 ********************************************************************/
Louis Mayencourt2c3b76c2019-04-09 14:11:06 +010022#define CLUSTERIDR_EL1 S3_0_C15_C3_1
23
John Tsichritzis8a677182018-07-23 09:11:59 +010024#define CLUSTERIDR_REV_SHIFT U(0)
25#define CLUSTERIDR_REV_BITS U(4)
26#define CLUSTERIDR_VAR_SHIFT U(4)
27#define CLUSTERIDR_VAR_BITS U(4)
John Tsichritzis8a677182018-07-23 09:11:59 +010028
29/********************************************************************
Louis Mayencourt2c3b76c2019-04-09 14:11:06 +010030 * DSU Cluster Auxiliary Control registers definitions
31 ********************************************************************/
32#define CLUSTERACTLR_EL1 S3_0_C15_C3_3
shengfei Xu9fd9f1d2022-09-30 08:56:21 +000033#define CLUSTERPWRCTLR_EL1 S3_0_C15_C3_5
Louis Mayencourt2c3b76c2019-04-09 14:11:06 +010034
Louis Mayencourt0e985d72019-04-09 16:29:01 +010035#define CLUSTERACTLR_EL1_DISABLE_CLOCK_GATING (ULL(1) << 15)
Bipin Ravi7e3273e2021-12-22 14:35:21 -060036#define CLUSTERACTLR_EL1_DISABLE_SCLK_GATING (ULL(3) << 15)
Louis Mayencourt0e985d72019-04-09 16:29:01 +010037
Louis Mayencourt2c3b76c2019-04-09 14:11:06 +010038/********************************************************************
39 * Masks applied for DSU errata workarounds
John Tsichritzis8a677182018-07-23 09:11:59 +010040 ********************************************************************/
Antonio Nino Diaz1a74e4a2019-02-11 13:34:15 +000041#define DSU_ERRATA_936184_MASK (U(0x3) << 15)
John Tsichritzis8a677182018-07-23 09:11:59 +010042
Boyan Karatotevb62673c2025-01-23 15:27:30 +000043#define CPUCFR_EL1 S3_0_C15_C0_0
44/* SCU bit of CPU Configuration Register, EL1 */
45#define SCU_SHIFT U(2)
46
shengfei Xu9fd9f1d2022-09-30 08:56:21 +000047#ifndef __ASSEMBLER__
Boyan Karatotevb62673c2025-01-23 15:27:30 +000048DEFINE_RENAME_SYSREG_RW_FUNCS(clusterpwrctlr_el1, CLUSTERPWRCTLR_EL1);
49
50/* ---------------------------------------------
51 * controls power features of the cluster
52 * 1. Cache portion power not request
53 * 2. Disable the retention circuit
54 * ---------------------------------------------
55 */
56static inline void dsu_pwr_dwn(void)
57{
58 write_clusterpwrctlr_el1(0);
59 isb();
60}
shengfei Xu9fd9f1d2022-09-30 08:56:21 +000061#endif
John Tsichritzis8a677182018-07-23 09:11:59 +010062#endif /* DSU_DEF_H */