openwrt/target/linux/ath79/dts/ar9344_nec_aterm.dtsi
INAGAKI Hiroshi 7e37a457d4 ath79: add support for NEC Aterm WR8750N
NEC Aterm WR8750N is a 2.4/5 GHz band 11n (Wi-Fi 4) router, based on
AR9344.

Specification:

- SoC             : Atheros AR9344
- RAM             : DDR2 128 MiB (2x Hynix H5PS5162GFR-S6C)
- Flash           : SPI-NOR 8 MiB (Macronix MX25L6406EMI-12G)
- WLAN            : 2.4/5 GHz 2T2R
  - 2.4 GHz       : Atheros AR9344 (SoC)
  - 5 GHz         : Atheros AR9382
- Ethernet        : 5x 10/100/1000 Mbps
  - switch        : Atheros AR8327
- LEDs/Keys (GPIO): 10x/4x
  - note          : all LEDs are controlled by ath9k chip (AR9382)
- UART            : through-hole on PCB
  - assignment    : 3.3V, GND, NC, TX, RX from tri-angle marking
  - settings      : 9600n8
- USB             : 1x USB 2.0 Type-A
  - hub (internal): NEC uPD720114
- Power           : 12 VDC, 1.5 A (Max. 16 W)
- Stock OS        : NetBSD based

Flash instruction using initramfs-factory.bin image (StockFW WebUI):

1. Boot WR8750N with router mode normally
2. Access to the WebUI ("http://aterm.me/" or "http://192.168.0.1/") on
   the device and open firmware update page ("ファームウェア更新")
3. Select the OpenWrt initramfs-factory.bin image and click update
   ("更新") button
4. After updating, the device will be rebooted and booted with OpenWrt
   initramfs image
5. On the initramfs image, upload (or download) uboot.bin and
   sysupgrade.bin image to the device
6. Replace the bootloader with a uboot.bin image

   mtd write <uboot.bin image> bootloader

7. Perform sysupgrade with a sysupgrade.bin image

   sysupgrade <sysupgrade image>

8. Wait ~120 seconds to complete flashing

Flash instruction using initramfs-factory.bin image (bootloader CLI):

 1. Connect and open serial console
 2. Power on WR8750N and interrupt bootloader by ESC key
 3. Login to the bootloader CLI with a password "chiron"
 4. Start TFTP server by "tftpd" command
 5. Upload initramfs-factory.bin via tftp from your computer

   example (Windows): tftp -i 192.168.0.1 PUT initramfs-factory.bin

 6. Boot initramfs image by "boot" command
 7. On the initramfs image, back up the stock bootloader and firmware if
   needed
 8. Upload (or download) uboot.bin and sysupgrade.bin image to the device
 9. Replace the bootloader with a uboot.bin image
10. Perform sysupgrade with a sysupgrade.bin image
11. Wait ~120 seconds to complete flashing

Notes:

- All LEDs are connected to the GPIO controller on the ath9k chip
  (AR9382) and controlled by it. Those LEDs are probed after probing of
  ath9k chip, so they cannot be handled as status LEDs of OpenWrt while
  booting.

- A reset pin of the internal USB hub is connected to the GPIO
  controller of the ath9k chip, like LEDs above. That hub will be
  detected after probing of the ath9k chip.

- The stock bootloader requires an unknown filesystem on firmware area
  in the flash. Booting of OpenWrt from that filesystem cannot be
  handled, so the bootloader needs to be replaced to mainline U-Boot
  before OpenWrt installation.

MAC Addresses:

LAN    : 1C:B1:7F:xx:xx:00 (config,  0x6 (hex))
WAN    : 1C:B1:7F:xx:xx:01 (config,  0xc (hex))
2.4 GHz: 1C:B1:7F:xx:xx:02 (config,  0x0 (hex) / art, 0x1002 (hex))
5 GHz  : 1C:B1:7F:xx:xx:03 (config, 0x12 (hex) / art, 0x5002 (hex))

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15432
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 18:47:56 +02:00

301 lines
5.4 KiB
Plaintext

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include "ar9344.dtsi"
/ {
aliases {
led-running = &led_power_green;
led-upgrade = &led_power_green;
};
chosen {
/*
* don't specify bootargs property in DeviceTree to
* enable a console with a default baudrate (9600)
* or passed console= parameter from the bootloader
*/
/delete-property/ bootargs;
stdout-path = &uart;
};
keys: keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&jtag_disable_pins>;
button-eco {
label = "eco";
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
linux,code = <BTN_0>;
debounce-interval = <60>;
};
switch-ap {
label = "ap";
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
linux,code = <BTN_1>;
debounce-interval = <60>;
};
button-reset {
label = "reset";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
debounce-interval = <60>;
};
button-wps {
label = "wps";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
debounce-interval = <60>;
};
};
ath9k_leds: ath9k-leds {
/* all LEDs are connected to ath9k chip (AR938x) */
compatible = "gpio-leds";
led_power_green: led-0 {
gpios = <&ath9k 0 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_POWER;
default-state = "on";
};
led-1 {
gpios = <&ath9k 1 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_POWER;
};
led-2 {
gpios = <&ath9k 2 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WAN_ONLINE;
};
led-3 {
gpios = <&ath9k 3 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_WAN_ONLINE;
};
led-4 {
gpios = <&ath9k 4 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WLAN_2GHZ;
linux,default-trigger = "phy0tpt";
};
led-5 {
gpios = <&ath9k 5 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_WLAN_2GHZ;
};
led-6 {
gpios = <&ath9k 6 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WLAN_5GHZ;
linux,default-trigger = "phy1tpt";
};
led-7 {
gpios = <&ath9k 7 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_WLAN_5GHZ;
};
led-8 {
gpios = <&ath9k 12 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_GREEN>;
function = "tv";
};
led-9 {
gpios = <&ath9k 13 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_RED>;
function = "tv";
};
};
regulator {
compatible = "regulator-fixed";
regulator-name = "usb-vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpio 20 GPIO_ACTIVE_HIGH>;
enable-active-high;
regulator-always-on;
};
};
&ref {
clock-frequency = <40000000>;
};
&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>;
/*
* since the OEM bootloader requires unknown
* filesystem on firmware area, needs to be
* replaced to u-boot before OpenWrt installation
*/
partition@0 {
label = "bootloader";
reg = <0x000000 0x020000>;
};
/* not compatible with u-boot */
partition@20000 {
label = "config";
reg = <0x020000 0x010000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
macaddr_config_6: macaddr@6 {
reg = <0x6 0x6>;
};
};
};
partition@30000 {
label = "art";
reg = <0x030000 0x010000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
cal_art_5000: calibration@5000 {
reg = <0x5000 0x440>;
};
};
};
};
};
};
&mdio0 {
status = "okay";
phy0: ethernet-phy@0 {
reg = <0>;
qca,ar8327-initvals = <
0x04 0x07a00000 /* PORT0_PAD_MODE_CTRL */
0x08 0x00000000 /* PORT5_PAD_MODE_CTRL */
0x0c 0x00000000 /* PORT6_PAD_MODE_CTRL */
0x10 0x81000080 /* POWER_ON_STRAP */
0x50 0xcf37cf37 /* LED_CTRL0 */
0x54 0x00000000 /* LED_CTRL1 */
0x58 0x00000000 /* LED_CTRL2 */
0x5c 0x03ffff00 /* LED_CTRL3 */
0x7c 0x0000007e /* PORT0_STATUS */
>;
};
};
&eth0 {
status = "okay";
pll-data = <0x06000000 0x00000101 0x00001616>;
phy-mode = "rgmii";
phy-handle = <&phy0>;
nvmem-cells = <&macaddr_config_6>;
nvmem-cell-names = "mac-address";
gmac-config {
device = <&gmac>;
rgmii-gmac0 = <1>;
rxdv-delay = <0>;
rxd-delay = <0>;
txd-delay = <0>;
txen-delay = <0>;
};
};
&gpio {
switch-reset {
gpio-hog;
gpios = <13 GPIO_ACTIVE_HIGH>;
output-high;
};
};
&pcie {
status = "okay";
ath9k: wifi@0,0 {
compatible = "pci168c,0030";
reg = <0x0000 0 0 0 0>;
#gpio-cells = <2>;
gpio-controller;
nvmem-cells = <&cal_art_5000>;
nvmem-cell-names = "calibration";
usb-hub-reset {
gpio-hog;
gpios = <10 GPIO_ACTIVE_HIGH>;
output-high;
};
};
};
&usb_phy {
status = "okay";
};
&usb {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
dr_mode = "host";
/delete-node/ port@1;
/* NEC uPD720114 */
hub@1 {
compatible = "usb0409,005a";
reg = <1>;
};
};
&wmac {
status = "okay";
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};