All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dirk Brandewie <dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: sodaville-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org,
	"H. Peter Anvin" <hpa-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	David VomLehn <dvomlehn-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Subject: Re: [RFC] [PATCH V2] Adding DTB to architecture independent vmlinux
Date: Thu, 28 Oct 2010 08:26:32 -0700	[thread overview]
Message-ID: <4CC99628.6000002@gmail.com> (raw)

Hi David,

Thanks for looking at the patch.

On 10/27/2010 05:57 PM, David VomLehn wrote:
> On Wed, Oct 27, 2010 at 05:30:27PM -0700, Dirk Brandewie wrote:
>> Here is V2 of the patch.
> ...
>> diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
>> index 3068e1e..0f5eb1d 100644
>> --- a/arch/x86/kernel/Makefile
>> +++ b/arch/x86/kernel/Makefile
>> @@ -120,6 +120,21 @@ obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o
>>   obj-$(CONFIG_SWIOTLB)			+= pci-swiotlb.o
>>   obj-$(CONFIG_X86_OF)			+= prom.o
>>
>> +ifeq ($(CONFIG_KERNEL_DTB),y)
>> +ifneq ($(PLATFORM_DTB),)
>> +obj-y += $(PLATFORM_DTB).dtb.o
>> +endif
>> +endif
>> +
>> +dtstree	:= $(srctree)/arch/x86/boot/dts
>> +
>> +$(obj)/%.dtb: $(dtstree)/%.dts
>> +	$(call if_changed,dtc)
>> +
>> +$(obj)/%.dtb.S: $(obj)/%.dtb
>> +	@echo '.section .dtb,"a"'>  $@
>> +	@echo '.incbin "$<" '>>  $@
>> +
>
> I've been playing a bit with the patch, and would suggest something
> like the following for the second target:
>
> 	$(obj)/%.dtb.S: $(obj)/%.dtb
> 		@echo '#include<asm/page.h>'>$@
> 		@echo '.balign PAGE_SIZE'>>  $@
> 		@echo '.section .kernel:dtb,"a"'>>  $@
> 		@echo '.global __$(*F)_dtb'>>  $@
> 		@echo '__$(*F)_dtb:'>>  $@
> 		@echo '.incbin "$<" '>>  $@
> 		@echo '.balign PAGE_SIZE'>>  $@
>
> Advantages:
> 1.	Each blob gets a name that can be used to refer to it. This
> 	allows multiple blobs to be built into a kernel, each with
> 	its own name.  The name of each blob is taken from the file
> 	name, so a source
> 	file abc.dts would produce a blob referred to as __abc_dtb.
> 2.	Blobs are aligned on a page boundary and extend to the nearest
> 	page boundary. Any blobs you don't care about can then easily
> 	be completely freed.
>

I like this idea in general but I have to admit I don't completely understand
all the implications of adding multiple blobs.  I can see a use case where a
vendor would want to make a single static image that supported multiple
platforms.  I am not sure how common this would be.  One issue I see with
linking multiple DTB's into the image is now the platform init code is back to
trying to detect which hardware it is running on to select the correct blob to
get its configuration from.

As part of the complete DTB story on x86 I am adding the ability to pass the DTB
in from the boot loader.  I think this mechanism would be the more common case
for supporting multiple platforms with a single vmlinux image.


> You might then use:
>
> 	obj-y += $(addprefix .dtb.o,$(PLATFORM_DTB))
>
> to add blob names, but I'm not completely confident this is the way to go.
I am still trying to settle on the right way to specify the DTB to be linked in
that won't generate a lot of hate from the build/distribution people where they
are supporting multiple platforms with/without the need of the DTB.

--Dirk

             reply	other threads:[~2010-10-28 15:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-28 15:26 Dirk Brandewie [this message]
     [not found] ` <4CC99628.6000002-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-01  3:05   ` [RFC] [PATCH V2] Adding DTB to architecture independent vmlinux Grant Likely
2010-11-01  4:02   ` Grant Likely
2010-11-10  6:03   ` Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2010-10-26 14:24 [RFC] [PATCH] " Dirk Brandewie
2010-10-27 11:09 ` Grant Likely
2010-10-27 17:27   ` [sodaville] " H. Peter Anvin
     [not found]     ` <4CC860EF.6060503-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2010-10-28  0:30       ` [RFC] [PATCH V2] " Dirk Brandewie
     [not found]         ` <4CC8C423.9050600-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-10-28  0:57           ` David VomLehn
     [not found]             ` <20101028005754.GA27386-ZEW99E7oL/EiWxQNNj96ibh/4TqKg8J2XqFh9Ls21Oc@public.gmane.org>
2010-10-28 15:18               ` H. Peter Anvin
     [not found]                 ` <4CC99441.4030307-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2010-10-28 17:32                   ` David VomLehn
     [not found]                     ` <20101028173202.GA25771-ZEW99E7oL/EiWxQNNj96ibh/4TqKg8J2XqFh9Ls21Oc@public.gmane.org>
2010-10-28 21:44                       ` H. Peter Anvin
     [not found]                         ` <4CC9EECF.9020208-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2010-10-29  4:04                           ` David Gibson
2010-10-29 20:29                             ` H. Peter Anvin
     [not found]                               ` <4CCB2E93.2010809-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2010-10-30 12:57                                 ` David Gibson
2010-11-01  4:12                       ` 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=4CC99628.6000002@gmail.com \
    --to=dirk.brandewie-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=dvomlehn-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    --cc=hpa-VuQAYsv1563Yd54FQh9/CA@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.