From fe6f178a3bb514e5698c2c97d1e1d861d0012f51 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Thu, 26 May 2016 10:47:07 -0700 Subject: [PATCH] nios2: generate kernel image in Intel HEX format Altera tools for creating .pof files for flashing onto their FPGAs require UFM data to be in this special format. Extend the current 'all' and 'zephyr' targets to additionally create this .hex file using objcopy, with the same exclusions as the existing rule for .bin files. Change-Id: I75293fba47536545359f817a1f2c1ae905b9d25c Signed-off-by: Andrew Boie --- arch/nios2/Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/nios2/Makefile b/arch/nios2/Makefile index 84464461a96..ae551c4e137 100644 --- a/arch/nios2/Makefile +++ b/arch/nios2/Makefile @@ -29,3 +29,17 @@ soc-aflags ?= $(soc-cflags) KBUILD_CFLAGS += $(soc-cflags) KBUILD_CXXFLAGS += $(soc-cxxflags) KBUILD_AFLAGS += $(soc-aflags) + +KERNEL_HEX_NAME = $(KERNEL_NAME).hex + +quiet_cmd_gen_hex = HEX $@ + cmd_gen_hex = \ +( \ + $(OBJCOPY) -S -O ihex -R .note -R .comment -R COMMON -R .eh_frame $< $@; \ +) + +$(KERNEL_HEX_NAME): $(KERNEL_ELF_NAME) + $(call cmd,gen_hex) + +zephyr: $(KERNEL_HEX_NAME) +all: $(KERNEL_HEX_NAME)