From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Mon, 17 Sep 2012 11:27:22 -0500 Subject: [U-Boot] [PATCH v2 10/11] Add u-boot-ubl.bin target to the Makefile In-Reply-To: <5056EC52.5040500@inov.pt> (from jose.goncalves@inov.pt on Mon Sep 17 04:24:34 2012) Message-ID: <1347899242.19543.4@snotra> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09/17/2012 04:24:34 AM, Jos? Miguel Gon?alves wrote: > On 09/17/2012 10:10 AM, Christian Riesch wrote: >> On Mon, Sep 17, 2012 at 10:30 AM, Jos? Miguel Gon?alves >> wrote: >>> On 09/17/2012 07:47 AM, Christian Riesch wrote: >>>> Hi, >>>> >>>> On Sun, Sep 16, 2012 at 11:27 AM, Jos? Miguel Gon?alves >>>> wrote: >>>>> On 09/14/2012 08:08 PM, Tom Rini wrote: >>>>>> On Fri, Sep 14, 2012 at 06:29:01PM +0100, Jos?? Miguel >>>>>> Gon??alves wrote: >>>>>> >>>>>>> Samsung's S3C24XX SoCs need this in order to generate a binary >>>>>>> image >>>>>>> with the SPL and U-Boot concatenated. >>>>>>> >>>>>>> Signed-off-by: Jos?? Miguel Gon??alves >>>>>>> --- >>>>>>> Changes for v2: >>>>>>> - None >>>>>>> --- >>>>>>> Makefile | 7 ++++--- >>>>>>> 1 file changed, 4 insertions(+), 3 deletions(-) >>>>>>> >>>>>>> diff --git a/Makefile b/Makefile >>>>>>> index 058fb53..595b5f6 100644 >>>>>>> --- a/Makefile >>>>>>> +++ b/Makefile >>>>>>> @@ -442,13 +442,14 @@ $(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-ubl.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 >>>>>>> + rm $(obj)spl/u-boot-spl-pad.bin >>>>>>> + >>>>>>> +$(obj)u-boot.ubl: $(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 >>>>>>> - rm $(obj)spl/u-boot-spl-pad.bin >>>>>>> $(obj)u-boot.ais: $(obj)spl/u-boot-spl.bin >>>>>>> $(obj)u-boot.bin >>>>>>> $(obj)tools/mkimage -s -n $(if >>>>>>> $(CONFIG_AIS_CONFIG_FILE),$(CONFIG_AIS_CONFIG_FILE),"/dev/null") >>>>>>> \ >>>>>> This diff is hard to read, but what exactly are you changing? >>>>>> The >>>>>> u-boot-ubl target is also used on TI platforms. It looks like >>>>>> you're >>>>>> making it such that u-boot-ubl.bin produces the old binary and >>>>>> u-boot-ubl adds a new target which is the mkimage header on top >>>>>> of the >>>>>> same bits as before, but without possibly padding the output >>>>>> image. I >>>>>> suspect in your case you could just set PAD_TO to 8192 in >>>>>> board/../config.mk and use the existing target. >>>>>> >>>>> In the S3C2416 I don't need the mkimage stuff. I only need the >>>>> raw SPL >>>>> image >>>>> padded at 8KB concatenated with the standard U-Boot. What I've >>>>> done was >>>>> to >>>>> split the existing u-boot-ubl target in two; u-boot-ubl.bin, that >>>>> I use >>>>> to >>>>> program the Flash, and u-boot-ubl that remains with the same >>>>> functionality >>>>> as before, just now it depends on u-boot-ubl.bin. >>>> I think you should drop the UBL names from your padding target >>>> (u-boot-ubl.bin) since this is TI specific, use something more >>>> generic. >>> >>> I only reused a temporary filename used for the u-boot-ubl target >>> and make >>> it a new target. >>> If you think this is not an adequate name, can you suggest a new >>> one? >> u-boot.pad? u-boot-pad.bin? >> > > If no one else has anything against, I will change the name of the > new target to u-boot-pad.bin What exactly is u-boot-pad.bin supposed to be? I hope that's not being proposed as the final output file the user sees. With old nand_spl we had u-boot-nand.bin for the final concatenated binary, but that's not appropriate for a generic spl. I think it would be better for the user to see "u-boot.bin" as the actual image to put on the boot device, regardless of implementation details like spl, if there's no requirement of a specific file format. The second stage could become "u-boot-main.bin" or similar on builds where spl is used. -Scott