# "Application" partition is the rootfs
mv $@ $@.tmp/hddapp.tgz
- # 256 bytes copy routine
- # TODO fix for IB-4220-B
- dd if=$(KDIR)/copy-kernel.bin of=$@.tmp/zImage
+ # 512 bytes copy routine
+ dd if=$(KDIR)/copy-kernel-$(2).bin of=$@.tmp/zImage
$(call Image/pad-to,$@.tmp/zImage,512)
# Copy first part of the kernel into zImage
- dd if=$(IMAGE_KERNEL) of=$@.tmp/zImage bs=1 seek=512 count=$(2)
+ dd if=$(IMAGE_KERNEL) of=$@.tmp/zImage bs=1 seek=512 count=$(3)
# Put the rest of the kernel into the "ramdisk"
- dd if=$(IMAGE_KERNEL) of=$@.tmp/rd.gz bs=1 skip=$(2) count=6144k conv=sync
+ dd if=$(IMAGE_KERNEL) of=$@.tmp/rd.gz bs=1 skip=$(3) count=6144k conv=sync
cp ./ImageInfo-$(1) $@.tmp/ImageInfo
sed -i -e "s/DATESTR/`date +%Y%m%d $(if $(SOURCE_DATE_EPOCH),--date "@$(SOURCE_DATE_EPOCH)")`/g" $@.tmp/ImageInfo
# 2048k "Kern" partition
define Build/storlink-default-image
- $(call CreateStorlinkTarfile,$(1),2096640)
+ $(call CreateStorlinkTarfile,$(1),2048k,2096640)
endef
-# 3032k "Kern" partition
+# 3072k "Kern" partition
define Build/raidsonic-ib-4220-b-image
- $(call CreateStorlinkTarfile,$(1),3145216)
+ $(call CreateStorlinkTarfile,$(1),3072k,3145216)
endef
# WBD-111 and WBD-222:
# Application 6144k | = 15360k
IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 6144k | \
raidsonic-ib-4220-b-image $(1)
- IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 6144k | \
+ IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 6144k | \
raidsonic-ib-4220-b-image $(1) | append-metadata
endef
TARGET_DEVICES += raidsonic_ib-4220-b
SRC_DIR := $(CURDIR)/
OUT_DIR := $(if $(O),$(if $(patsubst %/,,$(O)),$(O)/,$(O)),$(SRC_DIR))
-all: $(OUT_DIR)copy-kernel.bin
+all: $(OUT_DIR)copy-kernel-2048k.bin $(OUT_DIR)copy-kernel-3072k.bin
# Don't build dependencies, this may die if $(CC) isn't gcc
dep:
mrproper: clean
clean:
- rm -f $(OUT_DIR)copy-kernel.bin $(OUT_DIR)copy-kernel.o
+ rm -f $(OUT_DIR)copy-kernel-2048k.bin $(OUT_DIR)copy-kernel-2048k.o
+ rm -f $(OUT_DIR)copy-kernel-3072k.bin $(OUT_DIR)copy-kernel-3072k.o
--- /dev/null
+ // Arm assembly to copy the Gemini kernel on Raidsonic
+ // designs and derived devices with the same flash layout and
+ // boot loader.
+ //
+ // This will execute at 0x01600000
+ //
+ // Copies the kernel from two fragments (originally zImage
+ // and initramdisk) to 0x00400000 making space for a kernel
+ // image of up to 8 MB except for these 512 bytes used for
+ // this bootstrap.
+ //
+ // 0x01600200 .. 0x018fffff -> 0x00400000 .. 0x006ffdff
+ // 0x00800000 .. 0x00dfffff -> 0x006ffe00 .. 0x00cffdff
+
+ // Memory used for this bootstrap
+ .equ BOOT_HEADROOM, 0x200
+
+ .global _start // Stand-alone assembly code
+_start:
+ mov r1, #0x01600000
+ mov r2, #0x00400000
+ mov r3, #0x00300000
+ add r1, r1, #BOOT_HEADROOM
+ sub r3, r3, #BOOT_HEADROOM
+copyloop1:
+ ldr r0, [r1]
+ str r0, [r2]
+ add r1, r1, #4
+ add r2, r2, #4
+ sub r3, r3, #4
+ cmp r3, #0
+ bne copyloop1
+ mov r1, #0x00800000
+ mov r3, #0x00600000
+copyloop2:
+ ldr r0, [r1]
+ str r0, [r2]
+ add r1, r1, #4
+ add r2, r2, #4
+ sub r3, r3, #4
+ cmp r3, #0
+ bne copyloop2
+ mov r0, #0x00400000
+ // Let's go
+ mov pc, r0