Skip to content

Commit

Permalink
Merge branch 'openwrt:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
oxavelar authored Jan 10, 2024
2 parents 502c6d8 + e691e2b commit d95e33c
Show file tree
Hide file tree
Showing 31 changed files with 442 additions and 75 deletions.
2 changes: 1 addition & 1 deletion package/firmware/ipq-wifi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
PKG_SOURCE_DATE:=2024-01-06
PKG_SOURCE_VERSION:=71f45cff8944405b7cc2bf5c19df2bd8fe7f2421
PKG_MIRROR_HASH:=799602d1519605bab3a952bc07d1a055617ab295e338121bf0e6cae2ebbb0dc9
PKG_MIRROR_HASH:=90c3c1659c54cdb4685d0a71633746c1000230e459801eb8ce12c805a994cc37

PKG_FLAGS:=nonshared

Expand Down
5 changes: 5 additions & 0 deletions package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ mac80211_hostapd_setup_base() {
[ "$rx_stbc" -lt "$cap_rx_stbc" ] && cap_rx_stbc="$rx_stbc"
vht_cap="$(( ($vht_cap & ~(0x700)) | ($cap_rx_stbc << 8) ))"

[ "$vht_oper_chwidth" -lt 2 ] && {
vht160=0
short_gi_160=0
}

mac80211_add_capabilities vht_capab $vht_cap \
RXLDPC:0x10::$rxldpc \
SHORT-GI-80:0x20::$short_gi_80 \
Expand Down
8 changes: 8 additions & 0 deletions package/libs/libubox/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ CMAKE_HOST_OPTIONS += \
-DCMAKE_MACOSX_RPATH=1 \
-DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOST}/lib" \

ifeq ($(HOST_OS),Darwin)
define Host/Install
$(Host/Install/Default)
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib
cd "$(STAGING_DIR_HOSTPKG)/lib" && ln -sf ../../host/lib/libubox.* .
endef
endif

$(eval $(call BuildPackage,libubox))
$(eval $(call BuildPackage,libblobmsg-json))
$(eval $(call BuildPackage,jshn))
Expand Down
3 changes: 3 additions & 0 deletions package/network/services/hostapd/src/src/ap/ubus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1907,6 +1907,9 @@ void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequen
struct hostapd_data *hapd;
int i;

if (!ctx)
return;

blob_buf_init(&b, 0);
blobmsg_add_u16(&b, "frequency", frequency);
blobmsg_add_u16(&b, "width", chan_width);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@
status = "okay";
};

&btif {
status = "okay";
};

&eth {
pinctrl-names = "default";
pinctrl-0 = <&eth_pins>;
Expand Down
4 changes: 0 additions & 4 deletions target/linux/mediatek/dts/mt7622-linksys-e8450.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@
};
};

&btif {
status = "okay";
};

&cir {
pinctrl-names = "default";
pinctrl-0 = <&irrx_pins>;
Expand Down
4 changes: 0 additions & 4 deletions target/linux/mediatek/dts/mt7622-netgear-wax206.dts
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@
status = "okay";
};

&btif {
status = "okay";
};

&cir {
pinctrl-names = "default";
pinctrl-0 = <&irrx_pins>;
Expand Down
259 changes: 259 additions & 0 deletions target/linux/mediatek/dts/mt7981b-yuncore-ax835.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
// SPDX-License-Identifier: (GPL-2.0 OR MIT)

/dts-v1/;

#include "mt7981.dtsi"

/ {
compatible = "yuncore,ax835", "mediatek,mt7981";
model = "YunCore AX835";

aliases {
ethernet0 = &gmac0;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
serial0 = &uart0;
};

chosen {
stdout-path = "serial0:115200n8";
};

gpio-keys {
compatible = "gpio-keys";

reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
};
};

reg_led_vbus {
compatible = "regulator-fixed";
regulator-name = "led_vbus";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
gpio = <&pio 5 GPIO_ACTIVE_HIGH>;
};

leds {
compatible = "gpio-leds";

led_system: led_system {
label = "red:system";
gpios = <&pio 4 GPIO_ACTIVE_LOW>;
};

led_wifi24 {
label = "green:wifi2";
gpios = <&pio 34 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};

led_wifi5 {
label = "blue:wifi5";
gpios = <&pio 35 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};

led_hwwatchdog {
// a gpio-wdt watchdog couldn't be made to work.
// the device rebooted after 5 minutes.
label = "hwwatchdog";
gpios = <&pio 7 GPIO_ACTIVE_LOW>;
linux,default-trigger = "timer";
led-pattern = <1000>, <1000>;
};

// there's another "syswatchdog" on gpio2
};
};

&eth {
pinctrl-names = "default";
pinctrl-0 = <&mdio_pins>;

status = "okay";

gmac0: mac@0 {
compatible = "mediatek,eth-mac";
reg = <0>;
phy-mode = "2500base-x";

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

&mdio_bus {
switch: switch@1f {
compatible = "mediatek,mt7531";
reg = <31>;
reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
};
};

&pio {
spi0_flash_pins: spi0-pins {
mux {
function = "spi";
groups = "spi0", "spi0_wp_hold";
};
};

spi2_flash_pins: spi2-pins {
mux {
function = "spi";
groups = "spi2", "spi2_wp_hold";
};

conf-pu {
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
drive-strength = <8>;
bias-pull-up = <103>;
};

conf-pd {
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
drive-strength = <8>;
bias-pull-down = <103>;
};
};
};

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_flash_pins>;
status = "disabled";
};

&spi2 {
pinctrl-names = "default";
pinctrl-0 = <&spi2_flash_pins>;
status = "okay";

flash@0 {
#address-cells = <1>;
#size-cells = <1>;

compatible = "jedec,spi-nor";
reg = <0>;

spi-max-frequency = <52000000>;
spi-tx-buswidth = <4>;
spi-rx-buswidth = <4>;

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

partition@00000 {
label = "BL2";
reg = <0x00000 0x40000>;
read-only;
};

partition@40000 {
label = "u-boot-env";
reg = <0x40000 0x10000>;
read-only;
};

factory: partition@50000 {
label = "Factory";
reg = <0x50000 0x10000>;
read-only;

compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

eeprom_factory: eeprom@0 {
reg = <0x0 0x1000>;
};

macaddr_factory_4: macaddr@4 {
reg = <0x4 0x6>;
};

macaddr_factory_24: macaddr@24 {
reg = <0x24 0x6>;
};

macaddr_factory_2a: macaddr@2a {
reg = <0x2a 0x6>;
};
};

partition@100000 {
label = "FIP";
reg = <0x100000 0x80000>;
read-only;
};

partition@180000 {
compatible = "denx,fit";
label = "firmware";
reg = <0x180000 0xe00000>;
};
};
};
};

&switch {
ports {
#address-cells = <1>;
#size-cells = <0>;

lan: port@3 {
reg = <3>;
label = "lan";

nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_factory_2a 0>;
};

port@4 {
reg = <4>;
label = "wan";

nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_factory_2a 0>;
};

port@6 {
reg = <6>;
label = "cpu";
ethernet = <&gmac0>;
phy-mode = "2500base-x";

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

&uart0 {
status = "okay";
};

&watchdog {
status = "okay";
};

&wifi {
status = "okay";
nvmem-cells = <&eeprom_factory 0>;
nvmem-cell-names = "eeprom";
};
9 changes: 6 additions & 3 deletions target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

aliases {
serial0 = &uart0;
led-boot = &led_white;
led-failsafe = &led_white;
led-running = &led_blue;
led-upgrade = &led_white;
};

chosen {
Expand Down Expand Up @@ -51,13 +55,12 @@
leds {
compatible = "gpio-leds";

led_run: led@0 {
led_blue: led@0 {
label = "blue:run";
gpios = <&pio 38 GPIO_ACTIVE_LOW>;
default-state = "on";
};

led@1 {
led_white: led@1 {
label = "white:system";
gpios = <&pio 37 GPIO_ACTIVE_LOW>;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ mediatek_setup_interfaces()
ucidef_set_interface_lan "eth0"
;;
smartrg,sdg-8622|\
smartrg,sdg-8632)
smartrg,sdg-8632|\
yuncore,ax835)
ucidef_set_interfaces_lan_wan lan wan
;;
tplink,tl-xdr6086)
Expand Down Expand Up @@ -170,6 +171,9 @@ mediatek_setup_macs()
wan_mac=$(mtd_get_mac_ascii Bdata ethaddr_wan)
label_mac=$wan_mac
;;
yuncore,ax835)
label_mac=$(mtd_get_mac_binary "Factory" 0x4)
;;
esac

[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ case "$board" in
[ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress
;;
bananapi,bpi-r3)
addr=$(macaddr_add $(cat /sys/class/net/eth0/address) 2)
[ "$PHYNBR" = "0" ] && macaddr_unsetbit $addr 6 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_setbit $addr 6 > /sys${DEVPATH}/macaddress
addr=$(cat /sys/class/net/eth0/address)
[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
;;
cetron,ct3003)
addr=$(mtd_get_mac_binary "art" 0)
Expand Down
Loading

0 comments on commit d95e33c

Please sign in to comment.