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 --- target/linux/ath79/image/generic.mk | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'target/linux/ath79/image/generic.mk') diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 05b769b9c3..e92dbc99d6 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -6,6 +6,7 @@ include ./common-yuncore.mk DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK DEVICE_VARS += KERNEL_INITRAMFS_PREFIX +DEVICE_VARS += DAP_SIGNATURE define Build/add-elecom-factory-initramfs $(eval edimax_model=$(word 1,$(1))) @@ -49,6 +50,14 @@ define Build/cybertan-trx -rm $@-empty.bin endef +define Build/mkwrggimg + $(STAGING_DIR_HOST)/bin/mkwrggimg -b \ + -i $@ -o $@.imghdr -d /dev/mtdblock/1 \ + -m $(DEVICE_MODEL)-$(DEVICE_VARIANT) -s $(DAP_SIGNATURE) \ + -v $(VERSION_DIST) -B $(REVISION) + mv $@.imghdr $@ +endef + define Build/nec-enc $(STAGING_DIR_HOST)/bin/nec-enc \ -i $@ -o $@.new -k $(1) @@ -88,6 +97,10 @@ define Build/teltonika-fw-fake-checksum dd of=$@ bs=1 count=16 seek=$$offs conv=notrunc endef +define Build/wrgg-pad-rootfs + $(STAGING_DIR_HOST)/bin/padjffs2 $(IMAGE_ROOTFS) -c 64 >>$@ +endef + define Device/seama KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma KERNEL_INITRAMFS := $$(KERNEL) | seama @@ -458,6 +471,26 @@ define Device/devolo_magic-2-wifi endef TARGET_DEVICES += devolo_magic-2-wifi +define Device/dlink_dap-2695-a1 + SOC := qca9558 + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DAP-2965 + DEVICE_VARIANT := A1 + IMAGES := factory.img sysupgrade.bin + IMAGE_SIZE := 15360k + IMAGE/default := append-kernel | pad-offset 65536 160 + IMAGE/factory.img := $$(IMAGE/default) | append-rootfs | wrgg-pad-rootfs | \ + mkwrggimg | check-size + IMAGE/sysupgrade.bin := $$(IMAGE/default) | mkwrggimg | append-rootfs | \ + wrgg-pad-rootfs | append-metadata | check-size + KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma + KERNEL_INITRAMFS := $$(KERNEL) | mkwrggimg + DAP_SIGNATURE := wapac02_dkbs_dap2695 + SUPPORTED_DEVICES += dap-2695-a1 +endef +TARGET_DEVICES += dlink_dap-2695-a1 + define Device/dlink_dir-505 SOC := ar9330 DEVICE_VENDOR := D-Link -- cgit v1.2.3