aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mvebu/image
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/mvebu/image')
-rw-r--r--target/linux/mvebu/image/Makefile57
-rw-r--r--target/linux/mvebu/image/cortexa9.mk18
2 files changed, 75 insertions, 0 deletions
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 9220c6c9f1..44e66a5f87 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -51,6 +51,63 @@ define Build/buffalo-kernel-jffs2
rm -rf $(KDIR)/kernel_jffs2 $@.fakerd
endef
+# Some info about Ctera firmware:
+# 1. It's simple tar file (GNU standard), but it must have ".firm" suffix.
+# 2. It contains two images: kernel and romdisk. Both are required.
+# 3. Every image has header and trailer file.
+# 4. The struct of tar firmware is: header kernel trailer header romdisk trailer
+# 5. In header file are some strings used to describe image. It was decoded from
+# factory image.
+# 6. Version format in header file is restricted by Original FW.
+# 7. Trailer file contains MD5 sum string of header and image file.
+# 8. Firmware file must have <=24MB size.
+
+define Build/ctera-firmware
+ mkdir -p $@.tmp
+
+ # Prepare header and trailer file for kernel
+ echo "# CTera firmware information file" > $@.tmp/header
+ echo "image_type=kernel" >> $@.tmp/header
+ echo "arch=ARM" >> $@.tmp/header
+ echo "board=2Drive_A" >> $@.tmp/header
+ echo "version=5.5.165.61499" >> $@.tmp/header
+ echo "kernel_cmd=console=ttyS0,115200 earlycon" >> $@.tmp/header
+ echo "date=$$(date $(if $(SOURCE_DATE_EPOCH),-d@$(SOURCE_DATE_EPOCH)))" \
+ >> $@.tmp/header
+
+ cp $@ $@.tmp/kernel
+
+ echo "MD5=$$(cat $@.tmp/header $@.tmp/kernel | $(MKHASH) md5)" \
+ > $@.tmp/trailer
+
+ tar $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
+ -H gnu -C $@.tmp -cf $@.tar header kernel trailer
+
+ # Prepare header and trailer file for fake romdisk
+ echo "# CTera firmware information file" > $@.tmp/header
+ echo "image_type=romdisk" >> $@.tmp/header
+ echo "initrd=yes" >> $@.tmp/header
+ echo "arch=ARM" >> $@.tmp/header
+ echo "board=2Drive_A" >> $@.tmp/header
+ echo "version=5.5.165.61499" >> $@.tmp/header
+ echo "date=$$(date $(if $(SOURCE_DATE_EPOCH),-d@$(SOURCE_DATE_EPOCH)))" \
+ >> $@.tmp/header
+
+ rm -f $@
+ touch $@
+ $(call Build/append-uImage-fakehdr, ramdisk)
+ cp $@ $@.tmp/romdisk
+
+ echo "MD5=$$(cat $@.tmp/header $@.tmp/romdisk | $(MKHASH) md5)" \
+ > $@.tmp/trailer
+
+ tar $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
+ -H gnu -C $@.tmp -rf $@.tar header romdisk trailer
+
+ mv $@.tar $@
+ rm -rf $@.tmp
+endef
+
define Build/sdcard-img
SIGNATURE="$(IMG_PART_SIGNATURE)" \
./gen_mvebu_sdcard_img.sh $@ \
diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk
index 3f227259ee..06252670ab 100644
--- a/target/linux/mvebu/image/cortexa9.mk
+++ b/target/linux/mvebu/image/cortexa9.mk
@@ -31,6 +31,24 @@ define Device/buffalo_ls421de
endef
TARGET_DEVICES += buffalo_ls421de
+define Device/ctera_c200-v2
+ PAGESIZE := 2048
+ SUBPAGESIZE := 512
+ BLOCKSIZE := 128k
+ DEVICE_VENDOR := Ctera
+ DEVICE_MODEL := C200
+ DEVICE_VARIANT := V2
+ SOC := armada-370
+ KERNEL := kernel-bin | append-dtb | uImage none | ctera-firmware
+ KERNEL_IN_UBI :=
+ KERNEL_SUFFIX := -factory.firm
+ DEVICE_PACKAGES := \
+ kmod-gpio-button-hotplug kmod-hwmon-drivetemp kmod-hwmon-nct7802 \
+ kmod-rtc-s35390a kmod-usb3 kmod-usb-ledtrig-usbport
+ IMAGES := sysupgrade.bin
+endef
+TARGET_DEVICES += ctera_c200-v2
+
define Device/cznic_turris-omnia
DEVICE_VENDOR := CZ.NIC
DEVICE_MODEL := Turris Omnia