* RE: [PATCH] of/fdt: add kernel command line option for dtb_compat string
2010-12-06 17:54 [PATCH] of/fdt: add kernel command line option for dtb_compat string dirk.brandewie
@ 2010-12-06 18:37 ` Stephen Neuendorffer
2010-12-06 19:01 ` Dirk Brandewie
2010-12-14 17:33 ` Dirk Brandewie
2010-12-22 20:04 ` Dirk Brandewie
2 siblings, 1 reply; 11+ messages in thread
From: Stephen Neuendorffer @ 2010-12-06 18:37 UTC (permalink / raw)
To: dirk.brandewie, linux-kernel; +Cc: Randy Dunlap, devicetree-discuss, linux-doc
> -----Original Message-----
> From:
devicetree-discuss-bounces+stephen.neuendorffer=xilinx.com@lists.ozlabs.
org [mailto:devicetree-
> discuss-bounces+stephen.neuendorffer=xilinx.com@lists.ozlabs.org] On
Behalf Of
> dirk.brandewie@gmail.com
> Sent: Monday, December 06, 2010 9:54 AM
> To: linux-kernel@vger.kernel.org
> Cc: Randy Dunlap; devicetree-discuss@lists.ozlabs.org;
linux-doc@vger.kernel.org
> Subject: [PATCH] of/fdt: add kernel command line option for dtb_compat
string
>
> From: Dirk Brandewie <dirk.brandewie@gmail.com>
>
> Adds a kernel command line option "dtb_compat=<string>". This string
> will be used to select the first compatible device tree blob linked
> into the kernel if a device tree blob is was *not* passed in by the
> bootloader.
>
> Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
> ---
> Documentation/kernel-parameters.txt | 8 ++++++
> drivers/of/fdt.c | 48
+++++++++++++++++++++++++++++++++++
> 2 files changed, 56 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/kernel-parameters.txt
b/Documentation/kernel-parameters.txt
> index 92e83e5..64093e5 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -655,6 +655,14 @@ 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 vmlinux image. This
> + string will be used to select the first device
> + tree blob whose compatible property matches
> + the string if a dtb was NOT passed in by the
> + bootloader.
> +
> 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..ca1318c 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,49 @@ void __init unflatten_device_tree(void)
>
> pr_debug(" <- unflatten_device_tree()\n");
> }
> +
> +extern uint8_t __dtb_start[];
> +extern uint8_t __dtb_end[];
> +static void __init *of_flat_dt_find_compatible_dtb(char *name)
> +{
> + void *rc = NULL;
> + unsigned long root, size;
> + struct boot_param_header *orig_initial_boot_params;
> + uint8_t *blob;
> +
> + orig_initial_boot_params = initial_boot_params;
> + blob = __dtb_start;
> + initial_boot_params = (struct boot_param_header *)blob;
Oy... can you avoid the pointer dance by using of_fdt_is_compatible()
from my recent set of patches?
It takes a blob argument. Then the loop below goes away.
Steve
> +
> +
> + while (blob < __dtb_end) {
> + if (be32_to_cpu(initial_boot_params->magic) !=
OF_DT_HEADER) {
> + WARN(1, "Invalid device tree blob in
vmlinux\n");
> + break;
> + }
> +
> + root = of_get_flat_dt_root();
> + if (of_flat_dt_is_compatible(root, name) > 0) {
> + rc = blob;
> + break;
> + }
> +
> + size = be32_to_cpu(initial_boot_params->totalsize);
> + blob = PTR_ALIGN(blob + size, STRUCT_ALIGNMENT);
> + initial_boot_params = (struct boot_param_header *)blob;
> + }
> +
> + if (rc == NULL)
> + initial_boot_params = orig_initial_boot_params;
> + return rc;
> +}
> +
> +
> +static int __init of_flat_dtb_compat_setup(char *line)
> +{
> + if (!initial_boot_params)
> + initial_boot_params =
of_flat_dt_find_compatible_dtb(line);
> + return 1;
> +}
> +
> +early_param("dtb_compat", of_flat_dtb_compat_setup);
> +
> --
> 1.7.2.3
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] of/fdt: add kernel command line option for dtb_compat string
2010-12-06 18:37 ` Stephen Neuendorffer
@ 2010-12-06 19:01 ` Dirk Brandewie
2010-12-06 19:03 ` Dirk Brandewie
0 siblings, 1 reply; 11+ messages in thread
From: Dirk Brandewie @ 2010-12-06 19:01 UTC (permalink / raw)
To: Stephen Neuendorffer
Cc: linux-kernel, Randy Dunlap, devicetree-discuss, linux-doc,
Grant Likely
On 12/06/2010 10:37 AM, Stephen Neuendorffer wrote:
>
>
>> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
>> index c1360e0..ca1318c 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,49 @@ void __init unflatten_device_tree(void)
>>
>> pr_debug("<- unflatten_device_tree()\n");
>> }
>> +
>> +extern uint8_t __dtb_start[];
>> +extern uint8_t __dtb_end[];
>> +static void __init *of_flat_dt_find_compatible_dtb(char *name)
>> +{
>> + void *rc = NULL;
>> + unsigned long root, size;
>> + struct boot_param_header *orig_initial_boot_params;
>> + uint8_t *blob;
>> +
>> + orig_initial_boot_params = initial_boot_params;
>> + blob = __dtb_start;
>> + initial_boot_params = (struct boot_param_header *)blob;
>
> Oy... can you avoid the pointer dance by using of_fdt_is_compatible()
> from my recent set of patches?
I would like to get rid of the pointer dance. Is your patch set going to make it
into .37? I didn't see any acks.
> It takes a blob argument. Then the loop below goes away.
>
The loop will still be needed since multiple DTBs may be linked into the image.
using your of_fdt_is_compatible() will make the loop a lot more readable though.
--Dirk
> Steve
>
>> +
>> +
>> + while (blob< __dtb_end) {
>> + if (be32_to_cpu(initial_boot_params->magic) !=
> OF_DT_HEADER) {
>> + WARN(1, "Invalid device tree blob in
> vmlinux\n");
>> + break;
>> + }
>> +
>> + root = of_get_flat_dt_root();
>> + if (of_flat_dt_is_compatible(root, name)> 0) {
>> + rc = blob;
>> + break;
>> + }
>> +
>> + size = be32_to_cpu(initial_boot_params->totalsize);
>> + blob = PTR_ALIGN(blob + size, STRUCT_ALIGNMENT);
>> + initial_boot_params = (struct boot_param_header *)blob;
>> + }
>> +
>> + if (rc == NULL)
>> + initial_boot_params = orig_initial_boot_params;
>> + return rc;
>> +}
>> +
>> +
>> +static int __init of_flat_dtb_compat_setup(char *line)
>> +{
>> + if (!initial_boot_params)
>> + initial_boot_params =
> of_flat_dt_find_compatible_dtb(line);
>> + return 1;
>> +}
>> +
>> +early_param("dtb_compat", of_flat_dtb_compat_setup);
>> +
>> --
>> 1.7.2.3
>>
>> _______________________________________________
>> devicetree-discuss mailing list
>> devicetree-discuss@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/devicetree-discuss
>
>
> This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] of/fdt: add kernel command line option for dtb_compat string
2010-12-06 19:01 ` Dirk Brandewie
@ 2010-12-06 19:03 ` Dirk Brandewie
[not found] ` <4CFD3371.3080807-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 11+ messages in thread
From: Dirk Brandewie @ 2010-12-06 19:03 UTC (permalink / raw)
To: Stephen Neuendorffer
Cc: linux-kernel, Randy Dunlap, devicetree-discuss, linux-doc,
Grant Likely
On 12/06/2010 11:01 AM, Dirk Brandewie wrote:
> On 12/06/2010 10:37 AM, Stephen Neuendorffer wrote:
>>
>>
>>> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
>>> index c1360e0..ca1318c 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,49 @@ void __init unflatten_device_tree(void)
>>>
>>> pr_debug("<- unflatten_device_tree()\n");
>>> }
>>> +
>>> +extern uint8_t __dtb_start[];
>>> +extern uint8_t __dtb_end[];
>>> +static void __init *of_flat_dt_find_compatible_dtb(char *name)
>>> +{
>>> + void *rc = NULL;
>>> + unsigned long root, size;
>>> + struct boot_param_header *orig_initial_boot_params;
>>> + uint8_t *blob;
>>> +
>>> + orig_initial_boot_params = initial_boot_params;
>>> + blob = __dtb_start;
>>> + initial_boot_params = (struct boot_param_header *)blob;
>>
>> Oy... can you avoid the pointer dance by using of_fdt_is_compatible()
>> from my recent set of patches?
>
> I would like to get rid of the pointer dance. Is your patch set going to make it
> into .37? I didn't see any acks.
>
Obviously I meant .38 :-)
>> It takes a blob argument. Then the loop below goes away.
>>
>
> The loop will still be needed since multiple DTBs may be linked into the image.
> using your of_fdt_is_compatible() will make the loop a lot more readable though.
>
> --Dirk
>
>> Steve
>>
>>> +
>>> +
>>> + while (blob< __dtb_end) {
>>> + if (be32_to_cpu(initial_boot_params->magic) !=
>> OF_DT_HEADER) {
>>> + WARN(1, "Invalid device tree blob in
>> vmlinux\n");
>>> + break;
>>> + }
>>> +
>>> + root = of_get_flat_dt_root();
>>> + if (of_flat_dt_is_compatible(root, name)> 0) {
>>> + rc = blob;
>>> + break;
>>> + }
>>> +
>>> + size = be32_to_cpu(initial_boot_params->totalsize);
>>> + blob = PTR_ALIGN(blob + size, STRUCT_ALIGNMENT);
>>> + initial_boot_params = (struct boot_param_header *)blob;
>>> + }
>>> +
>>> + if (rc == NULL)
>>> + initial_boot_params = orig_initial_boot_params;
>>> + return rc;
>>> +}
>>> +
>>> +
>>> +static int __init of_flat_dtb_compat_setup(char *line)
>>> +{
>>> + if (!initial_boot_params)
>>> + initial_boot_params =
>> of_flat_dt_find_compatible_dtb(line);
>>> + return 1;
>>> +}
>>> +
>>> +early_param("dtb_compat", of_flat_dtb_compat_setup);
>>> +
>>> --
>>> 1.7.2.3
>>>
>>> _______________________________________________
>>> devicetree-discuss mailing list
>>> devicetree-discuss@lists.ozlabs.org
>>> https://lists.ozlabs.org/listinfo/devicetree-discuss
>>
>>
>> This email and any attachments are intended for the sole use of the named
>> recipient(s) and contain(s) confidential information that may be proprietary,
>> privileged or copyrighted under applicable law. If you are not the intended
>> recipient, do not read, copy, or forward this email message or any
>> attachments. Delete this email message and any attachments immediately.
>>
>>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] of/fdt: add kernel command line option for dtb_compat string
2010-12-06 17:54 [PATCH] of/fdt: add kernel command line option for dtb_compat string dirk.brandewie
2010-12-06 18:37 ` Stephen Neuendorffer
@ 2010-12-14 17:33 ` Dirk Brandewie
2010-12-22 20:04 ` Dirk Brandewie
2 siblings, 0 replies; 11+ messages in thread
From: Dirk Brandewie @ 2010-12-14 17:33 UTC (permalink / raw)
To: dirk.brandewie
Cc: linux-kernel, Randy Dunlap, Grant Likely, linux-doc,
devicetree-discuss
On 12/06/2010 09:54 AM, dirk.brandewie@gmail.com wrote:
> From: Dirk Brandewie<dirk.brandewie@gmail.com>
>
> Adds a kernel command line option "dtb_compat=<string>". This string
> will be used to select the first compatible device tree blob linked
> into the kernel if a device tree blob is was *not* passed in by the
> bootloader.
>
> Signed-off-by: Dirk Brandewie<dirk.brandewie@gmail.com>
> ---
> Documentation/kernel-parameters.txt | 8 ++++++
> drivers/of/fdt.c | 48 +++++++++++++++++++++++++++++++++++
> 2 files changed, 56 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 92e83e5..64093e5 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -655,6 +655,14 @@ 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 vmlinux image. This
> + string will be used to select the first device
> + tree blob whose compatible property matches
> + the string if a dtb was NOT passed in by the
> + bootloader.
> +
> 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..ca1318c 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,49 @@ void __init unflatten_device_tree(void)
>
> pr_debug("<- unflatten_device_tree()\n");
> }
> +
> +extern uint8_t __dtb_start[];
> +extern uint8_t __dtb_end[];
> +static void __init *of_flat_dt_find_compatible_dtb(char *name)
> +{
> + void *rc = NULL;
> + unsigned long root, size;
> + struct boot_param_header *orig_initial_boot_params;
> + uint8_t *blob;
> +
> + orig_initial_boot_params = initial_boot_params;
> + blob = __dtb_start;
> + initial_boot_params = (struct boot_param_header *)blob;
> +
> + while (blob< __dtb_end) {
> + if (be32_to_cpu(initial_boot_params->magic) != OF_DT_HEADER) {
> + WARN(1, "Invalid device tree blob in vmlinux\n");
> + break;
> + }
> +
> + root = of_get_flat_dt_root();
> + if (of_flat_dt_is_compatible(root, name)> 0) {
> + rc = blob;
> + break;
> + }
> +
> + size = be32_to_cpu(initial_boot_params->totalsize);
> + blob = PTR_ALIGN(blob + size, STRUCT_ALIGNMENT);
> + initial_boot_params = (struct boot_param_header *)blob;
> + }
> +
> + if (rc == NULL)
> + initial_boot_params = orig_initial_boot_params;
> + return rc;
> +}
> +
> +
> +static int __init of_flat_dtb_compat_setup(char *line)
> +{
> + if (!initial_boot_params)
> + initial_boot_params = of_flat_dt_find_compatible_dtb(line);
> + return 1;
> +}
> +
> +early_param("dtb_compat", of_flat_dtb_compat_setup);
> +
Any other comments on this patch? Do I need to port it to use Stephens patch
set to allow passing in blobs to fdt.c?
--Dirk
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] of/fdt: add kernel command line option for dtb_compat string
2010-12-06 17:54 [PATCH] of/fdt: add kernel command line option for dtb_compat string dirk.brandewie
2010-12-06 18:37 ` Stephen Neuendorffer
2010-12-14 17:33 ` Dirk Brandewie
@ 2010-12-22 20:04 ` Dirk Brandewie
2010-12-30 21:34 ` Grant Likely
2 siblings, 1 reply; 11+ messages in thread
From: Dirk Brandewie @ 2010-12-22 20:04 UTC (permalink / raw)
To: dirk.brandewie
Cc: linux-kernel, Randy Dunlap, Grant Likely, linux-doc,
devicetree-discuss
On 12/06/2010 09:54 AM, dirk.brandewie@gmail.com wrote:
> From: Dirk Brandewie<dirk.brandewie@gmail.com>
>
> Adds a kernel command line option "dtb_compat=<string>". This string
> will be used to select the first compatible device tree blob linked
> into the kernel if a device tree blob is was *not* passed in by the
> bootloader.
>
> Signed-off-by: Dirk Brandewie<dirk.brandewie@gmail.com>
> ---
> Documentation/kernel-parameters.txt | 8 ++++++
> drivers/of/fdt.c | 48 +++++++++++++++++++++++++++++++++++
> 2 files changed, 56 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 92e83e5..64093e5 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -655,6 +655,14 @@ 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 vmlinux image. This
> + string will be used to select the first device
> + tree blob whose compatible property matches
> + the string if a dtb was NOT passed in by the
> + bootloader.
> +
> 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..ca1318c 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,49 @@ void __init unflatten_device_tree(void)
>
> pr_debug("<- unflatten_device_tree()\n");
> }
> +
> +extern uint8_t __dtb_start[];
> +extern uint8_t __dtb_end[];
> +static void __init *of_flat_dt_find_compatible_dtb(char *name)
> +{
> + void *rc = NULL;
> + unsigned long root, size;
> + struct boot_param_header *orig_initial_boot_params;
> + uint8_t *blob;
> +
> + orig_initial_boot_params = initial_boot_params;
> + blob = __dtb_start;
> + initial_boot_params = (struct boot_param_header *)blob;
> +
> + while (blob< __dtb_end) {
> + if (be32_to_cpu(initial_boot_params->magic) != OF_DT_HEADER) {
> + WARN(1, "Invalid device tree blob in vmlinux\n");
> + break;
> + }
> +
> + root = of_get_flat_dt_root();
> + if (of_flat_dt_is_compatible(root, name)> 0) {
> + rc = blob;
> + break;
> + }
> +
> + size = be32_to_cpu(initial_boot_params->totalsize);
> + blob = PTR_ALIGN(blob + size, STRUCT_ALIGNMENT);
> + initial_boot_params = (struct boot_param_header *)blob;
> + }
> +
> + if (rc == NULL)
> + initial_boot_params = orig_initial_boot_params;
> + return rc;
> +}
> +
> +
> +static int __init of_flat_dtb_compat_setup(char *line)
> +{
> + if (!initial_boot_params)
> + initial_boot_params = of_flat_dt_find_compatible_dtb(line);
> + return 1;
> +}
> +
> +early_param("dtb_compat", of_flat_dtb_compat_setup);
> +
Any more comments on this patch? Is it good to go or DOA?
Thanks
--Dirk
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] of/fdt: add kernel command line option for dtb_compat string
2010-12-22 20:04 ` Dirk Brandewie
@ 2010-12-30 21:34 ` Grant Likely
0 siblings, 0 replies; 11+ messages in thread
From: Grant Likely @ 2010-12-30 21:34 UTC (permalink / raw)
To: Dirk Brandewie; +Cc: linux-kernel, Randy Dunlap, linux-doc, devicetree-discuss
On Wed, Dec 22, 2010 at 12:04:56PM -0800, Dirk Brandewie wrote:
> On 12/06/2010 09:54 AM, dirk.brandewie@gmail.com wrote:
> >From: Dirk Brandewie<dirk.brandewie@gmail.com>
> >
> >Adds a kernel command line option "dtb_compat=<string>". This string
> >will be used to select the first compatible device tree blob linked
> >into the kernel if a device tree blob is was *not* passed in by the
> >bootloader.
> >
> >Signed-off-by: Dirk Brandewie<dirk.brandewie@gmail.com>
> >---
> > Documentation/kernel-parameters.txt | 8 ++++++
> > drivers/of/fdt.c | 48 +++++++++++++++++++++++++++++++++++
> > 2 files changed, 56 insertions(+), 0 deletions(-)
> >
> >diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> >index 92e83e5..64093e5 100644
> >--- a/Documentation/kernel-parameters.txt
> >+++ b/Documentation/kernel-parameters.txt
> >@@ -655,6 +655,14 @@ 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 vmlinux image. This
> >+ string will be used to select the first device
> >+ tree blob whose compatible property matches
> >+ the string if a dtb was NOT passed in by the
> >+ bootloader.
> >+
> > 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..ca1318c 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,49 @@ void __init unflatten_device_tree(void)
> >
> > pr_debug("<- unflatten_device_tree()\n");
> > }
> >+
> >+extern uint8_t __dtb_start[];
> >+extern uint8_t __dtb_end[];
> >+static void __init *of_flat_dt_find_compatible_dtb(char *name)
> >+{
> >+ void *rc = NULL;
> >+ unsigned long root, size;
> >+ struct boot_param_header *orig_initial_boot_params;
> >+ uint8_t *blob;
> >+
> >+ orig_initial_boot_params = initial_boot_params;
> >+ blob = __dtb_start;
> >+ initial_boot_params = (struct boot_param_header *)blob;
> >+
> >+ while (blob< __dtb_end) {
> >+ if (be32_to_cpu(initial_boot_params->magic) != OF_DT_HEADER) {
> >+ WARN(1, "Invalid device tree blob in vmlinux\n");
> >+ break;
> >+ }
> >+
> >+ root = of_get_flat_dt_root();
> >+ if (of_flat_dt_is_compatible(root, name)> 0) {
> >+ rc = blob;
> >+ break;
> >+ }
> >+
> >+ size = be32_to_cpu(initial_boot_params->totalsize);
> >+ blob = PTR_ALIGN(blob + size, STRUCT_ALIGNMENT);
> >+ initial_boot_params = (struct boot_param_header *)blob;
> >+ }
> >+
> >+ if (rc == NULL)
> >+ initial_boot_params = orig_initial_boot_params;
> >+ return rc;
> >+}
> >+
> >+
> >+static int __init of_flat_dtb_compat_setup(char *line)
> >+{
> >+ if (!initial_boot_params)
> >+ initial_boot_params = of_flat_dt_find_compatible_dtb(line);
> >+ return 1;
> >+}
> >+
> >+early_param("dtb_compat", of_flat_dtb_compat_setup);
> >+
> Any more comments on this patch? Is it good to go or DOA?
Not DOA, but I want to discuss the linking vs. wrapper issue again
before I commit to merging it. BTW, sorry for being MIA on this stuff
for pretty much all December. I got over committed, but things should
be better now.
g.
^ permalink raw reply [flat|nested] 11+ messages in thread