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
94e0ed60
Commit
94e0ed60
authored
Apr 21, 2017
by
davidcunado-arm
Committed by
GitHub
Apr 21, 2017
Browse files
Merge pull request #902 from vwadekar/tegra186-sip-mce-calls
Tegra186: Support AARCH32/64 encoding for MCE calls
parents
e83b5fdc
c76c1b71
Changes
2
Hide whitespace changes
Inline
Side-by-side
plat/nvidia/tegra/common/tegra_sip_calls.c
View file @
94e0ed60
...
...
@@ -86,7 +86,7 @@ uint64_t tegra_sip_handler(uint32_t smc_fid,
/* Check if this is a SoC specific SiP */
err
=
plat_sip_handler
(
smc_fid
,
x1
,
x2
,
x3
,
x4
,
cookie
,
handle
,
flags
);
if
(
err
==
0
)
SMC_RET1
(
handle
,
err
);
SMC_RET1
(
handle
,
(
uint64_t
)
err
);
switch
(
smc_fid
)
{
...
...
plat/nvidia/tegra/soc/t186/plat_sip_calls.c
View file @
94e0ed60
...
...
@@ -52,27 +52,27 @@ extern uint32_t tegra186_system_powerdn_state;
/*******************************************************************************
* Tegra186 SiP SMCs
******************************************************************************/
#define TEGRA_SIP_SYSTEM_SHUTDOWN_STATE 0x
8
2FFFE01
#define TEGRA_SIP_GET_ACTMON_CLK_COUNTERS 0x
8
2FFFE02
#define TEGRA_SIP_MCE_CMD_ENTER_CSTATE 0x
8
2FFFF00
#define TEGRA_SIP_MCE_CMD_UPDATE_CSTATE_INFO 0x
8
2FFFF01
#define TEGRA_SIP_MCE_CMD_UPDATE_CROSSOVER_TIME 0x
8
2FFFF02
#define TEGRA_SIP_MCE_CMD_READ_CSTATE_STATS 0x
8
2FFFF03
#define TEGRA_SIP_MCE_CMD_WRITE_CSTATE_STATS 0x
8
2FFFF04
#define TEGRA_SIP_MCE_CMD_IS_SC7_ALLOWED 0x
8
2FFFF05
#define TEGRA_SIP_MCE_CMD_ONLINE_CORE 0x
8
2FFFF06
#define TEGRA_SIP_MCE_CMD_CC3_CTRL 0x
8
2FFFF07
#define TEGRA_SIP_MCE_CMD_ECHO_DATA 0x
8
2FFFF08
#define TEGRA_SIP_MCE_CMD_READ_VERSIONS 0x
8
2FFFF09
#define TEGRA_SIP_MCE_CMD_ENUM_FEATURES 0x
8
2FFFF0A
#define TEGRA_SIP_MCE_CMD_ROC_FLUSH_CACHE_TRBITS 0x
8
2FFFF0B
#define TEGRA_SIP_MCE_CMD_ENUM_READ_MCA 0x
8
2FFFF0C
#define TEGRA_SIP_MCE_CMD_ENUM_WRITE_MCA 0x
8
2FFFF0D
#define TEGRA_SIP_MCE_CMD_ROC_FLUSH_CACHE 0x
8
2FFFF0E
#define TEGRA_SIP_MCE_CMD_ROC_CLEAN_CACHE 0x
8
2FFFF0F
#define TEGRA_SIP_MCE_CMD_ENABLE_LATIC 0x
8
2FFFF10
#define TEGRA_SIP_MCE_CMD_UNCORE_PERFMON_REQ 0x
8
2FFFF11
#define TEGRA_SIP_MCE_CMD_MISC_CCPLEX 0x
8
2FFFF12
#define TEGRA_SIP_SYSTEM_SHUTDOWN_STATE 0x
C
2FFFE01
#define TEGRA_SIP_GET_ACTMON_CLK_COUNTERS 0x
C
2FFFE02
#define TEGRA_SIP_MCE_CMD_ENTER_CSTATE 0x
C
2FFFF00
#define TEGRA_SIP_MCE_CMD_UPDATE_CSTATE_INFO 0x
C
2FFFF01
#define TEGRA_SIP_MCE_CMD_UPDATE_CROSSOVER_TIME 0x
C
2FFFF02
#define TEGRA_SIP_MCE_CMD_READ_CSTATE_STATS 0x
C
2FFFF03
#define TEGRA_SIP_MCE_CMD_WRITE_CSTATE_STATS 0x
C
2FFFF04
#define TEGRA_SIP_MCE_CMD_IS_SC7_ALLOWED 0x
C
2FFFF05
#define TEGRA_SIP_MCE_CMD_ONLINE_CORE 0x
C
2FFFF06
#define TEGRA_SIP_MCE_CMD_CC3_CTRL 0x
C
2FFFF07
#define TEGRA_SIP_MCE_CMD_ECHO_DATA 0x
C
2FFFF08
#define TEGRA_SIP_MCE_CMD_READ_VERSIONS 0x
C
2FFFF09
#define TEGRA_SIP_MCE_CMD_ENUM_FEATURES 0x
C
2FFFF0A
#define TEGRA_SIP_MCE_CMD_ROC_FLUSH_CACHE_TRBITS 0x
C
2FFFF0B
#define TEGRA_SIP_MCE_CMD_ENUM_READ_MCA 0x
C
2FFFF0C
#define TEGRA_SIP_MCE_CMD_ENUM_WRITE_MCA 0x
C
2FFFF0D
#define TEGRA_SIP_MCE_CMD_ROC_FLUSH_CACHE 0x
C
2FFFF0E
#define TEGRA_SIP_MCE_CMD_ROC_CLEAN_CACHE 0x
C
2FFFF0F
#define TEGRA_SIP_MCE_CMD_ENABLE_LATIC 0x
C
2FFFF10
#define TEGRA_SIP_MCE_CMD_UNCORE_PERFMON_REQ 0x
C
2FFFF11
#define TEGRA_SIP_MCE_CMD_MISC_CCPLEX 0x
C
2FFFF12
/*******************************************************************************
* This function is responsible for handling all T186 SiP calls
...
...
@@ -90,8 +90,20 @@ int plat_sip_handler(uint32_t smc_fid,
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 -
* 0x82FFFFFF SiP SMC space
...
...
@@ -120,7 +132,8 @@ int plat_sip_handler(uint32_t smc_fid,
/* execute the command and store the result */
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
;
...
...
@@ -176,8 +189,10 @@ int plat_sip_handler(uint32_t smc_fid,
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
,
core_clk_ctr
);
write_ctx_reg
(
get_gpregs_ctx
(
handle
),
CTX_GPREG_X2
,
ref_clk_ctr
);
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
;
...
...
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