mediatek: add support for Buffalo WSR-3200AX4S
[openwrt/staging/jow.git] / target / linux / mediatek / image / mt7622.mk
index 6f64740628cf6ffe3034af0d6cffb539e08b955b..65db1ebe2e36fc75ca38438e792ae1a1cac29bbe 100644 (file)
@@ -1,5 +1,7 @@
 DTS_DIR := $(DTS_DIR)/mediatek
 
+DEVICE_VARS += BUFFALO_TRX_MAGIC
+
 define Image/Prepare
        # For UBI we want only one extra block
        rm -f $(KDIR)/ubi_mark
@@ -95,33 +97,38 @@ define Device/bananapi_bpi-r64
 endef
 TARGET_DEVICES += bananapi_bpi-r64
 
-define Device/buffalo_wsr-2533dhp2
+define Device/buffalo_wsr
   DEVICE_VENDOR := Buffalo
-  DEVICE_MODEL := WSR-2533DHP2
-  DEVICE_DTS := mt7622-buffalo-wsr-2533dhp2
   DEVICE_DTS_DIR := ../dts
-  IMAGE_SIZE := 59392k
   KERNEL_SIZE := 6144k
   BLOCKSIZE := 128k
   PAGESIZE := 2048
-  SUBPAGESIZE := 512
   UBINIZE_OPTS := -E 5
   BUFFALO_TAG_PLATFORM := MTK
   BUFFALO_TAG_VERSION := 9.99
   BUFFALO_TAG_MINOR := 9.99
   IMAGES += factory.bin factory-uboot.bin
-  KERNEL_INITRAMFS := kernel-bin | lzma | \
+  KERNEL_INITRAMFS = kernel-bin | lzma | \
        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | \
        buffalo-trx
-  IMAGE/factory.bin := append-ubi | \
-       buffalo-trx 0x32504844 $$$$@ $(KDIR)/ubi_mark | \
-       buffalo-enc WSR-2533DHP2 $$(BUFFALO_TAG_VERSION) -l | \
-       buffalo-tag-dhp WSR-2533DHP2 JP JP | buffalo-enc-tag -l | buffalo-dhp-image
+  IMAGE/factory.bin = append-ubi | \
+       buffalo-trx $$$$(BUFFALO_TRX_MAGIC) $$$$@ $(KDIR)/ubi_mark | \
+       buffalo-enc $$(DEVICE_MODEL) $$(BUFFALO_TAG_VERSION) -l | \
+       buffalo-tag-dhp $$(DEVICE_MODEL) JP JP | buffalo-enc-tag -l | buffalo-dhp-image
   IMAGE/factory-uboot.bin := append-ubi | \
-       buffalo-trx 0x32504844 $$$$@ $(KDIR)/ubi_mark
+       buffalo-trx $$$$(BUFFALO_TRX_MAGIC) $$$$@ $(KDIR)/ubi_mark
   IMAGE/sysupgrade.bin := \
-       buffalo-trx 0x32504844 $(KDIR)/tmp/$$(DEVICE_NAME).null | \
+       buffalo-trx $$$$(BUFFALO_TRX_MAGIC) $(KDIR)/tmp/$$(DEVICE_NAME).null | \
        sysupgrade-tar kernel=$$$$@ | append-metadata
+endef
+
+define Device/buffalo_wsr-2533dhp2
+  $(Device/buffalo_wsr)
+  DEVICE_MODEL := WSR-2533DHP2
+  DEVICE_DTS := mt7622-buffalo-wsr-2533dhp2
+  IMAGE_SIZE := 59392k
+  SUBPAGESIZE := 512
+  BUFFALO_TRX_MAGIC := 0x32504844
   DEVICE_PACKAGES := kmod-mt7615-firmware swconfig
   DEVICE_COMPAT_VERSION := 1.1
   DEVICE_COMPAT_MESSAGE := Partition table has been changed due to kernel size restrictions. \
@@ -130,6 +137,16 @@ define Device/buffalo_wsr-2533dhp2
 endef
 TARGET_DEVICES += buffalo_wsr-2533dhp2
 
+define Device/buffalo_wsr-3200ax4s
+  $(Device/buffalo_wsr)
+  DEVICE_MODEL := WSR-3200AX4S
+  DEVICE_DTS := mt7622-buffalo-wsr-3200ax4s
+  IMAGE_SIZE := 24576k
+  BUFFALO_TRX_MAGIC := 0x33504844
+  DEVICE_PACKAGES := kmod-mt7915-firmware
+endef
+TARGET_DEVICES += buffalo_wsr-3200ax4s
+
 define Device/elecom_wrc-2533gent
   DEVICE_VENDOR := Elecom
   DEVICE_MODEL := WRC-2533GENT