diff mbox

[U-Boot,resend,1/2] u-boot/spl: Add u-boot-spl.img to u-boot targets

Message ID 0914ca07f3fa7549188e349e7a0a32c3d6521321.1354786138.git.vipin.kumar@st.com
State Changes Requested
Delegated to: Albert ARIBAUD
Headers show

Commit Message

Vipin Kumar Dec. 6, 2012, 9:29 a.m. UTC
Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
---
 Makefile | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Stefan Roese Dec. 6, 2012, 12:08 p.m. UTC | #1
On 12/06/2012 10:29 AM, Vipin Kumar wrote:
> Signed-off-by: Vipin Kumar <vipin.kumar@st.com>

Is this new build target really needed? Please take a look at the
recently added/renamed targets (e.g. u-boot-with-spl.bin or u-boot-img.bin).

If this does not fit, then please add a short description about this new
build target and which SoC's need it and why.

Thanks,
STefan
Vipin Kumar Dec. 7, 2012, 9:47 a.m. UTC | #2
On 12/6/2012 5:38 PM, Stefan Roese wrote:
> On 12/06/2012 10:29 AM, Vipin Kumar wrote:
>> Signed-off-by: Vipin Kumar<vipin.kumar@st.com>
>
> Is this new build target really needed? Please take a look at the
> recently added/renamed targets (e.g. u-boot-with-spl.bin or u-boot-img.bin).
>

Hmm, this is an mkimage version of spl binary. This mkimage header is 
detected by the BootROM in spear devices for loading and booting the SPL 
binary

> If this does not fit, then please add a short description about this new
> build target and which SoC's need it and why.
>

You mean add a short description in commit log or in README ?

Vipin

> Thanks,
> STefan
>
>
Stefan Roese Dec. 7, 2012, 10:44 a.m. UTC | #3
On 12/07/2012 10:47 AM, Vipin Kumar wrote:
> On 12/6/2012 5:38 PM, Stefan Roese wrote:
>> On 12/06/2012 10:29 AM, Vipin Kumar wrote:
>>> Signed-off-by: Vipin Kumar<vipin.kumar@st.com>
>>
>> Is this new build target really needed? Please take a look at the
>> recently added/renamed targets (e.g. u-boot-with-spl.bin or u-boot-img.bin).
>>
> 
> Hmm, this is an mkimage version of spl binary. This mkimage header is 
> detected by the BootROM in spear devices for loading and booting the SPL 
> binary

Yes, I remember this from the SPEAr600. I introduced a new build target
for this: u-boot.spr. Take a look at the commit:

94aebe6cc3111c7c9e3cd1311cc9793d01cc3ded

    Makefile: Add u-boot.spr build target (SPEAr)

    On x600 (SPEAr600) U-Boot is appended to U-Boot SPL. Both images are
    created using mkimage (crc etc), so that the ROM bootloader can check
    its integrity. Padding needs to be done to the SPL image (with
    mkimage header) and not the binary. Otherwise the resulting image
    which is loaded/copied by the ROM bootloader to SRAM doesn't fit.
    The resulting image containing both U-Boot images is called u-boot.spr.


Or does your patch "only" introduce the mkimage SPL image version?

Then please consolidate this with the u-boot.spr build target.

Thanks,
Stefan
Vipin Kumar Dec. 7, 2012, 11:55 a.m. UTC | #4
On 12/7/2012 4:14 PM, Stefan Roese wrote:
> On 12/07/2012 10:47 AM, Vipin Kumar wrote:
>> On 12/6/2012 5:38 PM, Stefan Roese wrote:
>>> On 12/06/2012 10:29 AM, Vipin Kumar wrote:
>>>> Signed-off-by: Vipin Kumar<vipin.kumar@st.com>
>>>
>>> Is this new build target really needed? Please take a look at the
>>> recently added/renamed targets (e.g. u-boot-with-spl.bin or u-boot-img.bin).
>>>
>>
>> Hmm, this is an mkimage version of spl binary. This mkimage header is
>> detected by the BootROM in spear devices for loading and booting the SPL
>> binary
>
> Yes, I remember this from the SPEAr600. I introduced a new build target
> for this: u-boot.spr. Take a look at the commit:
>

Yes, I remember

> 94aebe6cc3111c7c9e3cd1311cc9793d01cc3ded
>
>      Makefile: Add u-boot.spr build target (SPEAr)
>
>      On x600 (SPEAr600) U-Boot is appended to U-Boot SPL. Both images are
>      created using mkimage (crc etc), so that the ROM bootloader can check
>      its integrity. Padding needs to be done to the SPL image (with
>      mkimage header) and not the binary. Otherwise the resulting image
>      which is loaded/copied by the ROM bootloader to SRAM doesn't fit.
>      The resulting image containing both U-Boot images is called u-boot.spr.
>
>
> Or does your patch "only" introduce the mkimage SPL image version?
>

Yes, it introduces only mkimage SPL image version. This is necessary for 
a few booting options where we absolutely require a different SPL binary 
with an mkimage header

> Then please consolidate this with the u-boot.spr build target.
>

You mean u-boot.spr can use this u-boot-spl.img. Yes, I will do that in v2

> Thanks,
> Stefan
> .
>

Vipin
Stefan Roese Dec. 7, 2012, 11:59 a.m. UTC | #5
On 12/07/2012 12:55 PM, Vipin Kumar wrote:
>> Or does your patch "only" introduce the mkimage SPL image version?
>>
> 
> Yes, it introduces only mkimage SPL image version. This is necessary for 
> a few booting options where we absolutely require a different SPL binary 
> with an mkimage header
> 
>> Then please consolidate this with the u-boot.spr build target.
>>
> 
> You mean u-boot.spr can use this u-boot-spl.img. Yes, I will do that in v2

Yes, thats what I mean.

Thanks,
Stefan
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 8a04727..7f416f4 100644
--- a/Makefile
+++ b/Makefile
@@ -499,6 +499,13 @@  $(obj)u-boot.sb:       $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
 		elftosb -zdf $(ELFTOSB_TARGET-y) -c $(TOPDIR)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd \
 			-o $(obj)u-boot.sb
 
+$(obj)spl/u-boot-spl.img:	$(obj)spl/u-boot-spl.bin
+		$(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
+		-a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) \
+		-n $(shell sed -n -e 's/.*U_BOOT_SPL_VERSION//p' $(VERSION_FILE) | \
+			sed -e 's/"[	 ]*$$/ for $(BOARD) board"/') \
+		-d $(obj)spl/u-boot-spl.bin $(obj)spl/u-boot-spl.img
+
 # On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
 # Both images are created using mkimage (crc etc), so that the ROM
 # bootloader can check its integrity. Padding needs to be done to the
@@ -707,6 +714,9 @@  $(VERSION_FILE):
 			"$(U_BOOT_VERSION)" "$${localvers}" ; \
 		   printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \
 			"$(U_BOOT_VERSION)" "$${localvers}" ; \
+		   printf '#define U_BOOT_SPL_VERSION "%s %s%s"\n' \
+			$(if $(CONFIG_SPL_IMAGENAME),$(CONFIG_SPL_IMAGENAME),"U-Boot SPL") \
+			"$(U_BOOT_VERSION)" "$${localvers}" ; \
 		) > $@.tmp
 		@( printf '#define CC_VERSION_STRING "%s"\n' \
 		 '$(shell $(CC) --version | head -n 1)' )>>  $@.tmp