ath79: use common device definition for Buffalo devices

The Buffalo devices in ath79 share their image generation code,
so let's create a shared Device definition for them.

Since most of them use BUFFALO_HWVER := 3, this is moved as
default to the shared definition as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2020-09-13 14:48:26 +02:00
parent a99614a44f
commit c68105c3b4
3 changed files with 27 additions and 36 deletions

View File

@ -1,3 +1,5 @@
DEVICE_VARS += BUFFALO_PRODUCT BUFFALO_HWVER
define Build/buffalo-tag
$(eval product=$(word 1,$(1)))
$(eval hwver=$(word 2,$(1)))
@ -17,3 +19,16 @@ define Build/buffalo-tftp-header
) > $@.new
mv $@.new $@
endef
define Device/buffalo_common
DEVICE_VENDOR := Buffalo
BUFFALO_PRODUCT :=
BUFFALO_HWVER := 3
IMAGES += factory.bin tftp.bin
IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \
pad-rootfs | check-size
IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc $$$$(BUFFALO_PRODUCT) 1.99 | \
buffalo-tag $$$$(BUFFALO_PRODUCT) $$$$(BUFFALO_HWVER)
IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
endef

View File

@ -315,17 +315,12 @@ endef
TARGET_DEVICES += avm_fritzdvbc
define Device/buffalo_bhr-4grv
$(Device/buffalo_common)
SOC := ar7242
DEVICE_VENDOR := Buffalo
DEVICE_MODEL := BHR-4GRV
BUFFALO_PRODUCT := BHR-4GRV
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
IMAGE_SIZE := 32256k
IMAGES += factory.bin tftp.bin
IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \
pad-rootfs | check-size
IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc BHR-4GRV 1.99 | \
buffalo-tag BHR-4GRV 3
IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
SUPPORTED_DEVICES += wzr-hp-g450h
endef
TARGET_DEVICES += buffalo_bhr-4grv
@ -339,51 +334,37 @@ endef
TARGET_DEVICES += buffalo_bhr-4grv2
define Device/buffalo_wzr-hp-ag300h
$(Device/buffalo_common)
SOC := ar7161
DEVICE_VENDOR := Buffalo
DEVICE_MODEL := WZR-HP-AG300H
IMAGE_SIZE := 32320k
IMAGES += factory.bin tftp.bin
IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \
pad-rootfs | check-size
IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-AG300H 1.99 | \
buffalo-tag WZR-HP-AG300H 3
IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
BUFFALO_PRODUCT := WZR-HP-AG300H
DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
kmod-leds-reset kmod-owl-loader
IMAGE_SIZE := 32320k
SUPPORTED_DEVICES += wzr-hp-ag300h
endef
TARGET_DEVICES += buffalo_wzr-hp-ag300h
define Device/buffalo_wzr-hp-g302h-a1a0
$(Device/buffalo_common)
SOC := ar7242
DEVICE_VENDOR := Buffalo
DEVICE_MODEL := WZR-HP-G302H
DEVICE_VARIANT := A1A0
BUFFALO_PRODUCT := WZR-HP-G302H
BUFFALO_HWVER := 4
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
IMAGE_SIZE := 32128k
IMAGES += factory.bin tftp.bin
IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \
pad-rootfs | check-size
IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-G302H 1.99 | \
buffalo-tag WZR-HP-G302H 4
IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
SUPPORTED_DEVICES += wzr-hp-g300nh2
endef
TARGET_DEVICES += buffalo_wzr-hp-g302h-a1a0
define Device/buffalo_wzr-hp-g450h
$(Device/buffalo_common)
SOC := ar7242
DEVICE_VENDOR := Buffalo
DEVICE_MODEL := WZR-HP-G450H/WZR-450HP
BUFFALO_PRODUCT := WZR-HP-G450H
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
IMAGE_SIZE := 32256k
IMAGES += factory.bin tftp.bin
IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \
pad-rootfs | check-size
IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-G450H 1.99 | \
buffalo-tag WZR-HP-G450H 3
IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
SUPPORTED_DEVICES += wzr-hp-g450h
endef
TARGET_DEVICES += buffalo_wzr-hp-g450h

View File

@ -1,16 +1,11 @@
include ./common-buffalo.mk
define Device/buffalo_whr-g301n
$(Device/buffalo_common)
SOC := ar7240
DEVICE_VENDOR := Buffalo
DEVICE_MODEL := WHR-G301N
BUFFALO_PRODUCT := WHR-G301N
IMAGE_SIZE := 3712k
IMAGES += factory.bin tftp.bin
IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \
pad-rootfs | check-size
IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WHR-G301N 1.99 | \
buffalo-tag WHR-G301N 3
IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
SUPPORTED_DEVICES += whr-g301n
DEFAULT := n
endef