rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | # |
| 2 | # arch/arm/boot/Makefile |
| 3 | # |
| 4 | # This file is included by the global makefile so that you can add your own |
| 5 | # architecture-specific flags and dependencies. |
| 6 | # |
| 7 | # This file is subject to the terms and conditions of the GNU General Public |
| 8 | # License. See the file "COPYING" in the main directory of this archive |
| 9 | # for more details. |
| 10 | # |
| 11 | # Copyright (C) 1995-2002 Russell King |
| 12 | # |
| 13 | |
| 14 | OBJCOPYFLAGS :=-O binary -R .comment -S |
| 15 | |
| 16 | ifneq ($(MACHINE),) |
| 17 | include $(MACHINE)/Makefile.boot |
| 18 | endif |
| 19 | include $(srctree)/arch/arm/boot/dts/Makefile |
| 20 | |
| 21 | # Note: the following conditions must always be true: |
| 22 | # ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET) |
| 23 | # PARAMS_PHYS must be within 4MB of ZRELADDR |
| 24 | # INITRD_PHYS must be in RAM |
| 25 | ZRELADDR := $(zreladdr-y) |
| 26 | PARAMS_PHYS := $(params_phys-y) |
| 27 | INITRD_PHYS := $(initrd_phys-y) |
| 28 | |
| 29 | export ZRELADDR INITRD_PHYS PARAMS_PHYS |
| 30 | |
| 31 | targets := Image zImage xipImage bootpImage uImage |
| 32 | |
| 33 | DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES)) |
| 34 | ifneq ($(DTB_NAMES),) |
| 35 | DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES)) |
| 36 | else |
| 37 | DTB_LIST := $(dtb-y) |
| 38 | endif |
| 39 | DTB_OBJS := $(addprefix $(obj)/dts/,$(DTB_LIST)) |
| 40 | |
| 41 | ifeq ($(CONFIG_XIP_KERNEL),y) |
| 42 | |
| 43 | $(obj)/xipImage: vmlinux FORCE |
| 44 | $(call if_changed,objcopy) |
| 45 | @$(kecho) ' Physical Address of xipImage: $(CONFIG_XIP_PHYS_ADDR)' |
| 46 | |
| 47 | $(obj)/Image $(obj)/zImage: FORCE |
| 48 | @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)' |
| 49 | @echo 'Only the xipImage target is available in this case' |
| 50 | @false |
| 51 | |
| 52 | else |
| 53 | |
| 54 | $(obj)/xipImage: FORCE |
| 55 | @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)' |
| 56 | @false |
| 57 | |
| 58 | $(obj)/Image: vmlinux FORCE |
| 59 | $(call if_changed,objcopy) |
| 60 | |
| 61 | $(obj)/compressed/vmlinux: $(obj)/Image FORCE |
| 62 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
| 63 | |
| 64 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE |
| 65 | $(call if_changed,objcopy) |
| 66 | |
| 67 | $(obj)/zImage-dtb: $(obj)/zImage $(DTB_OBJS) FORCE |
| 68 | $(call if_changed,cat) |
| 69 | @echo ' Kernel: $@ is ready' |
| 70 | |
| 71 | endif |
| 72 | |
| 73 | ifneq ($(LOADADDR),) |
| 74 | UIMAGE_LOADADDR=$(LOADADDR) |
| 75 | else |
| 76 | ifeq ($(CONFIG_ZBOOT_ROM),y) |
| 77 | UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT) |
| 78 | else |
| 79 | UIMAGE_LOADADDR=$(ZRELADDR) |
| 80 | endif |
| 81 | endif |
| 82 | |
| 83 | check_for_multiple_loadaddr = \ |
| 84 | if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \ |
| 85 | echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \ |
| 86 | echo 'This is incompatible with uImages'; \ |
| 87 | echo 'Specify LOADADDR on the commandline to build an uImage'; \ |
| 88 | false; \ |
| 89 | fi |
| 90 | |
| 91 | $(obj)/uImage: $(obj)/zImage FORCE |
| 92 | @$(check_for_multiple_loadaddr) |
| 93 | $(call if_changed,uimage) |
| 94 | |
| 95 | $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE |
| 96 | $(Q)$(MAKE) $(build)=$(obj)/bootp $@ |
| 97 | |
| 98 | $(obj)/bootpImage: $(obj)/bootp/bootp FORCE |
| 99 | $(call if_changed,objcopy) |
| 100 | |
| 101 | PHONY += initrd install zinstall uinstall |
| 102 | initrd: |
| 103 | @test "$(INITRD_PHYS)" != "" || \ |
| 104 | (echo This machine does not support INITRD; exit -1) |
| 105 | @test "$(INITRD)" != "" || \ |
| 106 | (echo You must specify INITRD; exit -1) |
| 107 | |
| 108 | install: |
| 109 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
| 110 | $(obj)/Image System.map "$(INSTALL_PATH)" |
| 111 | |
| 112 | zinstall: |
| 113 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
| 114 | $(obj)/zImage System.map "$(INSTALL_PATH)" |
| 115 | |
| 116 | uinstall: |
| 117 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
| 118 | $(obj)/uImage System.map "$(INSTALL_PATH)" |
| 119 | |
| 120 | subdir- := bootp compressed dts |