Skip to content

Commit

Permalink
dlink,dap-1720-a1: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Sepa committed Sep 13, 2023
1 parent cdc8470 commit b021227
Show file tree
Hide file tree
Showing 6 changed files with 222 additions and 1 deletion.
198 changes: 198 additions & 0 deletions target/linux/ath79/dts/qca9563_dlink_dap-1720-a1.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "qca956x.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>

/ {
model = "D-Link DAP-1720 A1";
compatible = "dlink,dap-1720-a1", "qca,qca9563";

aliases {
led-boot = &led_power;
led-failsafe = &led_status;
led-running = &led_power;
led-upgrade = &led_status;

label-mac-device = &eth0;
};

keys {
compatible = "gpio-keys";

reset {
label = "reset";
gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
debounce-interval = <60>;
};

wps {
label = "wps";
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
debounce-interval = <60>;
};

modeswitch {
label = "mode";
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
linux,code = <BTN_0>;
linux,input-type = <EV_SW>;
debounce-interval = <60>;
};
};

leds {
compatible = "gpio-leds";

led_status: status {
label = "red:power";
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_RED>;
gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
panic-indicator;
};

led_power: power {
label = "green:power";
function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
};

rssilow {
label = "red:rssilow";
function = LED_FUNCTION_INDICATOR;
color = <LED_COLOR_ID_RED>;
gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
};

rssimediumlow {
label = "green:rssimediumlow";
function = LED_FUNCTION_INDICATOR;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
};

rssimediumhigh {
label = "green:rssimediumhigh";
function = LED_FUNCTION_INDICATOR;
function-enumerator = <1>;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
};

rssihigh {
label = "green:rssihigh";
function = LED_FUNCTION_INDICATOR;
function-enumerator = <2>;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};

};

};

&spi {
status = "okay";

flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;

partitions: partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "bootloader";
reg = <0x000000 0x40000>;
read-only;
};

partition@40000 {
compatible = "u-boot,env";
label = "bdcfg";
reg = <0x040000 0x10000>;
read-only;
};

partition@50000 {
label = "devdata";
reg = <0x050000 0x10000>;
read-only;
};

partition@60000 {
label = "devconf";
reg = <0x060000 0x10000>;
read-only;
};

partition@70000 {
compatible = "seama";
label = "firmware";
reg = <0x070000 0xf80000>;
};

art: partition@ff0000 {
compatible = "nvmem-cells";
label = "art";
reg = <0xff0000 0x010000>;
read-only;
#address-cells = <1>;
#size-cells = <1>;

calibration_ath9k: calibration@1000 {
reg = <0x1000 0x440>;
};

calibration_ath10k: calibration@5000 {
reg = <0x5000 0x844>;
};
};
};
};
};

&mdio0 {
status = "okay";

phy0: ethernet-phy@0 {
reg = <0>;
phy-mode = "sgmii";

reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
};
};

&eth0 {
status = "okay";
phy-handle = <&phy0>;
};

&wmac {
status = "okay";

nvmem-cells = <&calibration_ath9k>;
nvmem-cell-names = "calibration";
};

&pcie {
status = "okay";

wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0x0000 0 0 0 0>;

nvmem-cells = <&calibration_ath10k>;
nvmem-cell-names = "calibration";
};
};

3 changes: 2 additions & 1 deletion target/linux/ath79/generic/base-files/etc/board.d/01_leds
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ devolo,magic-2-wifi)
ucidef_set_led_netdev "plcw" "dLAN" "white:dlan" "eth0.1" "rx"
;;
dlink,dap-1330-a1|\
dlink,dap-1365-a1)
dlink,dap-1365-a1|\
dlink,dap-1720-a1)
ucidef_set_rssimon "wlan0" "200000" "1"
ucidef_set_led_rssi "rssilow" "RSSILOW" "red:rssilow" "wlan0" "1" "25"
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "green:rssimediumlow" "wlan0" "1" "100"
Expand Down
2 changes: 2 additions & 0 deletions target/linux/ath79/generic/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ath79_setup_interfaces()
devolo,dvl1750x|\
dlink,dap-1330-a1|\
dlink,dap-1365-a1|\
dlink,dap-1720-a1|\
dlink,dap-2230-a1|\
dlink,dap-2660-a1|\
dlink,dap-2680-a1|\
Expand Down Expand Up @@ -659,6 +660,7 @@ ath79_setup_macs()
wan_mac=$(mtd_get_mac_ascii devdata "wanmac")
label_mac=$lan_mac
;;
dlink,dap-1720-a1|\
dlink,dir-859-a1|\
dlink,dir-869-a1)
lan_mac=$(mtd_get_mac_text "devdata" 0xc9)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ case "$board" in
dlink,dch-g020-a1)
mtd_get_mac_text "mp" 0x13 > /sys${DEVPATH}/macaddress
;;
dlink,dap-1720-a1)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_ascii devdata "wlan5mac" > /sys${DEVPATH}/macaddress
[ "$PHYNBR" -eq 1 ] && \
macaddr_add "$(mtd_get_mac_ascii devdata wlan24mac)" 1 > /sys${DEVPATH}/macaddress
;;
dlink,dap-2230-a1|\
dlink,dap-3320-a1)
mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dlink,dap-3320-a1|\
dlink,dap-3662-a1)
fixwrgg
;;
dlink,dap-1720-a1|\
dlink,dir-629-a1|\
dlink,dir-859-a1|\
dlink,dir-859-a3|\
Expand Down
13 changes: 13 additions & 0 deletions target/linux/ath79/image/generic.mk
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,19 @@ define Device/dlink_dap-1365-a1
endef
TARGET_DEVICES += dlink_dap-1365-a1

define Device/dlink_dap-1720-a1
$(Device/seama)
SOC := qca9563
DEVICE_VENDOR := D-Link
DEVICE_MODEL := DAP-1720
DEVICE_VARIANT := A1
IMAGE_SIZE := 15872k
DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct \
rssileds
SEAMA_SIGNATURE := wapac28_dlink.2015_dap1720
endef
TARGET_DEVICES += dlink_dap-1720-a1

define Device/dlink_dap-2xxx
IMAGES += factory.img
IMAGE/factory.img := append-kernel | pad-offset 6144k 160 | \
Expand Down

0 comments on commit b021227

Please sign in to comment.