summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0038-Disabling-serial-console-if-FFUJ-is-enabled.patch
blob: 676107b546161247cd48ff8797f7644c1d8d9937 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
From 622a7d9cae44056b7cc06f1c1997fc883cd8c954 Mon Sep 17 00:00:00 2001
From: gokulsanker <gokul.sanker.v.g@intel.com>
Date: Wed, 8 Dec 2021 01:44:19 +0530
Subject: [PATCH] If FFUJ is enabled serial console must be disabled

FFUJ mode user is not allowed to enter uboot command
line interface. Serial console is disabled by creating
an indefinite sleep if FFUJ is enabled, same
functionality is used in whitely platforms

Since, boot failure check and FFUJ check were handled
by a single function, U-boot was disabling serial console which was the
expected behaviour of FFUJ mode.
That single fuction was splitted into two separate function for FFUJ
check and boot failure check. So in case of failed boot check, BMC
is going for #ast mode.

Tested:
Serial console is disabled in FFUJ mode

After 3rd terminating command for watchdog,this is the output:
Board ID: 0x02
Net: eth1: ftgmac@1e680000
FFUJ: 0
Intel failed boot check
ast#

Signed-off-by: gokulsanker <gokul.sanker.v.g@intel.com>
Signed-off-by: Anjaliintel-21 <anjali.ray@intel.com>
---
 board/aspeed/ast2600_intel/intel.c |  6 ++----
 common/autoboot.c                  | 16 ++++++++++++++--
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/board/aspeed/ast2600_intel/intel.c b/board/aspeed/ast2600_intel/intel.c
index 37b798ea44..fc435935de 100644
--- a/board/aspeed/ast2600_intel/intel.c
+++ b/board/aspeed/ast2600_intel/intel.c
@@ -57,7 +57,8 @@ int intel_failed_boot(void)
 		ret = led_get_by_label("id", &dev);
 		if (!ret)
 			led_set_state(dev, LEDST_ON);
-
+		printf("Intel failed boot check \n");
+
 		return 1;
 	}
 
@@ -111,9 +112,6 @@ int gpio_abort(void)
 {
 	int value;
 
-	if (intel_failed_boot())
-		return 1;
-
 	/* check ffuj to abort the autoboot */
 	value = read_ffuj();
 	printf("FFUJ: %d\n", value);
diff --git a/common/autoboot.c b/common/autoboot.c
index 8a99780423..b9b872f6f1 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -19,6 +19,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define MAX_DELAY_STOP_STR 32
 
+#define WAIT_STATE_TIMEOUT	10000
 #ifndef DEBUG_BOOTKEYS
 #define DEBUG_BOOTKEYS 0
 #endif
@@ -271,9 +272,20 @@ static int abortboot(int bootdelay)
 {
 	int abort = 0;
 
-	abort =	gpio_abort();
-	if (abort)
+	if (gpio_abort())
+	{
+		printf("#### BMC is in disabled state(FFU Jumper is asserted), "
+					"So BMC serial console disabled. ####\n");
+		while (1) {
+			mdelay(WAIT_STATE_TIMEOUT);
+		}
+	}
+
+	if (intel_failed_boot())
+	{
+		abort=1;
 		goto exit;
+	}
 
 	if (bootdelay >= 0)
 		abort = __abortboot(bootdelay);
-- 
2.17.1