2020-04-04 18:51:26 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2013-05-16 14:45:57 +02:00
|
|
|
|
|
|
|
/* Power setup code for EXYNOS5 */
|
|
|
|
|
2019-03-03 07:01:05 +01:00
|
|
|
#include <device/mmio.h>
|
2014-11-29 10:38:17 +01:00
|
|
|
#include <halt.h>
|
2014-10-20 22:18:56 +02:00
|
|
|
#include <soc/dmc.h>
|
|
|
|
#include <soc/power.h>
|
|
|
|
#include <soc/setup.h>
|
2013-05-16 14:45:57 +02:00
|
|
|
|
2014-12-23 13:31:30 +01:00
|
|
|
/* Set the PS-Hold drive value */
|
|
|
|
static void ps_hold_setup(void)
|
2013-05-16 14:45:57 +02:00
|
|
|
{
|
|
|
|
/* Set PS-Hold high */
|
2019-12-03 07:03:27 +01:00
|
|
|
setbits32(&exynos_power->ps_hold_ctrl,
|
2013-08-29 23:17:36 +02:00
|
|
|
POWER_PS_HOLD_CONTROL_DATA_HIGH);
|
2013-05-16 14:45:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void power_reset(void)
|
|
|
|
{
|
|
|
|
/* Clear inform1 so there's no change we think we've got a wake reset */
|
2013-08-29 23:17:36 +02:00
|
|
|
exynos_power->inform1 = 0;
|
2013-05-16 14:45:57 +02:00
|
|
|
|
2019-12-03 07:03:27 +01:00
|
|
|
setbits32(&exynos_power->sw_reset, 1);
|
2013-05-16 14:45:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* This function never returns */
|
|
|
|
void power_shutdown(void)
|
|
|
|
{
|
2019-12-03 07:03:27 +01:00
|
|
|
clrbits32(&exynos_power->ps_hold_ctrl,
|
2013-08-29 23:17:36 +02:00
|
|
|
POWER_PS_HOLD_CONTROL_DATA_HIGH);
|
2013-05-16 14:45:57 +02:00
|
|
|
|
2014-11-29 10:38:17 +01:00
|
|
|
halt();
|
2013-05-16 14:45:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void power_enable_dp_phy(void)
|
|
|
|
{
|
2019-12-03 07:03:27 +01:00
|
|
|
setbits32(&exynos_power->dptx_phy_control, EXYNOS_DP_PHY_ENABLE);
|
2013-05-16 14:45:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void power_enable_hw_thermal_trip(void)
|
|
|
|
{
|
|
|
|
/* Enable HW thermal trip */
|
2019-12-03 07:03:27 +01:00
|
|
|
setbits32(&exynos_power->ps_hold_ctrl, POWER_ENABLE_HW_TRIP);
|
2013-05-16 14:45:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t power_read_reset_status(void)
|
|
|
|
{
|
2013-08-29 23:17:36 +02:00
|
|
|
return exynos_power->inform1;
|
2013-05-16 14:45:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void power_exit_wakeup(void)
|
|
|
|
{
|
|
|
|
typedef void (*resume_func)(void);
|
|
|
|
|
2013-08-29 23:17:36 +02:00
|
|
|
((resume_func)exynos_power->inform0)();
|
2013-05-16 14:45:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int power_init(void)
|
|
|
|
{
|
|
|
|
ps_hold_setup();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void power_enable_xclkout(void)
|
|
|
|
{
|
|
|
|
/* use xxti for xclk out */
|
2019-12-03 07:03:27 +01:00
|
|
|
clrsetbits32(&exynos_power->pmu_debug, PMU_DEBUG_CLKOUT_SEL_MASK,
|
2013-08-29 23:17:36 +02:00
|
|
|
PMU_DEBUG_XXTI);
|
2013-05-16 14:45:57 +02:00
|
|
|
}
|
2013-09-24 09:51:05 +02:00
|
|
|
|
|
|
|
void power_release_uart_retention(void)
|
|
|
|
{
|
arm(64): Globally replace writel(v, a) with write32(a, v)
This patch is a raw application of the following spatch to src/:
@@
expression A, V;
@@
- writel(V, A)
+ write32(A, V)
@@
expression A, V;
@@
- writew(V, A)
+ write16(A, V)
@@
expression A, V;
@@
- writeb(V, A)
+ write8(A, V)
@@
expression A;
@@
- readl(A)
+ read32(A)
@@
expression A;
@@
- readb(A)
+ read8(A)
BRANCH=none
BUG=chromium:444723
TEST=None (depends on next patch)
Change-Id: I5dd96490c85ee2bcbc669f08bc6fff0ecc0f9e27
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 64f643da95d85954c4d4ea91c34a5c69b9b08eb6
Original-Change-Id: I366a2eb5b3a0df2279ebcce572fe814894791c42
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/254864
Reviewed-on: http://review.coreboot.org/9836
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-02-19 23:51:15 +01:00
|
|
|
write32(&exynos_power->padret_uart_opt, 1 << 28);
|
2013-09-24 09:51:05 +02:00
|
|
|
}
|