summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-02-13 19:01:16 +0100
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-03-09 01:40:20 +0100
commit0a475b553e27d3b2eb283f0ee72fdc3dc9248a3f (patch)
tree89688c254a08dc90a97fd9e19e1248e6efa20172
parent0b587a836bb3ec7c27619c29d9e6fd15a9e4b56b (diff)
sunxi: Scan DT tree node '/clocks' on sunxi boards
Moving to a DT-based clock framework on sunxi requires the subnodes of /clocks to be bound on boot-up. As /clocks does not contain a compatible-string, the U-Boot DT parsing code ignores it (and any subnodes). To overcome this limitation, the sunxi board-init code retrieves the /clocks node and explicitly starts a DM scan of the subnodes. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
-rw-r--r--board/sunxi/board.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 8e60145127..93a9785633 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -28,6 +28,7 @@
#include <asm/gpio.h>
#include <asm/io.h>
#include <crc.h>
+#include <dm/root.h>
#include <environment.h>
#include <libfdt.h>
#include <fdtdec.h>
@@ -109,9 +110,20 @@ static int setup_led(void)
int board_init(void)
{
__maybe_unused int id_pfr1, ret;
+ int __maybe_unused offset;
gd->bd->bi_boot_params = (PHYS_SDRAM_0 + 0x100);
+#if defined(CONFIG_CLK)
+ /* Sunxi device trees have their clock definitions in a tree
+ * below /clocks, which is a node without a compatible-string.
+ * We need to manually locate it and scan its subnodes.
+ */
+ offset = fdt_path_offset(gd->fdt_blob, "/clocks");
+ if (offset > 0)
+ dm_scan_fdt_node(gd->dm_root, gd->fdt_blob, offset, false);
+#endif
+
#ifndef CONFIG_ARM64
asm volatile("mrc p15, 0, %0, c0, c1, 1" : "=r"(id_pfr1));
debug("id_pfr1: 0x%08x\n", id_pfr1);
@@ -1040,4 +1052,3 @@ int board_fit_config_name_match(const char *name)
#endif
}
-