Thread (24 messages) 24 messages, 4 authors, 2010-12-02

Re: [PATCH 2/5] of/fdt: add kernel command line option for dtb_compat string

From: Grant Likely <hidden>
Date: 2010-11-17 00:16:37
Also in: linux-arch, linux-devicetree, linux-kbuild, lkml

On Tue, Nov 16, 2010 at 3:41 PM,  [off-list ref] wrote:
From: Dirk Brandewie <redacted>

Adds a kernel command line option "dtb_compat=3D<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 <redacted>
---
[...]
+void __init *of_flat_dt_find_compatible_dtb(char *name)
+{
+ =A0 =A0 =A0 void *rc =3D NULL;
+ =A0 =A0 =A0 unsigned long root, size;
+ =A0 =A0 =A0 struct boot_param_header =A0*orig_initial_boot_params;
+ =A0 =A0 =A0 uint8_t *blob;
+
+ =A0 =A0 =A0 orig_initial_boot_params =3D initial_boot_params;
+ =A0 =A0 =A0 blob =3D __dtb_start;
+ =A0 =A0 =A0 initial_boot_params =3D (struct boot_param_header *)blob;
+
+ =A0 =A0 =A0 while (blob < __dtb_end &&
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 (be32_to_cpu(initial_boot_params->magic) =
=3D=3D OF_DT_HEADER)) {

The kernel needs to complain *loudly* if this occurs because it
represents a bug.  I'm tempted to say use BUG, but that would halt the
kernel and prevent any possibility of kernel log output.  WARN_ON() is
probably best.

g.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help