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 | |
| 34 | $(obj)/xipImage: vmlinux FORCE |
| 35 | $(call if_changed,objcopy) |
Masahiro Yamada | c6bbfbb7 | 2016-05-30 03:01:23 +0100 | [diff] [blame] | 36 | @$(kecho) ' Physical Address of xipImage: $(CONFIG_XIP_PHYS_ADDR)' |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
| 38 | $(obj)/Image $(obj)/zImage: FORCE |
| 39 | @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)' |
| 40 | @echo 'Only the xipImage target is available in this case' |
| 41 | @false |
| 42 | |
| 43 | else |
| 44 | |
| 45 | $(obj)/xipImage: FORCE |
| 46 | @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)' |
| 47 | @false |
| 48 | |
| 49 | $(obj)/Image: vmlinux FORCE |
| 50 | $(call if_changed,objcopy) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | |
| 52 | $(obj)/compressed/vmlinux: $(obj)/Image FORCE |
| 53 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
| 54 | |
| 55 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE |
| 56 | $(call if_changed,objcopy) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
| 58 | endif |
| 59 | |
Stephen Warren | e339364 | 2012-03-16 15:03:55 -0600 | [diff] [blame] | 60 | ifneq ($(LOADADDR),) |
| 61 | UIMAGE_LOADADDR=$(LOADADDR) |
Uwe Kleine-König | 0f98014 | 2008-03-06 16:22:33 +0100 | [diff] [blame] | 62 | else |
Stephen Warren | e339364 | 2012-03-16 15:03:55 -0600 | [diff] [blame] | 63 | ifeq ($(CONFIG_ZBOOT_ROM),y) |
| 64 | UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT) |
| 65 | else |
| 66 | UIMAGE_LOADADDR=$(ZRELADDR) |
| 67 | endif |
Uwe Kleine-König | 0f98014 | 2008-03-06 16:22:33 +0100 | [diff] [blame] | 68 | endif |
| 69 | |
Sascha Hauer | cd227fb | 2011-08-17 14:23:46 +0100 | [diff] [blame] | 70 | check_for_multiple_loadaddr = \ |
Olof Johansson | 938f94c | 2013-02-23 08:02:24 +0100 | [diff] [blame] | 71 | if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \ |
| 72 | echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \ |
Sascha Hauer | cd227fb | 2011-08-17 14:23:46 +0100 | [diff] [blame] | 73 | echo 'This is incompatible with uImages'; \ |
| 74 | echo 'Specify LOADADDR on the commandline to build an uImage'; \ |
| 75 | false; \ |
| 76 | fi |
| 77 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | $(obj)/uImage: $(obj)/zImage FORCE |
Sascha Hauer | cd227fb | 2011-08-17 14:23:46 +0100 | [diff] [blame] | 79 | @$(check_for_multiple_loadaddr) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | $(call if_changed,uimage) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | |
| 82 | $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE |
| 83 | $(Q)$(MAKE) $(build)=$(obj)/bootp $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | |
| 85 | $(obj)/bootpImage: $(obj)/bootp/bootp FORCE |
| 86 | $(call if_changed,objcopy) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | |
Masahiro Yamada | bc5ce15 | 2016-04-05 03:08:26 +0100 | [diff] [blame] | 88 | PHONY += initrd install zinstall uinstall |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | initrd: |
| 90 | @test "$(INITRD_PHYS)" != "" || \ |
| 91 | (echo This machine does not support INITRD; exit -1) |
| 92 | @test "$(INITRD)" != "" || \ |
| 93 | (echo You must specify INITRD; exit -1) |
| 94 | |
Robert Richter | 19514fc | 2013-07-17 18:05:06 +0200 | [diff] [blame] | 95 | install: |
| 96 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | $(obj)/Image System.map "$(INSTALL_PATH)" |
| 98 | |
Robert Richter | 19514fc | 2013-07-17 18:05:06 +0200 | [diff] [blame] | 99 | zinstall: |
| 100 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | $(obj)/zImage System.map "$(INSTALL_PATH)" |
| 102 | |
Robert Richter | 19514fc | 2013-07-17 18:05:06 +0200 | [diff] [blame] | 103 | uinstall: |
| 104 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
Russell King | a65d292 | 2011-01-08 16:18:51 +0000 | [diff] [blame] | 105 | $(obj)/uImage System.map "$(INSTALL_PATH)" |
| 106 | |
Nishanth Menon | 9e25fe6 | 2013-01-22 15:27:29 -0600 | [diff] [blame] | 107 | subdir- := bootp compressed dts |