Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Thumb-2: Make the uImage entry an odd number

This allows U-Boot to branch to the kernel in Thumb-2 mode via
"mov pc, lr".

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

+8 -1
+8 -1
arch/arm/boot/Makefile
··· 61 61 62 62 quiet_cmd_uimage = UIMAGE $@ 63 63 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \ 64 - -C none -a $(LOADADDR) -e $(LOADADDR) \ 64 + -C none -a $(LOADADDR) -e $(STARTADDR) \ 65 65 -n 'Linux-$(KERNELRELEASE)' -d $< $@ 66 66 67 67 ifeq ($(CONFIG_ZBOOT_ROM),y) 68 68 $(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT) 69 69 else 70 70 $(obj)/uImage: LOADADDR=$(ZRELADDR) 71 + endif 72 + 73 + ifeq ($(CONFIG_THUMB2_KERNEL),y) 74 + # Set bit 0 to 1 so that "mov pc, rx" switches to Thumb-2 mode 75 + $(obj)/uImage: STARTADDR=$(shell echo $(LOADADDR) | sed -e "s/.$$/1/") 76 + else 77 + $(obj)/uImage: STARTADDR=$(LOADADDR) 71 78 endif 72 79 73 80 $(obj)/uImage: $(obj)/zImage FORCE