Skip to contentSkip to conversation

of/dtb: Add missing pieces of the in-kernel dtb support

RFC New Sebastian Andrzej Siewior 1 participant 1 message Jun 8, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 of/dtb: Add missing pieces of the in-kernel dtb support

This are the remaining pieces of Dirk's in-kernel-dtb-support which did not found their way upstream. Most of the support was merged via different trees except this.
I still need this because I don't (yet) have a bootloader with dtb support for my CE4100. Ralf has a similar on few of this boards and he poked me.
I'm exporting of_flat_dt_find_compatible_dtb() within the kernel because it may be required by others in case the kernel calls into firmware for the name of the required blob. See [0].
initial_dtb is currently x86 specific. Do we want to keep it that way or should be renamed?
Should this patch be splitted into thee smaller (x86, Makefile.lib, fdt) or is okay?

[0] http://www.linux-mips.org/archives/linux-mips/2011-06/msg00059.html

---
 arch/x86/platform/ce4100/Makefile |    4 +++
 drivers/of/fdt.c                  |   47 +++++++++++++++++++++++++++++++++++++
 include/linux/of_fdt.h            |    5 ++++
 scripts/Makefile.lib              |    3 ++
 4 files changed, 59 insertions(+), 0 deletions(-)
arch/x86/platform/ce4100/Makefile +4 -0
index 91fc929..ee6e836 100644
@@ -1 +1,5 @@
 obj-$(CONFIG_X86_INTEL_CE)	+= ce4100.o
+
+ifdef CONFIG_OF
+obj-$(CONFIG_X86_INTEL_CE) += falconfalls.dtb.o
+endif
drivers/of/fdt.c +47 -0

57 lines not on this page · raw message

include/linux/of_fdt.h +5 -0
index c84d900..58d7e3a 100644
@@ -117,8 +117,13 @@ extern int early_init_dt_scan_root(unsigned long node, const char *uname,
 /* Other Prototypes */
 extern void unflatten_device_tree(void);
 extern void early_init_devtree(void *);
+extern phys_addr_t of_flat_dt_find_compatible_dtb(char *name);
 #else /* CONFIG_OF_FLATTREE */
 static inline void unflatten_device_tree(void) {}
+static inline phys_addr_t of_flat_dt_find_compatible_dtb(char *name)
+{
+	return 0;
+}
 #endif /* CONFIG_OF_FLATTREE */
 
 #endif /* __ASSEMBLY__ */
scripts/Makefile.lib +3 -0
index 93b2b59..150b9ba 100644
@@ -224,6 +224,9 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
 quiet_cmd_dtc = DTC     $@
 cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $<
 
+$(obj)/%.dtb: $(obj)/%.dts
+	$(call if_changed,dtc)
+
 # Bzip2
 # ---------------------------------------------------------------------------
 
Signature · 1 line
1.7.4.4