summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch')
-rw-r--r--meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch39
1 files changed, 27 insertions, 12 deletions
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch
index 76606db0a..eaccfa99e 100644
--- a/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch
+++ b/meta-openbmc-mods/meta-ast2500/recipes-bsp/u-boot/files/0025-Manufacturing-mode-physical-presence-detection.patch
@@ -1,4 +1,4 @@
-From 3ed477feebb959749bd20a22e3acd8b39e22c193 Mon Sep 17 00:00:00 2001
+From 8a2f6a42c3be0426803fc0a70444ba95bf73443f Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Thu, 20 Jun 2019 18:11:43 +0530
Subject: [PATCH] Manufacturing mode physical presence detection
@@ -24,10 +24,10 @@ Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.co
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
---
board/aspeed/ast-g5/ast-g5-gpio.h | 2 +-
- board/aspeed/ast-g5/ast-g5-intel.c | 42 ++++++++++++++++++++++++++++++
+ board/aspeed/ast-g5/ast-g5-intel.c | 57 ++++++++++++++++++++++++++++++
board/aspeed/ast-g5/ast-g5.c | 2 --
- common/autoboot.c | 16 ++++++++++--
- 4 files changed, 57 insertions(+), 5 deletions(-)
+ common/autoboot.c | 16 +++++++--
+ 4 files changed, 72 insertions(+), 5 deletions(-)
diff --git a/board/aspeed/ast-g5/ast-g5-gpio.h b/board/aspeed/ast-g5/ast-g5-gpio.h
index 54b7388a22f5..8ccf4373460b 100644
@@ -43,7 +43,7 @@ index 54b7388a22f5..8ccf4373460b 100644
// GPIO Configuration Register bits
#define GPCFG_EVENT_TO_SMI (1 << 7) // 1 == enabled
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
-index 45ecd83fd3f0..79de13caa0af 100644
+index 45ecd83fd3f0..6ea7f0060c57 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
@@ -24,6 +24,7 @@ enum gpio_names {
@@ -74,7 +74,7 @@ index 45ecd83fd3f0..79de13caa0af 100644
static void sgpio_init(void)
{
uint32_t value;
-@@ -403,6 +410,30 @@ static void update_bootargs_cmd(const char *key, const char *value)
+@@ -403,6 +410,44 @@ static void update_bootargs_cmd(const char *key, const char *value)
free(buf);
}
@@ -87,8 +87,10 @@ index 45ecd83fd3f0..79de13caa0af 100644
+ */
+ const uint32_t delay_in_ms = 100;
+ const uint32_t read_count = ((15 * 1000) / delay_in_ms);
-+ const uint32_t delay_for_indication = 10 * 1000;
-+ for (uint32_t count = 0; count < read_count; ++count) {
++ const uint32_t delay_for_indication = 2 * 1000;
++ uint32_t count;
++
++ for (count = 0; count < read_count; ++count) {
+ if (!gpio_get_value(GPIO_FP_PWR_BTN))
+ return false;
+
@@ -96,8 +98,20 @@ index 45ecd83fd3f0..79de13caa0af 100644
+ }
+ debug("is_mfg_mode_phy_req : detected mfg mode request\n");
+ id_led_control(GPIO_GREEN_LED, EIDLED_Blink_3HZ);
-+ /* Delay the boot to do physical indication for mfg mode */
-+ mdelay(delay_for_indication);
++ /*
++ * Delay up to 15 seconds until the power button is released to prevent
++ * unintentional power button overriding to PCH through GPIO
++ * pass-through.
++ */
++ for (count = 0; count < read_count; ++count) {
++ if (!gpio_get_value(GPIO_FP_PWR_BTN))
++ break;
++
++ mdelay(delay_in_ms);
++ }
++ /* Keep the indication at least for 2 seconds */
++ if (delay_in_ms * count < delay_for_indication)
++ mdelay(delay_for_indication - (delay_in_ms * count));
+
+ return true;
+}
@@ -105,7 +119,7 @@ index 45ecd83fd3f0..79de13caa0af 100644
void ast_g5_intel_late_init(void)
{
char value[32];
-@@ -450,6 +481,17 @@ void ast_g5_intel_late_init(void)
+@@ -450,6 +495,18 @@ void ast_g5_intel_late_init(void)
ast_scu_write(0, AST_SCU_SYS_CTRL);
update_bootargs_cmd("resetreason", value);
@@ -115,11 +129,12 @@ index 45ecd83fd3f0..79de13caa0af 100644
+ update_bootargs_cmd("special", "mfg");
+ else
+ update_bootargs_cmd("special", NULL);
++
++ ast_enable_pass_through();
+}
+
+void board_pre_abort_autoboot(void)
+{
-+ ast_enable_pass_through();
}
static void pwm_init(void)