svn commit: r245080 - head/sys/arm/broadcom/bcm2835

Oleksandr Tymoshenko gonzo at FreeBSD.org
Sat Jan 5 23:08:58 UTC 2013


Author: gonzo
Date: Sat Jan  5 23:08:58 2013
New Revision: 245080
URL: http://svnweb.freebsd.org/changeset/base/245080

Log:
  Export board serial and board revision obtained from FDT blob

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c	Sat Jan  5 23:08:10 2013	(r245079)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c	Sat Jan  5 23:08:58 2013	(r245080)
@@ -78,6 +78,25 @@ initarm_gpio_init(void)
 void
 initarm_late_init(void)
 {
+	phandle_t system;
+	pcell_t cells[2];
+	int len;
+
+	/*
+	 * It seems there is no way to let syscons framework know
+	 * that framebuffer resolution has changed. So just try
+	 * to fetch data from FDT and go with defaults if failed
+	 */
+	system = OF_finddevice("/system");
+	if (system != 0) {
+		len = OF_getprop(system, "linux,serial", &cells, sizeof(cells));
+		if (len > 0)
+			board_set_serial(fdt64_to_cpu(*((uint64_t *)cells)));
+
+		len = OF_getprop(system, "linux,revision", &cells, sizeof(cells));
+		if (len > 0)
+			board_set_revision(fdt32_to_cpu(*((uint32_t *)cells)));
+	}
 }
 
 #define FDT_DEVMAP_MAX	(2)		// FIXME


More information about the svn-src-all mailing list