summaryrefslogtreecommitdiff
path: root/recipes/u-boot/u-boot-git/beagleboard/0008-OMAP3-Overo-enable-config-eeprom-to-set-u-boot-env-v.patch
blob: c7aea042a72bc35436964ce4ab7ec9e4e1848b37 (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
From 4fb2bbcae8f283c46e762aa93b25cbbd55bab8b6 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Tue, 16 Feb 2010 09:58:01 -0800
Subject: [PATCH 08/37] OMAP3: Overo: enable config eeprom to set u-boot env variable

---
 board/overo/overo.c |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/board/overo/overo.c b/board/overo/overo.c
index 2838a1f..f6093d2 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -43,7 +43,9 @@ static struct {
 	unsigned int device_vendor;
 	unsigned char revision;
 	unsigned char content;
-	unsigned char data[6];
+	unsigned char fab_revision[8];
+	unsigned char env_var[16];
+	unsigned char env_setting[64];
 } expansion_config;
 
 #define TWL4030_I2C_BUS			0
@@ -209,36 +211,36 @@ int misc_init_r(void)
 	switch (get_expansion_id()) {
 		case GUMSTIX_SUMMIT:
 			printf("Recognized Summit expansion board (rev %d %s)\n",
-				expansion_config.revision, expansion_config.data);
+				expansion_config.revision, expansion_config.fab_revision);
 			setenv("defaultdisplay", "dvi");
 			break;
 		case GUMSTIX_TOBI:
 			printf("Recognized Tobi expansion board (rev %d %s)\n",
-				expansion_config.revision, expansion_config.data);
+				expansion_config.revision, expansion_config.fab_revision);
 			setenv("defaultdisplay", "dvi");
 			break;
 		case GUMSTIX_TOBI_DUO:
 			printf("Recognized Tobi Duo expansion board (rev %d %s)\n",
-				expansion_config.revision, expansion_config.data);
+				expansion_config.revision, expansion_config.fab_revision);
 			break;
 		case GUMSTIX_PALO35:
 			printf("Recognized Palo 35 expansion board (rev %d %s)\n",
-				expansion_config.revision, expansion_config.data);
+				expansion_config.revision, expansion_config.fab_revision);
 			setenv("defaultdisplay", "lcd35");
 			break;
 		case GUMSTIX_PALO43:
 			printf("Recognized Palo 43 expansion board (rev %d %s)\n",
-				expansion_config.revision, expansion_config.data);
+				expansion_config.revision, expansion_config.fab_revision);
 			setenv("defaultdisplay", "lcd43");
 			break;
 		case GUMSTIX_CHESTNUT43:
 			printf("Recognized Chestnut 43 expansion board (rev %d %s)\n",
-				expansion_config.revision, expansion_config.data);
+				expansion_config.revision, expansion_config.fab_revision);
 			setenv("defaultdisplay", "lcd43");
 			break;
 		case GUMSTIX_PINTO:
 			printf("Recognized Pinto expansion board (rev %d %s)\n",
-				expansion_config.revision, expansion_config.data);
+				expansion_config.revision, expansion_config.fab_revision);
 			break;
 		case GUMSTIX_NO_EEPROM:
 			printf("No EEPROM on expansion board\n");
@@ -247,6 +249,9 @@ int misc_init_r(void)
 			printf("Unrecognized expansion board\n");
 	}
 
+	if (expansion_config.content == 1)
+		setenv(expansion_config.env_var, expansion_config.env_setting);
+
 	i2c_set_bus_num(TWL4030_I2C_BUS);
 	twl4030_power_init();
 	twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
-- 
1.6.6.1