Commit ef0a6bfc authored by Lin Huang's avatar Lin Huang Committed by Xing Zheng
Browse files

rockchip: rk3399: restore PMU_CRU_GATEDIS_CON0 value after ddr dvfs



we will set PMU_CRU_GATEDIS_CON0 when idle port, it will enable
all clock, for save power consumption, we need to restore old value
when finish it.
Signed-off-by: default avatarLin Huang <hl@rock-chips.com>
parent 87b5c17f
...@@ -112,6 +112,8 @@ ...@@ -112,6 +112,8 @@
#define CIC_CTRL1 0x4 #define CIC_CTRL1 0x4
#define CIC_STATUS0 0x10 #define CIC_STATUS0 0x10
uint32_t gatedis_con0;
static inline int check_dma_status(uint32_t vop_addr, uint32_t *clr_dma_flag) static inline int check_dma_status(uint32_t vop_addr, uint32_t *clr_dma_flag)
{ {
if (*clr_dma_flag) { if (*clr_dma_flag) {
...@@ -182,6 +184,7 @@ out: ...@@ -182,6 +184,7 @@ out:
static void idle_port(void) static void idle_port(void)
{ {
gatedis_con0 = mmio_read_32(PMU_CRU_BASE_ADDR + PMU_CRU_GATEDIS_CON0);
mmio_write_32(PMU_CRU_BASE_ADDR + PMU_CRU_GATEDIS_CON0, 0x3fffffff); mmio_write_32(PMU_CRU_BASE_ADDR + PMU_CRU_GATEDIS_CON0, 0x3fffffff);
mmio_setbits_32(PMU_BASE + PMU_BUS_IDLE_REQ, mmio_setbits_32(PMU_BASE + PMU_BUS_IDLE_REQ,
IDLE_REQ_MSCH0 | IDLE_REQ_MSCH1); IDLE_REQ_MSCH0 | IDLE_REQ_MSCH1);
...@@ -197,6 +200,9 @@ static void deidle_port(void) ...@@ -197,6 +200,9 @@ static void deidle_port(void)
while (mmio_read_32(PMU_BASE + PMU_BUS_IDLE_ST) & while (mmio_read_32(PMU_BASE + PMU_BUS_IDLE_ST) &
(IDLE_MSCH1 | IDLE_MSCH0)) (IDLE_MSCH1 | IDLE_MSCH0))
continue; continue;
/* document is wrong, PMU_CRU_GATEDIS_CON0 do not need set MASK BIT */
mmio_write_32(PMU_CRU_BASE_ADDR + PMU_CRU_GATEDIS_CON0, gatedis_con0);
} }
static void ddr_set_pll(void) static void ddr_set_pll(void)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment