Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | # |
| 2 | # arch/arm/boot/Makefile |
| 3 | # |
Paul Smith | 4f19336 | 2006-03-05 17:14:10 -0500 | [diff] [blame] | 4 | # This file is included by the global makefile so that you can add your own |
| 5 | # architecture-specific flags and dependencies. |
| 6 | # |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
Mark Rutland | 3cb5958 | 2016-07-19 11:23:37 +0100 | [diff] [blame] | 14 | OBJCOPYFLAGS :=-O binary -R .comment -S |
| 15 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | ifneq ($(MACHINE),) |
Masahiro Yamada | 7aacad5 | 2015-03-27 20:43:35 +0900 | [diff] [blame] | 17 | include $(MACHINE)/Makefile.boot |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | endif |
| 19 | |
| 20 | # Note: the following conditions must always be true: |
Russell King | 9e84ed6 | 2010-09-09 22:39:41 +0100 | [diff] [blame] | 21 | # ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | # PARAMS_PHYS must be within 4MB of ZRELADDR |
| 23 | # INITRD_PHYS must be in RAM |
Russell King | 9e84ed6 | 2010-09-09 22:39:41 +0100 | [diff] [blame] | 24 | ZRELADDR := $(zreladdr-y) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | PARAMS_PHYS := $(params_phys-y) |
| 26 | INITRD_PHYS := $(initrd_phys-y) |
| 27 | |
Russell King | 9e84ed6 | 2010-09-09 22:39:41 +0100 | [diff] [blame] | 28 | export ZRELADDR INITRD_PHYS PARAMS_PHYS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | |
| 30 | targets := Image zImage xipImage bootpImage uImage |
| 31 | |
| 32 | ifeq ($(CONFIG_XIP_KERNEL),y) |
| 33 | |
Nicolas Pitre | ca8b5d9 | 2017-08-25 00:54:18 -0400 | [diff] [blame] | 34 | cmd_deflate_xip_data = $(CONFIG_SHELL) -c \ |
| 35 | '$(srctree)/$(src)/deflate_xip_data.sh $< $@ || { rm -f $@; false; }' |
| 36 | |
| 37 | ifeq ($(CONFIG_XIP_DEFLATED_DATA),y) |
| 38 | quiet_cmd_mkxip = XIPZ $@ |
| 39 | cmd_mkxip = $(cmd_objcopy) && $(cmd_deflate_xip_data) |
| 40 | else |
| 41 | quiet_cmd_mkxip = $(quiet_cmd_objcopy) |
| 42 | cmd_mkxip = $(cmd_objcopy) |
| 43 | endif |
| 44 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | $(obj)/xipImage: vmlinux FORCE |
Nicolas Pitre | ca8b5d9 | 2017-08-25 00:54:18 -0400 | [diff] [blame] | 46 | $(call if_changed,mkxip) |
Masahiro Yamada | c6bbfbb7 | 2016-05-30 03:01:23 +0100 | [diff] [blame] | 47 | @$(kecho) ' Physical Address of xipImage: $(CONFIG_XIP_PHYS_ADDR)' |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | |
| 49 | $(obj)/Image $(obj)/zImage: FORCE |
| 50 | @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)' |
| 51 | @echo 'Only the xipImage target is available in this case' |
| 52 | @false |
| 53 | |
| 54 | else |
| 55 | |
| 56 | $(obj)/xipImage: FORCE |
| 57 | @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)' |
| 58 | @false |
| 59 | |
| 60 | $(obj)/Image: vmlinux FORCE |
| 61 | $(call if_changed,objcopy) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | |
| 63 | $(obj)/compressed/vmlinux: $(obj)/Image FORCE |
| 64 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
| 65 | |
| 66 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE |
| 67 | $(call if_changed,objcopy) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | |
| 69 | endif |
| 70 | |
Stephen Warren | e339364 | 2012-03-16 15:03:55 -0600 | [diff] [blame] | 71 | ifneq ($(LOADADDR),) |
| 72 | UIMAGE_LOADADDR=$(LOADADDR) |
Uwe Kleine-König | 0f98014 | 2008-03-06 16:22:33 +0100 | [diff] [blame] | 73 | else |
Stephen Warren | e339364 | 2012-03-16 15:03:55 -0600 | [diff] [blame] | 74 | ifeq ($(CONFIG_ZBOOT_ROM),y) |
| 75 | UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT) |
| 76 | else |
| 77 | UIMAGE_LOADADDR=$(ZRELADDR) |
| 78 | endif |
Uwe Kleine-König | 0f98014 | 2008-03-06 16:22:33 +0100 | [diff] [blame] | 79 | endif |
| 80 | |
Sascha Hauer | cd227fb | 2011-08-17 14:23:46 +0100 | [diff] [blame] | 81 | check_for_multiple_loadaddr = \ |
Olof Johansson | 938f94c | 2013-02-23 08:02:24 +0100 | [diff] [blame] | 82 | if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \ |
| 83 | echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \ |
Sascha Hauer | cd227fb | 2011-08-17 14:23:46 +0100 | [diff] [blame] | 84 | echo 'This is incompatible with uImages'; \ |
| 85 | echo 'Specify LOADADDR on the commandline to build an uImage'; \ |
| 86 | false; \ |
| 87 | fi |
| 88 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | $(obj)/uImage: $(obj)/zImage FORCE |
Sascha Hauer | cd227fb | 2011-08-17 14:23:46 +0100 | [diff] [blame] | 90 | @$(check_for_multiple_loadaddr) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | $(call if_changed,uimage) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | |
| 93 | $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE |
| 94 | $(Q)$(MAKE) $(build)=$(obj)/bootp $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | |
| 96 | $(obj)/bootpImage: $(obj)/bootp/bootp FORCE |
| 97 | $(call if_changed,objcopy) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | |
Masahiro Yamada | bc5ce15 | 2016-04-05 03:08:26 +0100 | [diff] [blame] | 99 | PHONY += initrd install zinstall uinstall |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | initrd: |
| 101 | @test "$(INITRD_PHYS)" != "" || \ |
| 102 | (echo This machine does not support INITRD; exit -1) |
| 103 | @test "$(INITRD)" != "" || \ |
| 104 | (echo You must specify INITRD; exit -1) |
| 105 | |
Robert Richter | 19514fc | 2013-07-17 18:05:06 +0200 | [diff] [blame] | 106 | install: |
| 107 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | $(obj)/Image System.map "$(INSTALL_PATH)" |
| 109 | |
Robert Richter | 19514fc | 2013-07-17 18:05:06 +0200 | [diff] [blame] | 110 | zinstall: |
| 111 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | $(obj)/zImage System.map "$(INSTALL_PATH)" |
| 113 | |
Robert Richter | 19514fc | 2013-07-17 18:05:06 +0200 | [diff] [blame] | 114 | uinstall: |
| 115 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
Russell King | a65d292 | 2011-01-08 16:18:51 +0000 | [diff] [blame] | 116 | $(obj)/uImage System.map "$(INSTALL_PATH)" |
| 117 | |
Nishanth Menon | 9e25fe6 | 2013-01-22 15:27:29 -0600 | [diff] [blame] | 118 | subdir- := bootp compressed dts |