mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-08-14 16:37:05 +02:00
SMMU and MC registers are saved as part of the System Suspend sequence. The register list includes some NS world SMMU registers that need to be saved by NS world software instead. All that remains as a result are the MC registers. This patch moves code to MC file as a result and renames all the variables and defines to use the MC prefix instead of SMMU. The Tegra186 and Tegra194 platform ports are updated to provide the MC context register list to the parent driver. The memory required for context save is reduced due to removal of the SMMU registers. Change-Id: I83a05079039f52f9ce91c938ada6cd6dfd9c843f Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
36 lines
962 B
C
36 lines
962 B
C
/*
|
|
* Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <common/bl_common.h>
|
|
#include <common/debug.h>
|
|
#include <smmu.h>
|
|
#include <tegra_def.h>
|
|
|
|
#define BOARD_SYSTEM_FPGA_BASE U(1)
|
|
#define BASE_CONFIG_SMMU_DEVICES U(2)
|
|
#define MAX_NUM_SMMU_DEVICES U(3)
|
|
|
|
static uint32_t tegra_misc_read_32(uint32_t off)
|
|
{
|
|
return mmio_read_32((uintptr_t)TEGRA_MISC_BASE + off);
|
|
}
|
|
|
|
/*******************************************************************************
|
|
* Handler to return the support SMMU devices number
|
|
******************************************************************************/
|
|
uint32_t plat_get_num_smmu_devices(void)
|
|
{
|
|
uint32_t ret_num = MAX_NUM_SMMU_DEVICES;
|
|
uint32_t board_revid = ((tegra_misc_read_32(MISCREG_EMU_REVID) >> \
|
|
BOARD_SHIFT_BITS) & BOARD_MASK_BITS);
|
|
|
|
if (board_revid == BOARD_SYSTEM_FPGA_BASE) {
|
|
ret_num = BASE_CONFIG_SMMU_DEVICES;
|
|
}
|
|
|
|
return ret_num;
|
|
}
|