summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPortisch <hugo.portisch@yahoo.de>2019-08-20 12:42:38 +0300
committerDongjin Kim <tobetter@gmail.com>2020-02-13 11:13:40 +0300
commit47cf95874f648456e102d9080c771edeb2df2229 (patch)
tree82f83cd7e05ad14a4b6bd792b0778335a33f8d12
parent2c67f44981a88d7c92249d198f639f440fd54fad (diff)
downloadu-boot-47cf95874f648456e102d9080c771edeb2df2229.tar.xz
g12a/g12b: scp_task: add enable/disable of 5V system power
Change-Id: I6ee95ee196daa02aa73a99ef9c024f0503152474
-rw-r--r--arch/arm/cpu/armv8/g12a/firmware/scp_task/user_task.c5
-rw-r--r--arch/arm/cpu/armv8/g12b/firmware/scp_task/user_task.c5
-rw-r--r--board/hardkernel/odroidc4/firmware/scp_task/pwr_ctrl.c18
-rw-r--r--board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c20
4 files changed, 36 insertions, 12 deletions
diff --git a/arch/arm/cpu/armv8/g12a/firmware/scp_task/user_task.c b/arch/arm/cpu/armv8/g12a/firmware/scp_task/user_task.c
index fc2e74764c..1bad144eea 100644
--- a/arch/arm/cpu/armv8/g12a/firmware/scp_task/user_task.c
+++ b/arch/arm/cpu/armv8/g12a/firmware/scp_task/user_task.c
@@ -40,6 +40,7 @@ enum scpi_client_id {
SCPI_CL_WOL,
SCPI_CL_IRPROTO,
SCPI_CL_REMOTE_MASK,
+ SCPI_CL_5V_SYSTEM_POWER,
SCPI_MAX,
};
@@ -153,6 +154,7 @@ extern unsigned int usr_pwr_key;
extern unsigned int usr_pwr_key_mask;
extern unsigned int usr_ir_proto;
extern unsigned int enable_wol;
+extern unsigned int enable_5V_system_power;
void process_low_task(unsigned command)
{
@@ -174,6 +176,9 @@ void process_low_task(unsigned command)
} else if ((command >> 16) == SCPI_CL_REMOTE_MASK) {
usr_pwr_key_mask = *(pcommand + 2);
dbg_print("pwr_key_mask = ", usr_pwr_key_mask);
+ } else if ((command >> 16) == SCPI_CL_5V_SYSTEM_POWER) {
+ enable_5V_system_power = *(pcommand + 2);
+ dbg_print("system power = ", enable_5V_system_power);
}
}
}
diff --git a/arch/arm/cpu/armv8/g12b/firmware/scp_task/user_task.c b/arch/arm/cpu/armv8/g12b/firmware/scp_task/user_task.c
index fc2e74764c..1bad144eea 100644
--- a/arch/arm/cpu/armv8/g12b/firmware/scp_task/user_task.c
+++ b/arch/arm/cpu/armv8/g12b/firmware/scp_task/user_task.c
@@ -40,6 +40,7 @@ enum scpi_client_id {
SCPI_CL_WOL,
SCPI_CL_IRPROTO,
SCPI_CL_REMOTE_MASK,
+ SCPI_CL_5V_SYSTEM_POWER,
SCPI_MAX,
};
@@ -153,6 +154,7 @@ extern unsigned int usr_pwr_key;
extern unsigned int usr_pwr_key_mask;
extern unsigned int usr_ir_proto;
extern unsigned int enable_wol;
+extern unsigned int enable_5V_system_power;
void process_low_task(unsigned command)
{
@@ -174,6 +176,9 @@ void process_low_task(unsigned command)
} else if ((command >> 16) == SCPI_CL_REMOTE_MASK) {
usr_pwr_key_mask = *(pcommand + 2);
dbg_print("pwr_key_mask = ", usr_pwr_key_mask);
+ } else if ((command >> 16) == SCPI_CL_5V_SYSTEM_POWER) {
+ enable_5V_system_power = *(pcommand + 2);
+ dbg_print("system power = ", enable_5V_system_power);
}
}
}
diff --git a/board/hardkernel/odroidc4/firmware/scp_task/pwr_ctrl.c b/board/hardkernel/odroidc4/firmware/scp_task/pwr_ctrl.c
index 51e784c4f0..29fcc9aed1 100644
--- a/board/hardkernel/odroidc4/firmware/scp_task/pwr_ctrl.c
+++ b/board/hardkernel/odroidc4/firmware/scp_task/pwr_ctrl.c
@@ -30,6 +30,7 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
unsigned int enable_wol = 0; /* disable Wake-On-Lan by default*/
+unsigned int enable_5V_system_power = 0; /* disable 5V system power (USB) by default*/
static void set_vddee_voltage(unsigned int target_voltage)
{
@@ -50,9 +51,11 @@ static void set_vddee_voltage(unsigned int target_voltage)
static void power_off_at_24M(unsigned int suspend_from)
{
- /*set gpioH_8 low to power off 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);
+ if (!enable_5V_system_power) {
+ /*set gpioH_8 low to power off 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);
+ }
if (!enable_wol) {
/*set test_n low to power off vcck_b & vcc 3.3v*/
@@ -78,9 +81,12 @@ static void power_on_at_24M(unsigned int suspend_from)
_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);
+ if (!enable_5V_system_power) {
+ /*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);
+ }
+
_udelay(10000);
}
diff --git a/board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c b/board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c
index db9335a71a..ce42cdfe03 100644
--- a/board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c
+++ b/board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c
@@ -30,6 +30,7 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
unsigned int enable_wol = 0; /* disable Wake-On-Lan by default*/
+unsigned int enable_5V_system_power = 0; /* disable 5V system power (USB) by default*/
static void set_vddee_voltage(unsigned int target_voltage)
{
@@ -67,9 +68,12 @@ static void set_vddee_voltage(unsigned int target_voltage)
static void power_off_at_24M(unsigned int suspend_from)
{
- /*set gpioH_8 low to power off 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);
+ if (!enable_5V_system_power)
+ {
+ /*set gpioH_8 low to power off 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);
+ }
/*set gpioao_4 low to power off vcck_a*/
writel(readl(AO_GPIO_O) & (~(1 << 4)), AO_GPIO_O);
@@ -105,9 +109,13 @@ static void power_on_at_24M(unsigned int suspend_from)
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);
+
+ if (!enable_5V_system_power)
+ {
+ /*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);
+ }
_udelay(10000);
}