Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] OF FDT compilation support
@ 2010-11-17 11:49 Stanislav Bogatyrev
  2010-11-17 16:18 ` Thomas Petazzoni
  2010-11-23 21:45 ` Thomas Petazzoni
  0 siblings, 2 replies; 11+ messages in thread
From: Stanislav Bogatyrev @ 2010-11-17 11:49 UTC (permalink / raw)
  To: buildroot

Hello,

Here is a little patch to support OpenFirmware Flattened Device Tree
compilation.
I didn't found how to do it with vanilla buildroot source, so this is
added this to kernel compilation makefile, maybe it's better to put it
somewhere else.

Could anybody tell me if it's appropriate way in terms of buildroot ideology?
Thank you!

Best regards,
Stanislav Bogatyrev aka realloc()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-Flattened-Device-Tree-compilation-support-for-Po.patch
Type: text/x-diff
Size: 4270 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20101117/5bce8c24/attachment.bin>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] OF FDT compilation support
  2010-11-17 11:49 [Buildroot] OF FDT compilation support Stanislav Bogatyrev
@ 2010-11-17 16:18 ` Thomas Petazzoni
  2010-11-17 16:55   ` Stanislav Bogatyrev
  2010-11-23 21:45 ` Thomas Petazzoni
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2010-11-17 16:18 UTC (permalink / raw)
  To: buildroot

Hello!

On Wed, 17 Nov 2010 14:49:06 +0300
Stanislav Bogatyrev <realloc@gmail.com> wrote:

> Here is a little patch to support OpenFirmware Flattened Device Tree
> compilation.
> I didn't found how to do it with vanilla buildroot source, so this is
> added this to kernel compilation makefile, maybe it's better to put it
> somewhere else.

Thanks!

Could you describe a typical use case for this ? I.e, how would a
Buildroot user make use of this new feature ?

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] OF FDT compilation support
  2010-11-17 16:18 ` Thomas Petazzoni
@ 2010-11-17 16:55   ` Stanislav Bogatyrev
  0 siblings, 0 replies; 11+ messages in thread
From: Stanislav Bogatyrev @ 2010-11-17 16:55 UTC (permalink / raw)
  To: buildroot

Hello,

-Choose PowerPC architecture
- In `Linux Kernel` section enable `Compile OpenFirmware Flattened Device Tree`
- Provide a list of board you want to build device trees for, without
.dts extension. The list can be found in arch/powerpc/boot/dts/
- Choose output format
- Provide some options fot device tree compiler if necessary
- Get your device trees in output/images/


Best regards,
Stanislav Bogatyrev aka realloc()



On Wed, Nov 17, 2010 at 7:18 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello!
>
> On Wed, 17 Nov 2010 14:49:06 +0300
> Stanislav Bogatyrev <realloc@gmail.com> wrote:
>
>> Here is a little patch to support OpenFirmware Flattened Device Tree
>> compilation.
>> I didn't found how to do it with vanilla buildroot source, so this is
>> added this to kernel compilation makefile, maybe it's better to put it
>> somewhere else.
>
> Thanks!
>
> Could you describe a typical use case for this ? I.e, how would a
> Buildroot user make use of this new feature ?
>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] OF FDT compilation support
  2010-11-17 11:49 [Buildroot] OF FDT compilation support Stanislav Bogatyrev
  2010-11-17 16:18 ` Thomas Petazzoni
@ 2010-11-23 21:45 ` Thomas Petazzoni
  2011-03-26  8:28   ` Thomas De Schampheleire
  2011-03-31 20:51   ` Grant Likely
  1 sibling, 2 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2010-11-23 21:45 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 17 Nov 2010 14:49:06 +0300
Stanislav Bogatyrev <realloc@gmail.com> wrote:

>  #
> +# Device tree
> +#
> +
> +config BR2_LINUX_BUILD_DT

I think I'd prefer BR2_LINUX_DEVICE_TREE (ditto for all other options)

> +  bool "Compile OpenFirmware Flattened Device Tree"

Indentation before bool, depends on, help, etc. is one tab. Could you
fix everywhere ?

> +  depends on BR2_powerpc
> +  help
> +    Compile OpenFirmware Flattened Device Tree

And for help text it's one tab and two spaces. Could you fix
everywhere ?

A slightly better help text would be useful as well.

> +config BR2_LINUX_BUILD_DT_FORCE
> +  bool "Force - try to produce output even if the input tree has errors"
> +  depends on BR2_LINUX_BUILD_DT

We don't really have many "force" options anywhere else in Buildroot.
Is this really needed ?

Replace all BR2_LINUX_BUILD_DT by an enclosing if BR2_LINUX_DEVICE_TREE

> +config BR2_LINUX_BUILD_DT_LIST
> +  string "List of .dts files to compile"
> +  depends on BR2_LINUX_BUILD_DT
> +
> +choice
> +	prompt "DTC output format"
> +  depends on BR2_LINUX_BUILD_DT
> +  default BR2_LINUX_BUILD_DT_DTB
> +
> +config BR2_LINUX_BUILD_DT_DTB
> +  bool "dtb"
> +
> +config BR2_LINUX_BUILD_DT_DTS
> +  bool "dts"
> +
> +config BR2_LINUX_BUILD_DT_ASM
> +  bool "asm"
> +endchoice

What are all those formats for ?

> +config BR2_LINUX_BUILD_DT_BOOT_CPU
> +  string "CPU number to boot"
> +  default 0
> +  depends on BR2_LINUX_BUILD_DT
> +
> +config BR2_LINUX_BUILD_DT_EXTRA_SPACE
> +  string "Make the blob at least <bytes> long (extra space)"
> +  default 0
> +  depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )
> +
> +config BR2_LINUX_BUILD_DT_RESERVED_SPACE
> +  string "Make space for <number> reserve map entries"
> +  default 0
> +  depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )
> +
> +config BR2_LINUX_BUILD_DT_PADDING_SPACE
> +  string "Add padding to the blob of <bytes> long (extra space)"
> +  default 0
> +  depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )

I am not very familiar with the device tree, are those options really
useful in general ?

> +# prepare command-line arguments for dtc
> +LINUX26_DTS_PATH=$(LINUX26_DIR)/arch/$(KERNEL_ARCH)/boot/dts
> +LINUX26_DTC=$(LINUX26_DIR)/arch/$(KERNEL_ARCH)/boot/dtc
> +
> +ifeq ($(BR2_LINUX_BUILD_DT_FORCE),y)
> +LINUX26_DTC_ARG+= -f
> +endif
> +
> +ifeq ($(BR2_LINUX_BUILD_DT_DTB),y)
> +LINUX26_DTC_OUTF+=dtb
> +else ifeq ($(BR2_LINUX_BUILD_DT_ASM),y)
> +LINUX26_DTC_OUTF+=asm
> +else ifeq ($(BR2_LINUX_BUILD_DT_DTS),y)
> +LINUX26_DTC_OUTF+=dts
> +endif

Those lines should probably be LINUX26_DTC_OUTF= and not += since they
are mutually exclusive.

> +LINUX26_DTC_ARG+= -b $(call qstrip,$(BR2_LINUX_BUILD_DT_BOOT_CPU)) \
> +-R $(call qstrip,$(BR2_LINUX_BUILD_DT_RESERVED_SPACE)) \
> +-S $(call qstrip,$(BR2_LINUX_BUILD_DT_EXTRA_SPACE)) \
> +-p $(call qstrip,$(BR2_LINUX_BUILD_DT_PADDING_SPACE)) \
> +-o $(BINARIES_DIR)/$(file).$(LINUX26_DTC_OUTF) \
> +-O $(LINUX26_DTC_OUTF)

One tab here before each continuing line.

> +# Flattened Device Tree compilation
> +$(LINUX26_DIR)/.stamp_dt_compiled: $(LINUX26_DIR)/.stamp_compiled	
> +ifeq ($(BR2_LINUX_BUILD_DT),y)
> +	@$(call MESSAGE,"Compiling Flattened Device Tree")	
> +	$(foreach file, $(call qstrip,$(BR2_LINUX_BUILD_DT_LIST)), \
> +	$(LINUX26_DTC) $(LINUX26_DTC_ARG) $(LINUX26_DTS_PATH)/$(file).dts;)
> +endif
> +	$(Q)touch $@
> +
>  # Installation
>  $(LINUX26_DIR)/.stamp_installed: $(LINUX26_DIR)/.stamp_compiled
>  	@$(call MESSAGE,"Installing kernel")
> @@ -143,7 +176,7 @@ $(LINUX26_DIR)/.stamp_installed: $(LINUX26_DIR)/.stamp_compiled
>  	fi
>  	$(Q)touch $@
>  
> -linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed
> +linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed $(LINUX26_DIR)/.stamp_dt_compiled

I think I'd prefer something such as:

+$(LINUX26_DIR)/.stamp_dt_compiled: $(LINUX26_DIR)/.stamp_compiled	
+	@$(call MESSAGE,"Compiling Flattened Device Tree")	
+	$(foreach file, $(call qstrip,$(BR2_LINUX_BUILD_DT_LIST)), \
+	$(LINUX26_DTC) $(LINUX26_DTC_ARG) $(LINUX26_DTS_PATH)/$(file).dts;)
+	$(Q)touch $@
+
+ifeq ($(BR2_LINUX_BUILD_DT),y)
+LINUX26_DEVICE_TREE_DEP=$(LINUX26_DIR)/.stamp_dt_compiled
+endif
[...]
-linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed
+linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed $(LINUX26_DEVICE_TREE_DEP)

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] OF FDT compilation support
  2010-11-23 21:45 ` Thomas Petazzoni
@ 2011-03-26  8:28   ` Thomas De Schampheleire
  2011-03-28 13:22     ` Martin Hicks
  2011-03-31 20:51   ` Grant Likely
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas De Schampheleire @ 2011-03-26  8:28 UTC (permalink / raw)
  To: buildroot

Stanislav,

I haven't seen a follow-up on this. Have you ever considered sending
an updated patch, based on Thomas' comments?

Thanks,
Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] OF FDT compilation support
  2011-03-26  8:28   ` Thomas De Schampheleire
@ 2011-03-28 13:22     ` Martin Hicks
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Hicks @ 2011-03-28 13:22 UTC (permalink / raw)
  To: buildroot

On Sat, Mar 26, 2011 at 4:28 AM, Thomas De Schampheleire
<patrickdepinguin+buildroot@gmail.com> wrote:
> Stanislav,
>
> I haven't seen a follow-up on this. Have you ever considered sending
> an updated patch, based on Thomas' comments?

I also posted a patch last week to allow specifying an alternate
kernel make target, rather than the default 'bzImage', 'uImage', etc.
I'd much rather just leave FDT compilation to the kernel.  The
alternate make target, at least for powerpc boards, is how you tell
the kernel which FDT is used for your board.

mh

-- 
Martin Hicks P.Eng. ?? ? | ? ? ? ? mort at bork.org
Bork Consulting Inc. ? ? | ? +1 (613) 266-2296

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] OF FDT compilation support
  2010-11-23 21:45 ` Thomas Petazzoni
  2011-03-26  8:28   ` Thomas De Schampheleire
@ 2011-03-31 20:51   ` Grant Likely
  2011-03-31 21:31     ` Bryan Hundven
  2011-04-01  6:39     ` Thomas De Schampheleire
  1 sibling, 2 replies; 11+ messages in thread
From: Grant Likely @ 2011-03-31 20:51 UTC (permalink / raw)
  To: buildroot

On Tue, Nov 23, 2010 at 10:45:05PM +0100, Thomas Petazzoni wrote:
> Hello,
> 
> On Wed, 17 Nov 2010 14:49:06 +0300
> Stanislav Bogatyrev <realloc@gmail.com> wrote:
> 
> >  #
> > +# Device tree
> > +#
> > +
> > +config BR2_LINUX_BUILD_DT
> 
> I think I'd prefer BR2_LINUX_DEVICE_TREE (ditto for all other options)
> 
> > +  bool "Compile OpenFirmware Flattened Device Tree"
> 
> Indentation before bool, depends on, help, etc. is one tab. Could you
> fix everywhere ?
> 
> > +  depends on BR2_powerpc
> > +  help
> > +    Compile OpenFirmware Flattened Device Tree
> 
> And for help text it's one tab and two spaces. Could you fix
> everywhere ?
> 
> A slightly better help text would be useful as well.
> 
> > +config BR2_LINUX_BUILD_DT_FORCE
> > +  bool "Force - try to produce output even if the input tree has errors"
> > +  depends on BR2_LINUX_BUILD_DT
> 
> We don't really have many "force" options anywhere else in Buildroot.
> Is this really needed ?
> 
> Replace all BR2_LINUX_BUILD_DT by an enclosing if BR2_LINUX_DEVICE_TREE
> 
> > +config BR2_LINUX_BUILD_DT_LIST
> > +  string "List of .dts files to compile"
> > +  depends on BR2_LINUX_BUILD_DT
> > +
> > +choice
> > +	prompt "DTC output format"
> > +  depends on BR2_LINUX_BUILD_DT
> > +  default BR2_LINUX_BUILD_DT_DTB
> > +
> > +config BR2_LINUX_BUILD_DT_DTB
> > +  bool "dtb"
> > +
> > +config BR2_LINUX_BUILD_DT_DTS
> > +  bool "dts"
> > +
> > +config BR2_LINUX_BUILD_DT_ASM
> > +  bool "asm"
> > +endchoice
> 
> What are all those formats for ?

Pretty much *nobody* uses the ASM or DTS output options for building
deployable images.  DTB is about the only target necessary.

> 
> > +config BR2_LINUX_BUILD_DT_BOOT_CPU
> > +  string "CPU number to boot"
> > +  default 0
> > +  depends on BR2_LINUX_BUILD_DT

I don't think anyone specifies this manually either.

> > +
> > +config BR2_LINUX_BUILD_DT_EXTRA_SPACE
> > +  string "Make the blob at least <bytes> long (extra space)"
> > +  default 0
> > +  depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )

Modern u-boot can handle unpadded .dtbs just fine.  Should not need
this options.

> > +
> > +config BR2_LINUX_BUILD_DT_RESERVED_SPACE
> > +  string "Make space for <number> reserve map entries"
> > +  default 0
> > +  depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )

Ditto.

> > +
> > +config BR2_LINUX_BUILD_DT_PADDING_SPACE
> > +  string "Add padding to the blob of <bytes> long (extra space)"
> > +  default 0
> > +  depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )
> 
> I am not very familiar with the device tree, are those options really
> useful in general ?

Ditto.

> 
> > +# prepare command-line arguments for dtc
> > +LINUX26_DTS_PATH=$(LINUX26_DIR)/arch/$(KERNEL_ARCH)/boot/dts
> > +LINUX26_DTC=$(LINUX26_DIR)/arch/$(KERNEL_ARCH)/boot/dtc
> > +
> > +ifeq ($(BR2_LINUX_BUILD_DT_FORCE),y)
> > +LINUX26_DTC_ARG+= -f
> > +endif
> > +
> > +ifeq ($(BR2_LINUX_BUILD_DT_DTB),y)
> > +LINUX26_DTC_OUTF+=dtb
> > +else ifeq ($(BR2_LINUX_BUILD_DT_ASM),y)
> > +LINUX26_DTC_OUTF+=asm
> > +else ifeq ($(BR2_LINUX_BUILD_DT_DTS),y)
> > +LINUX26_DTC_OUTF+=dts
> > +endif
> 
> Those lines should probably be LINUX26_DTC_OUTF= and not += since they
> are mutually exclusive.
> 
> > +LINUX26_DTC_ARG+= -b $(call qstrip,$(BR2_LINUX_BUILD_DT_BOOT_CPU)) \
> > +-R $(call qstrip,$(BR2_LINUX_BUILD_DT_RESERVED_SPACE)) \
> > +-S $(call qstrip,$(BR2_LINUX_BUILD_DT_EXTRA_SPACE)) \
> > +-p $(call qstrip,$(BR2_LINUX_BUILD_DT_PADDING_SPACE)) \
> > +-o $(BINARIES_DIR)/$(file).$(LINUX26_DTC_OUTF) \
> > +-O $(LINUX26_DTC_OUTF)
> 
> One tab here before each continuing line.
> 
> > +# Flattened Device Tree compilation
> > +$(LINUX26_DIR)/.stamp_dt_compiled: $(LINUX26_DIR)/.stamp_compiled	
> > +ifeq ($(BR2_LINUX_BUILD_DT),y)
> > +	@$(call MESSAGE,"Compiling Flattened Device Tree")	
> > +	$(foreach file, $(call qstrip,$(BR2_LINUX_BUILD_DT_LIST)), \
> > +	$(LINUX26_DTC) $(LINUX26_DTC_ARG) $(LINUX26_DTS_PATH)/$(file).dts;)
> > +endif
> > +	$(Q)touch $@
> > +
> >  # Installation
> >  $(LINUX26_DIR)/.stamp_installed: $(LINUX26_DIR)/.stamp_compiled
> >  	@$(call MESSAGE,"Installing kernel")
> > @@ -143,7 +176,7 @@ $(LINUX26_DIR)/.stamp_installed: $(LINUX26_DIR)/.stamp_compiled
> >  	fi
> >  	$(Q)touch $@
> >  
> > -linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed
> > +linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed $(LINUX26_DIR)/.stamp_dt_compiled
> 
> I think I'd prefer something such as:
> 
> +$(LINUX26_DIR)/.stamp_dt_compiled: $(LINUX26_DIR)/.stamp_compiled	
> +	@$(call MESSAGE,"Compiling Flattened Device Tree")	
> +	$(foreach file, $(call qstrip,$(BR2_LINUX_BUILD_DT_LIST)), \
> +	$(LINUX26_DTC) $(LINUX26_DTC_ARG) $(LINUX26_DTS_PATH)/$(file).dts;)
> +	$(Q)touch $@
> +
> +ifeq ($(BR2_LINUX_BUILD_DT),y)
> +LINUX26_DEVICE_TREE_DEP=$(LINUX26_DIR)/.stamp_dt_compiled
> +endif
> [...]
> -linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed
> +linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed $(LINUX26_DEVICE_TREE_DEP)
> 
> Thanks!
> 
> Thomas
> -- 
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] OF FDT compilation support
  2011-03-31 20:51   ` Grant Likely
@ 2011-03-31 21:31     ` Bryan Hundven
  2011-03-31 21:40       ` Grant Likely
  2011-04-01  6:39     ` Thomas De Schampheleire
  1 sibling, 1 reply; 11+ messages in thread
From: Bryan Hundven @ 2011-03-31 21:31 UTC (permalink / raw)
  To: buildroot

On Thu, Mar 31, 2011 at 1:51 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Tue, Nov 23, 2010 at 10:45:05PM +0100, Thomas Petazzoni wrote:
>> Hello,
>>
>> On Wed, 17 Nov 2010 14:49:06 +0300
>> Stanislav Bogatyrev <realloc@gmail.com> wrote:
>>
>> > ?#
>> > +# Device tree
>> > +#
>> > +
>> > +config BR2_LINUX_BUILD_DT
>>
>> I think I'd prefer BR2_LINUX_DEVICE_TREE (ditto for all other options)
>>
>> > + ?bool "Compile OpenFirmware Flattened Device Tree"
>>
>> Indentation before bool, depends on, help, etc. is one tab. Could you
>> fix everywhere ?
>>
>> > + ?depends on BR2_powerpc
>> > + ?help
>> > + ? ?Compile OpenFirmware Flattened Device Tree
>>
>> And for help text it's one tab and two spaces. Could you fix
>> everywhere ?
>>
>> A slightly better help text would be useful as well.
>>
>> > +config BR2_LINUX_BUILD_DT_FORCE
>> > + ?bool "Force - try to produce output even if the input tree has errors"
>> > + ?depends on BR2_LINUX_BUILD_DT
>>
>> We don't really have many "force" options anywhere else in Buildroot.
>> Is this really needed ?
>>
>> Replace all BR2_LINUX_BUILD_DT by an enclosing if BR2_LINUX_DEVICE_TREE
>>
>> > +config BR2_LINUX_BUILD_DT_LIST
>> > + ?string "List of .dts files to compile"
>> > + ?depends on BR2_LINUX_BUILD_DT
>> > +
>> > +choice
>> > + ? prompt "DTC output format"
>> > + ?depends on BR2_LINUX_BUILD_DT
>> > + ?default BR2_LINUX_BUILD_DT_DTB
>> > +
>> > +config BR2_LINUX_BUILD_DT_DTB
>> > + ?bool "dtb"
>> > +
>> > +config BR2_LINUX_BUILD_DT_DTS
>> > + ?bool "dts"
>> > +
>> > +config BR2_LINUX_BUILD_DT_ASM
>> > + ?bool "asm"
>> > +endchoice
>>
>> What are all those formats for ?
>
> Pretty much *nobody* uses the ASM or DTS output options for building
> deployable images. ?DTB is about the only target necessary.
>
>>
>> > +config BR2_LINUX_BUILD_DT_BOOT_CPU
>> > + ?string "CPU number to boot"
>> > + ?default 0
>> > + ?depends on BR2_LINUX_BUILD_DT
>
> I don't think anyone specifies this manually either.
>
>> > +
>> > +config BR2_LINUX_BUILD_DT_EXTRA_SPACE
>> > + ?string "Make the blob at least <bytes> long (extra space)"
>> > + ?default 0
>> > + ?depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )
>
> Modern u-boot can handle unpadded .dtbs just fine. ?Should not need
> this options.
>
>> > +
>> > +config BR2_LINUX_BUILD_DT_RESERVED_SPACE
>> > + ?string "Make space for <number> reserve map entries"
>> > + ?default 0
>> > + ?depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )
>
> Ditto.
>
>> > +
>> > +config BR2_LINUX_BUILD_DT_PADDING_SPACE
>> > + ?string "Add padding to the blob of <bytes> long (extra space)"
>> > + ?default 0
>> > + ?depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )
>>
>> I am not very familiar with the device tree, are those options really
>> useful in general ?
>
> Ditto.
>
>>
>> > +# prepare command-line arguments for dtc
>> > +LINUX26_DTS_PATH=$(LINUX26_DIR)/arch/$(KERNEL_ARCH)/boot/dts
>> > +LINUX26_DTC=$(LINUX26_DIR)/arch/$(KERNEL_ARCH)/boot/dtc
>> > +
>> > +ifeq ($(BR2_LINUX_BUILD_DT_FORCE),y)
>> > +LINUX26_DTC_ARG+= -f
>> > +endif
>> > +
>> > +ifeq ($(BR2_LINUX_BUILD_DT_DTB),y)
>> > +LINUX26_DTC_OUTF+=dtb
>> > +else ifeq ($(BR2_LINUX_BUILD_DT_ASM),y)
>> > +LINUX26_DTC_OUTF+=asm
>> > +else ifeq ($(BR2_LINUX_BUILD_DT_DTS),y)
>> > +LINUX26_DTC_OUTF+=dts
>> > +endif
>>
>> Those lines should probably be LINUX26_DTC_OUTF= and not += since they
>> are mutually exclusive.
>>
>> > +LINUX26_DTC_ARG+= -b $(call qstrip,$(BR2_LINUX_BUILD_DT_BOOT_CPU)) \
>> > +-R $(call qstrip,$(BR2_LINUX_BUILD_DT_RESERVED_SPACE)) \
>> > +-S $(call qstrip,$(BR2_LINUX_BUILD_DT_EXTRA_SPACE)) \
>> > +-p $(call qstrip,$(BR2_LINUX_BUILD_DT_PADDING_SPACE)) \
>> > +-o $(BINARIES_DIR)/$(file).$(LINUX26_DTC_OUTF) \
>> > +-O $(LINUX26_DTC_OUTF)
>>
>> One tab here before each continuing line.
>>
>> > +# Flattened Device Tree compilation
>> > +$(LINUX26_DIR)/.stamp_dt_compiled: $(LINUX26_DIR)/.stamp_compiled
>> > +ifeq ($(BR2_LINUX_BUILD_DT),y)
>> > + ? @$(call MESSAGE,"Compiling Flattened Device Tree")
>> > + ? $(foreach file, $(call qstrip,$(BR2_LINUX_BUILD_DT_LIST)), \
>> > + ? $(LINUX26_DTC) $(LINUX26_DTC_ARG) $(LINUX26_DTS_PATH)/$(file).dts;)
>> > +endif
>> > + ? $(Q)touch $@
>> > +
>> > ?# Installation
>> > ?$(LINUX26_DIR)/.stamp_installed: $(LINUX26_DIR)/.stamp_compiled
>> > ? ? @$(call MESSAGE,"Installing kernel")
>> > @@ -143,7 +176,7 @@ $(LINUX26_DIR)/.stamp_installed: $(LINUX26_DIR)/.stamp_compiled
>> > ? ? fi
>> > ? ? $(Q)touch $@
>> >
>> > -linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed
>> > +linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed $(LINUX26_DIR)/.stamp_dt_compiled
>>
>> I think I'd prefer something such as:
>>
>> +$(LINUX26_DIR)/.stamp_dt_compiled: $(LINUX26_DIR)/.stamp_compiled
>> + ? ? @$(call MESSAGE,"Compiling Flattened Device Tree")
>> + ? ? $(foreach file, $(call qstrip,$(BR2_LINUX_BUILD_DT_LIST)), \
>> + ? ? $(LINUX26_DTC) $(LINUX26_DTC_ARG) $(LINUX26_DTS_PATH)/$(file).dts;)
>> + ? ? $(Q)touch $@
>> +
>> +ifeq ($(BR2_LINUX_BUILD_DT),y)
>> +LINUX26_DEVICE_TREE_DEP=$(LINUX26_DIR)/.stamp_dt_compiled
>> +endif
>> [...]
>> -linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed
>> +linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed $(LINUX26_DEVICE_TREE_DEP)
>>
>> Thanks!
>>
>> Thomas
>> --
>> Thomas Petazzoni, Free Electrons
>> Kernel, drivers, real-time and embedded Linux
>> development, consulting, training and support.
>> http://free-electrons.com
>> _______________________________________________
>> buildroot mailing list
>> buildroot at busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>

Just curious, would it also make sense to optionally provide the .dtu
(uboot mkimage wrapped .dtb) as well?

Not sure if .dtu's are even needed/used anymore...

-Bryan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] OF FDT compilation support
  2011-03-31 21:31     ` Bryan Hundven
@ 2011-03-31 21:40       ` Grant Likely
  2011-04-01 12:47         ` Peter Korsgaard
  0 siblings, 1 reply; 11+ messages in thread
From: Grant Likely @ 2011-03-31 21:40 UTC (permalink / raw)
  To: buildroot

On Thu, Mar 31, 2011 at 3:31 PM, Bryan Hundven <bryanhundven@gmail.com> wrote:
> On Thu, Mar 31, 2011 at 1:51 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
>> On Tue, Nov 23, 2010 at 10:45:05PM +0100, Thomas Petazzoni wrote:
>>> Hello,
>>>
>>> On Wed, 17 Nov 2010 14:49:06 +0300
>>> Stanislav Bogatyrev <realloc@gmail.com> wrote:
>>>
>>> > ?#
>>> > +# Device tree
>>> > +#
>>> > +
>>> > +config BR2_LINUX_BUILD_DT
>>>
>>> I think I'd prefer BR2_LINUX_DEVICE_TREE (ditto for all other options)
>>>
>>> > + ?bool "Compile OpenFirmware Flattened Device Tree"
>>>
>>> Indentation before bool, depends on, help, etc. is one tab. Could you
>>> fix everywhere ?
>>>
>>> > + ?depends on BR2_powerpc
>>> > + ?help
>>> > + ? ?Compile OpenFirmware Flattened Device Tree
>>>
>>> And for help text it's one tab and two spaces. Could you fix
>>> everywhere ?
>>>
>>> A slightly better help text would be useful as well.
>>>
>>> > +config BR2_LINUX_BUILD_DT_FORCE
>>> > + ?bool "Force - try to produce output even if the input tree has errors"
>>> > + ?depends on BR2_LINUX_BUILD_DT
>>>
>>> We don't really have many "force" options anywhere else in Buildroot.
>>> Is this really needed ?
>>>
>>> Replace all BR2_LINUX_BUILD_DT by an enclosing if BR2_LINUX_DEVICE_TREE
>>>
>>> > +config BR2_LINUX_BUILD_DT_LIST
>>> > + ?string "List of .dts files to compile"
>>> > + ?depends on BR2_LINUX_BUILD_DT
>>> > +
>>> > +choice
>>> > + ? prompt "DTC output format"
>>> > + ?depends on BR2_LINUX_BUILD_DT
>>> > + ?default BR2_LINUX_BUILD_DT_DTB
>>> > +
>>> > +config BR2_LINUX_BUILD_DT_DTB
>>> > + ?bool "dtb"
>>> > +
>>> > +config BR2_LINUX_BUILD_DT_DTS
>>> > + ?bool "dts"
>>> > +
>>> > +config BR2_LINUX_BUILD_DT_ASM
>>> > + ?bool "asm"
>>> > +endchoice
>>>
>>> What are all those formats for ?
>>
>> Pretty much *nobody* uses the ASM or DTS output options for building
>> deployable images. ?DTB is about the only target necessary.
>>
>>>
>>> > +config BR2_LINUX_BUILD_DT_BOOT_CPU
>>> > + ?string "CPU number to boot"
>>> > + ?default 0
>>> > + ?depends on BR2_LINUX_BUILD_DT
>>
>> I don't think anyone specifies this manually either.
>>
>>> > +
>>> > +config BR2_LINUX_BUILD_DT_EXTRA_SPACE
>>> > + ?string "Make the blob at least <bytes> long (extra space)"
>>> > + ?default 0
>>> > + ?depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )
>>
>> Modern u-boot can handle unpadded .dtbs just fine. ?Should not need
>> this options.
>>
>>> > +
>>> > +config BR2_LINUX_BUILD_DT_RESERVED_SPACE
>>> > + ?string "Make space for <number> reserve map entries"
>>> > + ?default 0
>>> > + ?depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )
>>
>> Ditto.
>>
>>> > +
>>> > +config BR2_LINUX_BUILD_DT_PADDING_SPACE
>>> > + ?string "Add padding to the blob of <bytes> long (extra space)"
>>> > + ?default 0
>>> > + ?depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )
>>>
>>> I am not very familiar with the device tree, are those options really
>>> useful in general ?
>>
>> Ditto.
>>
>>>
>>> > +# prepare command-line arguments for dtc
>>> > +LINUX26_DTS_PATH=$(LINUX26_DIR)/arch/$(KERNEL_ARCH)/boot/dts
>>> > +LINUX26_DTC=$(LINUX26_DIR)/arch/$(KERNEL_ARCH)/boot/dtc
>>> > +
>>> > +ifeq ($(BR2_LINUX_BUILD_DT_FORCE),y)
>>> > +LINUX26_DTC_ARG+= -f
>>> > +endif
>>> > +
>>> > +ifeq ($(BR2_LINUX_BUILD_DT_DTB),y)
>>> > +LINUX26_DTC_OUTF+=dtb
>>> > +else ifeq ($(BR2_LINUX_BUILD_DT_ASM),y)
>>> > +LINUX26_DTC_OUTF+=asm
>>> > +else ifeq ($(BR2_LINUX_BUILD_DT_DTS),y)
>>> > +LINUX26_DTC_OUTF+=dts
>>> > +endif
>>>
>>> Those lines should probably be LINUX26_DTC_OUTF= and not += since they
>>> are mutually exclusive.
>>>
>>> > +LINUX26_DTC_ARG+= -b $(call qstrip,$(BR2_LINUX_BUILD_DT_BOOT_CPU)) \
>>> > +-R $(call qstrip,$(BR2_LINUX_BUILD_DT_RESERVED_SPACE)) \
>>> > +-S $(call qstrip,$(BR2_LINUX_BUILD_DT_EXTRA_SPACE)) \
>>> > +-p $(call qstrip,$(BR2_LINUX_BUILD_DT_PADDING_SPACE)) \
>>> > +-o $(BINARIES_DIR)/$(file).$(LINUX26_DTC_OUTF) \
>>> > +-O $(LINUX26_DTC_OUTF)
>>>
>>> One tab here before each continuing line.
>>>
>>> > +# Flattened Device Tree compilation
>>> > +$(LINUX26_DIR)/.stamp_dt_compiled: $(LINUX26_DIR)/.stamp_compiled
>>> > +ifeq ($(BR2_LINUX_BUILD_DT),y)
>>> > + ? @$(call MESSAGE,"Compiling Flattened Device Tree")
>>> > + ? $(foreach file, $(call qstrip,$(BR2_LINUX_BUILD_DT_LIST)), \
>>> > + ? $(LINUX26_DTC) $(LINUX26_DTC_ARG) $(LINUX26_DTS_PATH)/$(file).dts;)
>>> > +endif
>>> > + ? $(Q)touch $@
>>> > +
>>> > ?# Installation
>>> > ?$(LINUX26_DIR)/.stamp_installed: $(LINUX26_DIR)/.stamp_compiled
>>> > ? ? @$(call MESSAGE,"Installing kernel")
>>> > @@ -143,7 +176,7 @@ $(LINUX26_DIR)/.stamp_installed: $(LINUX26_DIR)/.stamp_compiled
>>> > ? ? fi
>>> > ? ? $(Q)touch $@
>>> >
>>> > -linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed
>>> > +linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed $(LINUX26_DIR)/.stamp_dt_compiled
>>>
>>> I think I'd prefer something such as:
>>>
>>> +$(LINUX26_DIR)/.stamp_dt_compiled: $(LINUX26_DIR)/.stamp_compiled
>>> + ? ? @$(call MESSAGE,"Compiling Flattened Device Tree")
>>> + ? ? $(foreach file, $(call qstrip,$(BR2_LINUX_BUILD_DT_LIST)), \
>>> + ? ? $(LINUX26_DTC) $(LINUX26_DTC_ARG) $(LINUX26_DTS_PATH)/$(file).dts;)
>>> + ? ? $(Q)touch $@
>>> +
>>> +ifeq ($(BR2_LINUX_BUILD_DT),y)
>>> +LINUX26_DEVICE_TREE_DEP=$(LINUX26_DIR)/.stamp_dt_compiled
>>> +endif
>>> [...]
>>> -linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed
>>> +linux26: host-module-init-tools $(LINUX26_DEPENDENCIES) $(LINUX26_DIR)/.stamp_installed $(LINUX26_DEVICE_TREE_DEP)
>>>
>>> Thanks!
>>>
>>> Thomas
>>> --
>>> Thomas Petazzoni, Free Electrons
>>> Kernel, drivers, real-time and embedded Linux
>>> development, consulting, training and support.
>>> http://free-electrons.com
>>> _______________________________________________
>>> buildroot mailing list
>>> buildroot at busybox.net
>>> http://lists.busybox.net/mailman/listinfo/buildroot
>> _______________________________________________
>> buildroot mailing list
>> buildroot at busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
>>
>
> Just curious, would it also make sense to optionally provide the .dtu
> (uboot mkimage wrapped .dtb) as well?
>
> Not sure if .dtu's are even needed/used anymore...

I certainly don't.  I'd prefer not to need them.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] OF FDT compilation support
  2011-03-31 20:51   ` Grant Likely
  2011-03-31 21:31     ` Bryan Hundven
@ 2011-04-01  6:39     ` Thomas De Schampheleire
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas De Schampheleire @ 2011-04-01  6:39 UTC (permalink / raw)
  To: buildroot

Hi,

On Thu, Mar 31, 2011 at 10:51 PM, Grant Likely
<grant.likely@secretlab.ca> wrote:
> On Tue, Nov 23, 2010 at 10:45:05PM +0100, Thomas Petazzoni wrote:
>> Hello,
>>
>> On Wed, 17 Nov 2010 14:49:06 +0300
>> Stanislav Bogatyrev <realloc@gmail.com> wrote:
>>
>> > ?#
>> > +# Device tree
>> > +#
>> > +
>> > +config BR2_LINUX_BUILD_DT
>>
>> I think I'd prefer BR2_LINUX_DEVICE_TREE (ditto for all other options)
>>
>> > + ?bool "Compile OpenFirmware Flattened Device Tree"
>>
>> Indentation before bool, depends on, help, etc. is one tab. Could you
>> fix everywhere ?
>>
>> > + ?depends on BR2_powerpc
>> > + ?help
>> > + ? ?Compile OpenFirmware Flattened Device Tree
>>
>> And for help text it's one tab and two spaces. Could you fix
>> everywhere ?
>>
>> A slightly better help text would be useful as well.
>>
>> > +config BR2_LINUX_BUILD_DT_FORCE
>> > + ?bool "Force - try to produce output even if the input tree has errors"
>> > + ?depends on BR2_LINUX_BUILD_DT
>>
>> We don't really have many "force" options anywhere else in Buildroot.
>> Is this really needed ?
>>
>> Replace all BR2_LINUX_BUILD_DT by an enclosing if BR2_LINUX_DEVICE_TREE
>>
>> > +config BR2_LINUX_BUILD_DT_LIST
>> > + ?string "List of .dts files to compile"
>> > + ?depends on BR2_LINUX_BUILD_DT
>> > +
>> > +choice
>> > + ? prompt "DTC output format"
>> > + ?depends on BR2_LINUX_BUILD_DT
>> > + ?default BR2_LINUX_BUILD_DT_DTB
>> > +
>> > +config BR2_LINUX_BUILD_DT_DTB
>> > + ?bool "dtb"
>> > +
>> > +config BR2_LINUX_BUILD_DT_DTS
>> > + ?bool "dts"
>> > +
>> > +config BR2_LINUX_BUILD_DT_ASM
>> > + ?bool "asm"
>> > +endchoice
>>
>> What are all those formats for ?
>
> Pretty much *nobody* uses the ASM or DTS output options for building
> deployable images. ?DTB is about the only target necessary.
>
>>
>> > +config BR2_LINUX_BUILD_DT_BOOT_CPU
>> > + ?string "CPU number to boot"
>> > + ?default 0
>> > + ?depends on BR2_LINUX_BUILD_DT
>
> I don't think anyone specifies this manually either.
>
>> > +
>> > +config BR2_LINUX_BUILD_DT_EXTRA_SPACE
>> > + ?string "Make the blob at least <bytes> long (extra space)"
>> > + ?default 0
>> > + ?depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )
>
> Modern u-boot can handle unpadded .dtbs just fine. ?Should not need
> this options.
>
>> > +
>> > +config BR2_LINUX_BUILD_DT_RESERVED_SPACE
>> > + ?string "Make space for <number> reserve map entries"
>> > + ?default 0
>> > + ?depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )
>
> Ditto.
>
>> > +
>> > +config BR2_LINUX_BUILD_DT_PADDING_SPACE
>> > + ?string "Add padding to the blob of <bytes> long (extra space)"
>> > + ?default 0
>> > + ?depends on BR2_LINUX_BUILD_DT && ( BR2_LINUX_BUILD_DT_DTB || BR2_LINUX_BUILD_DT_ASM )
>>
>> I am not very familiar with the device tree, are those options really
>> useful in general ?
>
> Ditto.
>


Although this may not be the common case, not everyone uses u-boot as
bootloader, some people do specify a boot cpu other than 0, etc.
I agree that providing a buildroot option for each and every one dtc
option is a bit over the top. Instead, I propose to add one buildroot
input string option that allows giving additional dtc parameters, e.g.
"-b 2 -R 5 -S 4096", if needed.

Best regards,
Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] OF FDT compilation support
  2011-03-31 21:40       ` Grant Likely
@ 2011-04-01 12:47         ` Peter Korsgaard
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2011-04-01 12:47 UTC (permalink / raw)
  To: buildroot

>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:

 >> Just curious, would it also make sense to optionally provide the .dtu
 >> (uboot mkimage wrapped .dtb) as well?
 >> 
 >> Not sure if .dtu's are even needed/used anymore...

 Grant> I certainly don't.  I'd prefer not to need them.

I also haven't seen anybody using them.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-04-01 12:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-17 11:49 [Buildroot] OF FDT compilation support Stanislav Bogatyrev
2010-11-17 16:18 ` Thomas Petazzoni
2010-11-17 16:55   ` Stanislav Bogatyrev
2010-11-23 21:45 ` Thomas Petazzoni
2011-03-26  8:28   ` Thomas De Schampheleire
2011-03-28 13:22     ` Martin Hicks
2011-03-31 20:51   ` Grant Likely
2011-03-31 21:31     ` Bryan Hundven
2011-03-31 21:40       ` Grant Likely
2011-04-01 12:47         ` Peter Korsgaard
2011-04-01  6:39     ` Thomas De Schampheleire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox