From: Dirk Brandewie <dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: sodaville-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
arjan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org
Subject: Re: [PATCH 2/2] of/fdt: add kernel command line option for dtb_compat string
Date: Tue, 16 Nov 2010 17:48:27 -0800 [thread overview]
Message-ID: <4CE3346B.3000109@gmail.com> (raw)
In-Reply-To: <AANLkTinwGh3HsLCfnfLLBHpu8UTy69JEYG17rkBn4nW4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 11/16/2010 04:12 PM, Grant Likely wrote:
> On Tue, Nov 16, 2010 at 6:50 AM, Dirk Brandewie
> <dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On 11/15/2010 10:32 PM, Grant Likely wrote:
>>>
>>> On Mon, Nov 15, 2010 at 08:01:21PM -0800, dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
>>>> +{
>>>> + void *rc = NULL;
>>>> + unsigned long root, size;
>>>> + struct boot_param_header *orig_initial_boot_params;
>>>> + uint8_t *blob;
>>>
>>> blob should be a void* here. It is never used as a uint8.
>>>
>>
>> I used uint8_t prevent compiler warning when blob is compared to __dtb_end
>>
>
> okay
>
>>>> +{
>>>> + strncpy(dtb_compat_name, line, MAX_DTB_COMPAT_STR);
>>>> + return 1;
>>>> +}
>>>
>>> I don't remember getting a response about whether or not
>>> of_find_compatible_dtb can be called directly from dtb_compat_setup.
>>> Doing so would eliminate the arbitrary MAX_DTB_COMPAT_STR because
>>> there would be no need to keep around a copy of dtb_compat_name. It
>>> also means that of_find_compatible_dtb() can be restricted to the file
>>> scope.
>>>
>>> Is there a use-case for calling of_find_compatible_dtb() anywhere
>>> other than in dtb_compat_setup?
>>>
>>
>> The use case for having these functions exposed is allowing the platfrom
>> code decide the policy for which dtb will be used in the case where a dtb
>> might have been passed in by the boot loader. These functions can be used as
>> a fallback if a dtb was not passed in or to override of the passed in dtb by
>> the platform code.
>
> Still this all looks very generic, even across architectures. I say
> don't export the functions for now, and change it later if a use case
> shows up that requires it. I'd really rather not let platform code
> muck about with it directly if there isn't a use case for it.
I have the use case for it in my platform. There will two ways that the kernel
can get the DTB.
1. The blob is linked in and I go find the one for my platform. This is the path
that uses the two new functions.
2. The a pointer blob passed in (physical address) from the bootloader. The blob
is relocated/copied to keep the bootloader from having to know the kernel memory
layout.
One method will be able to override the other. I am not sure what the
precedence between the methods will be ATM.
>
> However, thinking about it further. You also need to make sure this
> code is excluded for the powerpc and microblaze architectures because
> the kernel command line is passed via the device tree blob in those
> cases. By that time it gets called, it is too late to switch the
> device tree pointer.
>
if a "wrapped" kernel is booted doesn't it know exactly which dtb it should be
using? These platforms would never go looking for the command line value even
it it was passed in.
> g.
next prev parent reply other threads:[~2010-11-17 1:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-16 4:01 [PATCH 0/2] Adding DTB's to architecture independent vmlinux dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <cover.1289877715.git.dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-16 4:01 ` [PATCH 1/2] of: Add support for linking device tree blobs into vmlinux dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <ca5555dd665a668bf4e2b2256ccf4bb5d010cde1.1289877715.git.dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-16 4:41 ` Grant Likely
[not found] ` <20101116044110.GA4074-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-11-16 5:06 ` Dirk Brandewie
2010-11-16 5:17 ` Grant Likely
2010-11-16 5:17 ` Grant Likely
2010-11-16 5:28 ` Dirk Brandewie
2010-11-16 5:28 ` Dirk Brandewie
2010-11-16 6:10 ` Grant Likely
2010-11-16 6:10 ` Grant Likely
2010-11-16 4:01 ` [PATCH 2/2] of/fdt: add kernel command line option for dtb_compat string dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <bdb6f333aea69accf3ca3e74c1f01da0a8587aee.1289877715.git.dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-16 6:32 ` Grant Likely
[not found] ` <20101116063253.GB4074-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-11-16 13:50 ` Dirk Brandewie
[not found] ` <4CE28C32.3020807-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-17 0:12 ` Grant Likely
[not found] ` <AANLkTinwGh3HsLCfnfLLBHpu8UTy69JEYG17rkBn4nW4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-17 1:48 ` Dirk Brandewie [this message]
[not found] ` <4CE3346B.3000109-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-17 5:59 ` Grant Likely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CE3346B.3000109@gmail.com \
--to=dirk.brandewie-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=arjan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=sodaville-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.