diff options
| author | Oleksandr Tymoshenko <gonzo@FreeBSD.org> | 2013-01-05 23:08:58 +0000 |
|---|---|---|
| committer | Oleksandr Tymoshenko <gonzo@FreeBSD.org> | 2013-01-05 23:08:58 +0000 |
| commit | fd79f4a5a46efcdcd63fd0262f6667e51a09905d (patch) | |
| tree | a587a114cd70e425030f7076728ec3562ceaa2b2 | |
| parent | e57c66d586ae114e71975334217d94c067735405 (diff) | |
Export board serial and board revision obtained from FDT blob
Notes
svn path=/head/; revision=245080
| -rw-r--r-- | sys/arm/broadcom/bcm2835/bcm2835_machdep.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_machdep.c b/sys/arm/broadcom/bcm2835/bcm2835_machdep.c index 6baa8dde6e30..7308c0fba3d7 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 |
