aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2009-11-23 16:53:09 -0500
committerGrant Likely <grant.likely@secretlab.ca>2009-11-23 16:53:09 -0500
commite169cfbef46d62e042614ffafa8880eed1d894bb (patch)
tree44982b47e17dc361783d89629fbdde751cbc35e3 /drivers/of
parent2cfcadde83b308240690ff1c18f117d8bc7a08b0 (diff)
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 d2fa27c5c1b2..462825e03123 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -1,3 +1,7 @@
1config OF_FLATTREE
2 bool
3 depends on OF
4
1config OF_DEVICE 5config OF_DEVICE
2 def_bool y 6 def_bool y
3 depends on OF && (SPARC || PPC_OF || MICROBLAZE) 7 depends on OF && (SPARC || PPC_OF || MICROBLAZE)
diff --git a/drivers/of/Makefile b/drivers/of/Makefile
index bdfb5f5d4b06..f232cc98ce00 100644
--- a/drivers/of/Makefile
+++ b/drivers/of/Makefile
@@ -1,4 +1,5 @@
1obj-y = base.o 1obj-y = base.o
2obj-$(CONFIG_OF_FLATTREE) += fdt.o
2obj-$(CONFIG_OF_DEVICE) += device.o platform.o 3obj-$(CONFIG_OF_DEVICE) += device.o platform.o
3obj-$(CONFIG_OF_GPIO) += gpio.o 4obj-$(CONFIG_OF_GPIO) += gpio.o
4obj-$(CONFIG_OF_I2C) += of_i2c.o 5obj-$(CONFIG_OF_I2C) += of_i2c.o
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
new file mode 100644
index 000000000000..9faa9a5cbdf0
--- /dev/null
+++ b/drivers/of/fdt.c
@@ -0,0 +1,21 @@
1/*
2 * Functions for working with the Flattened Device Tree data format
3 *
4 * Copyright 2009 Benjamin Herrenschmidt, IBM Corp
5 * benh@kernel.crashing.org
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 */
11
12#include <linux/of.h>
13#include <linux/of_fdt.h>
14
15struct boot_param_header *initial_boot_params;
16
17char *find_flat_dt_string(u32 offset)
18{
19 return ((char *)initial_boot_params) +
20 initial_boot_params->off_dt_strings + offset;
21}