aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/image
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-11-07 12:51:39 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-11-07 12:51:39 +0000
commit35e062080a818d43a05815015a7751bd1e36a2c1 (patch)
tree0575a75382db10d35d9cc0a39d31457f5de89daf /target/linux/ar71xx/image
parent005e2d4e5ce338350bc538d8b8ffc5d6c7d0cd22 (diff)
downloadmaster-187ad058-35e062080a818d43a05815015a7751bd1e36a2c1.tar.gz
master-187ad058-35e062080a818d43a05815015a7751bd1e36a2c1.tar.bz2
master-187ad058-35e062080a818d43a05815015a7751bd1e36a2c1.zip
ar71xx: Add support for ZyXEL NBG6616.
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47405 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/image')
-rw-r--r--target/linux/ar71xx/image/Makefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 15cf2c6b8b..29e5064909 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -2055,6 +2055,39 @@ ifdef CONFIG_PACKAGE_uboot-ar71xx-nbg460n_550n_550nh
endef
endif
+define Device/NBG6616
+ BOARDNAME = NBG6616
+ KERNEL_SIZE = 2048k
+ IMAGE_SIZE = 15323k
+ MTDPARTS = spi0.0:192k(u-boot)ro,64k(env)ro,64k(RFdata)ro,384k(zyxel_rfsd),384k(romd),64k(header),2048k(kernel),13184k(rootfs),15232k@0x120000(firmware)
+ CMDLINE += mem=128M
+ IMAGES := sysupgrade.bin
+ KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 boot/vmlinux.lzma.uImage
+ IMAGE/sysupgrade.bin = append-kernel $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+ # We cannot currently build a factory image. It is the sysupgrade image
+ # prefixed with a header (which is actually written into the MTD device).
+ # The header is 2kiB and is filled with 0xff. The format seems to be:
+ # 2 bytes: 0x0000
+ # 2 bytes: checksum of the data partition (big endian)
+ # 4 bytes: length of the contained image file (big endian)
+ # 32 bytes: Firmware Version string (NUL terminated, 0xff padded)
+ # 2 bytes: 0x0000
+ # 2 bytes: checksum over the header partition (big endian)
+ # 32 bytes: Model (e.g. "NBG6616", NUL termiated, 0xff padded)
+ # rest: 0xff padding
+ #
+ # The checksums are calculated by adding up all bytes and if a 16bit
+ # overflow occurs, one is added and the sum is masked to 16 bit:
+ # csum = csum + databyte; if (csum > 0xffff) { csum += 1; csum &= 0xffff };
+ # Should the file have an odd number of bytes then the byte len-0x800 is
+ # used additionally.
+ # The checksum for the header is calcualted over the first 2048 bytes with
+ # the firmware checksum as the placeholder during calculation.
+ #
+ # The header is padded with 0xff to the erase block size of the device.
+endef
+
+TARGET_DEVICES += NBG6616
define Image/Build/ZyXELNAND/buildkernel
$(eval kernelsize=$(call mtdpartsize,kernel,$(5)))