From cd09f26660b684db541a0f49fc23988df142892c Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Mon, 8 Jun 2020 02:11:34 +0300 Subject: ath79: add support for D-Link DAP-2695-A1 Hardware: * SoC: Qualcomm Atheros QCA9558 * RAM: 256MB * Flash: 16MB SPI NOR * Ethernet: 2x 10/100/1000 (1x 802.3at PoE-PD) * WiFi 2.4GHz: Qualcomm Atheros QCA9558 * WiFi 5GHz: Qualcomm Ahteros QCA9880-2R4E * LEDS: 1x 5GHz, 1x 2.4GHz, 1x LAN1(POE), 1x LAN2, 1x POWER * Buttons: 1x RESET * UART: 1x RJ45 RS-232 Console port Installation via stock firmware: * Install the factory image via the stock firmware web interface Installation via bootloader Emergency Web Server: * Connect your PC to the LAN1(PoE) port * Configure your PC with IP address 192.168.0.90 * Open a serial console to the Console port (115200,8n1) * Press "q" within 2s when "press 'q' to stop autoboot" appears * Open http://192.168.0.50 in a browser * Upload either the factory or the sysupgrade image * Once you see "write image into flash...OK,dest addr=0x9f070000" you can power-cycle the device. Ignore "checksum bad" messages. Setting the MAC addresses for the ethernet interfaces via /etc/board.d/02_network adds the following snippets to /etc/config/network: config device 'lan_eth0_1_dev' option name 'eth0.1' option macaddr 'xx:xx:xx:xx:xx:xx' config device 'wan_eth1_2_dev' option name 'eth1.2' option macaddr 'xx:xx:xx:xx:xx:xx' This would result in the proper MAC addresses being set for the VLAN subinterfaces, but the parent interfaces would still have a random MAC address. Using untagged VLANs could solve this, but would still leave those extra snippets in /etc/config/network, and then the device VLAN setup would differ from the one used in ar71xx. Therefore, the MAC addresses of the ethernet interfaces are being set via preinit instead. The bdcfg partition contains 4 MAC address labels: - lanmac - wanmac - wlanmac - wlanmac_a The first 3 all contain the same MAC address, which is also the one on the label. Signed-off-by: Stijn Tintel Reviewed-by: Adrian Schmutzler --- .../ath79/generic/base-files/etc/uci-defaults/09_fix-checksum | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum') diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum index 22c9483e74..085ad2e925 100644 --- a/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum +++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum @@ -6,9 +6,17 @@ fix_seama_header() { [ "$kernel_size" ] && mtd -c 0x$kernel_size fixseama firmware } +fixwrgg() { + local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd) + [ "$kernel_size" ] && mtd -c 0x$kernel_size fixwrgg firmware +} + board=$(board_name) case "$board" in +dlink,dap-2695-a1) + fixwrgg + ;; qihoo,c301) fix_seama_header ;; -- cgit v1.2.3