coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
power.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 /* Register map for Exynos5 PMU */
4 
5 #ifndef CPU_SAMSUNG_EXYNOS5420_POWER_H
6 #define CPU_SAMSUNG_EXYNOS5420_POWER_H
7 
8 #include <soc/cpu.h>
9 
10 /* Enable HW thermal trip with PS_HOLD_CONTROL register ENABLE_HW_TRIP bit */
12 
13 #define MIPI_PHY1_CONTROL_ENABLE (1 << 0)
14 #define MIPI_PHY1_CONTROL_M_RESETN (1 << 2)
15 
16 #define POWER_USB_PHY_CTRL_EN (1 << 0)
17 #define POWER_PS_HOLD_CONTROL_DATA_HIGH (1 << 8)
18 #define POWER_ENABLE_HW_TRIP (1UL << 31)
19 
20 #define EXYNOS_DP_PHY_ENABLE (1 << 0)
21 
22 /* PMU_DEBUG bits [12:8] = 0x1000 selects XXTI clock source */
23 #define PMU_DEBUG_XXTI 0x1000
24 /* Mask bit[12:8] for xxti clock selection */
25 #define PMU_DEBUG_CLKOUT_SEL_MASK 0x1f00
26 
27 /* Power Management Unit register map */
28 struct exynos5_power {
29  /* Add registers as and when required */
30  uint32_t om_stat; /* 0x0000 */
31  uint8_t reserved1[0x03fc];
32  uint32_t sw_reset; /* 0x0400 */
33  uint8_t reserved2[0x0300];
36  uint32_t usb_host_phy_ctrl; /* 0x070c */
37  uint8_t reserved3[0x4];
38  uint32_t mipi_phy1_control; /* 0x0714 */
39  uint8_t reserved4[0x8];
40  uint32_t dptx_phy_control; /* 0x0720 */
41  uint8_t reserved5[0xdc];
42  uint32_t inform0; /* 0x0800 */
43  uint32_t inform1; /* 0x0804 */
44  uint8_t reserved6[0x0f8];
45  uint32_t spare0; /* 0x0900 */
46  uint8_t reserved7[0x0fc];
47  uint32_t pmu_debug; /* 0x0a00 */
48  uint8_t reserved8[0x15fc];
49  struct { /* 0x2000 */
50  uint32_t config; /* 0x00 */
51  uint32_t status; /* 0x04 */
53  } arm_core[4];
57  uint32_t padret_uart_opt; /* 0x30e8 */
61  uint32_t ps_hold_ctrl; /* 0x330c */
63 check_member(exynos5_power, ps_hold_ctrl, 0x330c);
64 
65 static struct exynos5_power *const exynos_power = (void *)EXYNOS5_POWER_BASE;
66 
67 /**
68  * Perform a software reset.
69  */
70 void power_reset(void);
71 
72 /**
73  * Power off the system; it should never return.
74  */
75 void power_shutdown(void);
76 
77 /* Enable DPTX PHY */
78 void power_enable_dp_phy(void);
79 
80 /* Initialize the pmic voltages to power up the system */
81 int power_init(void);
82 
83 /* Read the reset status. */
85 
86 /* Read the resume function and call it. */
87 void power_exit_wakeup(void);
88 
89 /* pmu debug is used for xclkout, enable xclkout with source as XXTI */
90 void power_enable_xclkout(void);
91 
92 /* Release UART retention on resume (only for debugging, may conflict with
93  * kernel). */
95 
96 #endif
void power_exit_wakeup(void)
Definition: power.c:58
void power_release_uart_retention(void)
Definition: power.c:78
void power_enable_xclkout(void)
Definition: power.c:71
void power_enable_dp_phy(void)
Definition: power.c:42
check_member(exynos5_power, ps_hold_ctrl, 0x330c)
void power_enable_hw_thermal_trip(void)
Definition: power.c:47
void power_shutdown(void)
Power off the system; it should never return.
Definition: power.c:34
struct exynos5_power __packed
uint32_t power_read_reset_status(void)
Definition: power.c:53
void power_reset(void)
Perform a software reset.
Definition: power.c:20
int power_init(void)
Definition: power.c:65
static struct exynos5_power *const exynos_power
Definition: power.h:65
#define EXYNOS5_POWER_BASE
Definition: cpu.h:13
unsigned int uint32_t
Definition: stdint.h:14
unsigned char uint8_t
Definition: stdint.h:8
uint32_t dptx_phy_control
Definition: power.h:39
uint8_t reserved7[0x2724]
Definition: power.h:45
uint32_t usb_drd0_phy_ctrl
Definition: power.h:34
uint8_t reservedB[0xfc]
Definition: power.h:58
uint32_t om_stat
Definition: power.h:30
uint32_t spare0
Definition: power.h:45
uint8_t reserved2[0x0300]
Definition: power.h:33
uint32_t padret_uart_opt
Definition: power.h:46
uint8_t reserved3[0x8]
Definition: power.h:36
uint8_t reserved1[0x03fc]
Definition: power.h:31
uint8_t reservedA[0xe0]
Definition: power.h:56
uint32_t mipi_phy1_control
Definition: power.h:37
struct exynos5_power::@1561 arm_core[4]
uint8_t reservedC[0x120]
Definition: power.h:60
uint32_t padret_dram_cblk_opt
Definition: power.h:59
uint8_t reserved4[0x8]
Definition: power.h:38
uint8_t reserved8[0x1e0]
Definition: power.h:47
uint32_t ps_hold_ctrl
Definition: power.h:48
uint32_t usb_host_phy_ctrl
Definition: power.h:35
uint8_t reserved5[0xdc]
Definition: power.h:40
uint32_t padret_dram_status
Definition: power.h:55
uint8_t reserved9[0xe04]
Definition: power.h:54
uint8_t reserved[0x78]
Definition: power.h:52
uint32_t pmu_debug
Definition: power.h:44
uint32_t sw_reset
Definition: power.h:32
uint32_t inform0
Definition: power.h:41
uint8_t reserved6[0x1f8]
Definition: power.h:43
uint32_t config
Definition: power.h:50
uint32_t status
Definition: power.h:51
uint32_t usb_drd1_phy_ctrl
Definition: power.h:35
uint32_t inform1
Definition: power.h:42