summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-01-31 02:32:29 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-01-31 02:32:29 +0000
commitce814c1c05dae77e9a265509ae0671ef145a9b38 (patch)
tree4c63bd906914018625f509e83f4cbf425ad68165 /target
parent269bbc843f5f5a013fd8c8650733ad232839bd06 (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/openwrt@3076 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/image/aruba/Makefile16
-rw-r--r--target/linux/image/generic/lzma-loader/Makefile (renamed from target/linux/image/aruba/lzma-loader/Makefile)8
-rw-r--r--target/linux/image/generic/lzma-loader/src/LzmaDecode.c (renamed from target/linux/image/aruba/lzma-loader/src/LzmaDecode.c)0
-rw-r--r--target/linux/image/generic/lzma-loader/src/LzmaDecode.h (renamed from target/linux/image/aruba/lzma-loader/src/LzmaDecode.h)0
-rw-r--r--target/linux/image/generic/lzma-loader/src/Makefile (renamed from target/linux/image/aruba/lzma-loader/src/Makefile)10
-rw-r--r--target/linux/image/generic/lzma-loader/src/decompress.c (renamed from target/linux/image/aruba/lzma-loader/src/decompress.c)5
-rw-r--r--target/linux/image/generic/lzma-loader/src/lzma.lds.in (renamed from target/linux/image/aruba/lzma-loader/src/lzma.lds)2
-rw-r--r--target/linux/image/generic/lzma-loader/src/print.c (renamed from target/linux/image/aruba/lzma-loader/src/print.c)0
-rw-r--r--target/linux/image/generic/lzma-loader/src/print.h (renamed from target/linux/image/aruba/lzma-loader/src/print.h)0
-rw-r--r--target/linux/image/generic/lzma-loader/src/printf.c (renamed from target/linux/image/aruba/lzma-loader/src/printf.c)0
-rw-r--r--target/linux/image/generic/lzma-loader/src/printf.h (renamed from target/linux/image/aruba/lzma-loader/src/printf.h)0
-rw-r--r--target/linux/image/generic/lzma-loader/src/start.S (renamed from target/linux/image/aruba/lzma-loader/src/start.S)0
-rw-r--r--target/linux/image/generic/lzma-loader/src/uart16550.c (renamed from target/linux/image/aruba/lzma-loader/src/uart16550.c)0
-rw-r--r--target/linux/image/generic/lzma-loader/src/uart16550.h (renamed from target/linux/image/aruba/lzma-loader/src/uart16550.h)0
14 files changed, 29 insertions, 12 deletions
diff --git a/target/linux/image/aruba/Makefile b/target/linux/image/aruba/Makefile
index 432a85d59..2a7f2e468 100644
--- a/target/linux/image/aruba/Makefile
+++ b/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/target/linux/image/aruba/lzma-loader/Makefile b/target/linux/image/generic/lzma-loader/Makefile
index 9d65a3c5d..daa83535e 100644
--- a/target/linux/image/aruba/lzma-loader/Makefile
+++ b/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/target/linux/image/aruba/lzma-loader/src/LzmaDecode.c b/target/linux/image/generic/lzma-loader/src/LzmaDecode.c
index aac5f60c0..aac5f60c0 100644
--- a/target/linux/image/aruba/lzma-loader/src/LzmaDecode.c
+++ b/target/linux/image/generic/lzma-loader/src/LzmaDecode.c
diff --git a/target/linux/image/aruba/lzma-loader/src/LzmaDecode.h b/target/linux/image/generic/lzma-loader/src/LzmaDecode.h
index 35e37ed0d..35e37ed0d 100644
--- a/target/linux/image/aruba/lzma-loader/src/LzmaDecode.h
+++ b/target/linux/image/generic/lzma-loader/src/LzmaDecode.h
diff --git a/target/linux/image/aruba/lzma-loader/src/Makefile b/target/linux/image/generic/lzma-loader/src/Makefile
index 3d0a58586..8dfd76a6a 100644
--- a/target/linux/image/aruba/lzma-loader/src/Makefile
+++ b/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/target/linux/image/aruba/lzma-loader/src/decompress.c b/target/linux/image/generic/lzma-loader/src/decompress.c
index e921863f1..f602276dd 100644
--- a/target/linux/image/aruba/lzma-loader/src/decompress.c
+++ b/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/target/linux/image/aruba/lzma-loader/src/lzma.lds b/target/linux/image/generic/lzma-loader/src/lzma.lds.in
index faf9bd229..5ac555bf7 100644
--- a/target/linux/image/aruba/lzma-loader/src/lzma.lds
+++ b/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/target/linux/image/aruba/lzma-loader/src/print.c b/target/linux/image/generic/lzma-loader/src/print.c
index 950687bef..950687bef 100644
--- a/target/linux/image/aruba/lzma-loader/src/print.c
+++ b/target/linux/image/generic/lzma-loader/src/print.c
diff --git a/target/linux/image/aruba/lzma-loader/src/print.h b/target/linux/image/generic/lzma-loader/src/print.h
index b05146390..b05146390 100644
--- a/target/linux/image/aruba/lzma-loader/src/print.h
+++ b/target/linux/image/generic/lzma-loader/src/print.h
diff --git a/target/linux/image/aruba/lzma-loader/src/printf.c b/target/linux/image/generic/lzma-loader/src/printf.c
index 49bd50d7c..49bd50d7c 100644
--- a/target/linux/image/aruba/lzma-loader/src/printf.c
+++ b/target/linux/image/generic/lzma-loader/src/printf.c
diff --git a/target/linux/image/aruba/lzma-loader/src/printf.h b/target/linux/image/generic/lzma-loader/src/printf.h
index 9b1c1df23..9b1c1df23 100644
--- a/target/linux/image/aruba/lzma-loader/src/printf.h
+++ b/target/linux/image/generic/lzma-loader/src/printf.h
diff --git a/target/linux/image/aruba/lzma-loader/src/start.S b/target/linux/image/generic/lzma-loader/src/start.S
index 37c7ca36d..37c7ca36d 100644
--- a/target/linux/image/aruba/lzma-loader/src/start.S
+++ b/target/linux/image/generic/lzma-loader/src/start.S
diff --git a/target/linux/image/aruba/lzma-loader/src/uart16550.c b/target/linux/image/generic/lzma-loader/src/uart16550.c
index 7df572760..7df572760 100644
--- a/target/linux/image/aruba/lzma-loader/src/uart16550.c
+++ b/target/linux/image/generic/lzma-loader/src/uart16550.c
diff --git a/target/linux/image/aruba/lzma-loader/src/uart16550.h b/target/linux/image/generic/lzma-loader/src/uart16550.h
index b3fd6fdd7..b3fd6fdd7 100644
--- a/target/linux/image/aruba/lzma-loader/src/uart16550.h
+++ b/target/linux/image/generic/lzma-loader/src/uart16550.h