diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2006-12-07 03:00:32 -0500 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2006-12-11 18:42:07 -0500 |
| commit | cf00e20444fc39fe37691ca32919061bf65527b0 (patch) | |
| tree | 823d5d6df649f6804c5bee243ca98ae207ee3644 | |
| parent | fce3a24e7087ba1f56eea5ec14fec592e677e672 (diff) | |
sh: Add uImage and S-rec generation support.
Add a couple of new targets, both for uImage and S-rec generation.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| -rw-r--r-- | arch/sh/Makefile | 7 | ||||
| -rw-r--r-- | arch/sh/boot/Makefile | 40 | ||||
| -rw-r--r-- | arch/sh/boot/compressed/Makefile | 6 |
3 files changed, 43 insertions, 10 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index d10bba5e1074..c1dbef212634 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
| @@ -179,7 +179,7 @@ maketools: include/linux/version.h FORCE | |||
| 179 | 179 | ||
| 180 | all: zImage | 180 | all: zImage |
| 181 | 181 | ||
| 182 | zImage: vmlinux | 182 | zImage uImage uImage.srec vmlinux.srec: vmlinux |
| 183 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ | 183 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
| 184 | 184 | ||
| 185 | compressed: zImage | 185 | compressed: zImage |
| @@ -190,5 +190,8 @@ archclean: | |||
| 190 | CLEAN_FILES += include/asm-sh/machtypes.h | 190 | CLEAN_FILES += include/asm-sh/machtypes.h |
| 191 | 191 | ||
| 192 | define archhelp | 192 | define archhelp |
| 193 | @echo ' zImage - Compressed kernel image (arch/sh/boot/zImage)' | 193 | @echo '* zImage - Compressed kernel image' |
| 194 | @echo ' vmlinux.srec - Create an ELF S-record' | ||
| 195 | @echo ' uImage - Create a bootable image for U-Boot' | ||
| 196 | @echo ' uImage.srec - Create an S-record for U-Boot' | ||
| 194 | endef | 197 | endef |
diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile index 60797b31089c..11dc272c618e 100644 --- a/arch/sh/boot/Makefile +++ b/arch/sh/boot/Makefile | |||
| @@ -8,13 +8,49 @@ | |||
| 8 | # Copyright (C) 1999 Stuart Menefy | 8 | # Copyright (C) 1999 Stuart Menefy |
| 9 | # | 9 | # |
| 10 | 10 | ||
| 11 | targets := zImage | 11 | MKIMAGE := $(srctree)/scripts/mkuboot.sh |
| 12 | |||
| 13 | # | ||
| 14 | # Assign safe dummy values if these variables are not defined, | ||
| 15 | # in order to suppress error message. | ||
| 16 | # | ||
| 17 | CONFIG_PAGE_OFFSET ?= 0x80000000 | ||
| 18 | CONFIG_MEMORY_START ?= 0x0c000000 | ||
| 19 | CONFIG_BOOT_LINK_OFFSET ?= 0x00800000 | ||
| 20 | CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000 | ||
| 21 | |||
| 22 | export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \ | ||
| 23 | CONFIG_ZERO_PAGE_OFFSET | ||
| 24 | |||
| 25 | targets := zImage vmlinux.srec uImage uImage.srec | ||
| 12 | subdir- := compressed | 26 | subdir- := compressed |
| 13 | 27 | ||
| 14 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE | 28 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE |
| 15 | $(call if_changed,objcopy) | 29 | $(call if_changed,objcopy) |
| 16 | @echo 'Kernel: $@ is ready' | 30 | @echo ' Kernel: $@ is ready' |
| 17 | 31 | ||
| 18 | $(obj)/compressed/vmlinux: FORCE | 32 | $(obj)/compressed/vmlinux: FORCE |
| 19 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ | 33 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
| 20 | 34 | ||
| 35 | KERNEL_LOAD := $(shell printf "0x%8x" $$[$(CONFIG_PAGE_OFFSET) + \ | ||
| 36 | $(CONFIG_MEMORY_START) + \ | ||
| 37 | $(CONFIG_ZERO_PAGE_OFFSET)+0x1000]) | ||
| 38 | |||
| 39 | quiet_cmd_uimage = UIMAGE $@ | ||
| 40 | cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \ | ||
| 41 | -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_LOAD) \ | ||
| 42 | -n 'Linux-$(KERNELRELEASE)' -d $< $@ | ||
| 43 | |||
| 44 | $(obj)/uImage: $(obj)/zImage FORCE | ||
| 45 | $(call if_changed,uimage) | ||
| 46 | @echo ' Image $@ is ready' | ||
| 47 | |||
| 48 | OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec | ||
| 49 | $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux | ||
| 50 | $(call if_changed,objcopy) | ||
| 51 | |||
| 52 | OBJCOPYFLAGS_uImage.srec := -I binary -O srec | ||
| 53 | $(obj)/uImage.srec: $(obj)/uImage | ||
| 54 | $(call if_changed,objcopy) | ||
| 55 | |||
| 56 | clean-files += uImage uImage.srec vmlinux.srec | ||
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile index e5f443790079..d9512416f885 100644 --- a/arch/sh/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile | |||
| @@ -15,13 +15,7 @@ endif | |||
| 15 | 15 | ||
| 16 | # | 16 | # |
| 17 | # IMAGE_OFFSET is the load offset of the compression loader | 17 | # IMAGE_OFFSET is the load offset of the compression loader |
| 18 | # Assign dummy values if these 2 variables are not defined, | ||
| 19 | # in order to suppress error message. | ||
| 20 | # | 18 | # |
| 21 | CONFIG_PAGE_OFFSET ?= 0x80000000 | ||
| 22 | CONFIG_MEMORY_START ?= 0x0c000000 | ||
| 23 | CONFIG_BOOT_LINK_OFFSET ?= 0x00800000 | ||
| 24 | |||
| 25 | IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_PAGE_OFFSET) + \ | 19 | IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_PAGE_OFFSET) + \ |
| 26 | $(CONFIG_MEMORY_START) + \ | 20 | $(CONFIG_MEMORY_START) + \ |
| 27 | $(CONFIG_BOOT_LINK_OFFSET)]) | 21 | $(CONFIG_BOOT_LINK_OFFSET)]) |
