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
a8b7a175
Commit
a8b7a175
authored
Jun 17, 2021
by
Madhukar Pappireddy
Committed by
TrustedFirmware Code Review
Jun 17, 2021
Browse files
Merge "feat(plat/imx8m): add system_reset2 implementation" into integration
parents
5d582ff9
60a0dde9
Changes
4
Hide whitespace changes
Inline
Side-by-side
plat/imx/imx8m/imx8m_psci_common.c
View file @
a8b7a175
...
...
@@ -152,19 +152,45 @@ void imx_get_sys_suspend_power_state(psci_power_state_t *req_state)
req_state
->
pwr_domain_state
[
i
]
=
PLAT_STOP_OFF_STATE
;
}
void
__dead2
imx_
system
_reset
(
void
)
static
void
__dead2
imx_
wdog_restart
(
bool
external
_reset
)
{
uintptr_t
wdog_base
=
IMX_WDOG_BASE
;
unsigned
int
val
;
/* WDOG_B reset */
val
=
mmio_read_16
(
wdog_base
);
#ifdef IMX_WDOG_B_RESET
val
=
(
val
&
0x00FF
)
|
WDOG_WCR_WDZST
|
WDOG_WCR_WDE
|
WDOG_WCR_WDT
|
WDOG_WCR_SRS
;
#else
val
=
(
val
&
0x00FF
)
|
WDOG_WCR_WDZST
|
WDOG_WCR_SRS
;
#endif
/*
* Common watchdog init flags, for additional details check
* 6.6.4.1 Watchdog Control Register (WDOGx_WCR)
*
* Initial bit selection:
* WDOG_WCR_WDE - Enable the watchdog.
*
* 0x000E mask is used to keep previous values (that could be set
* in SPL) of WDBG and WDE/WDT (both are write-one once-only bits).
*/
val
=
(
val
&
0x000E
)
|
WDOG_WCR_WDE
;
if
(
external_reset
)
{
/*
* To assert WDOG_B (external reset) we have
* to set WDA bit 0 (already set in previous step).
* SRS bits are required to be set to 1 (no effect on the
* system).
*/
val
|=
WDOG_WCR_SRS
;
}
else
{
/*
* To assert Software Reset Signal (internal reset) we have
* to set SRS bit to 0 (already set in previous step).
* SRE bit is required to be set to 1 when used in
* conjunction with the Software Reset Signal before
* SRS asserton, otherwise SRS bit will just automatically
* reset to 1.
*
* Also we set WDA to 1 (no effect on system).
*/
val
|=
WDOG_WCR_SRE
|
WDOG_WCR_WDA
;
}
mmio_write_16
(
wdog_base
,
val
);
mmio_write_16
(
wdog_base
+
WDOG_WSR
,
0x5555
);
...
...
@@ -173,6 +199,27 @@ void __dead2 imx_system_reset(void)
;
}
void
__dead2
imx_system_reset
(
void
)
{
#ifdef IMX_WDOG_B_RESET
imx_wdog_restart
(
true
);
#else
imx_wdog_restart
(
false
);
#endif
}
int
imx_system_reset2
(
int
is_vendor
,
int
reset_type
,
u_register_t
cookie
)
{
imx_wdog_restart
(
false
);
/*
* imx_wdog_restart cannot return (as it's a __dead function),
* however imx_system_reset2 has to return some value according
* to PSCI v1.1 spec.
*/
return
0
;
}
void
__dead2
imx_system_off
(
void
)
{
mmio_write_32
(
IMX_SNVS_BASE
+
SNVS_LPCR
,
SNVS_LPCR_SRTC_ENV
|
...
...
plat/imx/imx8m/imx8mm/imx8mm_psci.c
View file @
a8b7a175
...
...
@@ -28,6 +28,7 @@ static const plat_psci_ops_t imx_plat_psci_ops = {
.
pwr_domain_pwr_down_wfi
=
imx_pwr_domain_pwr_down_wfi
,
.
get_sys_suspend_power_state
=
imx_get_sys_suspend_power_state
,
.
system_reset
=
imx_system_reset
,
.
system_reset2
=
imx_system_reset2
,
.
system_off
=
imx_system_off
,
};
...
...
plat/imx/imx8m/imx8mq/imx8mq_psci.c
View file @
a8b7a175
...
...
@@ -117,6 +117,7 @@ static const plat_psci_ops_t imx_plat_psci_ops = {
.
pwr_domain_pwr_down_wfi
=
imx_pwr_domain_pwr_down_wfi
,
.
get_sys_suspend_power_state
=
imx_get_sys_suspend_power_state
,
.
system_reset
=
imx_system_reset
,
.
system_reset2
=
imx_system_reset2
,
.
system_off
=
imx_system_off
,
};
...
...
plat/imx/imx8m/include/imx8m_psci.h
View file @
a8b7a175
...
...
@@ -19,5 +19,6 @@ void imx_cpu_standby(plat_local_state_t cpu_state);
void
imx_domain_suspend
(
const
psci_power_state_t
*
target_state
);
void
imx_domain_suspend_finish
(
const
psci_power_state_t
*
target_state
);
void
__dead2
imx_pwr_domain_pwr_down_wfi
(
const
psci_power_state_t
*
target_state
);
int
imx_system_reset2
(
int
is_vendor
,
int
reset_type
,
u_register_t
cookie
);
#endif
/* IMX8M_PSCI_H */
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