All pastes #958551 Raw Edit

florian

public text v1 · immutable
#958551 ·published 2008-03-26 20:11 UTC
rendered paste body
Index: target/linux/generic-2.6/image/lzma-loader/src/decompress.c
===================================================================
--- target/linux/generic-2.6/image/lzma-loader/src/decompress.c (revision 10649)
+++ target/linux/generic-2.6/image/lzma-loader/src/decompress.c (working copy)
@@ -145,6 +145,7 @@
                get_byte();

        /* decompress kernel */
+       printf("Decompressing kernel\n");
        if ((i = LzmaDecode(&vs, &callback,
        (unsigned char*)KERNEL_ENTRY, osize, &osize)) == LZMA_RESULT_OK)
        {
@@ -152,6 +153,8 @@
                blast_icache(icache_size, icache_lsize);

                /* Jump to load address */
+               printf("Jumping !\n");
                ((void (*)(int a0, int a1, int a2, int a3)) KERNEL_ENTRY)(arg0, arg1, arg2, arg3);
        }
+       printf("Failed to decompress !\n");
 }
Index: target/linux/generic-2.6/image/lzma-loader/src/Makefile
===================================================================
--- target/linux/generic-2.6/image/lzma-loader/src/Makefile     (revision 10661)
+++ target/linux/generic-2.6/image/lzma-loader/src/Makefile     (working copy)
@@ -49,7 +49,7 @@

 ifeq ($(IMAGE_COPY),1)
 LOADER_ENTRY ?= $(KERNEL_ENTRY)
-lzma.o: decompress.o LzmaDecode.o kernel.o
+lzma.o: decompress.o LzmaDecode.o kernel.o print.o printf.o uart16550.o
        sed -e 's,@LOADADDR@,$(LOADADDR),g' -e 's,@ENTRY@,entry,g' lzma.lds.in >lzma-stage2.lds
        $(LD) -static --no-warn-mismatch -e entry -Tlzma-stage2.lds -o temp-$@ $^
        $(OBJCOPY) temp-$@ lzma.tmp
@@ -60,7 +60,7 @@
        sed -e 's,@LOADADDR@,$(LOADER_ENTRY),g' lzma-copy.lds.in >lzma-copy.lds
        $(LD) -s -Tlzma-copy.lds -o $@ $^
 else
-lzma.elf: start.o decompress.o LzmaDecode.o kernel.o
+lzma.elf: start.o decompress.o LzmaDecode.o kernel.o print.o printf.o uart16550.o
        $(LD) -s -Tlzma.lds -o $@ $^
 endif

Index: target/linux/atheros/image/Makefile
===================================================================
--- target/linux/atheros/image/Makefile (revision 10649)
+++ target/linux/atheros/image/Makefile (working copy)
@@ -7,14 +7,36 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk

-define Image/BuildKernel
+LOADADDR = 0x81000000           # RAM start + 16M
+KERNEL_ENTRY = 0x80041000
+RAMSIZE = 0x00100000            # 1MB
+IMAGE_COPY = 1
+
+LOADER_MAKEOPTS= \
+               KDIR=$(KDIR) \
+               LOADADDR=$(LOADADDR) \
+               KERNEL_ENTRY=$(KERNEL_ENTRY) \
+               RAMSIZE=$(RAMSIZE) \
+               IMAGE_COPY=$(IMAGE_COPY)
+
+define Build/Clean
+       $(MAKE) -C $(GENERIC_PLATFORM_DIR)/image/lzma-loader $(LOADER_MAKEOPTS) clean
+endef
+
+define Image/Prepare
        cp $(KDIR)/vmlinux.elf $(BIN_DIR)/openwrt-$(BOARD)-vmlinux.elf
        gzip -9 -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
        $(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/vmlinux $(KDIR)/vmlinux.bin.l7
        dd if=$(KDIR)/vmlinux.bin.l7 of=$(BIN_DIR)/openwrt-$(BOARD)-vmlinux.lzma bs=65536 conv=sync
        dd if=$(KDIR)/vmlinux.bin.gz of=$(BIN_DIR)/openwrt-$(BOARD)-vmlinux.gz bs=65536 conv=sync
+       cat $(KDIR)/vmlinux | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
+       $(MAKE) -C $(GENERIC_PLATFORM_DIR)/image/lzma-loader $(LOADER_MAKEOPTS) clean compile
 endef

+define Image/BuildKernel
+       $(CP) $(KDIR)/loader.bin $(BIN_DIR)/openwrt-$(BOARD)-vmlinux
+endef
+
 define Image/Build/squashfs
     $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
 endef
@@ -24,5 +46,14 @@
        dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-root.$(1) bs=128k conv=sync
 endef

+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
+  define Image/Prepare
+       cat $(KDIR)/vmlinux | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
+       $(MAKE) -C $(GENERIC_PLATFORM_DIR)/image/lzma-loader $(LOADER_MAKEOPTS) clean compile
+  endef
+  define Image/BuildKernel
+       $(CP) $(KDIR)/loader.bin $(BIN_DIR)/openwrt-$(BOARD)-vmlinux
+  endef
+endif

 $(eval $(call BuildImage))
Index: tools/firmware-utils/src/mkzynfw.c
===================================================================
--- tools/firmware-utils/src/mkzynfw.c  (revision 10662)
+++ tools/firmware-utils/src/mkzynfw.c  (working copy)
@@ -119,7 +119,7 @@
 #define AR7_CODE_START         0x94008000

 #define ATHEROS_FLASH_BASE     0xBFC00000
-#define ATHEROS_CODE_START     0x80000800
+#define ATHEROS_CODE_START     0x80e00000

 #define BOARD(n, d, v, m, fb, fs, cs, fo) { \
        .name = (n), .desc=(d), \