aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/image/generic.mk
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ath79/image/generic.mk')
-rw-r--r--target/linux/ath79/image/generic.mk35
1 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 60dc512f06..fc38c09958 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -17,6 +17,31 @@ define Build/addpattern
-mv "$@.new" "$@"
endef
+define Build/elecom-header
+ $(eval fw_size=$(word 1,$(1)))
+ $(eval edimax_model=$(word 2,$(1)))
+ $(eval product=$(word 3,$(1)))
+ $(eval factory_bin=$(word 4,$(1)))
+ if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(fw_size)" ]; then \
+ $(CP) $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) $(factory_bin); \
+ $(STAGING_DIR_HOST)/bin/mkedimaximg \
+ -b -s CSYS -m $(edimax_model) \
+ -f 0x70000 -S 0x01100000 \
+ -i $(factory_bin) -o $(factory_bin).new; \
+ mv $(factory_bin).new $(factory_bin); \
+ ( \
+ echo -n -e "ELECOM\x00\x00$(product)" | dd bs=40 count=1 conv=sync; \
+ echo -n "0.00" | dd bs=16 count=1 conv=sync; \
+ dd if=$(factory_bin); \
+ ) > $(factory_bin).new; \
+ mv $(factory_bin).new $(factory_bin); \
+ $(CP) $(factory_bin) $(BIN_DIR)/; \
+ else \
+ echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
+ fi
+
+endef
+
define Device/avm_fritz300e
ATH_SOC := ar7242
DEVICE_TITLE := AVM FRITZ!WLAN Repeater 300E
@@ -62,6 +87,16 @@ define Device/dlink_dir-825-b1
endef
TARGET_DEVICES += dlink_dir-825-b1
+define Device/elecom_wrc-300ghbk2-i
+ ATH_SOC := qca9563
+ DEVICE_TITLE := ELECOM WRC-300GHBK2-I
+ IMAGE_SIZE := 7616k
+ KERNEL_INITRAMFS := $$(KERNEL) | pad-to 2 | \
+ elecom-header 7798706 RN51 WRC-300GHBK2-I \
+ $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.bin
+endef
+TARGET_DEVICES += elecom_wrc-300ghbk2-i
+
define Device/embeddedwireless_dorin
ATH_SOC := ar9331
DEVICE_TITLE := Embedded Wireless Dorin