linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: add uImage build target

To: James Hogan <james.hogan@imgtec.com>
Subject: Re: [PATCH] MIPS: add uImage build target
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Wed, 21 Aug 2013 16:59:44 +0100
Cc: Ralf Baechle <ralf@linux-mips.org>, Linux-MIPS <linux-mips@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Sk5M2QTkoXPtTMB8gFQ/Y4b6ZG7uL7EpWm7zbFcOzPc=; b=w5m49UTriZ9zsrpAkkSsdPrWGyNEoOOMLZpZAXmT7RFGbGlaMzaWEHOVQ5zc6pVAOh HfLWeYzFJBiYycP8A/o4bOEJKgrYA1f1dJgrJXnDCiM3+TlEV8QFnuZntPTQxNvm8ZAy 8rkhWjHNokZtTdbp9/vJKLYklOed5TUq3/gwUigcyh9Ey/shGIzaIqvYzSurSwy5odMJ AKlW4sZQ7eSTkde4Pp/zPZKpuy6fa9p81T9BK7AB5Andj3TGmVH+SPzuPcVoVfRl/c7z kz6qeRL93AW7MkMH3WC3GoOAkMAdVVcCf9pyrU5CqrulReIuj9M8rNcdOuVNDONuUawV G88A==
In-reply-to: <5214E05E.7000303@imgtec.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1377096947-3959-1-git-send-email-james.hogan@imgtec.com> <CAGVrzcZ8FVv9p00R6yDaqRMQARi64P+zVzNRsyeGpiL4UZL3Vg@mail.gmail.com> <5214E05E.7000303@imgtec.com>
Sender: linux-mips-bounce@linux-mips.org
Hello James,

2013/8/21 James Hogan <james.hogan@imgtec.com>:
> Hi Florian,
>
> On 21/08/13 16:08, Florian Fainelli wrote:
>> 2013/8/21 James Hogan <james.hogan@imgtec.com>:
>>> diff --git a/arch/mips/Makefile b/arch/mips/Makefile
>>> index b2be6b8..c4f339e 100644
>>> --- a/arch/mips/Makefile
>>> +++ b/arch/mips/Makefile
>>> @@ -284,7 +284,7 @@ vmlinux.64: vmlinux
>>>  all:   $(all-y)
>>>
>>>  # boot
>>> -vmlinux.bin vmlinux.ecoff vmlinux.srec: $(vmlinux-32) FORCE
>>> +vmlinux.bin vmlinux.ecoff vmlinux.srec uImage: $(vmlinux-32) FORCE
>>>         $(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) 
>>> arch/mips/boot/$@
>>>
>>>  # boot/compressed
>>> @@ -327,6 +327,7 @@ define archhelp
>>>         echo '  vmlinuz.ecoff        - ECOFF zboot image'
>>>         echo '  vmlinuz.bin          - Raw binary zboot image'
>>>         echo '  vmlinuz.srec         - SREC zboot image'
>>> +       echo '  uImage               - U-Boot image (gzip)'
>>
>> This is not quite accurate, since you introduce two new uImage
>> targets, this should be:
>>
>> +       echo '  uImage               - U-Boot image'
>> +       echo '  uImage.gz               - U-Boot image (gzip)'
>
> Only uImage is passed through to arch/mips/boot/Makefile, but yes, they
> probably both should be.
>
>>
>>>         echo
>>>         echo '  These will be default as appropriate for a configured 
>>> platform.'
>>>  endef
>>> diff --git a/arch/mips/boot/.gitignore b/arch/mips/boot/.gitignore
>>> index f210b09..a73d6e2 100644
>>> --- a/arch/mips/boot/.gitignore
>>> +++ b/arch/mips/boot/.gitignore
>>> @@ -4,3 +4,4 @@ vmlinux.*
>>>  zImage
>>>  zImage.tmp
>>>  calc_vmlinuz_load_addr
>>> +uImage
>>> diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile
>>> index 851261e..8169d42 100644
>>> --- a/arch/mips/boot/Makefile
>>> +++ b/arch/mips/boot/Makefile
>>> @@ -40,3 +40,18 @@ quiet_cmd_srec = OBJCOPY $@
>>>        cmd_srec = $(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $@
>>>  $(obj)/vmlinux.srec: $(VMLINUX) FORCE
>>>         $(call if_changed,srec)
>>> +
>>> +UIMAGE_LOADADDR  = $(shell $(NM) $(VMLINUX) | grep "\b_text\b"        | 
>>> cut -f1 -d\ )
>>
>> Is not VMLINUX_LOAD_ADDRESS suitable here?
>
> It's only passed through to arch/mips/boot/compressed. It can always be
> made to pass it to arch/mips/boot too though.

Right, in your case $(load-y) should do it.

>
>>
>>> +UIMAGE_ENTRYADDR = $(shell $(NM) $(VMLINUX) | grep '\bkernel_entry\b' | 
>>> cut -f1 -d\ )
>>
>> This logic already exists in arch/mips/boot/compressed/Makefile, so we
>> might want to move this to arch/mips/Makefile? This could be a
>> preliminary or subsequent patch, your call.
>
> Thanks for the feedback. I'll refactor it a bit to avoid duplication.

Great, thanks!
-- 
Florian

<Prev in Thread] Current Thread [Next in Thread>