Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
0f22bef3
Commit
0f22bef3
authored
Apr 29, 2017
by
Scott Branden
Committed by
GitHub
Apr 29, 2017
Browse files
Merge branch 'integration' into tf_issue_461
parents
53d9c9c8
dd454b40
Changes
132
Show whitespace changes
Inline
Side-by-side
plat/nvidia/tegra/soc/t186/drivers/mce/nvg.c
View file @
0f22bef3
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
#include <debug.h>
#include <debug.h>
#include <denver.h>
#include <denver.h>
#include <mmio.h>
#include <mmio.h>
#include <mce.h>
#include <mce
_private
.h>
#include <sys/errno.h>
#include <sys/errno.h>
#include <t18x_ari.h>
#include <t18x_ari.h>
...
...
plat/nvidia/tegra/soc/t186/plat_memctrl.c
0 → 100644
View file @
0f22bef3
/*
* Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bl_common.h>
#include <memctrl_v2.h>
/*******************************************************************************
* Array to hold stream_id override config register offsets
******************************************************************************/
const
static
uint32_t
tegra186_streamid_override_regs
[]
=
{
MC_STREAMID_OVERRIDE_CFG_PTCR
,
MC_STREAMID_OVERRIDE_CFG_AFIR
,
MC_STREAMID_OVERRIDE_CFG_HDAR
,
MC_STREAMID_OVERRIDE_CFG_HOST1XDMAR
,
MC_STREAMID_OVERRIDE_CFG_NVENCSRD
,
MC_STREAMID_OVERRIDE_CFG_SATAR
,
MC_STREAMID_OVERRIDE_CFG_MPCORER
,
MC_STREAMID_OVERRIDE_CFG_NVENCSWR
,
MC_STREAMID_OVERRIDE_CFG_AFIW
,
MC_STREAMID_OVERRIDE_CFG_HDAW
,
MC_STREAMID_OVERRIDE_CFG_MPCOREW
,
MC_STREAMID_OVERRIDE_CFG_SATAW
,
MC_STREAMID_OVERRIDE_CFG_ISPRA
,
MC_STREAMID_OVERRIDE_CFG_ISPWA
,
MC_STREAMID_OVERRIDE_CFG_ISPWB
,
MC_STREAMID_OVERRIDE_CFG_XUSB_HOSTR
,
MC_STREAMID_OVERRIDE_CFG_XUSB_HOSTW
,
MC_STREAMID_OVERRIDE_CFG_XUSB_DEVR
,
MC_STREAMID_OVERRIDE_CFG_XUSB_DEVW
,
MC_STREAMID_OVERRIDE_CFG_TSECSRD
,
MC_STREAMID_OVERRIDE_CFG_TSECSWR
,
MC_STREAMID_OVERRIDE_CFG_GPUSRD
,
MC_STREAMID_OVERRIDE_CFG_GPUSWR
,
MC_STREAMID_OVERRIDE_CFG_SDMMCRA
,
MC_STREAMID_OVERRIDE_CFG_SDMMCRAA
,
MC_STREAMID_OVERRIDE_CFG_SDMMCR
,
MC_STREAMID_OVERRIDE_CFG_SDMMCRAB
,
MC_STREAMID_OVERRIDE_CFG_SDMMCWA
,
MC_STREAMID_OVERRIDE_CFG_SDMMCWAA
,
MC_STREAMID_OVERRIDE_CFG_SDMMCW
,
MC_STREAMID_OVERRIDE_CFG_SDMMCWAB
,
MC_STREAMID_OVERRIDE_CFG_VICSRD
,
MC_STREAMID_OVERRIDE_CFG_VICSWR
,
MC_STREAMID_OVERRIDE_CFG_VIW
,
MC_STREAMID_OVERRIDE_CFG_NVDECSRD
,
MC_STREAMID_OVERRIDE_CFG_NVDECSWR
,
MC_STREAMID_OVERRIDE_CFG_APER
,
MC_STREAMID_OVERRIDE_CFG_APEW
,
MC_STREAMID_OVERRIDE_CFG_NVJPGSRD
,
MC_STREAMID_OVERRIDE_CFG_NVJPGSWR
,
MC_STREAMID_OVERRIDE_CFG_SESRD
,
MC_STREAMID_OVERRIDE_CFG_SESWR
,
MC_STREAMID_OVERRIDE_CFG_ETRR
,
MC_STREAMID_OVERRIDE_CFG_ETRW
,
MC_STREAMID_OVERRIDE_CFG_TSECSRDB
,
MC_STREAMID_OVERRIDE_CFG_TSECSWRB
,
MC_STREAMID_OVERRIDE_CFG_GPUSRD2
,
MC_STREAMID_OVERRIDE_CFG_GPUSWR2
,
MC_STREAMID_OVERRIDE_CFG_AXISR
,
MC_STREAMID_OVERRIDE_CFG_AXISW
,
MC_STREAMID_OVERRIDE_CFG_EQOSR
,
MC_STREAMID_OVERRIDE_CFG_EQOSW
,
MC_STREAMID_OVERRIDE_CFG_UFSHCR
,
MC_STREAMID_OVERRIDE_CFG_UFSHCW
,
MC_STREAMID_OVERRIDE_CFG_NVDISPLAYR
,
MC_STREAMID_OVERRIDE_CFG_BPMPR
,
MC_STREAMID_OVERRIDE_CFG_BPMPW
,
MC_STREAMID_OVERRIDE_CFG_BPMPDMAR
,
MC_STREAMID_OVERRIDE_CFG_BPMPDMAW
,
MC_STREAMID_OVERRIDE_CFG_AONR
,
MC_STREAMID_OVERRIDE_CFG_AONW
,
MC_STREAMID_OVERRIDE_CFG_AONDMAR
,
MC_STREAMID_OVERRIDE_CFG_AONDMAW
,
MC_STREAMID_OVERRIDE_CFG_SCER
,
MC_STREAMID_OVERRIDE_CFG_SCEW
,
MC_STREAMID_OVERRIDE_CFG_SCEDMAR
,
MC_STREAMID_OVERRIDE_CFG_SCEDMAW
,
MC_STREAMID_OVERRIDE_CFG_APEDMAR
,
MC_STREAMID_OVERRIDE_CFG_APEDMAW
,
MC_STREAMID_OVERRIDE_CFG_NVDISPLAYR1
,
MC_STREAMID_OVERRIDE_CFG_VICSRD1
,
MC_STREAMID_OVERRIDE_CFG_NVDECSRD1
};
/*******************************************************************************
* Array to hold the security configs for stream IDs
******************************************************************************/
const
static
mc_streamid_security_cfg_t
tegra186_streamid_sec_cfgs
[]
=
{
mc_make_sec_cfg
(
SCEW
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
AFIR
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
AFIW
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
NVDISPLAYR1
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
XUSB_DEVR
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
VICSRD1
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
NVENCSWR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
TSECSRDB
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
AXISW
,
SECURE
,
NO_OVERRIDE
,
DISABLE
),
mc_make_sec_cfg
(
SDMMCWAB
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
AONDMAW
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
GPUSWR2
,
SECURE
,
NO_OVERRIDE
,
DISABLE
),
mc_make_sec_cfg
(
SATAW
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
UFSHCW
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
SDMMCR
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
SCEDMAW
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
UFSHCR
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
SDMMCWAA
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
SESWR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
MPCORER
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
PTCR
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
BPMPW
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
ETRW
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
GPUSRD
,
SECURE
,
NO_OVERRIDE
,
DISABLE
),
mc_make_sec_cfg
(
VICSWR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
SCEDMAR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
HDAW
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
ISPWA
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
EQOSW
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
XUSB_HOSTW
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
TSECSWR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
SDMMCRAA
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
VIW
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
AXISR
,
SECURE
,
NO_OVERRIDE
,
DISABLE
),
mc_make_sec_cfg
(
SDMMCW
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
BPMPDMAW
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
ISPRA
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
NVDECSWR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
XUSB_DEVW
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
NVDECSRD
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
MPCOREW
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
NVDISPLAYR
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
BPMPDMAR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
NVJPGSWR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
NVDECSRD1
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
TSECSRD
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
NVJPGSRD
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
SDMMCWA
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
SCER
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
XUSB_HOSTR
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
VICSRD
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
AONDMAR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
AONW
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
SDMMCRA
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
HOST1XDMAR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
EQOSR
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
SATAR
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
BPMPR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
HDAR
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
SDMMCRAB
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
ETRR
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
AONR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
SESRD
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
NVENCSRD
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
GPUSWR
,
SECURE
,
NO_OVERRIDE
,
DISABLE
),
mc_make_sec_cfg
(
TSECSWRB
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
ISPWB
,
NON_SECURE
,
OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
GPUSRD2
,
SECURE
,
NO_OVERRIDE
,
DISABLE
),
mc_make_sec_cfg
(
APEDMAW
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
APER
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
APEW
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
mc_make_sec_cfg
(
APEDMAR
,
NON_SECURE
,
NO_OVERRIDE
,
ENABLE
),
};
/*******************************************************************************
* Array to hold the transaction override configs
******************************************************************************/
const
static
mc_txn_override_cfg_t
tegra186_txn_override_cfgs
[]
=
{
mc_make_txn_override_cfg
(
BPMPW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
EQOSW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
NVJPGSWR
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
SDMMCWAA
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
MPCOREW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
SCEDMAW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
SDMMCW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
AXISW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
TSECSWR
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
GPUSWR
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
XUSB_HOSTW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
TSECSWRB
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
GPUSWR2
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
AONDMAW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
AONW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
SESWR
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
BPMPDMAW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
SDMMCWA
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
HDAW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
NVDECSWR
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
UFSHCW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
SATAW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
ETRW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
VICSWR
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
NVENCSWR
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
SDMMCWAB
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
ISPWB
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
APEW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
XUSB_DEVW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
AFIW
,
CGID_TAG_ADR
),
mc_make_txn_override_cfg
(
SCEW
,
CGID_TAG_ADR
),
};
/*******************************************************************************
* Struct to hold the memory controller settings
******************************************************************************/
static
tegra_mc_settings_t
tegra186_mc_settings
=
{
.
streamid_override_cfg
=
tegra186_streamid_override_regs
,
.
num_streamid_override_cfgs
=
ARRAY_SIZE
(
tegra186_streamid_override_regs
),
.
streamid_security_cfg
=
tegra186_streamid_sec_cfgs
,
.
num_streamid_security_cfgs
=
ARRAY_SIZE
(
tegra186_streamid_sec_cfgs
),
.
txn_override_cfg
=
tegra186_txn_override_cfgs
,
.
num_txn_override_cfgs
=
ARRAY_SIZE
(
tegra186_txn_override_cfgs
)
};
/*******************************************************************************
* Handler to return the pointer to the memory controller's settings struct
******************************************************************************/
tegra_mc_settings_t
*
tegra_get_mc_settings
(
void
)
{
return
&
tegra186_mc_settings
;
}
plat/nvidia/tegra/soc/t186/plat_psci_handlers.c
View file @
0f22bef3
...
@@ -46,11 +46,8 @@
...
@@ -46,11 +46,8 @@
extern
void
prepare_cpu_pwr_dwn
(
void
);
extern
void
prepare_cpu_pwr_dwn
(
void
);
extern
void
tegra186_cpu_reset_handler
(
void
);
extern
void
tegra186_cpu_reset_handler
(
void
);
extern
uint32_t
__tegra186_cpu_reset_handler_data
,
extern
uint32_t
__tegra186_cpu_reset_handler_end
,
__tegra186_cpu_reset_handler_end
;
__tegra186_smmu_context
;
/* TZDRAM offset for saving SMMU context */
#define TEGRA186_SMMU_CTX_OFFSET 16
/* state id mask */
/* state id mask */
#define TEGRA186_STATE_ID_MASK 0xF
#define TEGRA186_STATE_ID_MASK 0xF
...
@@ -151,9 +148,8 @@ int tegra_soc_pwr_domain_suspend(const psci_power_state_t *target_state)
...
@@ -151,9 +148,8 @@ int tegra_soc_pwr_domain_suspend(const psci_power_state_t *target_state)
/* save SMMU context to TZDRAM */
/* save SMMU context to TZDRAM */
smmu_ctx_base
=
params_from_bl2
->
tzdram_base
+
smmu_ctx_base
=
params_from_bl2
->
tzdram_base
+
((
uintptr_t
)
&
__tegra186_cpu_reset_handler_data
-
((
uintptr_t
)
&
__tegra186_smmu_context
-
(
uintptr_t
)
tegra186_cpu_reset_handler
)
+
(
uintptr_t
)
tegra186_cpu_reset_handler
);
TEGRA186_SMMU_CTX_OFFSET
;
tegra_smmu_save_context
((
uintptr_t
)
smmu_ctx_base
);
tegra_smmu_save_context
((
uintptr_t
)
smmu_ctx_base
);
/* Prepare for system suspend */
/* Prepare for system suspend */
...
@@ -260,7 +256,7 @@ int tegra_soc_pwr_domain_power_down_wfi(const psci_power_state_t *target_state)
...
@@ -260,7 +256,7 @@ int tegra_soc_pwr_domain_power_down_wfi(const psci_power_state_t *target_state)
plat_params_from_bl2_t
*
params_from_bl2
=
bl31_get_plat_params
();
plat_params_from_bl2_t
*
params_from_bl2
=
bl31_get_plat_params
();
unsigned
int
stateid_afflvl2
=
pwr_domain_state
[
PLAT_MAX_PWR_LVL
]
&
unsigned
int
stateid_afflvl2
=
pwr_domain_state
[
PLAT_MAX_PWR_LVL
]
&
TEGRA186_STATE_ID_MASK
;
TEGRA186_STATE_ID_MASK
;
uint
32
_t
val
;
uint
64
_t
val
;
if
(
stateid_afflvl2
==
PSTATE_ID_SOC_POWERDN
)
{
if
(
stateid_afflvl2
==
PSTATE_ID_SOC_POWERDN
)
{
/*
/*
...
...
plat/nvidia/tegra/soc/t186/plat_setup.c
View file @
0f22bef3
...
@@ -49,6 +49,13 @@
...
@@ -49,6 +49,13 @@
DEFINE_RENAME_SYSREG_RW_FUNCS
(
l2ctlr_el1
,
L2CTLR_EL1
)
DEFINE_RENAME_SYSREG_RW_FUNCS
(
l2ctlr_el1
,
L2CTLR_EL1
)
extern
uint64_t
tegra_enable_l2_ecc_parity_prot
;
extern
uint64_t
tegra_enable_l2_ecc_parity_prot
;
/*******************************************************************************
* Tegra186 CPU numbers in cluster #0
*******************************************************************************
*/
#define TEGRA186_CLUSTER0_CORE2 2
#define TEGRA186_CLUSTER0_CORE3 3
/*******************************************************************************
/*******************************************************************************
* The Tegra power domain tree has a single system level power domain i.e. a
* The Tegra power domain tree has a single system level power domain i.e. a
* single root node. The first entry in the power domain descriptor specifies
* single root node. The first entry in the power domain descriptor specifies
...
@@ -102,7 +109,9 @@ static const mmap_region_t tegra_mmap[] = {
...
@@ -102,7 +109,9 @@ static const mmap_region_t tegra_mmap[] = {
MT_DEVICE
|
MT_RW
|
MT_SECURE
),
MT_DEVICE
|
MT_RW
|
MT_SECURE
),
MAP_REGION_FLAT
(
TEGRA_MMCRAB_BASE
,
0x60000
,
/* 384KB */
MAP_REGION_FLAT
(
TEGRA_MMCRAB_BASE
,
0x60000
,
/* 384KB */
MT_DEVICE
|
MT_RW
|
MT_SECURE
),
MT_DEVICE
|
MT_RW
|
MT_SECURE
),
MAP_REGION_FLAT
(
TEGRA_SMMU_BASE
,
0x1000000
,
/* 64KB */
MAP_REGION_FLAT
(
TEGRA_ARM_ACTMON_CTR_BASE
,
0x20000
,
/* 128KB - ARM/Denver */
MT_DEVICE
|
MT_RW
|
MT_SECURE
),
MAP_REGION_FLAT
(
TEGRA_SMMU0_BASE
,
0x1000000
,
/* 64KB */
MT_DEVICE
|
MT_RW
|
MT_SECURE
),
MT_DEVICE
|
MT_RW
|
MT_SECURE
),
{
0
}
{
0
}
};
};
...
@@ -252,3 +261,40 @@ plat_params_from_bl2_t *plat_get_bl31_plat_params(void)
...
@@ -252,3 +261,40 @@ plat_params_from_bl2_t *plat_get_bl31_plat_params(void)
return
(
plat_params_from_bl2_t
*
)(
uintptr_t
)
val
;
return
(
plat_params_from_bl2_t
*
)(
uintptr_t
)
val
;
}
}
/*******************************************************************************
* This function implements a part of the critical interface between the psci
* generic layer and the platform that allows the former to query the platform
* to convert an MPIDR to a unique linear index. An error code (-1) is returned
* in case the MPIDR is invalid.
******************************************************************************/
int
plat_core_pos_by_mpidr
(
u_register_t
mpidr
)
{
unsigned
int
cluster_id
,
cpu_id
,
pos
;
cluster_id
=
(
mpidr
>>
MPIDR_AFF1_SHIFT
)
&
MPIDR_AFFLVL_MASK
;
cpu_id
=
(
mpidr
>>
MPIDR_AFF0_SHIFT
)
&
MPIDR_AFFLVL_MASK
;
/*
* Validate cluster_id by checking whether it represents
* one of the two clusters present on the platform.
*/
if
(
cluster_id
>=
PLATFORM_CLUSTER_COUNT
)
return
PSCI_E_NOT_PRESENT
;
/*
* Validate cpu_id by checking whether it represents a CPU in
* one of the two clusters present on the platform.
*/
if
(
cpu_id
>=
PLATFORM_MAX_CPUS_PER_CLUSTER
)
return
PSCI_E_NOT_PRESENT
;
/* calculate the core position */
pos
=
cpu_id
+
(
cluster_id
<<
2
);
/* check for non-existent CPUs */
if
(
pos
==
TEGRA186_CLUSTER0_CORE2
||
pos
==
TEGRA186_CLUSTER0_CORE3
)
return
PSCI_E_NOT_PRESENT
;
return
pos
;
}
plat/nvidia/tegra/soc/t186/plat_sip_calls.c
View file @
0f22bef3
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include <bl_common.h>
#include <bl_common.h>
#include <context_mgmt.h>
#include <context_mgmt.h>
#include <debug.h>
#include <debug.h>
#include <denver.h>
#include <errno.h>
#include <errno.h>
#include <mce.h>
#include <mce.h>
#include <memctrl.h>
#include <memctrl.h>
...
@@ -43,30 +44,35 @@
...
@@ -43,30 +44,35 @@
extern
uint32_t
tegra186_system_powerdn_state
;
extern
uint32_t
tegra186_system_powerdn_state
;
/*******************************************************************************
* Offset to read the ref_clk counter value
******************************************************************************/
#define REF_CLK_OFFSET 4
/*******************************************************************************
/*******************************************************************************
* Tegra186 SiP SMCs
* Tegra186 SiP SMCs
******************************************************************************/
******************************************************************************/
#define TEGRA_SIP_
NEW_VIDEOMEM_REGION 0x82000003
#define TEGRA_SIP_
SYSTEM_SHUTDOWN_STATE 0xC2FFFE01
#define TEGRA_SIP_
SYSTEM_SHUTDOWN_STATE
0x
8
2FFFE0
1
#define TEGRA_SIP_
GET_ACTMON_CLK_COUNTERS
0x
C
2FFFE0
2
#define TEGRA_SIP_MCE_CMD_ENTER_CSTATE 0x
8
2FFFF00
#define TEGRA_SIP_MCE_CMD_ENTER_CSTATE 0x
C
2FFFF00
#define TEGRA_SIP_MCE_CMD_UPDATE_CSTATE_INFO 0x
8
2FFFF01
#define TEGRA_SIP_MCE_CMD_UPDATE_CSTATE_INFO 0x
C
2FFFF01
#define TEGRA_SIP_MCE_CMD_UPDATE_CROSSOVER_TIME 0x
8
2FFFF02
#define TEGRA_SIP_MCE_CMD_UPDATE_CROSSOVER_TIME 0x
C
2FFFF02
#define TEGRA_SIP_MCE_CMD_READ_CSTATE_STATS 0x
8
2FFFF03
#define TEGRA_SIP_MCE_CMD_READ_CSTATE_STATS 0x
C
2FFFF03
#define TEGRA_SIP_MCE_CMD_WRITE_CSTATE_STATS 0x
8
2FFFF04
#define TEGRA_SIP_MCE_CMD_WRITE_CSTATE_STATS 0x
C
2FFFF04
#define TEGRA_SIP_MCE_CMD_IS_SC7_ALLOWED 0x
8
2FFFF05
#define TEGRA_SIP_MCE_CMD_IS_SC7_ALLOWED 0x
C
2FFFF05
#define TEGRA_SIP_MCE_CMD_ONLINE_CORE 0x
8
2FFFF06
#define TEGRA_SIP_MCE_CMD_ONLINE_CORE 0x
C
2FFFF06
#define TEGRA_SIP_MCE_CMD_CC3_CTRL 0x
8
2FFFF07
#define TEGRA_SIP_MCE_CMD_CC3_CTRL 0x
C
2FFFF07
#define TEGRA_SIP_MCE_CMD_ECHO_DATA 0x
8
2FFFF08
#define TEGRA_SIP_MCE_CMD_ECHO_DATA 0x
C
2FFFF08
#define TEGRA_SIP_MCE_CMD_READ_VERSIONS 0x
8
2FFFF09
#define TEGRA_SIP_MCE_CMD_READ_VERSIONS 0x
C
2FFFF09
#define TEGRA_SIP_MCE_CMD_ENUM_FEATURES 0x
8
2FFFF0A
#define TEGRA_SIP_MCE_CMD_ENUM_FEATURES 0x
C
2FFFF0A
#define TEGRA_SIP_MCE_CMD_ROC_FLUSH_CACHE_TRBITS 0x
8
2FFFF0B
#define TEGRA_SIP_MCE_CMD_ROC_FLUSH_CACHE_TRBITS 0x
C
2FFFF0B
#define TEGRA_SIP_MCE_CMD_ENUM_READ_MCA 0x
8
2FFFF0C
#define TEGRA_SIP_MCE_CMD_ENUM_READ_MCA 0x
C
2FFFF0C
#define TEGRA_SIP_MCE_CMD_ENUM_WRITE_MCA 0x
8
2FFFF0D
#define TEGRA_SIP_MCE_CMD_ENUM_WRITE_MCA 0x
C
2FFFF0D
#define TEGRA_SIP_MCE_CMD_ROC_FLUSH_CACHE 0x
8
2FFFF0E
#define TEGRA_SIP_MCE_CMD_ROC_FLUSH_CACHE 0x
C
2FFFF0E
#define TEGRA_SIP_MCE_CMD_ROC_CLEAN_CACHE 0x
8
2FFFF0F
#define TEGRA_SIP_MCE_CMD_ROC_CLEAN_CACHE 0x
C
2FFFF0F
#define TEGRA_SIP_MCE_CMD_ENABLE_LATIC 0x
8
2FFFF10
#define TEGRA_SIP_MCE_CMD_ENABLE_LATIC 0x
C
2FFFF10
#define TEGRA_SIP_MCE_CMD_UNCORE_PERFMON_REQ 0x
8
2FFFF11
#define TEGRA_SIP_MCE_CMD_UNCORE_PERFMON_REQ 0x
C
2FFFF11
#define TEGRA_SIP_MCE_CMD_MISC_CCPLEX 0x
8
2FFFF12
#define TEGRA_SIP_MCE_CMD_MISC_CCPLEX 0x
C
2FFFF12
/*******************************************************************************
/*******************************************************************************
* This function is responsible for handling all T186 SiP calls
* This function is responsible for handling all T186 SiP calls
...
@@ -81,9 +87,23 @@ int plat_sip_handler(uint32_t smc_fid,
...
@@ -81,9 +87,23 @@ int plat_sip_handler(uint32_t smc_fid,
uint64_t
flags
)
uint64_t
flags
)
{
{
int
mce_ret
;
int
mce_ret
;
int
impl
,
cpu
;
uint32_t
base
,
core_clk_ctr
,
ref_clk_ctr
;
switch
(
smc_fid
)
{
if
(((
smc_fid
>>
FUNCID_CC_SHIFT
)
&
FUNCID_CC_MASK
)
==
SMC_32
)
{
/* 32-bit function, clear top parameter bits */
x1
=
(
uint32_t
)
x1
;
x2
=
(
uint32_t
)
x2
;
x3
=
(
uint32_t
)
x3
;
}
/*
* Convert SMC FID to SMC64, to support SMC32/SMC64 configurations
*/
smc_fid
|=
(
SMC_64
<<
FUNCID_CC_SHIFT
);
switch
(
smc_fid
)
{
/*
/*
* Micro Coded Engine (MCE) commands reside in the 0x82FFFF00 -
* Micro Coded Engine (MCE) commands reside in the 0x82FFFF00 -
* 0x82FFFFFF SiP SMC space
* 0x82FFFFFF SiP SMC space
...
@@ -112,7 +132,8 @@ int plat_sip_handler(uint32_t smc_fid,
...
@@ -112,7 +132,8 @@ int plat_sip_handler(uint32_t smc_fid,
/* execute the command and store the result */
/* execute the command and store the result */
mce_ret
=
mce_command_handler
(
smc_fid
,
x1
,
x2
,
x3
);
mce_ret
=
mce_command_handler
(
smc_fid
,
x1
,
x2
,
x3
);
write_ctx_reg
(
get_gpregs_ctx
(
handle
),
CTX_GPREG_X0
,
mce_ret
);
write_ctx_reg
(
get_gpregs_ctx
(
handle
),
CTX_GPREG_X0
,
(
uint64_t
)
mce_ret
);
return
0
;
return
0
;
...
@@ -143,6 +164,38 @@ int plat_sip_handler(uint32_t smc_fid,
...
@@ -143,6 +164,38 @@ int plat_sip_handler(uint32_t smc_fid,
return
0
;
return
0
;
/*
* This function ID reads the Activity monitor's core/ref clock
* counter values for a core/cluster.
*
* x1 = MPIDR of the target core
* x2 = MIDR of the target core
*/
case
TEGRA_SIP_GET_ACTMON_CLK_COUNTERS
:
cpu
=
(
uint32_t
)
x1
&
MPIDR_CPU_MASK
;
impl
=
((
uint32_t
)
x2
>>
MIDR_IMPL_SHIFT
)
&
MIDR_IMPL_MASK
;
/* sanity check target CPU number */
if
(
cpu
>
PLATFORM_MAX_CPUS_PER_CLUSTER
)
return
-
EINVAL
;
/* get the base address for the current CPU */
base
=
(
impl
==
DENVER_IMPL
)
?
TEGRA_DENVER_ACTMON_CTR_BASE
:
TEGRA_ARM_ACTMON_CTR_BASE
;
/* read the clock counter values */
core_clk_ctr
=
mmio_read_32
(
base
+
(
8
*
cpu
));
ref_clk_ctr
=
mmio_read_32
(
base
+
(
8
*
cpu
)
+
REF_CLK_OFFSET
);
/* return the counter values as two different parameters */
write_ctx_reg
(
get_gpregs_ctx
(
handle
),
CTX_GPREG_X1
,
(
uint64_t
)
core_clk_ctr
);
write_ctx_reg
(
get_gpregs_ctx
(
handle
),
CTX_GPREG_X2
,
(
uint64_t
)
ref_clk_ctr
);
return
0
;
default:
default:
break
;
break
;
}
}
...
...
plat/nvidia/tegra/soc/t186/
drivers/smmu/
smmu.c
→
plat/nvidia/tegra/soc/t186/
plat_
smmu.c
View file @
0f22bef3
/*
/*
* Copyright (c) 201
6
,
ARM Limited and Contributors
. All rights reserved.
* Copyright (c) 201
7
,
NVIDIA CORPORATION
. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* Permission is hereby granted, free of charge, to any person obtaining a
* modification, are permitted provided that the following conditions are met:
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
*
*
Redistributions of source code must retain the above copyright notice, this
*
The above copyright notice and this permission notice shall be included in
*
list of condi
tions
and
the
following disclaimer
.
*
all copies or substantial por
tions
of
the
Software
.
*
*
* Redistributions in binary form must reproduce the above copyright notice,
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* this list of conditions and the following disclaimer in the documentation
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* and/or other materials provided with the distribution.
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
*
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* Neither the name of ARM nor the names of its contributors may be used
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* to endorse or promote products derived from this software without specific
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* prior written permission.
* DEALINGS IN THE SOFTWARE.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
*/
#include <assert.h>
#include <bl_common.h>
#include <bl_common.h>
#include <debug.h>
#include <memctrl_v2.h>
#include <platform_def.h>
#include <smmu.h>
#include <smmu.h>
#include <string.h>
#include <tegra_def.h>
#include <tegra_private.h>
typedef
struct
smmu_regs
{
uint32_t
reg
;
uint32_t
val
;
}
smmu_regs_t
;
#define mc_make_sid_override_cfg(name) \
{ \
.reg = TEGRA_MC_STREAMID_BASE + MC_STREAMID_OVERRIDE_CFG_ ## name, \
.val = 0x00000000, \
}
#define mc_make_sid_security_cfg(name) \
{ \
.reg = TEGRA_MC_STREAMID_BASE + MC_STREAMID_SECURITY_CFG_ ## name, \
.val = 0x00000000, \
}
#define smmu_make_gnsr0_sec_cfg(name) \
{ \
.reg = TEGRA_SMMU_BASE + SMMU_GNSR0_ ## name, \
.val = 0x00000000, \
}
/*
* On ARM-SMMU, conditional offset to access secure aliases of non-secure registers
* is 0x400. So, add it to register address
*/
#define smmu_make_gnsr0_nsec_cfg(name) \
{ \
.reg = TEGRA_SMMU_BASE + 0x400 + SMMU_GNSR0_ ## name, \
.val = 0x00000000, \
}
#define smmu_make_gnsr0_smr_cfg(n) \
{ \
.reg = TEGRA_SMMU_BASE + SMMU_GNSR0_SMR ## n, \
.val = 0x00000000, \
}
#define smmu_make_gnsr0_s2cr_cfg(n) \
{ \
.reg = TEGRA_SMMU_BASE + SMMU_GNSR0_S2CR ## n, \
.val = 0x00000000, \
}
#define smmu_make_gnsr1_cbar_cfg(n) \
{ \
.reg = TEGRA_SMMU_BASE + (1 << PGSHIFT) + SMMU_GNSR1_CBAR ## n, \
.val = 0x00000000, \
}
#define smmu_make_gnsr1_cba2r_cfg(n) \
{ \
.reg = TEGRA_SMMU_BASE + (1 << PGSHIFT) + SMMU_GNSR1_CBA2R ## n, \
.val = 0x00000000, \
}
#define make_smmu_cb_cfg(name, n) \
{ \
.reg = TEGRA_SMMU_BASE + (CB_SIZE >> 1) + (n * (1 << PGSHIFT)) \
+ SMMU_CBn_ ## name, \
.val = 0x00000000, \
}
#define smmu_make_smrg_group(n) \
smmu_make_gnsr0_smr_cfg(n), \
smmu_make_gnsr0_s2cr_cfg(n), \
smmu_make_gnsr1_cbar_cfg(n), \
smmu_make_gnsr1_cba2r_cfg(n)
/* don't put "," here. */
#define smmu_make_cb_group(n) \
make_smmu_cb_cfg(SCTLR, n), \
make_smmu_cb_cfg(TCR2, n), \
make_smmu_cb_cfg(TTBR0_LO, n), \
make_smmu_cb_cfg(TTBR0_HI, n), \
make_smmu_cb_cfg(TCR, n), \
make_smmu_cb_cfg(PRRR_MAIR0, n),\
make_smmu_cb_cfg(FSR, n), \
make_smmu_cb_cfg(FAR_LO, n), \
make_smmu_cb_cfg(FAR_HI, n), \
make_smmu_cb_cfg(FSYNR0, n)
/* don't put "," here. */
#define smmu_bypass_cfg \
{ \
.reg = TEGRA_MC_BASE + MC_SMMU_BYPASS_CONFIG, \
.val = 0x00000000, \
}
#define _START_OF_TABLE_ \
{ \
.reg = 0xCAFE05C7, \
.val = 0x00000000, \
}
#define _END_OF_TABLE_ \
{ \
.reg = 0xFFFFFFFF, \
.val = 0xFFFFFFFF, \
}
static
__attribute__
((
aligned
(
16
)))
smmu_regs_t
smmu_ctx_regs
[]
=
{
/*******************************************************************************
* Array to hold SMMU context for Tegra186
******************************************************************************/
static
__attribute__
((
aligned
(
16
)))
smmu_regs_t
tegra186_smmu_context
[]
=
{
_START_OF_TABLE_
,
_START_OF_TABLE_
,
mc_make_sid_security_cfg
(
SCEW
),
mc_make_sid_security_cfg
(
SCEW
),
mc_make_sid_security_cfg
(
AFIR
),
mc_make_sid_security_cfg
(
AFIR
),
...
@@ -424,83 +314,13 @@ static __attribute__((aligned(16))) smmu_regs_t smmu_ctx_regs[] = {
...
@@ -424,83 +314,13 @@ static __attribute__((aligned(16))) smmu_regs_t smmu_ctx_regs[] = {
_END_OF_TABLE_
,
_END_OF_TABLE_
,
};
};
/*
/*
******************************************************************************
*
Save SMMU settings before "System Suspend" to TZDRAM
*
Handler to return the pointer to the SMMU's context struct
*/
*****************************************************************************
*/
void
tegra_smmu_save_context
(
uint64_t
smmu_ctx
_addr
)
smmu_regs_t
*
plat_get_
smmu_ctx
(
void
)
{
{
uint32_t
i
;
#if DEBUG
plat_params_from_bl2_t
*
params_from_bl2
=
bl31_get_plat_params
();
uint64_t
tzdram_base
=
params_from_bl2
->
tzdram_base
;
uint64_t
tzdram_end
=
tzdram_base
+
params_from_bl2
->
tzdram_size
;
uint32_t
reg_id1
,
pgshift
,
cb_size
;
/* sanity check SMMU settings c*/
reg_id1
=
mmio_read_32
((
TEGRA_SMMU_BASE
+
SMMU_GNSR0_IDR1
));
pgshift
=
(
reg_id1
&
ID1_PAGESIZE
)
?
16
:
12
;
cb_size
=
(
2
<<
pgshift
)
*
\
(
1
<<
(((
reg_id1
>>
ID1_NUMPAGENDXB_SHIFT
)
&
ID1_NUMPAGENDXB_MASK
)
+
1
));
assert
(
!
((
pgshift
!=
PGSHIFT
)
||
(
cb_size
!=
CB_SIZE
)));
#endif
assert
((
smmu_ctx_addr
>=
tzdram_base
)
&&
(
smmu_ctx_addr
<=
tzdram_end
));
/* index of _END_OF_TABLE_ */
/* index of _END_OF_TABLE_ */
smmu_ctx_regs
[
0
].
val
=
ARRAY_SIZE
(
smmu_ctx_regs
)
-
1
;
tegra186_smmu_context
[
0
].
val
=
ARRAY_SIZE
(
tegra186_smmu_context
)
-
1
;
/* save SMMU register values */
for
(
i
=
1
;
i
<
ARRAY_SIZE
(
smmu_ctx_regs
)
-
1
;
i
++
)
smmu_ctx_regs
[
i
].
val
=
mmio_read_32
(
smmu_ctx_regs
[
i
].
reg
);
/* Save SMMU config settings */
memcpy16
((
void
*
)(
uintptr_t
)
smmu_ctx_addr
,
(
void
*
)
smmu_ctx_regs
,
sizeof
(
smmu_ctx_regs
));
/* save the SMMU table address */
mmio_write_32
(
TEGRA_SCRATCH_BASE
+
SECURE_SCRATCH_RSV11_LO
,
(
uint32_t
)
smmu_ctx_addr
);
mmio_write_32
(
TEGRA_SCRATCH_BASE
+
SECURE_SCRATCH_RSV11_HI
,
(
uint32_t
)(
smmu_ctx_addr
>>
32
));
}
#define SMMU_NUM_CONTEXTS 64
#define SMMU_CONTEXT_BANK_MAX_IDX 64
/*
* Init SMMU during boot or "System Suspend" exit
*/
void
tegra_smmu_init
(
void
)
{
uint32_t
val
,
i
,
ctx_base
;
/* Program the SMMU pagesize and reset CACHE_LOCK bit */
val
=
tegra_smmu_read_32
(
SMMU_GSR0_SECURE_ACR
);
val
|=
SMMU_GSR0_PGSIZE_64K
;
val
&=
~
SMMU_ACR_CACHE_LOCK_ENABLE_BIT
;
tegra_smmu_write_32
(
SMMU_GSR0_SECURE_ACR
,
val
);
/* reset CACHE LOCK bit for NS Aux. Config. Register */
val
=
tegra_smmu_read_32
(
SMMU_GNSR_ACR
);
val
&=
~
SMMU_ACR_CACHE_LOCK_ENABLE_BIT
;
tegra_smmu_write_32
(
SMMU_GNSR_ACR
,
val
);
/* disable TCU prefetch for all contexts */
ctx_base
=
(
SMMU_GSR0_PGSIZE_64K
*
SMMU_NUM_CONTEXTS
)
+
SMMU_CBn_ACTLR
;
for
(
i
=
0
;
i
<
SMMU_CONTEXT_BANK_MAX_IDX
;
i
++
)
{
val
=
tegra_smmu_read_32
(
ctx_base
+
(
SMMU_GSR0_PGSIZE_64K
*
i
));
val
&=
~
SMMU_CBn_ACTLR_CPRE_BIT
;
tegra_smmu_write_32
(
ctx_base
+
(
SMMU_GSR0_PGSIZE_64K
*
i
),
val
);
}
/* set CACHE LOCK bit for NS Aux. Config. Register */
val
=
tegra_smmu_read_32
(
SMMU_GNSR_ACR
);
val
|=
SMMU_ACR_CACHE_LOCK_ENABLE_BIT
;
tegra_smmu_write_32
(
SMMU_GNSR_ACR
,
val
);
/* set CACHE LOCK bit for S Aux. Config. Register */
return
tegra186_smmu_context
;
val
=
tegra_smmu_read_32
(
SMMU_GSR0_SECURE_ACR
);
val
|=
SMMU_ACR_CACHE_LOCK_ENABLE_BIT
;
tegra_smmu_write_32
(
SMMU_GSR0_SECURE_ACR
,
val
);
}
}
plat/nvidia/tegra/soc/t186/plat_trampoline.S
View file @
0f22bef3
...
@@ -94,6 +94,8 @@ endfunc tegra186_cpu_reset_handler
...
@@ -94,6 +94,8 @@ endfunc tegra186_cpu_reset_handler
__tegra186_cpu_reset_handler_data
:
__tegra186_cpu_reset_handler_data
:
.
quad
tegra_secure_entrypoint
.
quad
tegra_secure_entrypoint
.
quad
__BL31_END__
-
BL31_BASE
.
quad
__BL31_END__
-
BL31_BASE
.
globl
__tegra186_smmu_context
__tegra186_smmu_context
:
.
rept
TEGRA186_SMMU_CTX_SIZE
.
rept
TEGRA186_SMMU_CTX_SIZE
.
quad
0
.
quad
0
.
endr
.
endr
...
...
plat/nvidia/tegra/soc/t186/platform_t186.mk
View file @
0f22bef3
#
#
# Copyright (c) 2015-201
6
, ARM Limited and Contributors. All rights reserved.
# Copyright (c) 2015-201
7
, ARM Limited and Contributors. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# modification, are permitted provided that the following conditions are met:
...
@@ -29,6 +29,9 @@
...
@@ -29,6 +29,9 @@
#
#
# platform configs
# platform configs
ENABLE_AFI_DEVICE
:=
1
$(eval
$(call
add_define,ENABLE_AFI_DEVICE))
ENABLE_ROC_FOR_ORDERING_CLIENT_REQUESTS
:=
1
ENABLE_ROC_FOR_ORDERING_CLIENT_REQUESTS
:=
1
$(eval
$(call
add_define,ENABLE_ROC_FOR_ORDERING_CLIENT_REQUESTS))
$(eval
$(call
add_define,ENABLE_ROC_FOR_ORDERING_CLIENT_REQUESTS))
...
@@ -38,6 +41,12 @@ $(eval $(call add_define,RELOCATE_TO_BL31_BASE))
...
@@ -38,6 +41,12 @@ $(eval $(call add_define,RELOCATE_TO_BL31_BASE))
ENABLE_CHIP_VERIFICATION_HARNESS
:=
0
ENABLE_CHIP_VERIFICATION_HARNESS
:=
0
$(eval
$(call
add_define,ENABLE_CHIP_VERIFICATION_HARNESS))
$(eval
$(call
add_define,ENABLE_CHIP_VERIFICATION_HARNESS))
ENABLE_SMMU_DEVICE
:=
1
$(eval
$(call
add_define,ENABLE_SMMU_DEVICE))
NUM_SMMU_DEVICES
:=
1
$(eval
$(call
add_define,NUM_SMMU_DEVICES))
RESET_TO_BL31
:=
1
RESET_TO_BL31
:=
1
PROGRAMMABLE_RESET_ADDRESS
:=
1
PROGRAMMABLE_RESET_ADDRESS
:=
1
...
@@ -54,10 +63,10 @@ $(eval $(call add_define,PLATFORM_CLUSTER_COUNT))
...
@@ -54,10 +63,10 @@ $(eval $(call add_define,PLATFORM_CLUSTER_COUNT))
PLATFORM_MAX_CPUS_PER_CLUSTER
:=
4
PLATFORM_MAX_CPUS_PER_CLUSTER
:=
4
$(eval
$(call
add_define,PLATFORM_MAX_CPUS_PER_CLUSTER))
$(eval
$(call
add_define,PLATFORM_MAX_CPUS_PER_CLUSTER))
MAX_XLAT_TABLES
:=
2
0
MAX_XLAT_TABLES
:=
2
4
$(eval
$(call
add_define,MAX_XLAT_TABLES))
$(eval
$(call
add_define,MAX_XLAT_TABLES))
MAX_MMAP_REGIONS
:=
2
0
MAX_MMAP_REGIONS
:=
2
4
$(eval
$(call
add_define,MAX_MMAP_REGIONS))
$(eval
$(call
add_define,MAX_MMAP_REGIONS))
# platform files
# platform files
...
@@ -66,13 +75,16 @@ PLAT_INCLUDES += -I${SOC_DIR}/drivers/include
...
@@ -66,13 +75,16 @@ PLAT_INCLUDES += -I${SOC_DIR}/drivers/include
BL31_SOURCES
+=
lib/cpus/aarch64/denver.S
\
BL31_SOURCES
+=
lib/cpus/aarch64/denver.S
\
lib/cpus/aarch64/cortex_a57.S
\
lib/cpus/aarch64/cortex_a57.S
\
${COMMON_DIR}
/drivers/memctrl/memctrl_v2.c
\
${COMMON_DIR}
/drivers/memctrl/memctrl_v2.c
\
${COMMON_DIR}
/drivers/smmu/smmu.c
\
${SOC_DIR}
/drivers/mce/mce.c
\
${SOC_DIR}
/drivers/mce/mce.c
\
${SOC_DIR}
/drivers/mce/ari.c
\
${SOC_DIR}
/drivers/mce/ari.c
\
${SOC_DIR}
/drivers/mce/nvg.c
\
${SOC_DIR}
/drivers/mce/nvg.c
\
${SOC_DIR}
/drivers/mce/aarch64/nvg_helpers.S
\
${SOC_DIR}
/drivers/mce/aarch64/nvg_helpers.S
\
${SOC_DIR}
/
drivers/smmu/smmu
.c
\
${SOC_DIR}
/
plat_memctrl
.c
\
${SOC_DIR}
/plat_psci_handlers.c
\
${SOC_DIR}
/plat_psci_handlers.c
\
${SOC_DIR}
/plat_setup.c
\
${SOC_DIR}
/plat_setup.c
\
${SOC_DIR}
/plat_secondary.c
\
${SOC_DIR}
/plat_secondary.c
\
${SOC_DIR}
/plat_sip_calls.c
\
${SOC_DIR}
/plat_sip_calls.c
\
${SOC_DIR}
/plat_smmu.c
\
${SOC_DIR}
/plat_trampoline.S
${SOC_DIR}
/plat_trampoline.S
plat/rockchip/rk3399/drivers/dram/dfs.c
View file @
0f22bef3
...
@@ -445,7 +445,7 @@ static uint32_t get_pi_tdfi_phy_rdlat(struct dram_timing_t *pdram_timing,
...
@@ -445,7 +445,7 @@ static uint32_t get_pi_tdfi_phy_rdlat(struct dram_timing_t *pdram_timing,
}
else
if
(
timing_config
->
dram_type
==
LPDDR3
)
{
}
else
if
(
timing_config
->
dram_type
==
LPDDR3
)
{
mem_delay_ps
=
5500
;
mem_delay_ps
=
5500
;
}
else
{
}
else
{
printf
(
"get_pi_tdfi_phy_rdlat:dramtype unsupport
\n
"
);
NOTICE
(
"get_pi_tdfi_phy_rdlat:dramtype unsupport
\n
"
);
return
0
;
return
0
;
}
}
round_trip_ps
=
1100
+
500
+
mem_delay_ps
+
500
+
600
;
round_trip_ps
=
1100
+
500
+
mem_delay_ps
+
500
+
600
;
...
@@ -2009,21 +2009,6 @@ static uint32_t prepare_ddr_timing(uint32_t mhz)
...
@@ -2009,21 +2009,6 @@ static uint32_t prepare_ddr_timing(uint32_t mhz)
return
index
;
return
index
;
}
}
void
print_dram_status_info
(
void
)
{
uint32_t
*
p
;
uint32_t
i
;
p
=
(
uint32_t
*
)
&
rk3399_dram_status
.
timing_config
;
INFO
(
"rk3399_dram_status.timing_config:
\n
"
);
for
(
i
=
0
;
i
<
sizeof
(
struct
timing_related_config
)
/
4
;
i
++
)
tf_printf
(
"%u
\n
"
,
p
[
i
]);
p
=
(
uint32_t
*
)
&
rk3399_dram_status
.
drv_odt_lp_cfg
;
INFO
(
"rk3399_dram_status.drv_odt_lp_cfg:
\n
"
);
for
(
i
=
0
;
i
<
sizeof
(
struct
drv_odt_lp_config
)
/
4
;
i
++
)
tf_printf
(
"%u
\n
"
,
p
[
i
]);
}
uint32_t
ddr_set_rate
(
uint32_t
hz
)
uint32_t
ddr_set_rate
(
uint32_t
hz
)
{
{
uint32_t
low_power
,
index
,
ddr_index
;
uint32_t
low_power
,
index
,
ddr_index
;
...
...
plat/xilinx/zynqmp/platform.mk
View file @
0f22bef3
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# POSSIBILITY OF SUCH DAMAGE.
override ERRATA_A53_855873
:
= 1
override ENABLE_PLAT_COMPAT
:
= 0
override ENABLE_PLAT_COMPAT
:
= 0
override PROGRAMMABLE_RESET_ADDRESS
:
= 1
override PROGRAMMABLE_RESET_ADDRESS
:
= 1
PSCI_EXTENDED_STATE_ID
:=
1
PSCI_EXTENDED_STATE_ID
:=
1
...
...
services/spd/tspd/tspd_main.c
View file @
0f22bef3
...
@@ -631,7 +631,7 @@ uint64_t tspd_smc_handler(uint32_t smc_fid,
...
@@ -631,7 +631,7 @@ uint64_t tspd_smc_handler(uint32_t smc_fid,
cm_el1_sysregs_context_restore
(
NON_SECURE
);
cm_el1_sysregs_context_restore
(
NON_SECURE
);
cm_set_next_eret_context
(
NON_SECURE
);
cm_set_next_eret_context
(
NON_SECURE
);
SMC_RET
0
(
handle
);
SMC_RET
1
(
handle
,
SMC_OK
);
/*
/*
* Request from non secure world to resume the preempted
* Request from non secure world to resume the preempted
...
...
tools/fiptool/fiptool.c
View file @
0f22bef3
...
@@ -646,7 +646,7 @@ static unsigned long get_image_align(char *arg)
...
@@ -646,7 +646,7 @@ static unsigned long get_image_align(char *arg)
unsigned
long
align
;
unsigned
long
align
;
errno
=
0
;
errno
=
0
;
align
=
strtoul
(
arg
,
&
endptr
,
1
0
);
align
=
strtoul
(
arg
,
&
endptr
,
0
);
if
(
*
endptr
!=
'\0'
||
!
is_power_of_2
(
align
)
||
errno
!=
0
)
if
(
*
endptr
!=
'\0'
||
!
is_power_of_2
(
align
)
||
errno
!=
0
)
log_errx
(
"Invalid alignment: %s"
,
arg
);
log_errx
(
"Invalid alignment: %s"
,
arg
);
...
...
Prev
1
…
3
4
5
6
7
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment