blob: 417208e3c544e951aaadb89d69532465f41a5c01 [file] [log] [blame]
Varun Wadekar41221512016-03-03 13:09:08 -08001/*
Pritesh Raithatha06803cf2017-01-02 19:42:31 +05302 * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
Pritesh Raithathaa391d492018-08-03 15:48:15 +05303 * Copyright (c) 2020, NVIDIA Corporation. All rights reserved.
Varun Wadekar41221512016-03-03 13:09:08 -08004 *
dp-arm82cb2c12017-05-03 09:38:09 +01005 * SPDX-License-Identifier: BSD-3-Clause
Varun Wadekar41221512016-03-03 13:09:08 -08006 */
7
Antonio Nino Diazc3cf06f2018-11-08 10:20:19 +00008#ifndef SMMU_H
9#define SMMU_H
Varun Wadekar41221512016-03-03 13:09:08 -080010
Antonio Nino Diaz09d40e02018-12-14 00:18:21 +000011#include <lib/mmio.h>
12
Pritesh Raithatha06803cf2017-01-02 19:42:31 +053013#include <memctrl_v2.h>
Varun Wadekar41221512016-03-03 13:09:08 -080014#include <tegra_def.h>
15
Anthony Zhou50e91632017-03-13 15:34:08 +080016#define SMMU_CBn_ACTLR (0x4U)
Varun Wadekar41221512016-03-03 13:09:08 -080017
18/*******************************************************************************
19 * SMMU Global Secure Aux. Configuration Register
20 ******************************************************************************/
Anthony Zhou50e91632017-03-13 15:34:08 +080021#define SMMU_GSR0_SECURE_ACR 0x10U
22#define SMMU_GNSR_ACR (SMMU_GSR0_SECURE_ACR + 0x400U)
23#define SMMU_GSR0_PGSIZE_SHIFT 16U
24#define SMMU_GSR0_PGSIZE_4K (0U << SMMU_GSR0_PGSIZE_SHIFT)
25#define SMMU_GSR0_PGSIZE_64K (1U << SMMU_GSR0_PGSIZE_SHIFT)
26#define SMMU_ACR_CACHE_LOCK_ENABLE_BIT (1U << 26)
Varun Wadekar698f4252016-04-20 17:14:15 -070027
28/*******************************************************************************
29 * SMMU Global Aux. Control Register
30 ******************************************************************************/
Anthony Zhouaa64c5f2017-07-26 17:16:54 +080031#define SMMU_CBn_ACTLR_CPRE_BIT (1ULL << 1U)
Varun Wadekar41221512016-03-03 13:09:08 -080032
Varun Wadekar41221512016-03-03 13:09:08 -080033void tegra_smmu_init(void);
Steven Kaobc5a86f2017-07-25 11:29:46 +080034uint32_t plat_get_num_smmu_devices(void);
Varun Wadekar41221512016-03-03 13:09:08 -080035
Antonio Nino Diazc3cf06f2018-11-08 10:20:19 +000036#endif /* SMMU_H */