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:
authorJason M. Bills <jason.m.bills@linux.intel.com>2021-05-24 22:54:37 +0300
committerJason M. Bills <jason.m.bills@linux.intel.com>2021-05-24 23:12:35 +0300
commit2a64b8ae9b952b18b4aef38cb7c41ce6dba16c50 (patch)
tree704eb802dc7b987411a0e44d128bdd8978745d8c /meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0017-Manufacturing-mode-physical-presence-detection.patch
parent0e0df451ae365f09d5c0c766b253f23de26901f2 (diff)
downloadopenbmc-2a64b8ae9b952b18b4aef38cb7c41ce6dba16c50.tar.xz
Update to internal 0.52
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
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.patch118
1 files changed, 100 insertions, 18 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 0b0fb466d..c0d409592 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 8bfaae756740589ec9644a5ddcd8b19d7d7b9b73 Mon Sep 17 00:00:00 2001
+From 5d3f9d42ba9b1f634a65ae52f6263b1c4a95b947 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
@@ -6,11 +6,9 @@ Subject: [PATCH] Manufacturing mode physical presence detection
Support for physical presence of manufacturing mode added.
Front panel power button press for 15 seconds will be detected
and marked as special mode for manufacturing request.
-//TODO:
-//There will be 10 second Status LED blink for 10 seconds to
-//do the physical indication to the user. This indicates the
-//user that he has pressed power button long enough for
-//manufacturing mode detection.
+There will be Status LED blink for 10 seconds to do the physical
+indication to the user. This indicates the user that he has
+pressed power button long enough for manufacturing mode detection.
Tested:
1. Verified by holding the power button when u-boot boots for
@@ -24,14 +22,24 @@ 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 | 49 ++++++++++++++++++++++++++++++++++++++
- 1 file changed, 49 insertions(+)
+ board/aspeed/ast2600_intel/intel.c | 74 ++++++++++++++++++++++++++++--
+ common/autoboot.c | 12 ++++-
+ 2 files changed, 82 insertions(+), 4 deletions(-)
diff --git a/board/aspeed/ast2600_intel/intel.c b/board/aspeed/ast2600_intel/intel.c
-index 95e5492009d7..367657df56d1 100644
+index fb9075f93945..a644010dd339 100644
--- a/board/aspeed/ast2600_intel/intel.c
+++ b/board/aspeed/ast2600_intel/intel.c
-@@ -39,6 +39,26 @@ int gpio_abort(void)
+@@ -8,6 +8,8 @@
+ #include <led.h>
+ #include <malloc.h>
+
++#define SYS_PWR_RESET_FLAG BIT(0) /* from scu_info.c */
++
+ /* use GPIOC0 on intel boards */
+ #define FFUJ_GPIO "gpio@1e78000016"
+
+@@ -60,6 +62,26 @@ int gpio_abort(void)
return value <= 0 ? 0 : 1;
}
@@ -58,7 +66,28 @@ index 95e5492009d7..367657df56d1 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
-@@ -334,6 +354,31 @@ static void update_bootargs_cmd(const char *key, const char *value)
+@@ -119,6 +141,11 @@ 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)
+
+ set_gpio_default_state();
+
+- gpio_passthru_init();
+-
+ port80h_snoop_init();
+
+ sgpio_init();
+@@ -388,6 +413,43 @@ static void update_bootargs_cmd(const char *key, const char *value)
free(buf);
}
@@ -72,15 +101,27 @@ index 95e5492009d7..367657df56d1 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;
++#ifdef CONFIG_LED_BLINK
++ struct udevice *dev;
++ int ret;
++#endif
++
+ for (uint32_t count = 0; count < read_count; ++count) {
+ if (read_frontpanel_power_button() != 1)
+ return false;
+
+ mdelay(delay_in_ms);
+ }
-+ debug("is_mfg_mode_phy_req : detected mfg mode request\n");
-+ // TODO: enable id led control
-+ //id_led_control(GPIO_GREEN_LED, EIDLED_Blink_3HZ);
++
++ printf("MFG mode is requested.\n");
++
++#ifdef CONFIG_LED_BLINK
++ ret = led_get_by_label("green", &dev);
++ if (!ret) {
++ led_set_period(dev, 160);
++ }
++#endif
++
+ /* Delay the boot to do physical indication for mfg mode */
+ mdelay(delay_for_indication);
+
@@ -90,17 +131,58 @@ index 95e5492009d7..367657df56d1 100644
extern void espi_init(void);
extern void kcs_init(void);
extern void timer_enable(int n, u32 interval_us, interrupt_handler_t *handler,
-@@ -354,6 +399,10 @@ int board_late_init(void)
+@@ -413,8 +475,14 @@ int board_late_init(void)
snprintf(value, sizeof(value), "0x%x", gd->reset_reason);
update_bootargs_cmd("resetreason", value);
+- if (read_ffuj())
+ /* Update the special mode in bootargs */
-+ if (is_mfg_mode_phy_req())
++ if (gd->reset_reason & SYS_PWR_RESET_FLAG && is_mfg_mode_phy_req())
+ update_bootargs_cmd("special", "mfg");
+
- if (read_ffuj())
++ if (read_ffuj()) {
++ gpio_passthru_init();
kcs_init();
++ }
+
+ return 0;
+ }
+diff --git a/common/autoboot.c b/common/autoboot.c
+index 5e69000b848b..8a9978042386 100644
+--- a/common/autoboot.c
++++ b/common/autoboot.c
+@@ -261,13 +261,19 @@ int gpio_abort(void)
+ return 0;
+ }
+
++/* Allow for board specific config when we check abort condition */
++__weak void board_pre_abort_autoboot(void)
++{
++ /* please define board specific board_pre_abort_autoboot() */
++}
++
+ static int abortboot(int bootdelay)
+ {
+ int abort = 0;
+
+ abort = gpio_abort();
+ if (abort)
+- return abort;
++ goto exit;
+
+ if (bootdelay >= 0)
+ abort = __abortboot(bootdelay);
+@@ -277,6 +283,10 @@ static int abortboot(int bootdelay)
+ gd->flags &= ~GD_FLG_SILENT;
+ #endif
+
++exit:
++ if (abort)
++ board_pre_abort_autoboot();
++
+ return abort;
+ }
--
-2.7.4
+2.17.1