18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci#
38c2ecf20Sopenharmony_ci# linux/arch/sh/boot/romimage/Makefile
48c2ecf20Sopenharmony_ci#
58c2ecf20Sopenharmony_ci# create an romImage file suitable for burning to flash/mmc from zImage
68c2ecf20Sopenharmony_ci#
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_citargets		:= vmlinux head.o zeropage.bin piggy.o
98c2ecf20Sopenharmony_ciload-y		:= 0
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_cimmcif-load-$(CONFIG_CPU_SUBTYPE_SH7724)	:= 0xe5200000 # ILRAM
128c2ecf20Sopenharmony_cimmcif-obj-$(CONFIG_CPU_SUBTYPE_SH7724)	:= $(obj)/mmcif-sh7724.o
138c2ecf20Sopenharmony_ciload-$(CONFIG_ROMIMAGE_MMCIF)		:= $(mmcif-load-y)
148c2ecf20Sopenharmony_ciobj-$(CONFIG_ROMIMAGE_MMCIF)		:= $(mmcif-obj-y)
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciLDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(load-y) -e romstart \
178c2ecf20Sopenharmony_ci		   -T $(obj)/../../kernel/vmlinux.lds
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci$(obj)/vmlinux: $(obj)/head.o $(obj-y) $(obj)/piggy.o FORCE
208c2ecf20Sopenharmony_ci	$(call if_changed,ld)
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciOBJCOPYFLAGS += -j .empty_zero_page
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci$(obj)/zeropage.bin: vmlinux FORCE
258c2ecf20Sopenharmony_ci	$(call if_changed,objcopy)
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciLDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/zeropage.bin arch/sh/boot/zImage FORCE
308c2ecf20Sopenharmony_ci	$(call if_changed,ld)
31