From: Dirk Brandewie <dirk.brandewie@gmail.com>
Adds a kernel command line option "dtb_compat=<string>" and functions
for architecture/platform specific code to retrieve the command line
string and locate the compatible DTB linked into the kernel
of_flat_dt_get_dtb_compatible_string() returns a pointer string passed
from the command line or a pointer to an empty string.
of_flat_dt_find_compatible_dtb() returns a pointer to a DTB that is
compatible with the "compatible" string or a NULL pointer if no
matching DTB is present.
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
---
Documentation/kernel-parameters.txt | 7 +++++
drivers/of/fdt.c | 52 +++++++++++++++++++++++++++++++++++
include/linux/of_fdt.h | 4 +++
3 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index ed45e98..f9b77fa 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -655,6 +655,13 @@ and is between 256 and 4096 characters. It is defined in the file
dscc4.setup= [NET]
+ dtb_compat= [KNL]
+ Specify the "compatible" string for the device
+ tree blob present in the kernel image. This
+ string will be used to select the first device
+ tree blob whose compatible property matches
+ the string passed on the kernel commandline.
+
dynamic_printk Enables pr_debug()/dev_dbg() calls if
CONFIG_DYNAMIC_PRINTK_DEBUG has been enabled.
These can also be switched on/off via
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index c1360e0..c0858ce 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -15,6 +15,8 @@
#include <linux/of_fdt.h>
#include <linux/string.h>
#include <linux/errno.h>
+#include <asm-generic/vmlinux.lds.h>
+
#ifdef CONFIG_PPC
#include <asm/machdep.h>
@@ -604,3 +606,53 @@ void __init unflatten_device_tree(void)
pr_debug(" <- unflatten_device_tree()\n");
}
+
+#define ...