Export board serial and board revision obtained from FDT blob
This commit is contained in:
parent
e57c66d586
commit
fd79f4a5a4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user