All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Add support for building uImages
@ 2005-11-23 18:43 ` Kumar Gala
  0 siblings, 0 replies; 7+ messages in thread
From: Kumar Gala @ 2005-11-23 18:43 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linux-kernel

powerpc: Add support for building uImages

Add support to build a kernel image bootable by u-boot.
Most of the makefile foo is taken from arch/ppc/boot/images/Makefile

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

---
commit 74dc65dbfa00bb69929c34da2ae788868aaae399
tree 2344f27b9a84a2c3212c4dcc070f6b0cebb906ef
parent 8573cff663f4df7af110c9781ccefd6b12522a2f
author Kumar Gala <galak@kernel.crashing.org> Wed, 23 Nov 2005 12:44:01 -0600
committer Kumar Gala <galak@kernel.crashing.org> Wed, 23 Nov 2005 12:44:01 -0600

 arch/powerpc/Makefile      |    2 +-
 arch/powerpc/boot/Makefile |   30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index a13eb57..5f80e58 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -151,7 +151,7 @@ CPPFLAGS_vmlinux.lds	:= -Upowerpc
 # All the instructions talk about "make bzImage".
 bzImage: zImage
 
-BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
+BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage
 
 .PHONY: $(BOOT_TARGETS)
 
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 9770f58..dfc7eac 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -143,6 +143,36 @@ $(obj)/zImage.initrd: $(obj)/zImage.init
 	@cp -f $< $@
 	$(call if_changed,addnote)
 
+#-----------------------------------------------------------
+# build u-boot images
+#-----------------------------------------------------------
+quiet_cmd_mygzip = GZIP $@
+cmd_mygzip = gzip -f -9 < $< > $@.$$$$ && mv $@.$$$$ $@
+
+quiet_cmd_objbin = OBJCOPY $@
+      cmd_objbin = $(OBJCOPY) -O binary $< $@
+
+quiet_cmd_uimage = UIMAGE $@
+      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \
+               -C gzip -a 00000000 -e 00000000 -n 'Linux-$(KERNELRELEASE)' \
+               -d $< $@
+
+MKIMAGE		:= $(srctree)/scripts/mkuboot.sh
+targets		+= uImage
+extra-y		+= vmlinux.bin vmlinux.gz
+
+$(obj)/vmlinux.bin: vmlinux FORCE
+	$(call if_changed,objbin)
+
+$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
+	$(call if_changed,mygzip)
+
+$(obj)/uImage: $(obj)/vmlinux.gz
+	$(Q)rm -f $@
+	$(call if_changed,uimage)
+	@echo -n '  Image: $@ '
+	@if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi
+
 install: $(CONFIGURE) $(BOOTIMAGE)
 	sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" "$(BOOTIMAGE)"
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] powerpc: Add support for building uImages
@ 2005-11-23 18:43 ` Kumar Gala
  0 siblings, 0 replies; 7+ messages in thread
From: Kumar Gala @ 2005-11-23 18:43 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linux-kernel, linuxppc-dev

powerpc: Add support for building uImages

Add support to build a kernel image bootable by u-boot.
Most of the makefile foo is taken from arch/ppc/boot/images/Makefile

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

---
commit 74dc65dbfa00bb69929c34da2ae788868aaae399
tree 2344f27b9a84a2c3212c4dcc070f6b0cebb906ef
parent 8573cff663f4df7af110c9781ccefd6b12522a2f
author Kumar Gala <galak@kernel.crashing.org> Wed, 23 Nov 2005 12:44:01 -0600
committer Kumar Gala <galak@kernel.crashing.org> Wed, 23 Nov 2005 12:44:01 -0600

 arch/powerpc/Makefile      |    2 +-
 arch/powerpc/boot/Makefile |   30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index a13eb57..5f80e58 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -151,7 +151,7 @@ CPPFLAGS_vmlinux.lds	:= -Upowerpc
 # All the instructions talk about "make bzImage".
 bzImage: zImage
 
-BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
+BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage
 
 .PHONY: $(BOOT_TARGETS)
 
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 9770f58..dfc7eac 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -143,6 +143,36 @@ $(obj)/zImage.initrd: $(obj)/zImage.init
 	@cp -f $< $@
 	$(call if_changed,addnote)
 
+#-----------------------------------------------------------
+# build u-boot images
+#-----------------------------------------------------------
+quiet_cmd_mygzip = GZIP $@
+cmd_mygzip = gzip -f -9 < $< > $@.$$$$ && mv $@.$$$$ $@
+
+quiet_cmd_objbin = OBJCOPY $@
+      cmd_objbin = $(OBJCOPY) -O binary $< $@
+
+quiet_cmd_uimage = UIMAGE $@
+      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \
+               -C gzip -a 00000000 -e 00000000 -n 'Linux-$(KERNELRELEASE)' \
+               -d $< $@
+
+MKIMAGE		:= $(srctree)/scripts/mkuboot.sh
+targets		+= uImage
+extra-y		+= vmlinux.bin vmlinux.gz
+
+$(obj)/vmlinux.bin: vmlinux FORCE
+	$(call if_changed,objbin)
+
+$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
+	$(call if_changed,mygzip)
+
+$(obj)/uImage: $(obj)/vmlinux.gz
+	$(Q)rm -f $@
+	$(call if_changed,uimage)
+	@echo -n '  Image: $@ '
+	@if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi
+
 install: $(CONFIGURE) $(BOOTIMAGE)
 	sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" "$(BOOTIMAGE)"
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc: Add support for building uImages
  2005-11-23 18:43 ` Kumar Gala
@ 2005-11-23 18:55   ` Sam Ravnborg
  -1 siblings, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2005-11-23 18:55 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, linux-kernel

On Wed, Nov 23, 2005 at 12:43:15PM -0600, Kumar Gala wrote:
> +
> +$(obj)/uImage: $(obj)/vmlinux.gz
> +	$(Q)rm -f $@
> +	$(call if_changed,uimage)
> +	@echo -n '  Image: $@ '
> +	@if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi

The above is suboptimal. The $(call if_changed,uimage) will execute
$(cmd_uimage) if 1) prerequisites has changed or 2) the command to execute
has changed.
In the above case 1) is always true, otherwise we would not reach the
statement. So change it to $(call cmd,uimage) is the correct way.

The 'bug' is also present in ppc/boot/images

	Sam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc: Add support for building uImages
@ 2005-11-23 18:55   ` Sam Ravnborg
  0 siblings, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2005-11-23 18:55 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Paul Mackerras, linux-kernel, linuxppc-dev

On Wed, Nov 23, 2005 at 12:43:15PM -0600, Kumar Gala wrote:
> +
> +$(obj)/uImage: $(obj)/vmlinux.gz
> +	$(Q)rm -f $@
> +	$(call if_changed,uimage)
> +	@echo -n '  Image: $@ '
> +	@if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi

The above is suboptimal. The $(call if_changed,uimage) will execute
$(cmd_uimage) if 1) prerequisites has changed or 2) the command to execute
has changed.
In the above case 1) is always true, otherwise we would not reach the
statement. So change it to $(call cmd,uimage) is the correct way.

The 'bug' is also present in ppc/boot/images

	Sam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc: Add support for building uImages
  2005-11-23 18:55   ` Sam Ravnborg
@ 2005-11-23 19:02     ` Kumar Gala
  -1 siblings, 0 replies; 7+ messages in thread
From: Kumar Gala @ 2005-11-23 19:02 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linuxppc-dev, linux-kernel

On Wed, 23 Nov 2005, Sam Ravnborg wrote:

> On Wed, Nov 23, 2005 at 12:43:15PM -0600, Kumar Gala wrote:
> > +
> > +$(obj)/uImage: $(obj)/vmlinux.gz
> > +	$(Q)rm -f $@
> > +	$(call if_changed,uimage)
> > +	@echo -n '  Image: $@ '
> > +	@if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi
> 
> The above is suboptimal. The $(call if_changed,uimage) will execute
> $(cmd_uimage) if 1) prerequisites has changed or 2) the command to execute
> has changed.
> In the above case 1) is always true, otherwise we would not reach the
> statement. So change it to $(call cmd,uimage) is the correct way.
> 
> The 'bug' is also present in ppc/boot/images

thanks.  I'll send a follow up patch to fix both cases.

- kumar

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc: Add support for building uImages
@ 2005-11-23 19:02     ` Kumar Gala
  0 siblings, 0 replies; 7+ messages in thread
From: Kumar Gala @ 2005-11-23 19:02 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Paul Mackerras, linux-kernel, linuxppc-dev

On Wed, 23 Nov 2005, Sam Ravnborg wrote:

> On Wed, Nov 23, 2005 at 12:43:15PM -0600, Kumar Gala wrote:
> > +
> > +$(obj)/uImage: $(obj)/vmlinux.gz
> > +	$(Q)rm -f $@
> > +	$(call if_changed,uimage)
> > +	@echo -n '  Image: $@ '
> > +	@if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi
> 
> The above is suboptimal. The $(call if_changed,uimage) will execute
> $(cmd_uimage) if 1) prerequisites has changed or 2) the command to execute
> has changed.
> In the above case 1) is always true, otherwise we would not reach the
> statement. So change it to $(call cmd,uimage) is the correct way.
> 
> The 'bug' is also present in ppc/boot/images

thanks.  I'll send a follow up patch to fix both cases.

- kumar


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] powerpc: Add missing vmlinux.bin target
  2005-11-23 18:43 ` Kumar Gala
  (?)
  (?)
@ 2006-02-02 23:41 ` Geoff Levand
  -1 siblings, 0 replies; 7+ messages in thread
From: Geoff Levand @ 2006-02-02 23:41 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Kumar Gala, linuxppc-dev

With this patch 'make vmlinux.bin' works.  This is needed by
some embedded platforms.  Kumar already added the routines
to actually build the image in arch/powerpc/boot/Makefile.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>

--


Index: powerpc-merge.git/arch/powerpc/Makefile
===================================================================
--- powerpc-merge.git.orig/arch/powerpc/Makefile	2006-02-02 15:23:03.000000000 -0800
+++ powerpc-merge.git/arch/powerpc/Makefile	2006-02-02 15:23:53.000000000 -0800
@@ -147,7 +147,7 @@

 CPPFLAGS_vmlinux.lds	:= -Upowerpc

-BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage
+BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage vmlinux.bin

 .PHONY: $(BOOT_TARGETS)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-02-03  2:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-23 18:43 [PATCH] powerpc: Add support for building uImages Kumar Gala
2005-11-23 18:43 ` Kumar Gala
2005-11-23 18:55 ` Sam Ravnborg
2005-11-23 18:55   ` Sam Ravnborg
2005-11-23 19:02   ` Kumar Gala
2005-11-23 19:02     ` Kumar Gala
2006-02-02 23:41 ` [PATCH] powerpc: Add missing vmlinux.bin target Geoff Levand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.