arm/fdt: Clean up debugging statements

* Add some comments
This commit is contained in:
Alexander von Gluck IV
2015-03-13 23:52:37 -05:00
parent 59ef0db249
commit de8d2d8957
+9 -3
View File
@@ -683,6 +683,12 @@ find_physical_memory_ranges(uint64 &total)
static uint64
fdt_get_range_offset(int32 node)
{
// Obtain the offset of the device by searching
// for the first ranges start in parents.
// It could be possible that there are multiple
// offset ranges in several parents + children.
// Lets hope that no system designer is that insane.
int depth = fdt_node_depth(gFDT, node);
int32 examineNode = node;
uint64 pathOffset = 0x0;
@@ -697,7 +703,7 @@ fdt_get_range_offset(int32 node)
fdt_get_cell_count(examineNode, regAddressCells, regSizeCells);
const uint32 *p = (const uint32 *)prop;
// soc base address cells
// All we are interested in is the start offset
if (regAddressCells == 2)
pathOffset = fdt64_to_cpu(*(uint64_t *)p);
else
@@ -758,10 +764,9 @@ fdt_get_device_base(const char* device)
size = fdt64_to_cpu(*(uint64_t *)p);
else if (regSizeCells == 1)
size = fdt32_to_cpu(*(uint32_t *)p);
// we can have 0 size cells
//p += regSizeCells;
dprintf("%s: before: %" B_PRIx64 "\n", __func__, baseDevice);
baseDevice -= fdt_get_range_offset(node);
dprintf("%s: %s found @ 0x%" B_PRIx64 " , size: 0x%" B_PRIx64 "\n",
@@ -796,6 +801,7 @@ mmu_init(void)
dprintf("total physical memory = %" B_PRId64 "MB\n", total / (1024 * 1024));
}
// XXX: A simple test.
fdt_get_device_base("/soc/gpio");
// see if subpages are disabled