devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scripts/dtc: pad DTBs to facilitate later modification
@ 2014-05-23 23:41 Kevin Hilman
  2014-05-29 15:55 ` Stephen Warren
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Hilman @ 2014-05-23 23:41 UTC (permalink / raw)
  To: linux-arm-kernel, devicetree
  Cc: Arnd Bergmann, Olof Johansson, linaro-kernel, Nicolas Pitre,
	Stephen Warren, Thomas Petazzoni, Michal Marek,
	open list:KERNEL BUILD + fi..., open list

By default, add some padding to the DT blobs to facilitate later
patching.

An example need for DTB patching is the need to modifiy the command
line on platforms where ATAGS are not (or cannot) be used to pass the
commandline.  For example, we do not support a big-endian kernel
reading ATAGS from a little-endian u-boot, so the only way to pass a
command line in the DT.

Also, without ATAG support (or if u-boot was built without
CONFIG_INITRD_TAG) the only way to pass an initrd is by adding an
initrd= option to command line (in the DT).

Therefore, to facilitate adding to the DT command line directly in the
DTB, add some padding.

Cc: Nicolas Pitre <nico@linaro.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Kevin Hilman <khilman@linaro.org>
---
I kinda pulled 64 bytes out of the air here since it's enough to add
some common things to the commandline like debug, earlyprink
initrd=<addr>,<size>, etc., but I'm certainlly not opposed to more
padding.

 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 6a5b0decb797..d7a57c2620f3 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -264,7 +264,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
 
 quiet_cmd_dtc = DTC     $@
 cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
-	$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
+	$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 -p 64 \
 		-i $(dir $<) $(DTC_FLAGS) \
 		-d $(depfile).dtc.tmp $(dtc-tmp) ; \
 	cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
-- 
1.9.2


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

* Re: [PATCH] scripts/dtc: pad DTBs to facilitate later modification
  2014-05-23 23:41 [PATCH] scripts/dtc: pad DTBs to facilitate later modification Kevin Hilman
@ 2014-05-29 15:55 ` Stephen Warren
       [not found]   ` <53875876.2020001-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Warren @ 2014-05-29 15:55 UTC (permalink / raw)
  To: Kevin Hilman, linux-arm-kernel, devicetree
  Cc: Arnd Bergmann, Olof Johansson, linaro-kernel, Nicolas Pitre,
	Thomas Petazzoni, Michal Marek, open list:KERNEL BUILD + fi...,
	open list

On 05/23/2014 05:41 PM, Kevin Hilman wrote:
> By default, add some padding to the DT blobs to facilitate later
> patching.
> 
> An example need for DTB patching is the need to modifiy the command
> line on platforms where ATAGS are not (or cannot) be used to pass the
> commandline.  For example, we do not support a big-endian kernel
> reading ATAGS from a little-endian u-boot, so the only way to pass a
> command line in the DT.
> 
> Also, without ATAG support (or if u-boot was built without
> CONFIG_INITRD_TAG) the only way to pass an initrd is by adding an
> initrd= option to command line (in the DT).
> 
> Therefore, to facilitate adding to the DT command line directly in the
> DTB, add some padding.
> 
> Cc: Nicolas Pitre <nico@linaro.org>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Kevin Hilman <khilman@linaro.org>
> ---
> I kinda pulled 64 bytes out of the air here since it's enough to add
> some common things to the commandline like debug, earlyprink
> initrd=<addr>,<size>, etc., but I'm certainlly not opposed to more
> padding.

Conceptually,
Acked-by: Stephen Warren <swarren@nvidia.com>

But I would expect a pad of something like 4KB to be more future-proof.
U-Boot appears to use 4KB on ARM at least:

./arch/arm/dts/Makefile:37:DTC_FLAGS += -R 4 -p 0x1000

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

* Re: [PATCH] scripts/dtc: pad DTBs to facilitate later modification
       [not found]   ` <53875876.2020001-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2014-05-29 17:20     ` Kevin Hilman
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Hilman @ 2014-05-29 17:20 UTC (permalink / raw)
  To: Stephen Warren
  Cc: linux-arm-kernel,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Arnd Bergmann,
	Olof Johansson,
	linaro-kernel-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
	Nicolas Pitre, Thomas Petazzoni, Michal Marek,
	open list:KERNEL BUILD + fi..., open list

On Thu, May 29, 2014 at 8:55 AM, Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> wrote:
> On 05/23/2014 05:41 PM, Kevin Hilman wrote:
>> By default, add some padding to the DT blobs to facilitate later
>> patching.
>>
>> An example need for DTB patching is the need to modifiy the command
>> line on platforms where ATAGS are not (or cannot) be used to pass the
>> commandline.  For example, we do not support a big-endian kernel
>> reading ATAGS from a little-endian u-boot, so the only way to pass a
>> command line in the DT.
>>
>> Also, without ATAG support (or if u-boot was built without
>> CONFIG_INITRD_TAG) the only way to pass an initrd is by adding an
>> initrd= option to command line (in the DT).
>>
>> Therefore, to facilitate adding to the DT command line directly in the
>> DTB, add some padding.
>>
>> Cc: Nicolas Pitre <nico-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>> Cc: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
>> Cc: Thomas Petazzoni <thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
>> Signed-off-by: Kevin Hilman <khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>> ---
>> I kinda pulled 64 bytes out of the air here since it's enough to add
>> some common things to the commandline like debug, earlyprink
>> initrd=<addr>,<size>, etc., but I'm certainlly not opposed to more
>> padding.
>
> Conceptually,
> Acked-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> But I would expect a pad of something like 4KB to be more future-proof.
> U-Boot appears to use 4KB on ARM at least:
>
> ./arch/arm/dts/Makefile:37:DTC_FLAGS += -R 4 -p 0x1000

Great.  As I mentioned above, I'm certainly not opposed to more
padding, and agree that it would be more future proof.  I was simply
being rather conservative in case folks didn't want to see every .dtb
grow by 4k.

I'll wait a bit to see if there are any other opinions, and the respin
with 4k padding.

Kevin
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-05-29 17:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-23 23:41 [PATCH] scripts/dtc: pad DTBs to facilitate later modification Kevin Hilman
2014-05-29 15:55 ` Stephen Warren
     [not found]   ` <53875876.2020001-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-05-29 17:20     ` Kevin Hilman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).