openwrt/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi
Mauri Sandberg bc356de285 ath79: Add support for Buffalo WZR-HP-G300NH
This device is a wireless router working on 2.4GHz band based on
Qualcom/Atheros AR9132 rev 2 SoC and is accompanied by Atheros AR9103
wireless chip and Realtek RTL8366RB/S switches. Due to two different
switches being used also two different devices are provided.

  Specification:
  - 400 MHz CPU
  - 64 MB of RAM
  - 32 MB of FLASH (NOR)
  - 3x3:2 2.4 GHz 802.11bgn
  - 5x 10/100/1000 Mbps Ethernet
  - 4x LED, 3x button, On/Off slider, Auto/On/Off slider
  - 1x USB 2.0
  - bare UART header place on PCB

  Flash instruction:
  - NOTE: Pay attention to the switch variant and choose the image to
    flash accordingly. (dmesg / kernel logs can tell it)
  - Methods for flashing
    - Apply factory image in OEM firmware web-gui.
    - Sysupgrade on top of existing OpenWRT image
    - U-Boot TFPT recovery for both stock or OpenWRT images:
      The device U-boot contains a TFTP server that by default has
      an address 192.168.11.1 (MAC 02:AA:BB:CC:DD:1A). During the boot
      there is a time window, during which the device allows an image to
      be uploaded from a client with address 192.168.11.2. The image will
      be written on flash automatically.

      1) Have a computer with static IP address 192.168.11.2 and the
         router device switched off.
      2) Connect the LAN port next to the WAN port in the device and the
         computer using a network switch.
      3) Assign IP 192.168.11.1 the MAC address 02:AA:BB:CC:DD:1A
         arp -s 192.168.11.1 02:AA:BB:CC:DD:1A
      4) Initiate an upload using TFTP image variant
         curl -T <imagename> tftp://192.168.11.1
      5) Switch on the device. The image will be uploaded subsequently.
         You can keep an eye on the diag light on the device, it should
         keep on blinking for a while indicating the writing of the image.

  General notes:
  - In the stock firmware the MAC address is the same among all
    interfaces so it is left here that way too.

  Recovery:
  - TFTP method
  - U-boot serial console

  Differences to ar71xx platform
  - This device is split in two different targets now due to hardware
    being a bit different under the hood. Dynamic solution within the same
    image is left for later time.
  - GPIOs for a sliding On/Off switch, marked 'Movie engine' on the device
    cover, were the wrong way around and were renamed qos_on -> movie_off,
    qos_off -> movie_on. Associated key codes remained the same they were.

  The device tree source code is mostly based on musashino's work

Signed-off-by: Mauri Sandberg <sandberg@mailfence.com>
2021-03-22 09:23:10 +01:00

250 lines
4.1 KiB
Plaintext

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ar9132.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
aliases {
led-boot = &led_diag;
led-failsafe = &led_security;
led-upgrade = &led_diag;
};
clock40mhz: ref {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <40000000>;
};
gpio2: gpio-extender {
compatible = "nxp,74hc153-gpio";
gpio-controller;
#gpio-cells = <2>;
// GPIOs used by this node
gpio-s0 = <&gpio 9 GPIO_ACTIVE_HIGH>;
gpio-s1 = <&gpio 11 GPIO_ACTIVE_HIGH>;
gpio-1y = <&gpio 12 GPIO_ACTIVE_HIGH>;
gpio-2y = <&gpio 14 GPIO_ACTIVE_HIGH>;
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
aoss {
label = "aoss";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
router_on {
label = "router_on";
linux,code = <BTN_5>;
gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
debounce-interval = <60>;
};
movie_off {
label = "movie_off";
linux,code = <BTN_3>;
gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;
debounce-interval = <60>;
};
usb {
label = "usb";
linux,code = <BTN_2>;
gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
router_auto {
label = "router_auto";
linux,code = <BTN_6>;
gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>;
debounce-interval = <60>;
};
movie_on {
label = "movie_on";
linux,code = <BTN_4>;
gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>;
debounce-interval = <60>;
};
};
flash@1e000000 {
compatible = "cfi-flash";
reg = <0x1e000000 0x2000000>;
bank-width = <2>;
device-width = <2>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0000000 0x0040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x0040000 0x0020000>;
read-only;
};
partition@60000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x0060000 0x1f60000>;
};
partition@1fc0000 {
label = "user_property";
reg = <0x1fc0000 0x0020000>;
read-only;
};
art: partition@1fe0000 {
label = "art";
reg = <0x1fe0000 0x020000>;
read-only;
};
};
};
leds {
compatible = "gpio-leds";
usb {
label = "blue:usb";
gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
trigger-sources = <&hub_port>;
linux,default-trigger = "usbport";
};
led_diag: diag {
label = "red:diag";
gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
};
wireless {
label = "green:wireless";
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
led_security: security {
label = "amber:security";
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
};
router {
label = "green:router";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
};
};
switch: switch {
status = "disabled";
gpio-sda = <&gpio 19 GPIO_ACTIVE_HIGH>;
gpio-sck = <&gpio 20 GPIO_ACTIVE_HIGH>;
mii-bus = <&mdio0>;
mdio-bus {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
phy-mask = <0x10>;
phy4: ethernet-phy@4 {
reg = <4>;
phy-mode = "rgmii";
};
};
};
};
&mdio0 {
status = "okay";
};
&eth0 {
status = "disabled";
phy-mode = "rgmii";
mtd-mac-address = <&art 0x1120c>;
fixed-link {
speed = <1000>;
full-duplex;
};
};
&mdio1 {
status = "okay";
};
&eth1 {
status = "disabled";
compatible = "qca,ar9130-eth", "syscon";
reg = <0x1a000000 0x200
0x18070004 0x4>;
pll-reg = <0x4 0x18 22>;
pll-handle = <&pll>;
phy-mode = "rgmii";
phy-handle = <&phy4>;
resets = <&rst 13>;
reset-names = "mac";
qca,mac-idx = <1>;
mtd-mac-address = <&art 0x1120c>;
};
&wmac {
status = "okay";
mtd-cal-data = <&art 0x11000>;
};
&uart {
status = "okay";
};
&pll {
clocks = <&clock40mhz>;
};
&usb {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
hub_port: port@1 {
reg = <1>;
#trigger-source-cells = <0>;
};
};
&usb_phy {
status = "okay";
};