diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-01-17 21:19:38 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-01-17 21:19:38 +0000 |
commit | 506958b6f34cefa863ee3cee3656ef6cadbd6eb8 (patch) | |
tree | 9d0ed8708e6a7f2c388d06b4825bd05e1896558f /target/linux/ramips/image/relocate/Makefile | |
parent | 3ef1fdbe0562d78a30ad27c33190fb4766d52b41 (diff) | |
download | master-187ad058-506958b6f34cefa863ee3cee3656ef6cadbd6eb8.tar.gz master-187ad058-506958b6f34cefa863ee3cee3656ef6cadbd6eb8.tar.bz2 master-187ad058-506958b6f34cefa863ee3cee3656ef6cadbd6eb8.zip |
ramips: add code for relocating a kernel to the right place
(used if the boot loader wants a different loadaddr/entry)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44014 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/image/relocate/Makefile')
-rw-r--r-- | target/linux/ramips/image/relocate/Makefile | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/target/linux/ramips/image/relocate/Makefile b/target/linux/ramips/image/relocate/Makefile new file mode 100644 index 0000000000..a71bb00802 --- /dev/null +++ b/target/linux/ramips/image/relocate/Makefile @@ -0,0 +1,72 @@ +# +# Makefile for the LZMA compressed kernel loader for +# Atheros AR7XXX/AR9XXX based boards +# +# Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org> +# +# Some parts of this file was based on the OpenWrt specific lzma-loader +# for the BCM47xx and ADM5120 based boards: +# Copyright (C) 2004 Manuel Novoa III (mjn3@codepoet.org) +# Copyright (C) 2005 Mineharu Takahara <mtakahar@yahoo.com> +# Copyright (C) 2005 by Oleg I. Vdovikin <oleg@cs.msu.su> +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# + +LOADADDR := +LZMA_TEXT_START := 0x81000000 +LOADER_DATA := +BOARD := +FLASH_OFFS := +FLASH_MAX := +PLATFORM := + +CC := $(CROSS_COMPILE)gcc +LD := $(CROSS_COMPILE)ld +OBJCOPY := $(CROSS_COMPILE)objcopy +OBJDUMP := $(CROSS_COMPILE)objdump + +BIN_FLAGS := -O binary -R .reginfo -R .note -R .comment -R .mdebug -S + +CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \ + -fno-strict-aliasing -fno-common -fomit-frame-pointer -G 0 \ + -mno-abicalls -fno-pic -ffunction-sections -pipe -mlong-calls \ + -fno-common -ffreestanding -fhonour-copts \ + -mabi=32 -march=mips32r2 \ + -Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap \ + -DCONFIG_CACHELINE_SIZE=32 -DKERNEL_ADDR=$(KERNEL_ADDR) + +ASFLAGS = $(CFLAGS) -D__ASSEMBLY__ + +LDFLAGS = -static --gc-sections -no-warn-mismatch +LDFLAGS += -e startup -T loader.lds -Ttext $(LZMA_TEXT_START) + +O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32) + +OBJECTS := head.o + +all: head.o loader.bin + +# Don't build dependencies, this may die if $(CC) isn't gcc +dep: + +install: + +%.o : %.c + $(CC) $(CFLAGS) -c -o $@ $< + +%.o : %.S + $(CC) $(ASFLAGS) -c -o $@ $< + +loader: $(OBJECTS) + $(LD) $(LDFLAGS) -o $@ $(OBJECTS) + +loader.bin: loader + $(OBJCOPY) $(BIN_FLAGS) $< $@ + +mrproper: clean + +clean: + rm -f loader *.elf *.bin *.o |