* [U-Boot] [RFC] Makefile: Add a message warning size change for mpc85xx boards
@ 2014-07-29 21:23 York Sun
2014-07-29 21:56 ` York Sun
2014-07-30 5:02 ` Wolfgang Denk
0 siblings, 2 replies; 4+ messages in thread
From: York Sun @ 2014-07-29 21:23 UTC (permalink / raw)
To: u-boot
Some mpc85xx boards are using 768KB size u-boot image while some
legacy boards still use 512KB. To bring attention to users about
the size change, a message is printed when compiling. SPL/PBL is
not covered by this change.
Signed-off-by: York Sun <yorksun@freescale.com>
CC: Kim Phillips <kim.phillips@freescale.com>
---
Makefile | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/Makefile b/Makefile
index ca212b5..5c823dc 100644
--- a/Makefile
+++ b/Makefile
@@ -691,8 +691,20 @@ BOARD_SIZE_CHECK = \
exit 1; \
fi
else
+ifdef CONFIG_MPC85xx
+BOARD_SIZE_CHECK = \
+ @actual=`wc -c $@ | awk '{print $$1}'`; \
+ limit=524288; \
+ if test $$actual -gt $$limit; then \
+ echo "Attention: File size $$actual bytes, may be different from legacy images" >&2; \
+ offset=`printf "%x" $$actual`; \
+ echo " NOR flash address for u-boot.bin: 0x$$offset from end of boot bank" >&2; \
+ echo " See board README"; \
+ fi
+else
BOARD_SIZE_CHECK =
endif
+endif
# Statically apply RELA-style relocations (currently arm64 only)
ifneq ($(CONFIG_STATIC_RELA),)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [RFC] Makefile: Add a message warning size change for mpc85xx boards
2014-07-29 21:23 [U-Boot] [RFC] Makefile: Add a message warning size change for mpc85xx boards York Sun
@ 2014-07-29 21:56 ` York Sun
2014-07-30 5:02 ` Wolfgang Denk
1 sibling, 0 replies; 4+ messages in thread
From: York Sun @ 2014-07-29 21:56 UTC (permalink / raw)
To: u-boot
This is an RFC. Do NOT apply. It outputs the message, tricks MAKEALL to count it
as warning.
York
On 07/29/2014 02:23 PM, York Sun wrote:
> Some mpc85xx boards are using 768KB size u-boot image while some
> legacy boards still use 512KB. To bring attention to users about
> the size change, a message is printed when compiling. SPL/PBL is
> not covered by this change.
>
> Signed-off-by: York Sun <yorksun@freescale.com>
> CC: Kim Phillips <kim.phillips@freescale.com>
> ---
> Makefile | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index ca212b5..5c823dc 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -691,8 +691,20 @@ BOARD_SIZE_CHECK = \
> exit 1; \
> fi
> else
> +ifdef CONFIG_MPC85xx
> +BOARD_SIZE_CHECK = \
> + @actual=`wc -c $@ | awk '{print $$1}'`; \
> + limit=524288; \
> + if test $$actual -gt $$limit; then \
> + echo "Attention: File size $$actual bytes, may be different from legacy images" >&2; \
> + offset=`printf "%x" $$actual`; \
> + echo " NOR flash address for u-boot.bin: 0x$$offset from end of boot bank" >&2; \
> + echo " See board README"; \
> + fi
> +else
> BOARD_SIZE_CHECK =
> endif
> +endif
>
> # Statically apply RELA-style relocations (currently arm64 only)
> ifneq ($(CONFIG_STATIC_RELA),)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [RFC] Makefile: Add a message warning size change for mpc85xx boards
2014-07-29 21:23 [U-Boot] [RFC] Makefile: Add a message warning size change for mpc85xx boards York Sun
2014-07-29 21:56 ` York Sun
@ 2014-07-30 5:02 ` Wolfgang Denk
2014-07-30 22:13 ` York Sun
1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2014-07-30 5:02 UTC (permalink / raw)
To: u-boot
Dear York Sun,
In message <1406669019-31651-1-git-send-email-yorksun@freescale.com> you wrote:
> Some mpc85xx boards are using 768KB size u-boot image while some
> legacy boards still use 512KB. To bring attention to users about
> the size change, a message is printed when compiling. SPL/PBL is
> not covered by this change.
This makes no sense to me. Where are these magic image sizes coming
from? This is highly board specific stuff at best, probably valid for
some Freescale boards only.
I think if this is useful at all (which I actually doubt) this should
be moved to board specific code, or if you really think it fits, then
maybe made Freescale vendor specific.
But please keep such stuff out of the global Makefile.
Thanks.
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"If you want to eat hippopatomus, you've got to pay the freight." -
attributed to an IBM guy, about why IBM software uses so much memory
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [RFC] Makefile: Add a message warning size change for mpc85xx boards
2014-07-30 5:02 ` Wolfgang Denk
@ 2014-07-30 22:13 ` York Sun
0 siblings, 0 replies; 4+ messages in thread
From: York Sun @ 2014-07-30 22:13 UTC (permalink / raw)
To: u-boot
On 07/29/2014 10:02 PM, Wolfgang Denk wrote:
> Dear York Sun,
>
> In message <1406669019-31651-1-git-send-email-yorksun@freescale.com> you wrote:
>> Some mpc85xx boards are using 768KB size u-boot image while some
>> legacy boards still use 512KB. To bring attention to users about
>> the size change, a message is printed when compiling. SPL/PBL is
>> not covered by this change.
>
> This makes no sense to me. Where are these magic image sizes coming
> from? This is highly board specific stuff at best, probably valid for
> some Freescale boards only.
This was raised by an end user who got confused by upgrading from the older
image which was 512KB to the new image 768KB. The README file described the
change, but it may be not obvious enough to a user to notice.
Kim proposed the idea to add a compiling warning (not really a warning though)
about the size change to raise attention.
>
> I think if this is useful at all (which I actually doubt) this should
> be moved to board specific code, or if you really think it fits, then
> maybe made Freescale vendor specific.
>
> But please keep such stuff out of the global Makefile.
>
I agree it should not be put into global Makefile. I am struggling to understand
the right way to move such check to arch/powerpc/cpu/mpc85xx/Makefile. Do I need
to add a new target in arch/powerpc/cpu/mpc85xx/Makefile, like
+NEW_TARGET:
+ Do something special here
and add an entry in global Makefile, like
u-boot.bin: u-boot FORCE
$(call if_changed,objcopy)
$(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE))
$(BOARD_SIZE_CHECK)
+ $(Q)$(MAKE) $(build)=arch/powerpc/cpu/mpc85xx NEW_TARGET
Some guidance (or examples) will be appreciated.
York
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-07-30 22:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-29 21:23 [U-Boot] [RFC] Makefile: Add a message warning size change for mpc85xx boards York Sun
2014-07-29 21:56 ` York Sun
2014-07-30 5:02 ` Wolfgang Denk
2014-07-30 22:13 ` York Sun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox