162306a36Sopenharmony_ci#
262306a36Sopenharmony_ci# arch/sh/boot/Makefile
362306a36Sopenharmony_ci#
462306a36Sopenharmony_ci# This file is subject to the terms and conditions of the GNU General Public
562306a36Sopenharmony_ci# License.  See the file "COPYING" in the main directory of this archive
662306a36Sopenharmony_ci# for more details.
762306a36Sopenharmony_ci#
862306a36Sopenharmony_ci# Copyright (C) 1999 Stuart Menefy
962306a36Sopenharmony_ci#
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#
1262306a36Sopenharmony_ci# Assign safe dummy values if these variables are not defined,
1362306a36Sopenharmony_ci# in order to suppress error message.
1462306a36Sopenharmony_ci#
1562306a36Sopenharmony_ciCONFIG_PAGE_OFFSET	?= 0x80000000
1662306a36Sopenharmony_ciCONFIG_MEMORY_START	?= 0x0c000000
1762306a36Sopenharmony_ciCONFIG_BOOT_LINK_OFFSET	?= 0x00800000
1862306a36Sopenharmony_ciCONFIG_ZERO_PAGE_OFFSET	?= 0x00001000
1962306a36Sopenharmony_ciCONFIG_ENTRY_OFFSET	?= 0x00001000
2062306a36Sopenharmony_ciCONFIG_PHYSICAL_START	?= $(CONFIG_MEMORY_START)
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_cisuffix_y := bin
2362306a36Sopenharmony_cisuffix_$(CONFIG_KERNEL_GZIP)	:= gz
2462306a36Sopenharmony_cisuffix_$(CONFIG_KERNEL_BZIP2)	:= bz2
2562306a36Sopenharmony_cisuffix_$(CONFIG_KERNEL_LZMA)	:= lzma
2662306a36Sopenharmony_cisuffix_$(CONFIG_KERNEL_XZ)	:= xz
2762306a36Sopenharmony_cisuffix_$(CONFIG_KERNEL_LZO)	:= lzo
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_citargets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \
3062306a36Sopenharmony_ci	   uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin \
3162306a36Sopenharmony_ci	   vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
3262306a36Sopenharmony_ci	   vmlinux.bin.xz vmlinux.bin.lzo
3362306a36Sopenharmony_cisubdir- := compressed romimage
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
3662306a36Sopenharmony_ci	$(call if_changed,objcopy)
3762306a36Sopenharmony_ci	@echo '  Kernel: $@ is ready'
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci$(obj)/compressed/vmlinux: FORCE
4062306a36Sopenharmony_ci	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci$(obj)/romImage: $(obj)/romimage/vmlinux FORCE
4362306a36Sopenharmony_ci	$(call if_changed,objcopy)
4462306a36Sopenharmony_ci	@echo '  Kernel: $@ is ready'
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci$(obj)/romimage/vmlinux: $(obj)/zImage FORCE
4762306a36Sopenharmony_ci	$(Q)$(MAKE) $(build)=$(obj)/romimage $@
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ciKERNEL_MEMORY	:= $(shell /bin/bash -c 'printf "0x%08x" \
5062306a36Sopenharmony_ci		     $$[$(CONFIG_PHYSICAL_START) & 0x1fffffff]')
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ciKERNEL_LOAD	:= $(shell /bin/bash -c 'printf "0x%08x" \
5362306a36Sopenharmony_ci		     $$[$(CONFIG_PAGE_OFFSET)  + \
5462306a36Sopenharmony_ci			$(KERNEL_MEMORY) + \
5562306a36Sopenharmony_ci			$(CONFIG_ZERO_PAGE_OFFSET)]')
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ciKERNEL_ENTRY	:= $(shell /bin/bash -c 'printf "0x%08x" \
5862306a36Sopenharmony_ci		     $$[$(CONFIG_PAGE_OFFSET)  + \
5962306a36Sopenharmony_ci			$(KERNEL_MEMORY) + \
6062306a36Sopenharmony_ci			$(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ciUIMAGE_LOADADDR = $(KERNEL_LOAD)
6362306a36Sopenharmony_ciUIMAGE_ENTRYADDR = $(KERNEL_ENTRY)
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci$(obj)/vmlinux.bin: vmlinux FORCE
6662306a36Sopenharmony_ci	$(call if_changed,objcopy)
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
6962306a36Sopenharmony_ci	$(call if_changed,gzip)
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
7262306a36Sopenharmony_ci	$(call if_changed,bzip2)
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
7562306a36Sopenharmony_ci	$(call if_changed,lzma)
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci$(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE
7862306a36Sopenharmony_ci	$(call if_changed,xzkern)
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
8162306a36Sopenharmony_ci	$(call if_changed,lzo)
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2 FORCE
8462306a36Sopenharmony_ci	$(call if_changed,uimage,bzip2)
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci$(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE
8762306a36Sopenharmony_ci	$(call if_changed,uimage,gzip)
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci$(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE
9062306a36Sopenharmony_ci	$(call if_changed,uimage,lzma)
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci$(obj)/uImage.xz: $(obj)/vmlinux.bin.xz FORCE
9362306a36Sopenharmony_ci	$(call if_changed,uimage,xz)
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci$(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo FORCE
9662306a36Sopenharmony_ci	$(call if_changed,uimage,lzo)
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_ci$(obj)/uImage.bin: $(obj)/vmlinux.bin FORCE
9962306a36Sopenharmony_ci	$(call if_changed,uimage,none)
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ciOBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
10262306a36Sopenharmony_ci$(obj)/vmlinux.srec: $(obj)/compressed/vmlinux FORCE
10362306a36Sopenharmony_ci	$(call if_changed,objcopy)
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ciOBJCOPYFLAGS_uImage.srec := -I binary -O srec
10662306a36Sopenharmony_ci$(obj)/uImage.srec: $(obj)/uImage FORCE
10762306a36Sopenharmony_ci	$(call if_changed,objcopy)
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ci$(obj)/uImage: $(obj)/uImage.$(suffix_y)
11062306a36Sopenharmony_ci	@ln -sf $(notdir $<) $@
11162306a36Sopenharmony_ci	@echo '  Image $@ is ready'
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ciexport CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
11462306a36Sopenharmony_ci       CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \
11562306a36Sopenharmony_ci       KERNEL_MEMORY suffix_y
116