public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 10/11] Add u-boot-pad.bin target to the Makefile
Date: Thu, 20 Sep 2012 09:23:14 -0700	[thread overview]
Message-ID: <505B42F2.2090900@ti.com> (raw)
In-Reply-To: <5FBF8E85CA34454794F0F7ECBA79798F379F6FD992@HQMAIL04.nvidia.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/20/12 09:01, Tom Warren wrote:
>> -----Original Message----- From: Tom Rini [mailto:trini at ti.com] 
>> Sent: Wednesday, September 19, 2012 6:29 PM To: Jos? Miguel 
>> Gon?alves Cc: Scott Wood; u-boot at lists.denx.de; marex at denx.de; 
>> mk7.kang at samsung.com; Tom Warren Subject: Re: [PATCH v4 10/11] 
>> Add u-boot-pad.bin target to the Makefile
>> 
>> * PGP Signed by an unknown key
>> 
>> On 09/19/12 17:38, Jos? Miguel Gon?alves wrote:
>>> Tom & Scott,
>>> 
>>> On 09/20/2012 12:40 AM, Tom Rini wrote:
>>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>>> 
>>>> On 09/19/12 16:36, Scott Wood wrote:
>>>>> On 09/19/2012 06:31:29 PM, Tom Rini wrote:
>>>>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>>>>> 
>>>>>> On 09/19/12 15:39, Scott Wood wrote:
>>>>>>> On 09/19/2012 06:25:26 AM, Jos? Miguel Gon?alves 
>>>>>>> wrote:
>>>>>>>> Samsung's S3C24XX SoCs need this in order to
>>>>>>>> generate a binary image with a padded SPL
>>>>>>>> concatenated with U-Boot.
>>>>>>>> 
>>>>>>>> Signed-off-by: Jos? Miguel Gon?alves 
>>>>>>>> <jose.goncalves@inov.pt> --- Changes for v2: - None
>>>>>>>> 
>>>>>>>> Changes for v3: - Changed new binary target name from
>>>>>>>> u-boot-ubl.bin to u-boot-pad.bin
>>>>>>>> 
>>>>>>>> Changes for v4: - None --- Makefile |   11 
>>>>>>>> ++++++----- 1 file changed, 6 insertions(+), 5 
>>>>>>>> deletions(-)
>>>>>>>> 
>>>>>>>> diff --git a/Makefile b/Makefile index 
>>>>>>>> 8738d55..86dedca 100644 --- a/Makefile +++
>>>>>>>> b/Makefile @@ -433,14 +433,15 @@ $(obj)u-boot.sha1: 
>>>>>>>> $(obj)u-boot.bin $(obj)u-boot.dis: $(obj)u-boot 
>>>>>>>> $(OBJDUMP) -d $< > $@
>>>>>>>> 
>>>>>>>> -$(obj)u-boot.ubl:       $(obj)spl/u-boot-spl.bin 
>>>>>>>> $(obj)u-boot.bin +$(obj)u-boot-pad.bin: 
>>>>>>>> $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin $(OBJCOPY) 
>>>>>>>> ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary 
>>>>>>>> $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin - 
>>>>>>>> cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > 
>>>>>>>> $(obj)u-boot-ubl.bin -        $(obj)tools/mkimage -n
>>>>>>>>  $(UBL_CONFIG) -T ublimage \ -        -e 
>>>>>>>> $(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin 
>>>>>>>> $(obj)u-boot.ubl -        rm $(obj)u-boot-ubl.bin + 
>>>>>>>> cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > 
>>>>>>>> $(obj)u-boot-pad.bin rm $(obj)spl/u-boot-spl-pad.bin
>>>>>>> This rule lists u-boot-spl.bin as a prerequisite, but 
>>>>>>> it doesn't appear to use it -- it uses u-boot-spl 
>>>>>>> instead.
>>>>>>> 
>>>>>>> It seems that either spl/Makefile should produce 
>>>>>>> u-boot-spl rather than u-boot-spl.bin and let the 
>>>>>>> toplevel Makefile deal with converting it to a binary, 
>>>>>>> or spl/Makefile should take care of adding any needed 
>>>>>>> padding for the target and the final rule should just 
>>>>>>> be a concatenation.
>>>>>> So, if we use a weak PAD_TO value of say 0x1, we could 
>>>>>> always "pad" u-boot-spl.bin out and then do the 
>>>>>> concatenation here and in a few other targets as well.
>>>>> Yes, or use a variable that includes the linker option, so 
>>>>> that it expands to an empty string if padding isn't 
>>>>> required.
>>>> Yes, I don't know if say IMAGE_PAD ?= "" and having boards 
>>>> set that to - --pad-to=... or just saying 
>>>> --pad-to=$(PAD_SIZE) and PAD_SIZE ?= 0x1 ends up looking 
>>>> cleaner once all is said and done.  First one to try both
>>>> and patch... :)
>>>> 
>>> 
>>> Please check the following patch. It seems to work for me...
>>> 
>>> diff --git a/Makefile b/Makefile index 8738d55..fad8b33 100644 
>>> --- a/Makefile +++ b/Makefile @@ -433,13 +433,12 @@ 
>>> $(obj)u-boot.sha1: $(obj)u-boot.bin $(obj)u-boot.dis: 
>>> $(obj)u-boot $(OBJDUMP) -d $<
>>>> $@
>>> 
>>> -$(obj)u-boot.ubl:       $(obj)spl/u-boot-spl.bin 
>>> $(obj)u-boot.bin -        $(OBJCOPY) ${OBJCFLAGS} 
>>> --pad-to=$(PAD_TO) -O binary $(obj)spl/u-boot-spl 
>>> $(obj)spl/u-boot-spl-pad.bin -        cat 
>>> $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > 
>>> $(obj)u-boot-ubl.bin +$(obj)u-boot-with-spl.bin: 
>>> $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin +        cat $^ > $@ 
>>> + +$(obj)u-boot.ubl:       $(obj)u-boot-with-spl.bin 
>>> $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ -        -e
>>>  $(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin 
>>> $(obj)u-boot.ubl - rm $(obj)u-boot-ubl.bin -        rm 
>>> $(obj)spl/u-boot-spl-pad.bin + -e $(CONFIG_SYS_TEXT_BASE) -d
>>> $< $@
>>> 
>>> $(obj)u-boot.ais:       $(obj)spl/u-boot-spl.bin 
>>> $(obj)u-boot.img $(obj)tools/mkimage -s -n /dev/null -T 
>>> aisimage \ diff --git a/spl/Makefile b/spl/Makefile index 
>>> f96c08e..6ea9f26 100644 --- a/spl/Makefile +++ b/spl/Makefile 
>>> @@ -23,6 +23,8 @@ include $(TOPDIR)/config.mk # We want the 
>>> final binaries in this directory obj := $(OBJTREE)/spl/
>>> 
>>> +PAD_TO ?= 1 + HAVE_VENDOR_COMMON_LIB := $(shell [ -f 
>>> $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \ && echo y || 
>>> echo n)
>>> 
>>> @@ -124,7 +126,7 @@ $(obj)$(BOARD)-spl.bin: 
>>> $(obj)u-boot-spl.bin endif
>>> 
>>> $(obj)u-boot-spl.bin:    $(obj)u-boot-spl -    $(OBJCOPY) 
>>> $(OBJCFLAGS) -O binary $< $@ +    $(OBJCOPY) ${OBJCFLAGS} 
>>> --pad-to=$(PAD_TO) -O binary $< $@
>>> 
>>> GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \
>> 
>> Tom W, since I'd like you to upgrade the tegra rules after this 
>> change goes in (since they do a u-boot-spl.bin + pad +
>> u-boot.bin + stuff), does this look good to you as well?
>> Thanks!
> 
> I'm not clear what you want the final binary names to be. I seem
> to be missing segments of this discussion - maybe not CC'd on all 
> threads?

Sorry, I'm just asking if this way of padding u-boot-spl.bin to the
required size by default in spl/Makefile and then not doing any
- --pad-to in the toplevel Makefile rules for u-boot-spl will work for
your needs as well (so update the existing rules to just concatenate
spl/u-boot-spl.bin and u-boot.bin and whatever else you need and have
PAD_TO be set to $(CONFIG_SYS_TEXT_BASE), I believe).

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQW0LyAAoJENk4IS6UOR1Wst8P/2IhNv0s3YKGp2r8ze4TWKaJ
rMxHs9KQ+ZHcemZuD4jWkx+Ms1pZrZlKDbF2lG622n+FsgTvXP8xSyBZCB0sV0J9
wVUQR8QB6EHrdw5pOhMn7T4y3+sy61l/E50NQHU5Nu2sA7t5g/xQH95gslN9b1yv
VNhX/sdISna8lEqJPF5Iuxuc9Cl7huEbSCpu/uETQZVqHfKDxkp7mZDcOHq0JJ4q
150WwOQhNKNgtX1AV9D2vcDHMRO6AOXE1cH/jMv9CBoPMkeJaW1EaGHTv8PrKeUG
ONN8fCEcdTEPvv6XXk3DLXVDFruAG7jk7bQr7B59nr5NVwuxZkZKOGn4o07stTBK
c2ixDbsS8K4BIlDrAMckd4pyjAWVE0bN8lDfOKvJtxMDSjMj+EagiDnPkAsnzJAB
Usml6rpIuBNLC2l4MZsYEihNHk0I10/M328c0kKUwWmT4UI3GB8V/sti1OUOyAoy
DBy9dH7U/aPVr72aXLcBf8vDdA3abHmHt6zLq4KDMw4+xBLmsqmALYvOOoGSdW9S
X5C6d6xpQVt5ovvSV8IZkT3rKUFAhmjcLgjwxKam3eTuSEyapZAJPji9h1Bl2PMB
UqR6MP8RceP9OqkSXhyCK6reFq6KCtsvGMdPnYs2uY2dZVjqMwtxPNWE1W39LqhU
VCbg1HKz/kmpmS9gQqRt
=qd5a
-----END PGP SIGNATURE-----

  reply	other threads:[~2012-09-20 16:23 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 11:25 [U-Boot] [PATCH v4 00/11] S3C24XX: Add support to MINI2416 board José Miguel Gonçalves
2012-09-19 11:25 ` [U-Boot] [PATCH v4 01/11] Add configuration option to select printf() inclusion on SPL José Miguel Gonçalves
2012-09-19 11:25 ` [U-Boot] [PATCH v4 02/11] S3C24XX: Add core support for Samsung's S3C24XX SoCs José Miguel Gonçalves
2012-09-19 11:25 ` [U-Boot] [PATCH v4 03/11] serial: Add support to 4 ports in serial_s3c24x0 José Miguel Gonçalves
2012-09-19 11:25 ` [U-Boot] [PATCH v4 04/11] serial: Use a more precise baud rate generation for serial_s3c24x0 José Miguel Gonçalves
2012-09-19 11:25 ` [U-Boot] [PATCH v4 05/11] serial: Remove unnecessary delay in serial_s3c24x0 José Miguel Gonçalves
2012-09-19 11:25 ` [U-Boot] [PATCH v4 06/11] rtc: Improve rtc_get() on s3c24x0_rtc José Miguel Gonçalves
2012-09-19 11:25 ` [U-Boot] [PATCH v4 07/11] rtc: Fix rtc_reset() " José Miguel Gonçalves
2012-09-19 11:25 ` [U-Boot] [PATCH v4 08/11] rtc: Don't allow setting unsuported years " José Miguel Gonçalves
2012-09-19 11:25 ` [U-Boot] [PATCH v4 09/11] S3C24XX: Add NAND Flash driver José Miguel Gonçalves
2012-09-19 16:19   ` Scott Wood
2012-09-19 16:34     ` José Miguel Gonçalves
2012-09-19 11:25 ` [U-Boot] [PATCH v4 10/11] Add u-boot-pad.bin target to the Makefile José Miguel Gonçalves
2012-09-19 16:10   ` Scott Wood
2012-09-19 16:58     ` José Miguel Gonçalves
2012-09-19 17:08       ` Scott Wood
2012-09-19 17:40         ` José Miguel Gonçalves
2012-09-19 17:11       ` Stephen Warren
2012-09-19 18:19         ` Tom Rini
2012-09-19 18:36           ` Scott Wood
2012-09-19 20:17             ` Tom Rini
2012-09-19 18:44           ` José Miguel Gonçalves
2012-09-19 22:39   ` Scott Wood
2012-09-19 23:31     ` Tom Rini
2012-09-19 23:36       ` Scott Wood
2012-09-19 23:40         ` Tom Rini
2012-09-20  0:38           ` José Miguel Gonçalves
2012-09-20  1:29             ` Tom Rini
2012-09-20 16:01               ` Tom Warren
2012-09-20 16:23                 ` Tom Rini [this message]
2012-09-20 16:32                   ` Tom Warren
2012-09-20 18:09                 ` Scott Wood
2012-09-21  1:08                   ` José Miguel Gonçalves
2012-09-21  5:43                 ` Wolfgang Denk
2012-09-21  8:13                   ` José Miguel Gonçalves
2012-09-21 15:52                     ` Wolfgang Denk
2012-09-21 16:08                       ` Marek Vasut
2012-09-21 16:13                       ` Tom Rini
2012-09-21 16:26                         ` José Miguel Gonçalves
2012-09-21 16:38                           ` Tom Rini
2012-09-21 16:37                         ` Langer Thomas
2012-09-21 18:33                   ` Scott Wood
2012-09-21 18:43                     ` Marek Vasut
2012-09-21 19:03                       ` Scott Wood
2012-09-21 19:24                         ` Marek Vasut
2012-09-21 19:33                           ` Scott Wood
2012-09-23 16:25                           ` Wolfgang Denk
2012-09-19 11:25 ` [U-Boot] [PATCH v4 11/11] S3C24XX: Add support to MINI2416 board José Miguel Gonçalves
2012-09-19 19:18   ` Tom Rini
2012-09-19 20:34     ` José Miguel Gonçalves

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=505B42F2.2090900@ti.com \
    --to=trini@ti.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox