Skip to content

Commit b616285

Browse files
fhunlethmobileoverlord
authored andcommitted
Fix cape detection variables being lost
1 parent 98840d2 commit b616285

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
From fb17a037148873e548797941988f336243ecd8c0 Mon Sep 17 00:00:00 2001
2+
From: Frank Hunleth <[email protected]>
3+
Date: Wed, 11 Jul 2018 10:40:24 -0400
4+
Subject: [PATCH] Move cape detection to save environment
5+
6+
The U-boot environment gets trampled on when restoring it from eMMC.
7+
Since proper operation depends on the cape detection's environment
8+
variable settings carrying forward to the boot scripts, this moves the
9+
code to after the U-boot environment block is loaded.
10+
11+
It is unknown whether any code in between the first init and the late
12+
init does anything based on cape detection. If it does, then this patch
13+
breaks that code.
14+
---
15+
board/ti/am335x/board.c | 13 +++++--------
16+
1 file changed, 5 insertions(+), 8 deletions(-)
17+
18+
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
19+
index f4840d2..7dca157 100644
20+
--- a/board/ti/am335x/board.c
21+
+++ b/board/ti/am335x/board.c
22+
@@ -1204,14 +1204,6 @@ int board_init(void)
23+
}
24+
#endif
25+
26+
-#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
27+
-#ifdef CONFIG_TI_I2C_BOARD_DETECT
28+
- if (!board_is_pb() && !board_is_beaglelogic()) {
29+
- do_cape_detect();
30+
- }
31+
-#endif
32+
-#endif
33+
-
34+
return 0;
35+
}
36+
37+
@@ -1317,6 +1309,11 @@ int board_late_init(void)
38+
env_set("serial#", board_serial);
39+
}
40+
41+
+#ifdef CONFIG_TI_I2C_BOARD_DETECT
42+
+ if (!board_is_pb() && !board_is_beaglelogic()) {
43+
+ do_cape_detect();
44+
+ }
45+
+#endif
46+
return 0;
47+
}
48+
#endif
49+
--
50+
2.7.4
51+

0 commit comments

Comments
 (0)