[OpenWrt-Devel] [PATCH v2 3/3] ath79: add support for D-Link DAP-2695-A1

mail at adrianschmutzler.de mail at adrianschmutzler.de
Wed Jun 10 19:40:25 EDT 2020


Hi,

a few minor comments below.

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> On Behalf Of Stijn Tintel
> Sent: Mittwoch, 10. Juni 2020 22:15
> To: openwrt-devel at lists.openwrt.org
> Cc: mail at adrianschmutzler.de
> Subject: [OpenWrt-Devel] [PATCH v2 3/3] 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.

I liked the comment about the MAC addresses that was in the commit message before. While I see that you have adjusted the addresses based on our discussion, the fact that three of them are the same is quite helpful for somebody looking things up, so I would add it back here, e.g.

"
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 <stijn at linux-ipv6.be>
> ---
>  .../ath79/dts/qca9558_dlink_dap-2695-a1.dts   | 178 ++++++++++++++++++
>  .../generic/base-files/etc/board.d/02_network |   6 +
>  .../etc/hotplug.d/firmware/10-ath9k-eeprom    |   4 +
>  .../etc/hotplug.d/firmware/11-ath10k-caldata  |   4 +
>  .../etc/uci-defaults/09_fix-checksum          |   8 +
>  .../base-files/lib/preinit/10_fix_eth_mac.sh  |   4 +
>  target/linux/ath79/image/generic.mk           |  33 ++++
>  7 files changed, 237 insertions(+)
>  create mode 100644 target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
> 
> diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
> b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
> new file mode 100644
> index 0000000000..8d8c796ed8
> --- /dev/null
> +++ b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
> @@ -0,0 +1,178 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/;
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
> +
> +#include "qca955x.dtsi"
> +
> +/ {
> +	compatible = "dlink,dap-2695-a1", "qca,qca9557";
> +	model = "D-link DAP-2695-A1";
> +
> +	chosen {
> +		bootargs = "console=ttyS0,115200n8";
> +	};
> +
> +	aliases {
> +		led-boot = &led_power_red;
> +		led-failsafe = &led_power_red;
> +		led-running = &led_power_green;
> +		led-upgrade = &led_power_red;
> +	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +
> +		led_power_green: power_green {
> +			label = "d-link:green:power";
> +			gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
> +			default-state = "on";
> +		};
> +
> +		led_power_red: power_red {
> +			label = "d-link:red:power";
> +			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
> +		};
> +
> +		wifi2g {
> +			label = "d-link:green:wifi2g";
> +			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
> +			linux,default-trigger = "phy1tpt";
> +		};
> +	};
> +
> +	keys {
> +		compatible = "gpio-keys";
> +		#address-cells = <1>;
> +		#size-cells = <0>;

I think address-cells and size-cells can be just dropped here.

> +
> +		reset at 0 {

Based on the common use in ath79, this would be just "reset" instead of reset at 0 (like for the LEDs).

> +			label = "reset";
> +			linux,code = <KEY_RESTART>;
> +			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +};
> +
> +&spi {
> +	status = "okay";
> +	num-cs = <1>;
> +
> +	flash at 0 {
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		compatible = "mx25l12805d";
> +		reg = <0>;
> +		spi-max-frequency = <25000000>;
> +		partitions {
> +

The empty line was supposed to be _before_ "partitions {", not after, so the block is visually separated. :-)

Best

Adrian 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20200611/e7da760d/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list