summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2009-11-23 14:53:09 -0700
committerGrant Likely <grant.likely@secretlab.ca>2009-11-23 14:53:09 -0700
commite169cfbef46d62e042614ffafa8880eed1d894bb (patch)
tree44982b47e17dc361783d89629fbdde751cbc35e3 /drivers/of
parent2cfcadde83b308240690ff1c18f117d8bc7a08b0 (diff)
downloadlinux-3.10-e169cfbef46d62e042614ffafa8880eed1d894bb.tar.gz
linux-3.10-e169cfbef46d62e042614ffafa8880eed1d894bb.tar.bz2
linux-3.10-e169cfbef46d62e042614ffafa8880eed1d894bb.zip
of/flattree: merge find_flat_dt_string and initial_boot_params
Merge common code between Microblaze and PowerPC. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Tested-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/Kconfig4
-rw-r--r--drivers/of/Makefile1
-rw-r--r--drivers/of/fdt.c21
3 files changed, 26 insertions, 0 deletions
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index d2fa27c5c1b..462825e0312 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -1,3 +1,7 @@
+config OF_FLATTREE
+ bool
+ depends on OF
+
config OF_DEVICE
def_bool y
depends on OF && (SPARC || PPC_OF || MICROBLAZE)
diff --git a/drivers/of/Makefile b/drivers/of/Makefile
index bdfb5f5d4b0..f232cc98ce0 100644
--- a/drivers/of/Makefile
+++ b/drivers/of/Makefile
@@ -1,4 +1,5 @@
obj-y = base.o
+obj-$(CONFIG_OF_FLATTREE) += fdt.o
obj-$(CONFIG_OF_DEVICE) += device.o platform.o
obj-$(CONFIG_OF_GPIO) += gpio.o
obj-$(CONFIG_OF_I2C) += of_i2c.o
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
new file mode 100644
index 00000000000..9faa9a5cbdf
--- /dev/null
+++ b/drivers/of/fdt.c
@@ -0,0 +1,21 @@
+/*
+ * Functions for working with the Flattened Device Tree data format
+ *
+ * Copyright 2009 Benjamin Herrenschmidt, IBM Corp
+ * benh@kernel.crashing.org
+ *
+ * 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.
+ */
+
+#include <linux/of.h>
+#include <linux/of_fdt.h>
+
+struct boot_param_header *initial_boot_params;
+
+char *find_flat_dt_string(u32 offset)
+{
+ return ((char *)initial_boot_params) +
+ initial_boot_params->off_dt_strings + offset;
+}