diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2006-01-31 02:32:29 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2006-01-31 02:32:29 +0000 |
commit | 855954db088603d72b701ecc564c83ba7beacde9 (patch) | |
tree | b0b13cf7c838e92bc04bdba11082bd0fc7df5fbc /openwrt/target | |
parent | b74cd7490e2370ad7369bcb166c876788fcc33e1 (diff) |
make aruba lzma loader more generic and move it to target/linux/image/generic/lzma-loader
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@3076 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'openwrt/target')
-rw-r--r-- | openwrt/target/linux/image/aruba/Makefile | 16 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/Makefile (renamed from openwrt/target/linux/image/aruba/lzma-loader/Makefile) | 8 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/src/LzmaDecode.c (renamed from openwrt/target/linux/image/aruba/lzma-loader/src/LzmaDecode.c) | 0 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/src/LzmaDecode.h (renamed from openwrt/target/linux/image/aruba/lzma-loader/src/LzmaDecode.h) | 0 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/src/Makefile (renamed from openwrt/target/linux/image/aruba/lzma-loader/src/Makefile) | 10 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/src/decompress.c (renamed from openwrt/target/linux/image/aruba/lzma-loader/src/decompress.c) | 5 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/src/lzma.lds.in (renamed from openwrt/target/linux/image/aruba/lzma-loader/src/lzma.lds) | 2 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/src/print.c (renamed from openwrt/target/linux/image/aruba/lzma-loader/src/print.c) | 0 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/src/print.h (renamed from openwrt/target/linux/image/aruba/lzma-loader/src/print.h) | 0 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/src/printf.c (renamed from openwrt/target/linux/image/aruba/lzma-loader/src/printf.c) | 0 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/src/printf.h (renamed from openwrt/target/linux/image/aruba/lzma-loader/src/printf.h) | 0 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/src/start.S (renamed from openwrt/target/linux/image/aruba/lzma-loader/src/start.S) | 0 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/src/uart16550.c (renamed from openwrt/target/linux/image/aruba/lzma-loader/src/uart16550.c) | 0 | ||||
-rw-r--r-- | openwrt/target/linux/image/generic/lzma-loader/src/uart16550.h (renamed from openwrt/target/linux/image/aruba/lzma-loader/src/uart16550.h) | 0 |
14 files changed, 29 insertions, 12 deletions
diff --git a/openwrt/target/linux/image/aruba/Makefile b/openwrt/target/linux/image/aruba/Makefile index 432a85d59e..2a7f2e4682 100644 --- a/openwrt/target/linux/image/aruba/Makefile +++ b/openwrt/target/linux/image/aruba/Makefile @@ -1,15 +1,25 @@ include $(TOPDIR)/rules.mk +LOADADDR = 0x81000000 # RAM start + 16M +KERNEL_ENTRY = 0x80100000 +RAMSIZE = 0x00100000 # 1MB + +LOADER_MAKEOPTS= \ + KDIR=$(KDIR) \ + LOADADDR=$(LOADADDR) \ + KERNEL_ENTRY=$(KERNEL_ENTRY) \ + RAMSIZE=$(RAMSIZE) + KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD) lzma-loader-clean: - $(MAKE) -C lzma-loader clean + $(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) clean lzma-loader-prepare: - $(MAKE) -C lzma-loader prepare + $(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) prepare lzma-loader-compile: $(KDIR)/vmlinux.lzma lzma-loader-prepare - $(MAKE) -C lzma-loader compile KDIR=$(KDIR) + $(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) compile ifeq ($(IB),) $(KDIR)/vmlinux.lzma: $(KDIR)/vmlinux diff --git a/openwrt/target/linux/image/aruba/lzma-loader/Makefile b/openwrt/target/linux/image/generic/lzma-loader/Makefile index 9d65a3c5d4..daa83535e9 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/Makefile +++ b/openwrt/target/linux/image/generic/lzma-loader/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME := loader PKG_VERSION := 0.05 -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_DIR := $(KDIR)/$(PKG_NAME)-$(PKG_VERSION) $(PKG_BUILD_DIR)/.prepared: mkdir $(PKG_BUILD_DIR) @@ -14,7 +14,11 @@ $(PKG_BUILD_DIR)/.prepared: $(PKG_BUILD_DIR)/lzma.elf: $(PKG_BUILD_DIR)/.prepared $(PKG_BUILD_DIR)/vmlinux.lzma $(MAKE) -C $(PKG_BUILD_DIR) CC=$(TARGET_CC) \ - LD=$(TARGET_CROSS)ld CROSS_COMPILE=$(TARGET_CROSS) + LD=$(TARGET_CROSS)ld CROSS_COMPILE=$(TARGET_CROSS) \ + RAMSIZE=$(RAMSIZE) \ + LOADADDR=$(LOADADDR) \ + KERNEL_ENTRY=$(KERNEL_ENTRY) + $(PKG_BUILD_DIR)/vmlinux.lzma: $(KDIR)/vmlinux.lzma cp $< $@ diff --git a/openwrt/target/linux/image/aruba/lzma-loader/src/LzmaDecode.c b/openwrt/target/linux/image/generic/lzma-loader/src/LzmaDecode.c index aac5f60c09..aac5f60c09 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/src/LzmaDecode.c +++ b/openwrt/target/linux/image/generic/lzma-loader/src/LzmaDecode.c diff --git a/openwrt/target/linux/image/aruba/lzma-loader/src/LzmaDecode.h b/openwrt/target/linux/image/generic/lzma-loader/src/LzmaDecode.h index 35e37ed0df..35e37ed0df 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/src/LzmaDecode.h +++ b/openwrt/target/linux/image/generic/lzma-loader/src/LzmaDecode.h diff --git a/openwrt/target/linux/image/aruba/lzma-loader/src/Makefile b/openwrt/target/linux/image/generic/lzma-loader/src/Makefile index 3d0a58586d..8dfd76a6a2 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/src/Makefile +++ b/openwrt/target/linux/image/generic/lzma-loader/src/Makefile @@ -1,4 +1,5 @@ -LOADADDR = 0x81000000 +LOADADDR = 0x80400000 # RAM start + 4M +KERNEL_ENTRY = 0x80001000 RAMSIZE = 0x00100000 # 1MB CROSS_COMPILE = mips-linux- @@ -15,7 +16,7 @@ LD = $(CROSS_COMPILE)ld OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump -CFLAGS = -fno-builtin -Os -G 0 -mno-abicalls -fno-pic -Wall -DRAMSIZE=${RAMSIZE} -D_LZMA_IN_CB +CFLAGS = -fno-builtin -Os -G 0 -mno-abicalls -fno-pic -Wall -DRAMSIZE=${RAMSIZE} -DKERNEL_ENTRY=${KERNEL_ENTRY} -D_LZMA_IN_CB # CFLAGS = -fno-builtin -Os -G 0 -mno-abicalls -fno-pic -Wall -DRAMSIZE=${RAMSIZE} O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32) @@ -28,7 +29,10 @@ strip-flags = $(addprefix --remove-section=,$(drop-sections)) all : lzma.elf -kernel.o: vmlinux.lzma +lzma.lds: lzma.lds.in + sed -e 's,@LOADADDR@,$(LOADADDR),g' $< >$@ + +kernel.o: vmlinux.lzma lzma.lds $(LD) -r -b binary --oformat $(O_FORMAT) -o $@ $< lzma.elf: start.o decompress.o LzmaDecode.o kernel.o diff --git a/openwrt/target/linux/image/aruba/lzma-loader/src/decompress.c b/openwrt/target/linux/image/generic/lzma-loader/src/decompress.c index e921863f16..f602276ddc 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/src/decompress.c +++ b/openwrt/target/linux/image/generic/lzma-loader/src/decompress.c @@ -35,7 +35,6 @@ */ #include "LzmaDecode.h" -#define LOADADDR 0x80100000 #define KSEG0 0x80000000 #define KSEG1 0xa0000000 @@ -137,12 +136,12 @@ void entry(unsigned long icache_size, unsigned long icache_lsize, /* decompress kernel */ if ((i = LzmaDecode(&vs, &callback, - (unsigned char*)LOADADDR, osize, &osize)) == LZMA_RESULT_OK) + (unsigned char*)KERNEL_ENTRY, osize, &osize)) == LZMA_RESULT_OK) { blast_dcache(dcache_size, dcache_lsize); blast_icache(icache_size, icache_lsize); /* Jump to load address */ - ((void (*)(void)) LOADADDR)(); + ((void (*)(void)) KERNEL_ENTRY)(); } } diff --git a/openwrt/target/linux/image/aruba/lzma-loader/src/lzma.lds b/openwrt/target/linux/image/generic/lzma-loader/src/lzma.lds.in index faf9bd2295..5ac555bf7d 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/src/lzma.lds +++ b/openwrt/target/linux/image/generic/lzma-loader/src/lzma.lds.in @@ -3,7 +3,7 @@ ENTRY(_start) SECTIONS { /* Read-only sections, merged into text segment: */ - . = 0x81000000; + . = @LOADADDR@; .text : { _ftext = . ; diff --git a/openwrt/target/linux/image/aruba/lzma-loader/src/print.c b/openwrt/target/linux/image/generic/lzma-loader/src/print.c index 950687beff..950687beff 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/src/print.c +++ b/openwrt/target/linux/image/generic/lzma-loader/src/print.c diff --git a/openwrt/target/linux/image/aruba/lzma-loader/src/print.h b/openwrt/target/linux/image/generic/lzma-loader/src/print.h index b051463909..b051463909 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/src/print.h +++ b/openwrt/target/linux/image/generic/lzma-loader/src/print.h diff --git a/openwrt/target/linux/image/aruba/lzma-loader/src/printf.c b/openwrt/target/linux/image/generic/lzma-loader/src/printf.c index 49bd50d7c7..49bd50d7c7 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/src/printf.c +++ b/openwrt/target/linux/image/generic/lzma-loader/src/printf.c diff --git a/openwrt/target/linux/image/aruba/lzma-loader/src/printf.h b/openwrt/target/linux/image/generic/lzma-loader/src/printf.h index 9b1c1df232..9b1c1df232 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/src/printf.h +++ b/openwrt/target/linux/image/generic/lzma-loader/src/printf.h diff --git a/openwrt/target/linux/image/aruba/lzma-loader/src/start.S b/openwrt/target/linux/image/generic/lzma-loader/src/start.S index 37c7ca36d3..37c7ca36d3 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/src/start.S +++ b/openwrt/target/linux/image/generic/lzma-loader/src/start.S diff --git a/openwrt/target/linux/image/aruba/lzma-loader/src/uart16550.c b/openwrt/target/linux/image/generic/lzma-loader/src/uart16550.c index 7df5727600..7df5727600 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/src/uart16550.c +++ b/openwrt/target/linux/image/generic/lzma-loader/src/uart16550.c diff --git a/openwrt/target/linux/image/aruba/lzma-loader/src/uart16550.h b/openwrt/target/linux/image/generic/lzma-loader/src/uart16550.h index b3fd6fdd75..b3fd6fdd75 100644 --- a/openwrt/target/linux/image/aruba/lzma-loader/src/uart16550.h +++ b/openwrt/target/linux/image/generic/lzma-loader/src/uart16550.h |