diff options
Diffstat (limited to 'do-work/Edimax-v2/embr6478acv2')
-rw-r--r-- | do-work/Edimax-v2/embr6478acv2 | 130 |
1 files changed, 54 insertions, 76 deletions
diff --git a/do-work/Edimax-v2/embr6478acv2 b/do-work/Edimax-v2/embr6478acv2 index 4bbe3e9..0bcd3eb 100644 --- a/do-work/Edimax-v2/embr6478acv2 +++ b/do-work/Edimax-v2/embr6478acv2 @@ -11,6 +11,34 @@ index 51cd8f3..8ede6c4 100644 MAINTAINER:=John Crispin <john@phrozen.org> KERNEL_PATCHVER:=4.4 +diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh +index eda300b..8c27cad 100755 +--- a/target/linux/ramips/base-files/lib/ramips.sh ++++ b/target/linux/ramips/base-files/lib/ramips.sh +@@ -571,6 +571,9 @@ ramips_board_detect() { + *"YK1") + name="youku-yk1" + ;; ++ *"BR-6478ACV2") ++ name="br-6478ac-v2" ++ ;; + *) + name="generic" + ;; +diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh +index 0ef2308..e84fcef 100755 +--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh +@@ -183,7 +183,8 @@ platform_check_image() { + } + return 0 + ;; +- br-6475nd) ++ br-6475nd|\ ++ br-6478ac-v2) + [ "$magic" != "43535953" ] && { + echo "Invalid image type." + return 1 diff --git a/target/linux/ramips/dts/BR-6478AC-V2.dts b/target/linux/ramips/dts/BR-6478AC-V2.dts index ac870cc..ce1054f 100644 --- a/target/linux/ramips/dts/BR-6478AC-V2.dts @@ -88,23 +116,42 @@ index d165ec5..8a256bd 100644 include $(INCLUDE_DIR)/image.mk diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk -index d508fd9..ce953dd 100644 +index d508fd9..ee4b220 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk -@@ -2,6 +2,12 @@ +@@ -2,11 +2,22 @@ # MT7620A Profiles # + -+define Build/edmx-header -+ $(STAGING_DIR_HOST)/bin/mkedmximg < $@ > $@.new && mv $@.new $@ -+endef ++#define Build/edmx-header ++# $(STAGING_DIR_HOST)/bin/mkedmximg < $@ > $@.new && mv $@.new $@ ++#endef + + define Build/tplink-header $(STAGING_DIR_HOST)/bin/mktplinkfw2 -a 0x4 -V "ver. 2.0" -B $(1) \ -o $@.new -k $@ && mv $@.new $@ -@@ -416,18 +422,12 @@ define Device/br-6478ac-v2 + endef + ++ ++define Build/edimax-header ++ $(STAGING_DIR_HOST)/bin/mkedimaximg -i $@ -o $@.new -s CSYS $(1) && mv $@.new $@ ++endef ++ + define Build/pad-kernel-ex2700 + cp $@ $@.tmp && dd if=/dev/zero bs=64 count=1 >> $@.tmp \ + && dd if=$@.tmp of=$@.new bs=64k conv=sync && truncate -s -64 $@.new \ +@@ -400,7 +411,7 @@ define Device/dch-m225 + IMAGE/sysupgrade.bin := \ + append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \ + seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \ +- pad-rootfs | check-size $$$$(IMAGE_SIZE) ++ Pad-rootfs | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := \ + append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \ + append-rootfs | pad-rootfs -x 64 | \ +@@ -416,18 +427,8 @@ define Device/br-6478ac-v2 DTS := BR-6478AC-V2 DEVICE_TITLE := Edimax BR-6478AC-V2 BLOCKSIZE := 4k @@ -120,11 +167,7 @@ index d508fd9..ce953dd 100644 - seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \ - seama-seal -m "signature=wapn22_dlink.2013gui_dap1320b" | \ - check-size $$$$(IMAGE_SIZE) -+ IMAGES += factory.bin rawfs.bin kernel.bin -+ IMAGE/rawfs.bin := append-rootfs -+ IMAGE/kernel.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 20 | edmx-header -+ IMAGE/sysupgrade.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 20 | edmx-header | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) -+ IMAGE/factory.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 20 | edmx-header | append-rootfs | pad-rootfs -x 64 | check-size $$$$(IMAGE_SIZE) ++ IMAGE/sysupgrade.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 20 | append-rootfs | pad-rootfs -x 20 | check-size $$$$(IMAGE_SIZE) | edimax-header -m RN68 -f 0x70000 -S 0x1100000 DEVICE_PACKAGES := kmod-mt76 endef TARGET_DEVICES += br-6478ac-v2 @@ -242,68 +285,3 @@ index 0000000..59c7b5e + } + + static int -diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile -index 803ada4..d55d914 100644 ---- a/tools/firmware-utils/Makefile -+++ b/tools/firmware-utils/Makefile -@@ -72,6 +72,7 @@ define Host/Compile - $(call cc,mkheader_gemtek,-lz) - $(call cc,mkrtn56uimg, -lz) - $(call cc,dgn3500sum) -+ $(call cc,mkedmximg) - $(call cc,edimax_fw_header, -Wall) - $(call cc,mkmerakifw sha1, -Wall) - $(call cc,mkmerakifw-old, -Wall) -diff --git a/tools/firmware-utils/src/mkedmximg.c b/tools/firmware-utils/src/mkedmximg.c -new file mode 100644 -index 0000000..d420cc1 ---- /dev/null -+++ b/tools/firmware-utils/src/mkedmximg.c -@@ -0,0 +1,47 @@ -+#include <stdio.h> -+#include <stdint.h> -+#include <unistd.h> -+ -+char buf[8*1024*1024]; -+ -+ -+struct header { -+uint32_t csys; -+uint32_t thing1; -+uint32_t thing2; -+uint32_t board_sig; -+uint32_t len; -+}; -+ -+ -+ -+ -+int main(int argc,char *argv[]) -+{ -+size_t len; -+struct header h; -+uint32_t crc; -+ -+ -+len=read(0,buf,sizeof(buf)); -+ -+h.csys='SYSC'; -+h.thing1=0x01100000; -+h.thing2=0x00070000; -+h.board_sig='86NR'; -+h.len=len; -+ -+ -+write(1,&h,sizeof(h)); -+write(1,buf,len); -+//write(1,&crc,sizeof(crc)); -+ -+return 0; -+} -+ -+ -+ -+ -+ -+ -+ |