Skip to content
Permalink
Browse files

ath79: add support for Logitec LAN-W451NGR

  • Loading branch information...
musashino205 committed Dec 21, 2018
1 parent 0dd7329 commit 740603f536a0d7469d4ce6727015d23812ba7925
@@ -53,6 +53,7 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
;;
logitec,lan-w451ngr|\
buffalo,bhr-4grv|\
buffalo,wzr-hp-g450h)
ucidef_add_switch "switch0" \
@@ -313,6 +314,10 @@ ath79_setup_macs()
wan_mac=$(fconfig -s -r -d $(find_mtd_part "RedBoot config") -n alias/ethaddr)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
logitec,lan-w451ngr)
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
lan_mac=$(macaddr_add "$wan_mac" -6)
;;
nec,wg800hp)
lan_mac=$(mtd_get_mac_text board_data 640)
wan_mac=$(mtd_get_mac_text board_data 1152)
@@ -151,6 +151,10 @@ case "$FIRMWARE" in
ath9k_eeprom_extract "art" 20480 1088
ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_text "mac" 24) 1) 2
;;
logitec,lan-w451ngr)
ath9k_eeprom_extract "ART" 4096 1088
ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env wanaddr) -1) 2
;;
ocedo,raccoon|\
tplink,tl-wdr3600|\
tplink,tl-wdr4300|\
@@ -0,0 +1,183 @@
// 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 "ar7242.dtsi"

/ {
compatible = "logitec,lan-w451ngr", "qca,ar7242";
model = "Logitec LAN-W451NGR";

aliases {
led-boot = &wps;
led-failsafe = &wps;
led-upgrade = &wps;
};

extosc: ref {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <40000000>;
};

keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;

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

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

/* slide-switch GPIO not found */
};

leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&i2s_bitclk_disable_pin>;

wps: wps {
label = "lan-w451ngr:red:wps";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};
};

ath9k-leds {
compatible = "gpio-leds";

wlan {
label = "lan-w451ngr:blue:wlan";
gpios = <&ath9k 0 GPIO_ACTIVE_LOW>;
};
};
};

&spi {
status = "okay";
num-cs = <1>;

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

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

partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};

partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
// read-only;
};

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

partition@80000 {
label = "COMPCS";
reg = <0x080000 0x010000>;
// read-only;
};

partition@90000 {
label = "COMPDS";
reg = <0x090000 0x010000>;
// read-only;
};

partition@a0000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x0a0000 0x740000>;
};

partition@7e0000 {
label = "NVRAM";
reg = <0x7e0000 0x010000>;
read-only;
};

partition@7f0000 {
label = "ART";
reg = <0x7f0000 0x010000>;
read-only;
};
};
};
};

&mdio0 {
status = "okay";

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

qca,ar8327-initvals = <
0x04 0x07600000 /* PORT0 PAD MODE CTRL */
0x50 0xffb7ffb7 /* LED_CTRL0 */
0x54 0xffb7ffb7 /* LED_CTRL1 */
0x58 0xffb7ffb7 /* LED_CTRL2 */
0x5c 0x03ffff00 /* LED_CTRL3 */
0x7c 0x0000007e /* PORT0_STATUS */
>;
};
};

&eth0 {
status = "okay";

pll-data = <0x1c000000 0x00000101 0x00001616>;

phy-mode = "rgmii";
phy-handle = <&phy0>;
};

&pinmux {
i2s_bitclk_disable_pin: pinmux_i2s_bitclk_disable_pin {
pinctrl-single,bits = <0x0 0x0 0x40>;
};
};

&pcie {
status = "okay";

ath9k: wifi@0,0 {
compatible = "pci168c,0030";
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
#gpio-cells = <2>;
gpio-controller;
};
};

&pll {
clocks = <&extosc>;
};

&uart {
status = "okay";
};
@@ -12,6 +12,13 @@ define Device/buffalo_whr-g301n
endef
TARGET_DEVICES += buffalo_whr-g301n

define Device/logitec_lan-w451ngr
ATH_SOC := ar7242
DEVICE_TITLE := Logitec LAN-W451NGR
IMAGE_SIZE := 7744k
endef
TARGET_DEVICES += logitec_lan-w451ngr

define Device/pqi_air-pen
ATH_SOC := ar9330
DEVICE_TITLE := PQI Air-Pen

0 comments on commit 740603f

Please sign in to comment.
You can’t perform that action at this time.