summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0017-Manufacturing-mode-physical-presence-detection.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0017-Manufacturing-mode-physical-presence-detection.patch')
-rw-r--r--meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0017-Manufacturing-mode-physical-presence-detection.patch41
1 files changed, 27 insertions, 14 deletions
diff --git a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0017-Manufacturing-mode-physical-presence-detection.patch b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0017-Manufacturing-mode-physical-presence-detection.patch
index c0d409592..7df227c82 100644
--- a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0017-Manufacturing-mode-physical-presence-detection.patch
+++ b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0017-Manufacturing-mode-physical-presence-detection.patch
@@ -1,4 +1,4 @@
-From 5d3f9d42ba9b1f634a65ae52f6263b1c4a95b947 Mon Sep 17 00:00:00 2001
+From 3b08379cb6e841c934ded3db3c70a3d0906cea65 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
@@ -22,12 +22,12 @@ Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.co
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
- board/aspeed/ast2600_intel/intel.c | 74 ++++++++++++++++++++++++++++--
+ board/aspeed/ast2600_intel/intel.c | 87 ++++++++++++++++++++++++++++--
common/autoboot.c | 12 ++++-
- 2 files changed, 82 insertions(+), 4 deletions(-)
+ 2 files changed, 95 insertions(+), 4 deletions(-)
diff --git a/board/aspeed/ast2600_intel/intel.c b/board/aspeed/ast2600_intel/intel.c
-index fb9075f93945..a644010dd339 100644
+index f45b9d06a3f5..7664ac0ddfc6 100644
--- a/board/aspeed/ast2600_intel/intel.c
+++ b/board/aspeed/ast2600_intel/intel.c
@@ -8,6 +8,8 @@
@@ -66,19 +66,18 @@ index fb9075f93945..a644010dd339 100644
#define SCU_BASE 0x1E6E2000
#define SCU_338 0x338 //Generate UART 24 MHz Reference from UXCLK
#define SCU_33C 0x33c //Generate UART 24 MHz Reference from HUXCLK
-@@ -119,6 +141,11 @@ static void gpio_passthru_init(void)
+@@ -119,6 +141,10 @@ static void gpio_passthru_init(void)
SCU_BASE | SCU_418);
}
+void board_pre_abort_autoboot(void)
+{
-+ gpio_passthru_init();
+}
+
#define AST_LPC_BASE 0x1e789000
#define LPC_SNOOP_ADDR 0x80
#define HICR5 0x080 /* Host Interface Control Register 5 */
-@@ -300,8 +327,6 @@ int board_early_init_f(void)
+@@ -301,8 +327,6 @@ int board_early_init_f(void)
set_gpio_default_state();
@@ -87,7 +86,7 @@ index fb9075f93945..a644010dd339 100644
port80h_snoop_init();
sgpio_init();
-@@ -388,6 +413,43 @@ static void update_bootargs_cmd(const char *key, const char *value)
+@@ -389,6 +413,56 @@ static void update_bootargs_cmd(const char *key, const char *value)
free(buf);
}
@@ -100,13 +99,14 @@ index fb9075f93945..a644010dd339 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;
++ const uint32_t delay_for_indication = 2 * 1000;
++ uint32_t count;
+#ifdef CONFIG_LED_BLINK
+ struct udevice *dev;
+ int ret;
+#endif
+
-+ for (uint32_t count = 0; count < read_count; ++count) {
++ for (count = 0; count < read_count; ++count) {
+ if (read_frontpanel_power_button() != 1)
+ return false;
+
@@ -122,8 +122,20 @@ index fb9075f93945..a644010dd339 100644
+ }
+#endif
+
-+ /* 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 (read_frontpanel_power_button() != 1)
++ 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;
+}
@@ -131,7 +143,7 @@ index fb9075f93945..a644010dd339 100644
extern void espi_init(void);
extern void kcs_init(void);
extern void timer_enable(int n, u32 interval_us, interrupt_handler_t *handler,
-@@ -413,8 +475,14 @@ int board_late_init(void)
+@@ -414,8 +488,15 @@ int board_late_init(void)
snprintf(value, sizeof(value), "0x%x", gd->reset_reason);
update_bootargs_cmd("resetreason", value);
@@ -140,8 +152,9 @@ index fb9075f93945..a644010dd339 100644
+ if (gd->reset_reason & SYS_PWR_RESET_FLAG && is_mfg_mode_phy_req())
+ update_bootargs_cmd("special", "mfg");
+
++ gpio_passthru_init();
++
+ if (read_ffuj()) {
-+ gpio_passthru_init();
kcs_init();
+ }