From 47c050325d73daad19b9cc14091285fe246d51d9 Mon Sep 17 00:00:00 2001 From: gonzo Date: Sat, 5 Jan 2013 23:08:58 +0000 Subject: Export board serial and board revision obtained from FDT blob --- sys/arm/broadcom/bcm2835/bcm2835_machdep.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'sys/arm') diff --git a/sys/arm/broadcom/bcm2835/bcm2835_machdep.c b/sys/arm/broadcom/bcm2835/bcm2835_machdep.c index 6baa8dd..7308c0f 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_machdep.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_machdep.c @@ -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 -- cgit v1.1