Date: Sat, 5 Jan 2013 23:08:58 +0000 (UTC) From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245080 - head/sys/arm/broadcom/bcm2835 Message-ID: <201301052308.r05N8wIg098988@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301052308.r05N8wIg098988>