ath79: move D-Link DIR-859 and DIR-869 series to tiny sub-target
authorShiji Yang <yangshiji66@qq.com>
Tue, 19 Mar 2024 13:25:52 +0000 (21:25 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 30 Mar 2024 00:04:17 +0000 (01:04 +0100)
These devices only have 64 MiB RAM and ath10k wireless driver will
consume a lot of memory. Let's move them to the tiny sub-target to
get extra 7 MiB of free space. In this way, we can extend their
lifetime to receive support for the next OpenWrt LTS version. This
patch also trims the USB package for the non-existent USB port.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
target/linux/ath79/generic/base-files/etc/board.d/01_leds
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum
target/linux/ath79/image/generic.mk
target/linux/ath79/image/tiny.mk
target/linux/ath79/tiny/base-files/etc/board.d/01_leds
target/linux/ath79/tiny/base-files/etc/board.d/02_network
target/linux/ath79/tiny/base-files/etc/uci-defaults/09_fix-checksum [new file with mode: 0644]

index 525224bec91a942a94b4482fd3709fe5c7859de8..bfc383c0e5870e0a2a1df47553284f315a4875a7 100644 (file)
@@ -249,12 +249,6 @@ dlink,dap-1720-a1)
        ucidef_set_led_rssi "rssimediumhigh" "RSSI MEDIUM-HIGH" "green:signal-2" "wlan0" "61" "100"
        ucidef_set_led_rssi "rssihigh" "RSSI HIGH" "green:signal-3" "wlan0" "81" "100"
        ;;
-dlink,dir-859-a1)
-       ucidef_set_led_switch "internet" "WAN" "green:internet" "switch0" "0x20"
-       ;;
-dlink,dir-859-a3)
-       ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x20"
-       ;;
 engenius,ens202ext-v1|\
 engenius,enstationac-v1)
        ucidef_set_rssimon "wlan0" "200000" "1"
index 6c1cb8623554bf2588fd95d297bf740f1d0ad2d3..de9bd6a3006148ff5a470ae0b4b2512c980e8a12 100644 (file)
@@ -318,9 +318,6 @@ ath79_setup_interfaces()
        dlink,dir-842-c1|\
        dlink,dir-842-c2|\
        dlink,dir-842-c3|\
-       dlink,dir-859-a1|\
-       dlink,dir-859-a3|\
-       dlink,dir-869-a1|\
        engenius,epg5000|\
        engenius,esr1200|\
        engenius,esr1750|\
@@ -699,15 +696,6 @@ ath79_setup_macs()
                wan_mac=$(mtd_get_mac_ascii devdata "wanmac")
                label_mac=$lan_mac
                ;;
-       dlink,dir-859-a1|\
-       dlink,dir-869-a1)
-               lan_mac=$(mtd_get_mac_text "devdata" 0xc9)
-               wan_mac=$(mtd_get_mac_text "devdata" 0x79)
-               ;;
-       dlink,dir-859-a3)
-               lan_mac=$(get_mac_label)
-               wan_mac=$(macaddr_add "$lan_mac" 3)
-               ;;
        qihoo,c301|\
        wd,mynet-n600|\
        wd,mynet-n750)
index 4ec8c13eb7574500b9a2875cb2ee48f8302a59e7..3f85fc12a04866d2718eafb8c72dd712666e8deb 100644 (file)
@@ -23,9 +23,6 @@ dlink,dap-3662-a1)
        ;;
 dlink,dap-1720-a1|\
 dlink,dir-629-a1|\
-dlink,dir-859-a1|\
-dlink,dir-859-a3|\
-dlink,dir-869-a1|\
 qihoo,c301)
        fix_seama_header
        ;;
index d56afcaac807d8e70519f9703f808449259dc15f..03a0472c12d355f6786cde16ad54d580c20e1bee 100644 (file)
@@ -1278,41 +1278,6 @@ define Device/dlink_dir-842-c3
 endef
 TARGET_DEVICES += dlink_dir-842-c3
 
-define Device/dlink_dir-859-ax
-  $(Device/seama)
-  SOC := qca9563
-  DEVICE_VENDOR := D-Link
-  DEVICE_MODEL := DIR-859
-  IMAGE_SIZE := 15872k
-  DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
-  SEAMA_SIGNATURE := wrgac37_dlink.2013gui_dir859
-endef
-
-define Device/dlink_dir-859-a1
-  $(Device/dlink_dir-859-ax)
-  DEVICE_VARIANT := A1
-endef
-TARGET_DEVICES += dlink_dir-859-a1
-
-define Device/dlink_dir-859-a3
-  $(Device/dlink_dir-859-ax)
-  DEVICE_VARIANT := A3
-endef
-TARGET_DEVICES += dlink_dir-859-a3
-
-define Device/dlink_dir-869-a1
-  $(Device/seama)
-  SOC := qca9563
-  DEVICE_VENDOR := D-Link
-  DEVICE_MODEL := DIR-869
-  DEVICE_VARIANT := A1
-  IMAGE_SIZE := 15872k
-  DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
-  SEAMA_SIGNATURE := wrgac54_dlink.2015_dir869
-  SUPPORTED_DEVICES += dir-869-a1
-endef
-TARGET_DEVICES += dlink_dir-869-a1
-
 define Device/elecom_wab
   DEVICE_VENDOR := ELECOM
   IMAGE_SIZE := 14336k
index 25ec95b574846269b4c8d9972975e912e651d222..13f105d2028a1b30cb927479153f7ad30b90741d 100644 (file)
@@ -30,6 +30,41 @@ define Device/dlink_dir-615-e4
 endef
 TARGET_DEVICES += dlink_dir-615-e4
 
+define Device/dlink_dir-859-a
+  $(Device/seama)
+  SOC := qca9563
+  DEVICE_VENDOR := D-Link
+  DEVICE_MODEL := DIR-859
+  IMAGE_SIZE := 15872k
+  SEAMA_SIGNATURE := wrgac37_dlink.2013gui_dir859
+  DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct-smallbuffers
+endef
+
+define Device/dlink_dir-859-a1
+  $(Device/dlink_dir-859-a)
+  DEVICE_VARIANT := A1
+endef
+TARGET_DEVICES += dlink_dir-859-a1
+
+define Device/dlink_dir-859-a3
+  $(Device/dlink_dir-859-a)
+  DEVICE_VARIANT := A3
+endef
+TARGET_DEVICES += dlink_dir-859-a3
+
+define Device/dlink_dir-869-a1
+  $(Device/seama)
+  SOC := qca9563
+  DEVICE_VENDOR := D-Link
+  DEVICE_MODEL := DIR-869
+  DEVICE_VARIANT := A1
+  IMAGE_SIZE := 15872k
+  SEAMA_SIGNATURE := wrgac54_dlink.2015_dir869
+  DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct-smallbuffers
+  SUPPORTED_DEVICES += dir-869-a1
+endef
+TARGET_DEVICES += dlink_dir-869-a1
+
 define Device/engenius_eap350-v1
   $(Device/senao_loader_okli)
   BLOCKSIZE := 4k
index 07e48ec49f3800df1c0fdc7fbdfbe958ee93dacf..427eac8a068772bbd35f2fa0ef7f9208ffd71cc6 100644 (file)
@@ -20,6 +20,12 @@ tplink,tl-wr941-v4)
        ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x08"
        ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x10"
        ;;
+dlink,dir-859-a1)
+       ucidef_set_led_switch "internet" "INTERNET" "green:internet" "switch0" "0x20"
+       ;;
+dlink,dir-859-a3)
+       ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x20"
+       ;;
 engenius,enh202-v1)
        ucidef_set_led_switch "lan" "LAN" "amber:lan" "switch0" "0x10"
        ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
index 836d119867fb98c05be25addd88c4307174c6a21..60e640e0fb437f28118f3b30b43c85dfc627bb51 100644 (file)
@@ -27,6 +27,12 @@ ath79_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
                ;;
+       dlink,dir-859-a1|\
+       dlink,dir-859-a3|\
+       dlink,dir-869-a1)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
+               ;;
        engenius,eap350-v1|\
        engenius,ecb350-v1|\
        pqi,air-pen|\
@@ -126,6 +132,15 @@ ath79_setup_macs()
                wan_mac=$(mtd_get_mac_ascii "nvram" "wan_mac")
                label_mac=$wan_mac
                ;;
+       dlink,dir-859-a1|\
+       dlink,dir-869-a1)
+               lan_mac=$(mtd_get_mac_text "devdata" 0xc9)
+               wan_mac=$(mtd_get_mac_text "devdata" 0x79)
+               ;;
+       dlink,dir-859-a3)
+               lan_mac=$(get_mac_label)
+               wan_mac=$(macaddr_add "$lan_mac" 3)
+               ;;
        engenius,enh202-v1|\
        ubnt,airrouter|\
        ubnt,bullet-m-ar7240|\
diff --git a/target/linux/ath79/tiny/base-files/etc/uci-defaults/09_fix-checksum b/target/linux/ath79/tiny/base-files/etc/uci-defaults/09_fix-checksum
new file mode 100644 (file)
index 0000000..4febde5
--- /dev/null
@@ -0,0 +1,16 @@
+. /lib/functions.sh
+
+fix_seama_header() {
+       local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd)
+       [ "$kernel_size" ] && mtd -c 0x$kernel_size fixseama firmware
+}
+
+board=$(board_name)
+
+case "$board" in
+dlink,dir-859-a1|\
+dlink,dir-859-a3|\
+dlink,dir-869-a1)
+       fix_seama_header
+       ;;
+esac