Catalin Marinas | 8c2c3df | 2012-04-20 14:45:54 +0100 | [diff] [blame] | 1 | # |
| 2 | # arch/arm64/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) 2012, ARM Ltd. |
| 12 | # Author: Will Deacon <will.deacon@arm.com> |
| 13 | # |
| 14 | # Based on the ia64 boot/Makefile. |
| 15 | # |
| 16 | |
Alex Ray | 911da23 | 2014-03-17 13:44:01 -0700 | [diff] [blame] | 17 | include $(srctree)/arch/arm64/boot/dts/Makefile |
| 18 | |
Mark Rutland | f8fa70f | 2016-07-12 16:28:01 +0100 | [diff] [blame] | 19 | OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S |
| 20 | |
Catalin Marinas | 8c2c3df | 2012-04-20 14:45:54 +0100 | [diff] [blame] | 21 | targets := Image Image.gz |
| 22 | |
Alex Ray | e2d9f0a | 2014-03-17 13:44:01 -0700 | [diff] [blame] | 23 | DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE_NAMES)) |
| 24 | ifneq ($(DTB_NAMES),) |
| 25 | DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES)) |
Alex Ray | e2d9f0a | 2014-03-17 13:44:01 -0700 | [diff] [blame] | 26 | DTB_OBJS := $(addprefix $(obj)/dts/,$(DTB_LIST)) |
Channagoud Kadabi | 154584f | 2016-09-20 12:28:21 -0700 | [diff] [blame] | 27 | else |
| 28 | DTB_OBJS := $(shell find $(obj)/dts/ -name \*.dtb) |
| 29 | endif |
Alex Ray | e2d9f0a | 2014-03-17 13:44:01 -0700 | [diff] [blame] | 30 | |
Arun Menon | 12e1b34 | 2017-07-27 10:41:57 -0700 | [diff] [blame] | 31 | # Add RTIC DTB to the DTB list if RTIC MPGen is enabled |
| 32 | ifdef RTIC_MPGEN |
| 33 | DTB_OBJS += rtic_mp.dtb |
| 34 | endif |
| 35 | |
| 36 | rtic_mp.dtb: vmlinux FORCE |
| 37 | $(RTIC_MPGEN) --objcopy="${OBJCOPY}" --objdump="${OBJDUMP}" \ |
| 38 | --binpath="" --vmlinux="vmlinux" --config=${KCONFIG_CONFIG} \ |
| 39 | --cc="${CC}" --dts=rtic_mp.dts && \ |
| 40 | $(DTC) -O dtb -o rtic_mp.dtb -b 0 $(DTC_FLAGS) rtic_mp.dts |
| 41 | |
Catalin Marinas | 8c2c3df | 2012-04-20 14:45:54 +0100 | [diff] [blame] | 42 | $(obj)/Image: vmlinux FORCE |
| 43 | $(call if_changed,objcopy) |
| 44 | |
Olof Johansson | 0723c05 | 2015-07-16 21:26:16 +0100 | [diff] [blame] | 45 | $(obj)/Image.bz2: $(obj)/Image FORCE |
| 46 | $(call if_changed,bzip2) |
| 47 | |
Atanas Filipov | f1d581c | 2018-04-16 16:14:22 +0530 | [diff] [blame^] | 48 | $(obj)/Image-dtb-hdr: $(obj)/Image FORCE |
| 49 | echo -n 'UNCOMPRESSED_IMG' > $@ && \ |
| 50 | $(call size_append, $(filter-out FORCE,$^)) >> $@ |
| 51 | |
| 52 | $(obj)/Image-dtb: $(obj)/Image-dtb-hdr $(obj)/Image $(DTB_OBJS) FORCE |
Haojian Zhuang | c0b4d2f | 2016-04-22 17:23:29 +0800 | [diff] [blame] | 53 | $(call if_changed,cat) |
| 54 | |
Catalin Marinas | 8c2c3df | 2012-04-20 14:45:54 +0100 | [diff] [blame] | 55 | $(obj)/Image.gz: $(obj)/Image FORCE |
| 56 | $(call if_changed,gzip) |
| 57 | |
Olof Johansson | 0723c05 | 2015-07-16 21:26:16 +0100 | [diff] [blame] | 58 | $(obj)/Image.lz4: $(obj)/Image FORCE |
| 59 | $(call if_changed,lz4) |
| 60 | |
| 61 | $(obj)/Image.lzma: $(obj)/Image FORCE |
| 62 | $(call if_changed,lzma) |
| 63 | |
| 64 | $(obj)/Image.lzo: $(obj)/Image FORCE |
| 65 | $(call if_changed,lzo) |
| 66 | |
Alex Ray | e2d9f0a | 2014-03-17 13:44:01 -0700 | [diff] [blame] | 67 | $(obj)/Image.gz-dtb: $(obj)/Image.gz $(DTB_OBJS) FORCE |
| 68 | $(call if_changed,cat) |
| 69 | |
Masahiro Yamada | 8684fa3 | 2016-02-19 15:05:50 +0900 | [diff] [blame] | 70 | install: |
Catalin Marinas | 8c2c3df | 2012-04-20 14:45:54 +0100 | [diff] [blame] | 71 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ |
| 72 | $(obj)/Image System.map "$(INSTALL_PATH)" |
| 73 | |
Masahiro Yamada | 8684fa3 | 2016-02-19 15:05:50 +0900 | [diff] [blame] | 74 | zinstall: |
Catalin Marinas | 8c2c3df | 2012-04-20 14:45:54 +0100 | [diff] [blame] | 75 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ |
| 76 | $(obj)/Image.gz System.map "$(INSTALL_PATH)" |