diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-04-04 14:20:32 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-04-04 14:20:32 +0200 |
commit | c4da77611c7b04778eeba2a153447a81fd3a4c49 (patch) | |
tree | 315fd447e2751c331e3931d3691a3b2acc128b83 /arch/arm/cpu | |
parent | 70867916a716880b925790bd7fed308d7fd2e112 (diff) | |
parent | 90ab1ee199843abd6409be3a5fdf532ce0ff6cc4 (diff) | |
download | barebox-c4da77611c7b04778eeba2a153447a81fd3a4c49.tar.gz barebox-c4da77611c7b04778eeba2a153447a81fd3a4c49.tar.xz |
Merge branch 'for-next/oftree'
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r-- | arch/arm/cpu/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/cpu/dtb.c | 41 |
2 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile index 44410eec95..525a1806fe 100644 --- a/arch/arm/cpu/Makefile +++ b/arch/arm/cpu/Makefile @@ -8,6 +8,7 @@ obj-y += start.o setupc.o # obj-$(CONFIG_CMD_ARM_CPUINFO) += cpuinfo.o obj-$(CONFIG_CMD_ARM_MMUINFO) += mmuinfo.o +obj-$(CONFIG_BUILTIN_DTB) += dtb.o obj-$(CONFIG_MMU) += mmu.o cache.o mmu-early.o pbl-$(CONFIG_MMU) += cache.o mmu-early.o obj-$(CONFIG_CPU_32v4T) += cache-armv4.o diff --git a/arch/arm/cpu/dtb.c b/arch/arm/cpu/dtb.c new file mode 100644 index 0000000000..10b73bd519 --- /dev/null +++ b/arch/arm/cpu/dtb.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2013 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ +#include <common.h> +#include <init.h> +#include <of.h> + +extern char __dtb_start[]; + +static int of_arm_init(void) +{ + struct device_node *root; + + root = of_get_root_node(); + if (root) + return 0; + + root = of_unflatten_dtb(NULL, __dtb_start); + if (root) { + pr_debug("using internal DTB\n"); + of_set_root_node(root); + if (IS_ENABLED(CONFIG_OFDEVICE)) + of_probe(); + } + + return 0; +} +core_initcall(of_arm_init); |