xref: /openbmc/linux/arch/sh/boot/Makefile (revision 9e24c7e2)
11da177e4SLinus Torvalds#
21da177e4SLinus Torvalds# arch/sh/boot/Makefile
31da177e4SLinus Torvalds#
41da177e4SLinus Torvalds# This file is subject to the terms and conditions of the GNU General Public
51da177e4SLinus Torvalds# License.  See the file "COPYING" in the main directory of this archive
61da177e4SLinus Torvalds# for more details.
71da177e4SLinus Torvalds#
81da177e4SLinus Torvalds# Copyright (C) 1999 Stuart Menefy
91da177e4SLinus Torvalds#
101da177e4SLinus Torvalds
11cf00e204SPaul MundtMKIMAGE := $(srctree)/scripts/mkuboot.sh
12cf00e204SPaul Mundt
13cf00e204SPaul Mundt#
14cf00e204SPaul Mundt# Assign safe dummy values if these variables are not defined,
15cf00e204SPaul Mundt# in order to suppress error message.
16cf00e204SPaul Mundt#
17cf00e204SPaul MundtCONFIG_PAGE_OFFSET	?= 0x80000000
18cf00e204SPaul MundtCONFIG_MEMORY_START	?= 0x0c000000
19cf00e204SPaul MundtCONFIG_BOOT_LINK_OFFSET	?= 0x00800000
20cf00e204SPaul MundtCONFIG_ZERO_PAGE_OFFSET	?= 0x00001000
21d27e0854SPaul MundtCONFIG_ENTRY_OFFSET	?= 0x00001000
22cf00e204SPaul Mundt
239e24c7e2SMagnus Dammsuffix-y := bin
24ef9b542fSPaul Mundtsuffix-$(CONFIG_KERNEL_GZIP)  := gz
25ef9b542fSPaul Mundtsuffix-$(CONFIG_KERNEL_BZIP2) := bz2
26ef9b542fSPaul Mundtsuffix-$(CONFIG_KERNEL_LZMA)  := lzma
27ef9b542fSPaul Mundt
289e24c7e2SMagnus Dammtargets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz uImage.bz2 uImage.lzma uImage.bin
29ef9b542fSPaul Mundtextra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma
303c928320SMagnus Dammsubdir- := compressed romimage
311da177e4SLinus Torvalds
321da177e4SLinus Torvalds$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
331da177e4SLinus Torvalds	$(call if_changed,objcopy)
341da177e4SLinus Torvalds	@echo '  Kernel: $@ is ready'
351da177e4SLinus Torvalds
361da177e4SLinus Torvalds$(obj)/compressed/vmlinux: FORCE
371da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
381da177e4SLinus Torvalds
393c928320SMagnus Damm$(obj)/romImage: $(obj)/romimage/vmlinux FORCE
403c928320SMagnus Damm	$(call if_changed,objcopy)
413c928320SMagnus Damm	@echo '  Kernel: $@ is ready'
423c928320SMagnus Damm
433c928320SMagnus Damm$(obj)/romimage/vmlinux: $(obj)/zImage FORCE
443c928320SMagnus Damm	$(Q)$(MAKE) $(build)=$(obj)/romimage $@
453c928320SMagnus Damm
462f47f447SYoshihiro ShimodaKERNEL_MEMORY := 0x00000000
472f47f447SYoshihiro Shimodaifeq ($(CONFIG_PMB_FIXED),y)
482f47f447SYoshihiro ShimodaKERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
492f47f447SYoshihiro Shimoda		     $$[$(CONFIG_MEMORY_START) & 0x1fffffff]')
50664718a3SChris Smithendif
512f47f447SYoshihiro Shimodaifeq ($(CONFIG_29BIT),y)
522f47f447SYoshihiro ShimodaKERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
532f47f447SYoshihiro Shimoda		     $$[$(CONFIG_MEMORY_START)]')
542f47f447SYoshihiro Shimodaendif
552f47f447SYoshihiro Shimoda
562f47f447SYoshihiro ShimodaKERNEL_LOAD	:= $(shell /bin/bash -c 'printf "0x%08x" \
572f47f447SYoshihiro Shimoda		     $$[$(CONFIG_PAGE_OFFSET)  + \
582f47f447SYoshihiro Shimoda			$(KERNEL_MEMORY) + \
592f47f447SYoshihiro Shimoda			$(CONFIG_ZERO_PAGE_OFFSET)]')
60453ec9c1SThomas Betker
6166b5bf42SPaul MundtKERNEL_ENTRY	:= $(shell /bin/bash -c 'printf "0x%08x" \
626fc5153aSPaul Mundt		     $$[$(CONFIG_PAGE_OFFSET)  + \
632f47f447SYoshihiro Shimoda			$(KERNEL_MEMORY) + \
6482cb1f6fSYoshihiro Shimoda			$(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
65cf00e204SPaul Mundt
66cf00e204SPaul Mundtquiet_cmd_uimage = UIMAGE  $@
67cf00e204SPaul Mundt      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
68ef9b542fSPaul Mundt		   -C $(2) -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
69cf00e204SPaul Mundt		   -n 'Linux-$(KERNELRELEASE)' -d $< $@
70cf00e204SPaul Mundt
71453ec9c1SThomas Betker$(obj)/vmlinux.bin: vmlinux FORCE
72453ec9c1SThomas Betker	$(call if_changed,objcopy)
73453ec9c1SThomas Betker
74453ec9c1SThomas Betker$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
75453ec9c1SThomas Betker	$(call if_changed,gzip)
76453ec9c1SThomas Betker
77ef9b542fSPaul Mundt$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
78ef9b542fSPaul Mundt	$(call if_changed,bzip2)
79ef9b542fSPaul Mundt
80ef9b542fSPaul Mundt$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
81ef9b542fSPaul Mundt	$(call if_changed,lzma)
82ef9b542fSPaul Mundt
83ef9b542fSPaul Mundt$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2
84ef9b542fSPaul Mundt	$(call if_changed,uimage,bzip2)
85ef9b542fSPaul Mundt
86ef9b542fSPaul Mundt$(obj)/uImage.gz: $(obj)/vmlinux.bin.gz
87ef9b542fSPaul Mundt	$(call if_changed,uimage,gzip)
88ef9b542fSPaul Mundt
89ef9b542fSPaul Mundt$(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma
90ef9b542fSPaul Mundt	$(call if_changed,uimage,lzma)
91ef9b542fSPaul Mundt
929e24c7e2SMagnus Damm$(obj)/uImage.bin: $(obj)/vmlinux.bin
939e24c7e2SMagnus Damm	$(call if_changed,uimage,none)
949e24c7e2SMagnus Damm
95cf00e204SPaul MundtOBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
96cf00e204SPaul Mundt$(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
97cf00e204SPaul Mundt	$(call if_changed,objcopy)
98cf00e204SPaul Mundt
99cf00e204SPaul MundtOBJCOPYFLAGS_uImage.srec := -I binary -O srec
100cf00e204SPaul Mundt$(obj)/uImage.srec: $(obj)/uImage
101cf00e204SPaul Mundt	$(call if_changed,objcopy)
102cf00e204SPaul Mundt
103ef9b542fSPaul Mundt$(obj)/uImage: $(obj)/uImage.$(suffix-y)
104ef9b542fSPaul Mundt	@ln -sf $(notdir $<) $@
105ef9b542fSPaul Mundt	@echo '  Image $@ is ready'
106ef9b542fSPaul Mundt
107ef9b542fSPaul Mundtexport CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
108ef9b542fSPaul Mundt       CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET KERNEL_MEMORY suffix-y
109