From 5a7d11fb78f647078e276f88ef30d88d3be79c04 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 22 May 2020 18:26:29 +0200 Subject: [PATCH 1/6] bcm63xx: replace further "ok" with "okay" in DTS files While "ok" is recognized in DT parsing, only "okay" is actually mentioned as valid value. Replace it accordingly. Signed-off-by: Adrian Schmutzler --- target/linux/bcm63xx/dts/bcm63169-comtrend-vg-8050.dts | 4 ++-- target/linux/bcm63xx/dts/bcm6328-sercomm-ad1018.dts | 4 ++-- target/linux/bcm63xx/dts/bcm6362-huawei-hg253s-v2.dts | 6 +++--- target/linux/bcm63xx/dts/bcm6362-netgear-dgnd3700-v2.dts | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/target/linux/bcm63xx/dts/bcm63169-comtrend-vg-8050.dts b/target/linux/bcm63xx/dts/bcm63169-comtrend-vg-8050.dts index 4f54e9c842..93a1cb8fa1 100644 --- a/target/linux/bcm63xx/dts/bcm63169-comtrend-vg-8050.dts +++ b/target/linux/bcm63xx/dts/bcm63169-comtrend-vg-8050.dts @@ -45,7 +45,7 @@ }; &leds { - status = "ok"; + status = "okay"; brcm,serial-leds; brcm,serial-dat-low; brcm,serial-shift-inv; @@ -194,5 +194,5 @@ }; &uart0 { - status = "ok"; + status = "okay"; }; diff --git a/target/linux/bcm63xx/dts/bcm6328-sercomm-ad1018.dts b/target/linux/bcm63xx/dts/bcm6328-sercomm-ad1018.dts index 7f9a6e2698..440c653dca 100644 --- a/target/linux/bcm63xx/dts/bcm6328-sercomm-ad1018.dts +++ b/target/linux/bcm63xx/dts/bcm6328-sercomm-ad1018.dts @@ -52,7 +52,7 @@ }; &leds { - status = "ok"; + status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_leds &pinctrl_serial_led @@ -206,5 +206,5 @@ }; &uart0 { - status = "ok"; + status = "okay"; }; diff --git a/target/linux/bcm63xx/dts/bcm6362-huawei-hg253s-v2.dts b/target/linux/bcm63xx/dts/bcm6362-huawei-hg253s-v2.dts index 6b6cbe4170..e198ea2740 100644 --- a/target/linux/bcm63xx/dts/bcm6362-huawei-hg253s-v2.dts +++ b/target/linux/bcm63xx/dts/bcm6362-huawei-hg253s-v2.dts @@ -63,7 +63,7 @@ }; &leds { - status = "ok"; + status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_leds>; @@ -129,7 +129,7 @@ }; &nflash { - status = "ok"; + status = "okay"; nandcs@0 { compatible = "brcm,nandcs"; @@ -174,5 +174,5 @@ }; &uart0 { - status = "ok"; + status = "okay"; }; diff --git a/target/linux/bcm63xx/dts/bcm6362-netgear-dgnd3700-v2.dts b/target/linux/bcm63xx/dts/bcm6362-netgear-dgnd3700-v2.dts index 07e5c1eff8..e3c344f5eb 100644 --- a/target/linux/bcm63xx/dts/bcm6362-netgear-dgnd3700-v2.dts +++ b/target/linux/bcm63xx/dts/bcm6362-netgear-dgnd3700-v2.dts @@ -143,7 +143,7 @@ }; &nflash { - status = "ok"; + status = "okay"; nandcs@0 { compatible = "brcm,nandcs"; @@ -212,5 +212,5 @@ }; &uart0 { - status = "ok"; + status = "okay"; }; From e3e17b4ed44a7855ff3fe3f6270fd47a3ca70567 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 21 May 2020 19:41:41 +0200 Subject: [PATCH 2/6] bcm63xx: use model part of board name as variable in 01_leds This extracts the model part of the board name and uses it for the LED string identifiers in 01_leds. As this makes statements more generic, it will allow to merge more cases in the future. Signed-off-by: Adrian Schmutzler --- .../bcm63xx/base-files/etc/board.d/01_leds | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds index bfddcb69c4..907a425d16 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds @@ -7,7 +7,10 @@ board_config_update -case "$(board_name)" in +board=$(board_name) +model="${board##*,}" + +case "$board" in actiontec,r1000h) ucidef_set_led_usbport "usb" "USB" "R1000H:green:usb" "usb1-port1" "usb2-port1" ;; @@ -30,8 +33,9 @@ bt,home-hub-2-a) comtrend,ar-5315u) ucidef_set_led_usbdev "usb" "USB" "AR-5315u:green:usb" "1-1" ;; -comtrend,vr-3032u) - ucidef_set_led_usbdev "usb" "USB" "vr-3032u:green:usb" "1-1" +comtrend,vr-3032u|\ +huawei,hg253s-v2) + ucidef_set_led_usbdev "usb" "USB" "$model:green:usb" "1-1" ;; huawei,echolife-hg553) ucidef_set_led_netdev "lan" "LAN" "HW553:blue:lan" "eth0" @@ -50,9 +54,6 @@ huawei,echolife-hg622) huawei,echolife-hg655b) ucidef_set_led_usbdev "usb" "USB" "HW65x:green:usb" "1-2" ;; -huawei,hg253s-v2) - ucidef_set_led_usbdev "usb" "USB" "hg253s-v2:green:usb" "1-1" - ;; inventel,livebox-1) ucidef_set_led_netdev "lan" "LAN" "Livebox1:red:traffic" "eth0" ucidef_set_led_netdev "wan" "WAN" "Livebox1:red:adsl" "eth1" @@ -67,9 +68,9 @@ netgear,dgnd3700-v1) ucidef_set_led_usbdev "usb2" "USB2" "DGND3700v1_3800B:green:usb-front" "1-2" ;; netgear,dgnd3700-v2) - ucidef_set_led_netdev "lan" "LAN" "dgnd3700-v2:green:ethernet" "eth0" - ucidef_set_led_usbdev "usb1" "USB1" "dgnd3700-v2:green:usb1" "1-1" - ucidef_set_led_usbdev "usb2" "USB2" "dgnd3700-v2:green:usb2" "1-2" + ucidef_set_led_netdev "lan" "LAN" "$model:green:ethernet" "eth0" + ucidef_set_led_usbdev "usb1" "USB1" "$model:green:usb1" "1-1" + ucidef_set_led_usbdev "usb2" "USB2" "$model:green:usb2" "1-2" ;; netgear,evg2000) ucidef_set_led_netdev "lan" "LAN" "EVG2000:green:lan" "eth0" @@ -88,7 +89,7 @@ sagem,fast-2704-v2) ucidef_set_led_usbdev "usb" "USB" "F@ST2704V2:green:usb" "1-1" ;; sercomm,ad1018) - ucidef_set_led_netdev "wlan0" "WLAN" "ad1018:green:wifi" "wlan0" + ucidef_set_led_netdev "wlan0" "WLAN" "$model:green:wifi" "wlan0" ;; sercomm,ad1018-nor) ucidef_set_led_netdev "wlan0" "WLAN" "AD1018:green:wifi" "wlan0" From d6f66dd88e5d833f88fa4b6e056499ec7644ff7c Mon Sep 17 00:00:00 2001 From: Daniele Castro Date: Mon, 2 Dec 2019 16:13:44 +0100 Subject: [PATCH 3/6] brcm63xx: add support for ADB P.DG A4001N A-000-1A1-AX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ADB P.DG A4001N A-000-1A1-AX a.k.a. Telecom Italia ADSL2+ Wi-Fi N (AGPWI) has the same PCB as the OpenWrt's ADB P.DG A4001N1 with LEDs connected to different GPIO PINs in active low configuration. OpenWrt's ADB P.DG A4001N image is made for the ADB P.DG A4001N A-000-1A1-AE. It has different LEDs configuration and flash size/layout w.r.t the ADB P.DG A4001N A-000-1A1-AX. Hardware: * Board ID: 96328avng * SoC: Broadcom BCM6328 * RAM DDR2-800: 32 Mbyte - winbond W9725G6KB-25 * Serial flash: 16 Mbyte - MXIC MX25L 12845EMI-10G * Ethernet: 4x Ethernet 10/100 baseT * Wifi 2.4GHz: Broadcom Corporation BCM43224/5 Wireless Network Adapter (rev 01) * LEDs: 2x Power, 2x ADSL, 2x Internet, 2x Wi-Fi, 2x Service * Buttons: 1x Reset, 1x WPS (named WiFi/LED) * UART: 1x TTL 115200n8, TX NC RX, on J5 connector (short R192 and R193) NC GND NC Installation via CFE: * Stock CFE has to be overwriten with one for 96328avng boards that can upload .bin images with no signature check (cfe-A4001N-V0000_96328avng.bin) * connect a serial port to the board * Stop the boot process after power on by pressing enter * set static IP 192.168.1.2 and subnet mask 255.255.255.0 * navigate to http://192.168.1.1/ * upload the OpenWrt image file Signed-off-by: Daniele Castro Signed-off-by: Álvaro Fernández Rojas --- .../bcm63xx/base-files/etc/board.d/01_leds | 6 + .../bcm63xx/base-files/etc/board.d/02_network | 1 + .../base-files/etc/uci-defaults/09_fix_crc | 1 + .../bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts | 166 ++++++++++++++++++ target/linux/bcm63xx/image/bcm63xx.mk | 12 ++ ...67-board-adb_pdg-a4001n-a-000-1a1-ax.patch | 68 +++++++ 6 files changed, 254 insertions(+) create mode 100644 target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts create mode 100644 target/linux/bcm63xx/patches-5.4/567-board-adb_pdg-a4001n-a-000-1a1-ax.patch diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds index 907a425d16..91d67f0c0b 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds @@ -21,6 +21,12 @@ adb,a4001n1) ucidef_set_led_netdev "lan" "LAN" "A4001N1:green:eth" "eth0" ucidef_set_led_usbdev "usb" "USB" "A4001N1:green:3g" "1-1" ;; +adb,pdg-a4001n-a-000-1a1-ax) + ucidef_set_led_netdev "lan" "LAN" "$model:green:internet" "eth0.1" + ucidef_set_led_netdev "wan" "WAN" "$model:green:adsl" "eth0.2" + ucidef_set_led_netdev "wlan0" "WIFI" "$model:green:wifi" "wlan0" + ucidef_set_led_usbdev "usb" "USB" "$model:green:service" "1-1" + ;; adb,av4202n) ucidef_set_led_netdev "wlan0" "WLAN" "AV4202N:blue:wifi" "wlan0" ;; diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network index a3788adac2..784af29cb4 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network @@ -20,6 +20,7 @@ t-com,speedport-w-500v) ;; adb,a4001n1|\ adb,a4001n|\ +adb,pdg-a4001n-a-000-1a1-ax|\ adb,av4202n|\ brcm,bcm963281tan|\ brcm,bcm96328avng|\ diff --git a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc index 813b51fb52..3fcf40434f 100644 --- a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc +++ b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc @@ -14,6 +14,7 @@ case "$(board_name)" in actiontec,r1000h|\ adb,a4001n|\ adb,a4001n1|\ + adb,pdg-a4001n-a-000-1a1-ax|\ brcm,bcm96328avng|\ brcm,bcm963281tan|\ bt,voyager-2110|\ diff --git a/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts b/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts new file mode 100644 index 0000000000..8a6a8b58a2 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts @@ -0,0 +1,166 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "bcm6328.dtsi" + +#include + +/ { + model = "ADB P.DG A4001N A-000-1A1-AX"; + compatible = "adb,pdg-a4001n-a-000-1a1-ax", "brcm,bcm6328"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&pinctrl 23 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wifi-led"; + gpios = <&pinctrl 24 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + + led@2 { + reg = <2>; + active-low; + label = "pdg-a4001n-a-000-1a1-ax:red:internet"; + }; + + led@3 { + reg = <3>; + active-low; + label = "pdg-a4001n-a-000-1a1-ax:green:adsl"; + }; + + led@5 { + reg = <5>; + active-low; + label = "pdg-a4001n-a-000-1a1-ax:red:adsl"; + }; + + led@6 { + reg = <6>; + active-low; + label = "pdg-a4001n-a-000-1a1-ax:green:service"; + }; + + led@7 { + reg = <7>; + active-low; + label = "pdg-a4001n-a-000-1a1-ax:red:service"; + }; + + led@8 { + reg = <8>; + active-low; + label = "pdg-a4001n-a-000-1a1-ax:red:power"; + }; + + led@9 { + reg = <9>; + active-low; + label = "pdg-a4001n-a-000-1a1-ax:green:wifi"; + }; + + led@10 { + reg = <10>; + active-low; + label = "pdg-a4001n-a-000-1a1-ax:red:wifi"; + }; + + led@11 { + reg = <11>; + active-low; + label = "pdg-a4001n-a-000-1a1-ax:green:internet"; + }; + + led_power_green: led@12 { + reg = <12>; + active-low; + label = "pdg-a4001n-a-000-1a1-ax:green:power"; + default-state = "on"; + }; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x000000 0x010000>; + label = "cfe"; + read-only; + }; + + partition@10000 { + reg = <0x010000 0xfe0000>; + label = "linux"; + compatible = "brcm,bcm963xx-imagetag"; + }; + + partition@ff0000 { + reg = <0xff0000 0x010000>; + label = "nvram"; + }; + }; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio2", "gpio3", + "gpio5", "gpio6", + "gpio7", "gpio8", + "gpio9", "gpio10", + "gpio11", "gpio12"; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/bcm63xx/image/bcm63xx.mk b/target/linux/bcm63xx/image/bcm63xx.mk index 219eff5183..2627cbb509 100644 --- a/target/linux/bcm63xx/image/bcm63xx.mk +++ b/target/linux/bcm63xx/image/bcm63xx.mk @@ -220,6 +220,18 @@ define Device/adb_a4001n1 endef TARGET_DEVICES += adb_a4001n1 +define Device/adb_pdg-a4001n-a-000-1a1-ax + $(Device/bcm63xx) + DEVICE_VENDOR := ADB + DEVICE_MODEL := P.DG A4001N A-000-1A1-AX + IMAGES += sysupgrade.bin + CFE_BOARD_ID := 96328avng + CHIP_ID := 6328 + FLASH_MB := 16 + DEVICE_PACKAGES := $(USB2_PACKAGES) $(B43_PACKAGES) +endef +TARGET_DEVICES += adb_pdg-a4001n-a-000-1a1-ax + define Device/adb_av4202n $(Device/bcm63xx) DEVICE_VENDOR := ADB diff --git a/target/linux/bcm63xx/patches-5.4/567-board-adb_pdg-a4001n-a-000-1a1-ax.patch b/target/linux/bcm63xx/patches-5.4/567-board-adb_pdg-a4001n-a-000-1a1-ax.patch new file mode 100644 index 0000000000..3976527b37 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/567-board-adb_pdg-a4001n-a-000-1a1-ax.patch @@ -0,0 +1,68 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -627,6 +627,49 @@ static struct board_info __initdata boar + }, + }; + ++static struct board_info __initdata board_PDG_A4001N_A_000_1A1_AX = { ++ .name = "96328avng", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ .use_fallback_sprom = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ .has_enetsw = 1, ++ ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .fallback_sprom = { ++ .type = SPROM_BCM43225, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; ++ + static struct board_info __initdata board_A4001N1 = { + .name = "963281T_TEF", + .expected_cpu_id = 0x6328, +@@ -2849,6 +2892,7 @@ static const struct board_info __initcon + &board_AR5387un, + &board_963281TAN, + &board_A4001N, ++ &board_PDG_A4001N_A_000_1A1_AX, + &board_A4001N1, + &board_dsl_274xb_f1, + &board_FAST2704V2, +@@ -2957,6 +3001,7 @@ static struct of_device_id const bcm963x + #ifdef CONFIG_BCM63XX_CPU_6328 + { .compatible = "adb,a4001n", .data = &board_A4001N, }, + { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, ++ { .compatible = "adb,pdg-a4001n-a-000-1a1-ax", .data = &board_PDG_A4001N_A_000_1A1_AX, }, + { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, }, + { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, + { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, From a9f75101508f64306710590bf45a326d4c2a1970 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Thu, 21 May 2020 09:50:37 +0200 Subject: [PATCH 4/6] hostapd: add WEP as queryable build feature Commit 472fd98c5b12 ("hostapd: disable support for Wired Equivalent Privacy by default") made support for WEP optional. Expose the WEP support to LuCi or other userspace tools using the existing interface. This way they are able to remove WEP from the available ciphers if hostapd is built without WEP support. Signed-off-by: David Bauer --- .../network/services/hostapd/src/src/utils/build_features.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/network/services/hostapd/src/src/utils/build_features.h b/package/network/services/hostapd/src/src/utils/build_features.h index abebecb570..b28ff6fa9f 100644 --- a/package/network/services/hostapd/src/src/utils/build_features.h +++ b/package/network/services/hostapd/src/src/utils/build_features.h @@ -38,6 +38,10 @@ static inline int has_feature(const char *feat) #ifdef CONFIG_SUITEB192 if (!strcmp(feat, "suiteb192")) return 1; +#endif +#ifdef CONFIG_WEP + if (!strcmp(feat, "wep")) + return 1; #endif return 0; } From ebddc5f984a240980303aed68524eb615484eef8 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Tue, 19 May 2020 22:49:35 +0200 Subject: [PATCH 5/6] ath79: add support for Enterasys WS-AP3705i Hardware -------- SoC: Atheros AR9344 RAM: 128M DDR2 FLASH: 2x Macronix MX25L12845EM 2x 16MiB SPI-NOR WLAN2: Atheros AR9344 2x2 2T2R WLAN5: Atheros AR9580 2x2 2T2R SERIAL: Cisco-RJ45 on the back (115200 8n1) Installation ------------ The U-Boot CLI is password protected (using the same credentials as the OS). Default is admin/new2day. 1. Download the OpenWrt initramfs-image. Place it into a TFTP server root directory and rename it to 1401A8C0.img. Configure the TFTP server to listen at 192.168.1.66/24. 2. Connect the TFTP server to the access point. 3. Connect to the serial console of the access point. Attach power and interrupt the boot procedure when prompted (bootdelay is 1 second). 4. Configure the U-Boot environment for booting OpenWrt from Ram and flash: $ setenv boot_openwrt 'setenv bootargs; bootm 0xbf230000' $ setenv ramboot_openwrt 'setenv serverip 192.168.1.66; tftpboot 0x85000000; bootm' $ setenv bootcmd 'run boot_openwrt' $ saveenv 5. Load OpenWrt into memory: $ run ramboot_openwrt Wait for the image to boot. 6. Transfer the OpenWrt sysupgrade image to the device. Write the image to flash using sysupgrade: $ sysupgrade -n /path/to/openwrt-sysuograde.bin Signed-off-by: David Bauer --- .../ath79/dts/ar9344_enterasys_ws-ap3705i.dts | 236 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 3 +- .../generic/base-files/etc/board.d/02_network | 4 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 8 + .../base-files/lib/preinit/10_fix_eth_mac.sh | 3 + target/linux/ath79/image/generic.mk | 8 + 6 files changed, 261 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts diff --git a/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts b/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts new file mode 100644 index 0000000000..0f02881471 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts @@ -0,0 +1,236 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9344.dtsi" + +/ { + compatible = "enterasys,ws-ap3705i", "qca,ar9344"; + model = "Enterasys WS-AP3705i"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_red; + label-mac-device = ð0; + }; + + mtd-concat { + compatible = "mtd-concat"; + devices = <&concat0 &concat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0 0x1dd0000>; + }; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&enable_gpio_11 &enable_gpio_16>; + + led_power_green: power_green { + label = "ws-ap3705i:green:power"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led_power_red: power_red { + label = "ws-ap3705i:red:power"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + lan_blue { + label = "ws-ap3705i:blue:lan"; + gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; + }; + + lan_green { + label = "ws-ap3705i:green:lan"; + gpios = <&gpio 20 GPIO_ACTIVE_HIGH>; + }; + + radio2 { + label = "ws-ap3705i:green:radio2"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + radio1 { + label = "ws-ap3705i:green:radio1"; + gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&pinmux { + enable_gpio_16: pinmux_enable_gpio_16 { + pinctrl-single,bits = <0x10 0x0 0x000000ff>; + }; + + enable_gpio_11: pinmux_enable_gpio_11 { + pinctrl-single,bits = <0x8 0x0 0xff000000>; + }; +}; + +&gpio { + status = "okay"; +}; + +&wmac { + status = "okay"; + qca,no-eeprom; +}; + +&spi { + status = "okay"; + + cs-gpios = <0>, <0>; + num-cs = <2>; + + 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-bak"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "u-boot-env0"; + reg = <0x80000 0x10000>; + read-only; + }; + + partition@90000 { + label = "u-boot-env1"; + reg = <0x90000 0x10000>; + read-only; + }; + + partition@a0000 { + label = "u-boot"; + reg = <0xa0000 0x80000>; + read-only; + }; + + partition@120000 { + label = "calibrate"; + reg = <0x120000 0x10000>; + read-only; + }; + + partition@130000 { + label = "nvram"; + reg = <0x130000 0x100000>; + read-only; + }; + + concat0: partition@230000 { + label = "concat0"; + reg = <0x230000 0xdd0000>; + }; + }; + }; + + flash@1 { + compatible = "jedec,spi-nor"; + reg = <1>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + concat1: partition@0 { + label = "concat1"; + reg = <0x0 0x1000000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x1e000000 0x08000101 0x08001313>; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; + + gmac-config { + device = <&gmac>; + rgmii-gmac0 = <1>; + rxd-delay = <0>; + rxdv-delay = <0>; + txen-delay = <0>; + txd-delay = <0>; + }; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index a3c5b3f988..4774d5daf2 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -95,7 +95,8 @@ comfast,cf-ew72) ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:wan" "eth1" ;; comfast,cf-wr752ac-v1|\ -engenius,ecb1750) +engenius,ecb1750|\ +enterasys,ws-ap3705i) ucidef_set_led_netdev "lan" "LAN" "$boardname:blue:lan" "eth0" ;; devolo,magic-2-wifi) diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 0b05868baf..a99d5f6532 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -22,6 +22,7 @@ ath79_setup_interfaces() devolo,dvl1750x|\ dlink,dir-505|\ engenius,ecb1750|\ + enterasys,ws-ap3705i|\ glinet,gl-ar300m-lite|\ netgear,ex6400|\ netgear,ex7300|\ @@ -400,6 +401,9 @@ ath79_setup_macs() ucidef_set_interface "eth0" ifname "eth0" protocol "none" macaddr "$lan_mac" ucidef_set_interface "eth1" ifname "eth1" protocol "none" macaddr "$eth1_mac" ;; + enterasys,ws-ap3705i) + label_mac=$(mtd_get_mac_ascii u-boot-env0 ethaddr) + ;; iodata,etg3-r) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(macaddr_add "$lan_mac" -1) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 428b502d81..e0fa5ff354 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -43,6 +43,10 @@ case "$FIRMWARE" in caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr) ;; + enterasys,ws-ap3705i) + caldata_extract "calibrate" 0x1000 0x440 + ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR1) + ;; nec,wg800hp) caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(mtd_get_mac_text board_data 0x680) @@ -72,6 +76,10 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x440 ath9k_patch_mac $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1) ;; + enterasys,ws-ap3705i) + caldata_extract "calibrate" 0x5000 0x440 + ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0) + ;; ocedo,raccoon|\ tplink,tl-wdr3500-v1|\ tplink,tl-wdr3600-v1|\ diff --git a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh index b3c3de298e..da1583a825 100644 --- a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh @@ -8,6 +8,9 @@ preinit_set_mac_address() { avm,fritz450e) ip link set dev eth0 address $(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)")) ;; + enterasys,ws-ap3705i) + ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env0 ethaddr) + ;; siemens,ws-ap3610) ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr) ;; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 8d8767ddf6..7f06740c98 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -630,6 +630,14 @@ define Device/engenius_ews511ap endef TARGET_DEVICES += engenius_ews511ap +define Device/enterasys_ws-ap3705i + SOC := ar9344 + DEVICE_VENDOR := Enterasys + DEVICE_MODEL := WS-AP3705i + IMAGE_SIZE := 30528k +endef +TARGET_DEVICES += enterasys_ws-ap3705i + define Device/etactica_eg200 SOC := ar9331 DEVICE_VENDOR := eTactica From fe9a2beecb484e067552dac396de2388188fbd49 Mon Sep 17 00:00:00 2001 From: Russell Senior Date: Sat, 23 May 2020 01:19:50 -0700 Subject: [PATCH 6/6] ramips: fix 04_led_migration case syntax for mt7621 Commit f761f4052c4 had bogus case syntax, the uci-defaults script threw errors as a result and exited non-zero, probably didn't do what was intended, but tried over and over since the non-zero exit prevents the script from being deleted. Fixes: f761f4052c41 ("ramips: mt7621: harmonize naming scheme for Mikrotik") Signed-off-by: Russell Senior [extend commit title, add Fixes] Signed-off-by: Adrian Schmutzler --- .../mt7621/base-files/etc/uci-defaults/04_led_migration | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration index 73140fd7d5..1248dcec0f 100644 --- a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration +++ b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration @@ -9,14 +9,16 @@ boardonly="${board##*,}" case "$board" in mikrotik,routerboard-750gr3) migrate_leds "^rb750gr3:=$boardonly:" + ;; mikrotik,routerboard-m11g) migrate_leds "^rbm11g:=$boardonly:" + ;; mikrotik,routerboard-m33g) migrate_leds "^rbm33g:=$boardonly:" + ;; netgear,wndr3700-v5) migrate_leds "^wndr3700v5:=$boardonly:" ;; - esac migrations_apply system