Skip to content

Commit

Permalink
PM_SUSPEND: suspend: Suspend optimize the power consumption. [1/2]
Browse files Browse the repository at this point in the history
PD#168683

Problem:
Suspend optimize the power consumption

Solution:
Suspend optimize the power consumption by controlling gpio

Verify:
g12b-w400,test pass

Change-Id: Ib8d95606f7a2bfc5f1d60fc989858d35425b2961
Signed-off-by: Hong Guo <[email protected]>
(cherry picked from commit 2c9a47c9cb0a426b57aab2dbbf751ab159174aa2)
  • Loading branch information
Hong Guo committed Jul 6, 2018
1 parent 2546db5 commit 5997fb8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
15 changes: 13 additions & 2 deletions board/amlogic/g12b_skt_v1/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ static void power_off_at_24M(unsigned int suspend_from)
writel(readl(PREG_PAD_GPIO3_EN_N) & (~(1 << 8)), PREG_PAD_GPIO3_EN_N);
writel(readl(PERIPHS_PIN_MUX_C) & (~(0xf)), PERIPHS_PIN_MUX_C);

/*set test_n low to power off vcck & vcc 3.3v*/
/*set gpioao_4 low to power off vcck_a*/
writel(readl(AO_GPIO_O) & (~(1 << 4)), AO_GPIO_O);
writel(readl(AO_GPIO_O_EN_N) & (~(1 << 4)), AO_GPIO_O_EN_N);
writel(readl(AO_RTI_PIN_MUX_REG) & (~(0xf << 16)), AO_RTI_PIN_MUX_REG);

/*set test_n low to power off vcck_b & vcc 3.3v*/
writel(readl(AO_GPIO_O) & (~(1 << 31)), AO_GPIO_O);
writel(readl(AO_GPIO_O_EN_N) & (~(1 << 31)), AO_GPIO_O_EN_N);
writel(readl(AO_RTI_PIN_MUX_REG1) & (~(0xf << 28)), AO_RTI_PIN_MUX_REG1);
Expand All @@ -64,12 +69,18 @@ static void power_on_at_24M(unsigned int suspend_from)
/*step up ee voltage*/
set_vddee_voltage(CONFIG_VDDEE_INIT_VOLTAGE);

/*set test_n low to power on vcck & vcc 3.3v*/
/*set test_n low to power on vcck_b & vcc 3.3v*/
writel(readl(AO_GPIO_O) | (1 << 31), AO_GPIO_O);
writel(readl(AO_GPIO_O_EN_N) & (~(1 << 31)), AO_GPIO_O_EN_N);
writel(readl(AO_RTI_PIN_MUX_REG1) & (~(0xf << 28)), AO_RTI_PIN_MUX_REG1);
_udelay(100);

/*set gpioao_4 high to power on vcck_a*/
writel(readl(AO_GPIO_O) | (1 << 4), AO_GPIO_O);
writel(readl(AO_GPIO_O_EN_N) & (~(1 << 4)), AO_GPIO_O_EN_N);
writel(readl(AO_RTI_PIN_MUX_REG) & (~(0xf << 16)), AO_RTI_PIN_MUX_REG);
_udelay(100);

/*set gpioH_8 low to power on vcc 5v*/
writel(readl(PREG_PAD_GPIO3_EN_N) | (1 << 8), PREG_PAD_GPIO3_EN_N);
writel(readl(PERIPHS_PIN_MUX_C) & (~(0xf)), PERIPHS_PIN_MUX_C);
Expand Down
14 changes: 11 additions & 3 deletions board/amlogic/g12b_w400_v1/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ static void power_off_at_24M(unsigned int suspend_from)
writel(readl(PREG_PAD_GPIO3_EN_N) & (~(1 << 8)), PREG_PAD_GPIO3_EN_N);
writel(readl(PERIPHS_PIN_MUX_C) & (~(0xf)), PERIPHS_PIN_MUX_C);

/*set test_n low to power off vcck & vcc 3.3v*/
/*set gpioao_4 low to power off vcck_a*/
writel(readl(AO_GPIO_O) & (~(1 << 4)), AO_GPIO_O);
writel(readl(AO_GPIO_O_EN_N) & (~(1 << 4)), AO_GPIO_O_EN_N);
writel(readl(AO_RTI_PIN_MUX_REG) & (~(0xf << 16)), AO_RTI_PIN_MUX_REG);
/*set test_n low to power off vcck_b & vcc 3.3v*/
writel(readl(AO_GPIO_O) & (~(1 << 31)), AO_GPIO_O);
writel(readl(AO_GPIO_O_EN_N) & (~(1 << 31)), AO_GPIO_O_EN_N);
writel(readl(AO_RTI_PIN_MUX_REG1) & (~(0xf << 28)), AO_RTI_PIN_MUX_REG1);
Expand All @@ -64,12 +68,16 @@ static void power_on_at_24M(unsigned int suspend_from)
/*step up ee voltage*/
set_vddee_voltage(CONFIG_VDDEE_INIT_VOLTAGE);

/*set test_n low to power on vcck & vcc 3.3v*/
/*set test_n high to power on vcck_b & vcc 3.3v*/
writel(readl(AO_GPIO_O) | (1 << 31), AO_GPIO_O);
writel(readl(AO_GPIO_O_EN_N) & (~(1 << 31)), AO_GPIO_O_EN_N);
writel(readl(AO_RTI_PIN_MUX_REG1) & (~(0xf << 28)), AO_RTI_PIN_MUX_REG1);
_udelay(100);

/*set gpioao_4 high to power on vcck_a*/
writel(readl(AO_GPIO_O) | (1 << 4), AO_GPIO_O);
writel(readl(AO_GPIO_O_EN_N) & (~(1 << 4)), AO_GPIO_O_EN_N);
writel(readl(AO_RTI_PIN_MUX_REG) & (~(0xf << 16)), AO_RTI_PIN_MUX_REG);
_udelay(100);
/*set gpioH_8 low to power on vcc 5v*/
writel(readl(PREG_PAD_GPIO3_EN_N) | (1 << 8), PREG_PAD_GPIO3_EN_N);
writel(readl(PERIPHS_PIN_MUX_C) & (~(0xf)), PERIPHS_PIN_MUX_C);
Expand Down

0 comments on commit 5997fb8

Please sign in to comment.