Compare commits

...

6 Commits

Author SHA1 Message Date
jaspreetsachdev
b3493bcf55 Merge pull request #538 from Telecominfraproject/v2.9.0-rc4
V2.9.0 rc4
2023-03-27 09:44:32 -04:00
Jaspreet Sachdev
2b767fb84f Merge remote-tracking branch 'origin/main' into v2.9.0 2023-03-23 12:59:06 -04:00
Piotr Dymacz
560e9f326d mcu: fix host support for multi-slot UART based MCUs
In case of MCU with multiple firmware slots support, change of active
slot requires reset. This obviously results in MCU entering the serial
recovery mode in bootloader, with 5 sec timeout, which in case of UART
based MCUs isn't automatically detected and handled in the same way as
USB based devices (hotplug).

Starting host side support script when the MCU is waiting for MCUmgr
commands during recovery is wrong. This fixes the problem by requesting
UART based MCU to boot the firmware after active slot change followed by
reset. While at it, change also how single slot type MCUs are handled
during upgrade (always request reset after the upgrade).

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-23 08:06:42 +01:00
John Crispin
3da1530926 ratelimit: SSIDs with spaces failed to be configured
Fixes: WIFI-12421
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-23 07:39:11 +01:00
Arif Alam
abcf6dd1fd ipq807x: fix mac address assignment
Signed-off-by: Arif Alam <arif.alam@netexperience.com>
2023-03-21 07:57:13 +01:00
Chaitanya Kiran Godavarthi
2bcedafe0d ipa807x: generate an ath11k-macs file on eap104
Signed-off-by: Chaitanya Kiran Godavarthi <chaitanya.kiran@netexperience.com>
2023-03-21 06:23:39 +01:00
7 changed files with 48 additions and 20 deletions

View File

@@ -190,6 +190,7 @@ ath11k-macs)
;;
yuncore,ax840|\
edgecore,eap102|\
edgecore,eap104|\
edgecore,eap106|\
indio,um-310ax-v1|\
indio,um-510axp-v1|\

View File

@@ -1,3 +1,3 @@
#!/bin/sh
mac=$(cat /etc/board.json | jsonfilter -e '@["network-device"]["'$DEVICENAME'"]'.macaddr)
mac=$(cat /etc/board.json | jsonfilter -e '@["network_device"]["'$DEVICENAME'"]'.macaddr)
[ -n "$mac" ] && ip link set $DEVICENAME address $mac

View File

@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mcu
PKG_VERSION:=2023-03-12
PKG_VERSION:=2023-03-22
PKG_RELEASE=1
PKG_LICENSE:=GPL-2.0

View File

@@ -47,13 +47,19 @@ mcu_hotplug_setup() {
[ $? -ne 0 ] && return 1
mcu_fw_check_and_update "$uart"
[ $? -ne 0 ] && return 1
rc="$?"
fw_type="$(uci -q get "mcu.${SECT}.firmware" | awk -F '__' '{print $2}')"
[ -n "$fw_type" ] || return 0
[ "$rc" = "1" ] && return 1
[ -x "${MCU_HS_DIR}/${fw_type}.sh" ] && \
"${MCU_HS_DIR}/${fw_type}.sh" "$SECT"
[ "$rc" = "0" ] && {
fw_type="$(uci -q get "mcu.${SECT}.firmware" | awk -F '__' '{print $2}')"
[ -n "$fw_type" ] || return 0
[ -x "${MCU_HS_DIR}/${fw_type}.sh" ] && \
"${MCU_HS_DIR}/${fw_type}.sh" "$SECT"
}
return 0
}
# We are looking for ttyACM with specific product name and USB VID:PID

View File

@@ -24,7 +24,16 @@ mcu_setup_uart() {
[ $? -ne 0 ] && return 1
mcu_fw_check_and_update "$uart" "$baud" "$flow"
[ $? -ne 0 ] && return 1
rc="$?"
[ "$rc" = "1" ] && return 1
[ "$rc" = "2" ] && {
sleep 1
mcu_req "boot" "$uart" "$baud" "$flow"
[ $? -ne 0 ] && return 1
}
fw_type="$(uci -q get "mcu.${SECT}.firmware" | awk -F '__' '{print $2}')"
[ -n "$fw_type" ] || return 0
@@ -141,18 +150,20 @@ mcu_setup_usb() {
}
mcu_fw_check_and_update "$uart"
[ $? -ne 0 ] && {
rc="$?"
[ "$rc" = "1" ] && {
mcu_enable_pin_set "$gpio_path" "$gpio_off"
flock -u 9
return 1
}
fw_type="$(uci -q get "mcu.${SECT}.firmware" | awk -F '__' '{print $2}')"
[ -n "$fw_type" ] || return 0
[ -x "${MCU_HS_DIR}/${fw_type}.sh" ] && \
"${MCU_HS_DIR}/${fw_type}.sh" "$SECT"
[ "$rc" = "0" ] && {
fw_type="$(uci -q get "mcu.${SECT}.firmware" | awk -F '__' '{print $2}')"
[ -n "$fw_type" -a -x "${MCU_HS_DIR}/${fw_type}.sh" ] && \
"${MCU_HS_DIR}/${fw_type}.sh" "$SECT"
}
flock -u 9
}

View File

@@ -289,6 +289,10 @@ mcu_sn_check_and_update() {
return 0
}
# Returns:
# 0 if MCU was requested to boot firmware
# 1 on error
# 2 if MCU was requested to reset
mcu_fw_check_and_update() {
local uart="$1"
local baud="$2"
@@ -385,9 +389,11 @@ mcu_fw_check_and_update() {
mcu_req "boot" "$uart" "$baud" "$flow"
[ $? -ne 0 ] && return 1
return 0
}
return 0
return 1
}
# Do we have target firmware installed in the first slot?
@@ -401,6 +407,8 @@ mcu_fw_check_and_update() {
# Changing active slots requires MCU reset at the moment
mcu_req "reset" "$uart" "$baud" "$flow"
[ $? -ne 0 ] && return 1
return 2
else
mcu_req "boot" "$uart" "$baud" "$flow"
[ $? -ne 0 ] && return 1
@@ -411,15 +419,15 @@ mcu_fw_check_and_update() {
mcu_logi "no matching firmware found in slot '0'"
# Upload and boot firmware on single-slot device
# Upload firmware and reset on single-slot device
[ "$fw_slots" = "1" ] && {
mcu_fw_upload "$board" "0" "$firmware" "$uart" "$baud" "$flow"
[ $? -ne 0 ] && return 1
mcu_req "boot" "$uart" "$baud" "$flow"
mcu_req "reset" "$uart" "$baud" "$flow"
[ $? -ne 0 ] && return 1
return 0
return 2
}
# Do we have target firmware installed in the second slot?
@@ -433,6 +441,8 @@ mcu_fw_check_and_update() {
# Changing active slots requires MCU reset at the moment
mcu_req "reset" "$uart" "$baud" "$flow"
[ $? -ne 0 ] && return 1
return 2
else
mcu_req "boot" "$uart" "$baud" "$flow"
[ $? -ne 0 ] && return 1
@@ -461,7 +471,7 @@ mcu_fw_check_and_update() {
mcu_req "reset" "$uart" "$baud" "$flow"
[ $? -ne 0 ] && return 1
return 0
return 2
}
mcu_add_uci_config() {

View File

@@ -10,7 +10,7 @@ add_rate() {
config_get ssid "$cfg" ssid
config_get ingress "$cfg" ingress
config_get egress "$cfg" egress
ubus call ratelimit defaults_set '{"name": "'$ssid'", "rate_ingress": "'$ingress'mbit", "rate_egress": "'$egress'mbit" }'
ubus call ratelimit defaults_set "{\"name\": \"$ssid\", \"rate_ingress\": \""$ingress"mbit\", \"rate_egress\": \""$egress"mbit\" }"
}
reload_service() {