public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] omap3: overo: Select fdtfile for expansion board
@ 2014-06-06 18:37 Ash Charles
  2014-06-07 14:29 ` Stefan Herbrechtsmeier
  0 siblings, 1 reply; 15+ messages in thread
From: Ash Charles @ 2014-06-06 18:37 UTC (permalink / raw)
  To: u-boot

The u-boot Overo board actually supports both Overo (OMAP35xx)
and Overo Storm (AM/DM37xx) COMs with a range of different expansion
boards.  This provides a mechanism to select the an appropriate device
tree file based on the processor version and, if available, the
expansion board ID written on the expansion board EEPROM. To match the
3.15+ kernels, fdtfile names have this format:
 "omap3-overo[-storm]-<expansion board name>.dtb"

By default, we use "omap3-overo-storm-tobi.dtb".

Signed-off-by: Ash Charles <ashcharles@gmail.com>

Conflicts:
	include/configs/omap3_overo.h
---
 board/overo/overo.c           | 48 +++++++++++++++++++++++++++++++++++++++++++
 include/configs/omap3_overo.h |  2 +-
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/board/overo/overo.c b/board/overo/overo.c
index 62b50a8..6a0a655 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -230,6 +230,52 @@ unsigned int get_expansion_id(void)
 	return expansion_config.device_vendor;
 }
 
+#ifdef CONFIG_OF_LIBFDT
+void set_fdt(void)
+{
+	int is_storm = 0;
+	char fdtname[64];
+	char expansion_name[32];
+
+        if (get_cpu_family() != CPU_OMAP34XX)
+		is_storm = 1;
+
+        switch (expansion_config.device_vendor) {
+        case GUMSTIX_SUMMIT:
+		snprintf(expansion_name, ARRAY_SIZE(expansion_name), "%s",
+		        "summit");
+		break;
+	case GUMSTIX_CHESTNUT43:
+		snprintf(expansion_name, ARRAY_SIZE(expansion_name), "%s",
+		        "chestnut43");
+		break;
+	case GUMSTIX_PALO43:
+		snprintf(expansion_name, ARRAY_SIZE(expansion_name), "%s",
+		        "palo43");
+		break;
+	case GUMSTIX_GALLOP43:
+		snprintf(expansion_name, ARRAY_SIZE(expansion_name), "%s",
+		        "gallop43");
+		break;
+	case GUMSTIX_ALTO35:
+		snprintf(expansion_name, ARRAY_SIZE(expansion_name), "%s",
+		        "alto35");
+		break;
+	case GUMSTIX_TOBI:
+	case GUMSTIX_NO_EEPROM:
+	default:
+		snprintf(expansion_name, ARRAY_SIZE(expansion_name), "%s",
+		        "tobi");
+	}
+
+        snprintf(fdtname, ARRAY_SIZE(fdtname),  "omap3-overo%s-%s.dtb",
+                 is_storm ? "-storm" : "", expansion_name);
+        setenv("fdtfile", fdtname);
+}
+#else
+void set_fdt(void) { return; }
+#endif
+
 /*
  * Routine: misc_init_r
  * Description: Configure board specific parts
@@ -360,6 +406,8 @@ int misc_init_r(void)
 
 	dieid_num_r();
 
+	set_fdt();
+
 	return 0;
 }
 
diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
index 7b97be9..f79a528 100644
--- a/include/configs/omap3_overo.h
+++ b/include/configs/omap3_overo.h
@@ -83,7 +83,7 @@
 /* Environment information */
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	DEFAULT_LINUX_BOOT_ENV \
-	"fdtfile=overo.dtb\0" \
+	"fdtfile=omap3-overo-storm-tobi.dtb\0" \
 	"bootdir=/boot\0" \
 	"bootfile=zImage\0" \
 	"usbtty=cdc_acm\0" \
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-06-19 22:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-06 18:37 [U-Boot] [PATCH] omap3: overo: Select fdtfile for expansion board Ash Charles
2014-06-07 14:29 ` Stefan Herbrechtsmeier
2014-06-07 17:48   ` Tom Rini
2014-06-07 20:11     ` Ash Charles
2014-06-08  7:57       ` Stefan Herbrechtsmeier
2014-06-09 20:47         ` Ash Charles
2014-06-09 20:47           ` [U-Boot] [Patch v2] " Ash Charles
2014-06-10  7:30             ` Stefan Herbrechtsmeier
2014-06-10 17:17               ` Ash Charles
2014-06-10 18:06                 ` Stefan Herbrechtsmeier
2014-06-10 19:00                   ` Ash Charles
2014-06-10 19:02                     ` [U-Boot] [Patch v3] " Ash Charles
2014-06-10 19:29                       ` Stefan Herbrechtsmeier
2014-06-10 20:28                         ` Ash Charles
2014-06-19 22:02                       ` [U-Boot] [U-Boot, " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox