Skip to content

Commit

Permalink
mpc85xx: add support for Enterasys WS-AP3715i
Browse files Browse the repository at this point in the history
Hardware
--------

SoC:   NXP P1010 (1x e500 @ 800MHz)
RAM:   256M DDR3 (2x Samsung K4B1G1646G-BCH9)
FLASH: 32M NOR (Spansion S25FL256S)
BTN:   1x Reset
WiFi:  1x Atheros AR9590 2.4 bgn 3x3
       2x Atheros AR9590 5.0 an 3x3
ETH:   2x Gigabit Ethernet (Atheros AR8033 / AR8035)
UART:  115200 8N1 (RJ-45 Cisco)

Installation
------------
1. Grab the OpenWrt initramfs, rename it to ap3715.bin. Place it in
   the root directory of a TFTP server and serve it at
   192.168.1.66/24.

2. Connect to the serial port and boot the AP. Stop autoboot in U-Boot
   by pressing Enter when prompted. Credentials are identical to the one
   in the APs interface. By default it is admin / new2day.

3. Alter the bootcmd in U-Boot:

 $ setenv ramboot_openwrt "setenv ipaddr 192.168.1.1;
   setenv serverip 192.168.1.66; tftpboot 0x2000000 ap3715.bin; bootm"

 $ setenv boot_openwrt "sf probe 0; sf read 0x2000000 0x140000 0x1000000;
   bootm 0x2000000"

 $ setenv bootcmd "run boot_openwrt"

 $ saveenv

4. Boot the initramfs image

 $ run ramboot_openwrt

5. Transfer the OpenWrt sysupgrade image to the AP using SCP. Install
   using sysupgrade.

 $ sysupgrade -n <path-to-sysupgrade.bin>

Signed-off-by: David Bauer <mail@david-bauer.net>
  • Loading branch information
blocktrron committed Apr 8, 2023
1 parent f058dad commit 765f668
Show file tree
Hide file tree
Showing 13 changed files with 511 additions and 2 deletions.
4 changes: 4 additions & 0 deletions package/boot/uboot-envtools/files/mpc85xx
Expand Up @@ -8,6 +8,10 @@ touch /etc/config/ubootenv
board=$(board_name)

case "$board" in
enterasys,ws-ap3715i)
ubootenv_add_uci_config "$(find_mtd_part 'cfg1')" "0x0" "0x10000" "0x10000"
ubootenv_add_uci_config "$(find_mtd_part 'cfg2')" "0x0" "0x10000" "0x10000"
;;
extreme-networks,ws-ap3825i)
ubootenv_add_uci_config "$(find_mtd_part 'cfg1')" "0x0" "0x10000" "0x20000"
ubootenv_add_uci_config "$(find_mtd_part 'cfg2')" "0x0" "0x10000" "0x20000"
Expand Down
1 change: 1 addition & 0 deletions target/linux/mpc85xx/base-files/etc/board.d/01_leds
Expand Up @@ -8,6 +8,7 @@ boardname="${board##*,}"
board_config_update

case $board in
enterasys,ws-ap3715i|\
extreme-networks,ws-ap3825i)
ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth1"
ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth0"
Expand Down
3 changes: 2 additions & 1 deletion target/linux/mpc85xx/base-files/etc/board.d/02_network
Expand Up @@ -9,7 +9,8 @@ board_config_update
board=$(board_name)

case "$board" in
aerohive,hiveap-330)
aerohive,hiveap-330|\
enterasys,ws-ap3715i)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
ocedo,panda)
Expand Down
Expand Up @@ -12,6 +12,10 @@ PHYNBR=${DEVPATH##*/phy}
board=$(board_name)

case "$board" in
enterasys,ws-ap3715i)
[ "$PHYNBR" -eq 0 ] && mtd_get_mac_ascii cfg2 RADIOADDR1 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" -eq 1 ] && mtd_get_mac_ascii cfg2 RADIOADDR0 > /sys${DEVPATH}/macaddress
;;
enterasys,ws-ap3710i|\
extreme-networks,ws-ap3825i)
mtd_get_mac_ascii cfg2 RADIOADDR${PHYNBR} > /sys${DEVPATH}/macaddress
Expand Down
Expand Up @@ -3,6 +3,7 @@

preinit_set_mac_address() {
case $(board_name) in
enterasys,ws-ap3715i|\
extreme-networks,ws-ap3825i)
ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr)
ip link set dev eth1 address $(mtd_get_mac_ascii cfg1 eth1addr)
Expand Down
1 change: 1 addition & 0 deletions target/linux/mpc85xx/config-5.15
Expand Up @@ -262,6 +262,7 @@ CONFIG_VDSO32=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_WATCHDOG_CORE=y
# CONFIG_WS_AP3710I is not set
# CONFIG_WS_AP3715I is not set
# CONFIG_WS_AP3825I is not set
# CONFIG_XES_MPC85xx is not set
CONFIG_XZ_DEC_BCJ=y
Expand Down
293 changes: 293 additions & 0 deletions target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3715i.dts
@@ -0,0 +1,293 @@
// SPDX-License-Identifier: GPL-2.0-or-later or MIT

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

/include/ "fsl/p1010si-pre.dtsi"

/ {
model = "Enterasys WS-AP3715i";
compatible = "enterasys,ws-ap3715i";

aliases {
led-boot = &led_power_green;
led-failsafe = &led_power_red;
led-running = &led_power_green;
led-upgrade = &led_power_red;
label-mac-device = &enet0;
};

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

memory {
device_type = "memory";
reg = <0x0 0x0 0x0 0x10000000>;
};

leds {
compatible = "gpio-leds";

wifi1 {
gpios = <&spi_gpio 3 GPIO_ACTIVE_HIGH>;
label = "green:radio1";
linux,default-trigger = "phy1tpt";
};

wifi2 {
gpios = <&spi_gpio 2 GPIO_ACTIVE_HIGH>;
label = "green:radio2";
linux,default-trigger = "phy0tpt";
};

led_power_green: power_green {
gpios = <&spi_gpio 0 GPIO_ACTIVE_HIGH>;
label = "green:power";
};

led_power_red: power_red {
gpios = <&spi_gpio 1 GPIO_ACTIVE_HIGH>;
label = "red:power";
};

lan1_red {
gpios = <&spi_gpio 6 GPIO_ACTIVE_HIGH>;
label = "red:lan1";
};

lan1_green {
gpios = <&spi_gpio 4 GPIO_ACTIVE_HIGH>;
label = "green:lan1";
};

lan2_red {
gpios = <&spi_gpio 7 GPIO_ACTIVE_HIGH>;
label = "red:lan2";
};

lan2_green {
gpios = <&spi_gpio 5 GPIO_ACTIVE_HIGH>;
label = "green:lan2";
};
};

soc: soc@ffe00000 {
ranges = <0x0 0x0 0xffe00000 0x100000>;

gpio0: gpio-controller@fc00 {
};

usb@22000 {
status = "disabled";
};

mdio@24000 {
phy0: ethernet-phy@0 {
reg = <0x1>;
};

phy2: ethernet-phy@2 {
reg = <0x2>;
};
};

mdio@25000 {
tbi_phy: tbi-phy@11 {
reg = <0x11>;
};
};

mdio@26000 {
status = "disabled";
};

enet0: ethernet@b0000 {
phy-handle = <&phy0>;
phy-connection-type = "rgmii-id";

label = "lan1";
};

enet1: ethernet@b1000 {
phy-handle = <&phy2>;
phy-connection-type = "sgmii";

tbi-handle = <&tbi_phy>;

label = "lan2";
};

enet2: ethernet@b2000 {
status = "disabled";
};

sdhc@2e000 {
status = "disabled";
};
};

ifc: ifc@ffe1e000 {
};

pci0: pcie@ffe09000 {
reg = <0 0xffe09000 0 0x1000>;
ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
pcie@0 {
ranges = <0x2000000 0x0 0xa0000000
0x2000000 0x0 0xa0000000
0x0 0x20000000

0x1000000 0x0 0x0
0x1000000 0x0 0x0
0x0 0x100000>;

wifi@0,0,0 {
compatible = "pci168c,0033";
reg = <0x0 0 0 0 0>;
ieee80211-freq-limit = <2400000 2500000>;
};
};
};

pci1: pcie@ffe0a000 {
reg = <0 0xffe0a000 0 0x1000>;
ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
pcie@0 {
ranges = <0x2000000 0x0 0x80000000
0x2000000 0x0 0x80000000
0x0 0x20000000

0x1000000 0x0 0x0
0x1000000 0x0 0x0
0x0 0x100000>;

wifi@0,0,0 {
compatible = "pci168c,0033";
reg = <0x0 0 0 0 0>;
ieee80211-freq-limit = <5000000 6000000>;
};
};
};
};

&soc {
led_spi {
compatible = "spi-gpio";
#address-cells = <1>;
#size-cells = <0>;

sck-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
mosi-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
num-chipselects = <0>;

spi_gpio: led_gpio@0 {
compatible = "fairchild,74hc595";
reg = <0>;
gpio-controller;
#gpio-cells = <2>;
registers-number = <1>;
spi-max-frequency = <100000>;
};
};

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

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

partition@0 {
reg = <0x0 0xa0000>;
label = "boot-bak";
read-only;
};

partition@a0000 {
reg = <0xa0000 0xa0000>;
label = "boot-pri";
read-only;
};

partition@120000 {
reg = <0x120000 0x10000>;
label = "cfg1";
read-only;
};

partition@130000 {
reg = <0x130000 0x10000>;
label = "cfg2";
read-only;
};

partition@140000 {
compatible = "denx,uimage";
reg = <0x140000 0x1d80000>;
label = "firmware";
};

partition@1ec0000 {
reg = <0x1ec0000 0x100000>;
label = "nvram";
read-only;
};
};
};
};
};

/include/ "fsl/p1010si-post.dtsi"

/ {
cpus {
PowerPC,P1010@0 {
bus-frequency = <399999996>;
timebase-frequency = <50000000>;
clock-frequency = <799999992>;
d-cache-block-size = <0x20>;
d-cache-size = <0x8000>;
d-cache-sets = <0x80>;
i-cache-block-size = <0x20>;
i-cache-size = <0x8000>;
i-cache-sets = <0x80>;
};
};

soc@ffe00000 {
bus-frequency = <399999996>;

serial@4600 {
clock-frequency = <399999996>;
status = "disabled";
};

serial@4500 {
clock-frequency = <399999996>;
};

pic@40000 {
clock-frequency = <399999996>;
};
};
};

/*
* For the OpenWrt 22.03 release, since Linux 5.10.138 now uses
* aliases to determine PCI domain numbers, drop aliases so as not to
* change the sysfs path of our wireless netdevs.
*/

/ {
aliases {
/delete-property/ pci0;
/delete-property/ pci1;
};
};

0 comments on commit 765f668

Please sign in to comment.