summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-bsp/u-boot/files/0010-Update-Force-Firmware-Update-Jumper-to-use-new-gpio.patch
blob: c97e6d74f7cd54a424030b0c2f9d1b392ca610c3 (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
97
98
From 1f710737f2fe8dea4bc5ebef1e6011de294764b4 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mauery@linux.intel.com>
Date: Fri, 16 Nov 2018 14:59:04 -0800
Subject: [PATCH] Update Force Firmware Update Jumper to use new gpio API

Add a function that allows easy reading of the FFUJ from other
functions, such as autoboot.

Change-Id: I8ead931e9dd828522095a0ef386875be652ec885
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
---
 .../include/asm/arch-aspeed/ast-g5-intel.h    | 19 +++++++++++++++++++
 arch/arm/include/asm/arch-aspeed/platform.h   |  1 +
 board/aspeed/ast-g5/ast-g5-intel.c            |  5 +++++
 common/autoboot.c                             |  6 ++++++
 4 files changed, 31 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-aspeed/ast-g5-intel.h

diff --git a/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h b/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h
new file mode 100644
index 0000000000..cd9a0994fa
--- /dev/null
+++ b/arch/arm/include/asm/arch-aspeed/ast-g5-intel.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2018 Intel Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef __AST_INTEL_G5_H__
+#define __AST_INTEL_G5_H__
+
+#define AST_G5_INTEL 1
+
+#ifndef __ASSEMBLY__
+int intel_force_firmware_jumper_enabled(void);
+#endif
+
+#endif /* __AST_INTEL_G5_H__ */
diff --git a/arch/arm/include/asm/arch-aspeed/platform.h b/arch/arm/include/asm/arch-aspeed/platform.h
index 9f339e913a..3ea1c99089 100644
--- a/arch/arm/include/asm/arch-aspeed/platform.h
+++ b/arch/arm/include/asm/arch-aspeed/platform.h
@@ -27,6 +27,7 @@
 #include <asm/arch/ast2400_platform.h>
 #elif defined(AST_SOC_G5)
 #include <asm/arch/ast_g5_platform.h>
+#include <asm/arch/ast-g5-intel.h>
 #define CONFIG_BOARD_EARLY_INIT_F	1	/* Call board_early_init_f */
 #else
 #err "No define for platform.h"
diff --git a/board/aspeed/ast-g5/ast-g5-intel.c b/board/aspeed/ast-g5/ast-g5-intel.c
index 252a05dd73..58ad6a55b8 100644
--- a/board/aspeed/ast-g5/ast-g5-intel.c
+++ b/board/aspeed/ast-g5/ast-g5-intel.c
@@ -145,6 +145,11 @@ static void sgpio_init(void)
 	writel(value, AST_GPIO_BASE + GPIO254);
 }
 
+int intel_force_firmware_jumper_enabled(void)
+{
+	return gpio_get_value(GPIO_FF_UPD_JUMPER);
+}
+
 extern void espi_init(void);
 void ast_g5_intel(void)
 {
diff --git a/common/autoboot.c b/common/autoboot.c
index c52bad84a4..d66c0fa63a 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -14,6 +14,7 @@
 #include <menu.h>
 #include <post.h>
 #include <u-boot/sha256.h>
+#include <asm/arch/platform.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -259,6 +260,11 @@ static int abortboot(int bootdelay)
 {
 	int abort = 0;
 
+# ifdef AST_G5_INTEL
+	if (intel_force_firmware_jumper_enabled())
+		return 1;
+# endif
+
 	if (bootdelay >= 0)
 		abort = __abortboot(bootdelay);
 
-- 
2.17.1