Skip to content

Commit

Permalink
[WIP] ath79: add support for Ruckus R500
Browse files Browse the repository at this point in the history
Ruckus R500 datasheet: https://webresources.ruckuswireless.com/datasheets/r500/ds-ruckus-r500.html

Specifications:

SoC: 720Mhz QCA9558
RAM: 256MB
Storage: 64MB of FLASH (SPI NOR - S25FL512S)
1x AR8327 GB switch
Ethernet: 1x1000M (802.11), port openwrt#3 on AR8327,
          1x1000M (802.11at POE), port openwrt#5 on AR8327
Wireless: QCA988X HW2.0 802.11ac
AR9550 2.4GHz 802.11b/g/n
5x GPIO LED
1x GPIO Reset Button
1x DC Jack 12v
1x UART, 3.3v, 115200

MAC addresses:
 1. art 0x807E | Factory bridged | f0:3e:90:XX:XX:80 | - on label - not in use in OpenWRT
 2. art 0x66   | eth0            | f0:3e:90:XX:XX:83 | (port 5, cpu port 6) - PoE port
 3. art 0x6c   | eth1            | f0:3e:90:XX:XX:84 | (port 3, cpu port 0) - non PoE port

Installation:

Serial Port/TFTP

 1. Setup tftp server on the local network
 2. Connect to UART with TTL
 3. Interupt uboot process with Ctrl-C
 4. Setup appropriate ipaddr and serverip in setenv:
	a) setenv ipaddr 192.168.1.1
	b) setenv serverip 192.168.1.2
 5. On TFTP Server - copy openwrt-ath79-generic-ruckus_r500-initramfs-kernel.bin to /srv/tftp/1600000A.img
 6. On R500 boot into initrd image
	a) tftpboot
	b) bootm
 7. On TFTP server - scp openwrt-ath79-generic-ruckus_r500-squashfs-sysupgrade.bin [email protected]:/tmp
 8. On R500 - sysupgrade /tmp/openwrt-ath79-generic-ruckus_r500-squashfs-sysupgrade.bin

This patch adapted from https://github.com/victhor393/openwrt-ruckus-r500/tree/ruckus-r500-master

Signed-off-by: Damien Mascord <[email protected]>

- Refactored MAC and calibration data setups to use nvmem-layout
- Switched LAN interface to be the PoE (primary) port
- Enable lzma-loader for compressed initramfs
- Enabled the optional internal USB port

TODO:
- Identify GPIOs for other LEDs and set pinctrl accordingly
- Add the shift registers for controlling beamforming antennas
- Add the bit-banged I²C bus used for onboard TPM
- Refactor boot scheme and flash layout
- Exclude the reserved memory region at top of RAM used for
  communication with bootloader

Signed-off-by: Lech Perczak <[email protected]>
  • Loading branch information
dmascord authored and Leo-PL committed Nov 9, 2024
1 parent 8b61054 commit abd22ac
Show file tree
Hide file tree
Showing 3 changed files with 299 additions and 0 deletions.
277 changes: 277 additions & 0 deletions target/linux/ath79/dts/qca9557_ruckus_r500.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "qca955x.dtsi"

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

/ {
compatible = "ruckus,r500", "qca,qca9557";
model = "Ruckus R500";

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

chosen {
bootargs = "console=ttyS0,115200n8";
};

leds {
compatible = "gpio-leds";

led_power: power {
label = "red:power";
gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
default-state = "on";
};

// DIR (Zone Director) LED - Indicates Zone director connection status
dir {
label = "green:dir";
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
};

// AIR (Signal/Air Quality) LED - Indicates uplink status and the quality of the wireless signal to the uplink AP
air {
label = "green:air";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
};

wlan5g_green {
label = "green:wlan5g";
gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};

wlan5g_orange {
label = "orange:wlan5g";
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
};

};

keys {
compatible = "gpio-keys";

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

};

/*
beamforming-2g-spi {
compatible = "spi-gpio";
mosi-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
sck-gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
num-chipselects = <0>;
#address-cells = <1>;
#size-cells = <0>;

beamforming-2g-gpio@0 {
compatible = "fairchild,74hc595";
reg = <0>;
registers-number = <1>;
spi-max-frequency = <24000000>;
gpio-controller;
#gpio-cells = <2>;
};
};

beamforming-5g-spi {
compatible = "spi-gpio";
mosi-gpios = <&ath9k 15 GPIO_ACTIVE_HIGH>;
sck-gpios = <&ath9k 14 GPIO_ACTIVE_HIGH>;
num-chipselects = <0>;
#address-cells = <1>;
#size-cells = <0>;

beamforming-5g-gpio@0 {
compatible = "fairchild,74hc595";
reg = <0>;
registers-number = <1>;
spi-max-frequency = <24000000>;
gpio-controller;
#gpio-cells = <2>;
};
};
*/
};

&spi {
status = "okay";

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

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

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

partition@100000 {
label = "u-boot-env";
reg = <0x0100000 0x40000>;
};

board_data: partition@140000 {
label = "board-data";
reg = <0x0140000 0x80000>;
read-only;
};

partition@1c0000 {
label = "config-data";
reg = <0x01c0000 0x640000>;
read-only;
};

partition@800000 {
compatible = "openwrt,uimage", "denx,uimage";
label = "firmware";
openwrt,offset = <0xA0>;
openwrt,partition-magic = <0x52434B53>;
reg = <0x0800000 0x1800000>;
};

partition@2000000 {
label = "firmware-backup";
reg = <0x2000000 0x1800000>;
};

partition@3800000 {
label = "backup-config-data";
reg = <0x3800000 0x300000>;
read-only;
};

partition@3B00000 {
label = "reserved-space";
reg = <0x3B00000 0x500000>;
read-only;
};
};
};
};

&mdio0 {
status = "okay";

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

qca,ar8327-initvals = <
0x04 0x00080080 /* PORT0 PAD MODE CTRL */
0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
0x7c 0x0000007e /* PORT0_STATUS */
0x94 0x0000007e /* PORT6 STATUS */
>;
};
};

&eth0 {
status = "okay";

nvmem-cells = <&macaddr_board_data_66>;
nvmem-cell-names = "mac-address";
pll-data = <0x96000000 0x00000101 0x00001616>;

phy-handle = <&phy0>;
};

&eth1 {
status = "okay";

nvmem-cells = <&macaddr_board_data_6c>;
nvmem-cell-names = "mac-address";
pll-data = <0x03000101 0x00000101 0x00001616>;

fixed-link {
speed = <1000>;
full-duplex;
};
};

&pcie0 {
status = "okay";

wifi@0,0 {
compatible = "pci168c,003c";
reg = <0x0000 0 0 0 0>;
gpio-controller;
#gpio-cells = <2>;

nvmem-cells = <&macaddr_board_data_76>, <&cal_board_data_45000>;
nvmem-cell-names = "mac-address", "calibration";
};
};

&wmac {
status = "okay";

nvmem-cells = <&macaddr_board_data_60>, <&cal_board_data_41000>;
nvmem-cell-names = "mac-address", "calibration";
};

&usb_phy0 {
status = "okay";
};

&usb0 {
status = "okay";
};

&usb_phy1 {
status = "okay";
};

&usb1 {
status = "okay";
};

&board_data {
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;

macaddr_board_data_60: macaddr@60 {
reg = <0x60 0x6>;
};

macaddr_board_data_66: macaddr@66 {
reg = <0x66 0x6>;
};

macaddr_board_data_6c: macaddr@6c {
reg = <0x6c 0x6>;
};

macaddr_board_data_76: macaddr@76 {
reg = <0x76 0x6>;
};

cal_board_data_41000: cal@41000 {
reg = <0x41000 0x440>;
};

cal_board_data_45000: cal@45000 {
reg = <0x45000 0x844>;
};
};
};
5 changes: 5 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 @@ -491,6 +491,10 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0u@eth1" "4:lan:1" "3:lan:2" "2:lan:3" "1:lan:4"
;;
ruckus,r500)
ucidef_add_switch "switch0" \
"6@eth0" "5:lan" "0@eth1" "3:wan"
;;
teltonika,rut955|\
teltonika,rut955-h7v3c0)
ucidef_set_interface_wan "eth1"
Expand Down Expand Up @@ -800,6 +804,7 @@ ath79_setup_macs()
wan_mac=$(mtd_get_mac_binary factory 0x0)
lan_mac=$(macaddr_setbit_la "$wan_mac")
;;
ruckus,r500|\
ruckus,zf7025|\
ruckus,zf7321|\
ruckus,zf7341|\
Expand Down
17 changes: 17 additions & 0 deletions target/linux/ath79/image/generic.mk
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ define Build/pisen_wmb001n-factory
rm -rf "$@.tmp"
endef

define Build/ruckus_fw_header
$(STAGING_DIR_HOST)/bin/ruckus_fw_header -i $@ -o $@.out
mv -f $@.out $@
endef

define Build/teltonika-fw-fake-checksum
# Teltonika U-Boot web based firmware upgrade/recovery routine compares
# 16 bytes from md5sum1[16] field in TP-Link v1 header (offset: 76 bytes
Expand Down Expand Up @@ -2858,6 +2863,18 @@ define Device/ruckus_zf7372
endef
TARGET_DEVICES += ruckus_zf7372

define Device/ruckus_r500
$(Device/ruckus_common)
SOC := qca9557
DEVICE_MODEL := R500
IMAGE_SIZE := 24576k
BLOCKSIZE := 256k
DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
KERNEL := kernel-bin | append-dtb | lzma-no-dict | uImage lzma | ruckus_fw_header
KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | uImage none
endef
TARGET_DEVICES += ruckus_r500

define Device/samsung_wam250
SOC := ar9344
DEVICE_VENDOR := Samsung
Expand Down

0 comments on commit abd22ac

Please sign in to comment.