mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-03 20:07:59 +00:00
ipq807x: various improvements to cig,wf660a
Fixes: WIFI-12592 Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -60,7 +60,7 @@ qcom_setup_interfaces()
|
|||||||
ucidef_set_interface_wan "eth0"
|
ucidef_set_interface_wan "eth0"
|
||||||
;;
|
;;
|
||||||
cig,wf660a)
|
cig,wf660a)
|
||||||
ucidef_set_interface_lan "eth0"
|
ucidef_set_interface_wan "eth0"
|
||||||
;;
|
;;
|
||||||
cig,wf186w)
|
cig,wf186w)
|
||||||
ucidef_set_interface_lan "eth1"
|
ucidef_set_interface_lan "eth1"
|
||||||
@@ -134,6 +134,15 @@ qcom_setup_macs()
|
|||||||
ip link set eth1 address $lan_mac
|
ip link set eth1 address $lan_mac
|
||||||
ucidef_set_label_macaddr $wan_mac
|
ucidef_set_label_macaddr $wan_mac
|
||||||
;;
|
;;
|
||||||
|
cig,wf660a)
|
||||||
|
mmc_dev=$(echo $(find_mmc_part "0:APPSBLENV") | sed 's/^.\{5\}//')
|
||||||
|
[ -z mmc_dev ] && return
|
||||||
|
mac=$(grep BaseMacAddress= /dev/$mmc_dev | cut -dx -f2)
|
||||||
|
[ -z "$mac" ] && return;
|
||||||
|
wan_mac=$(macaddr_canonicalize $mac)
|
||||||
|
ucidef_set_network_device_mac eth0 $wan_mac
|
||||||
|
ip link set eth0 address $wan_mac
|
||||||
|
;;
|
||||||
cybertan,eww622-a1)
|
cybertan,eww622-a1)
|
||||||
mac=$(grep -i -m 1 mac_addr_base= /dev/`cat /proc/mtd | grep devinfo | cut -d: -f1` | cut -d= -f2)
|
mac=$(grep -i -m 1 mac_addr_base= /dev/`cat /proc/mtd | grep devinfo | cut -d: -f1` | cut -d= -f2)
|
||||||
[ -z "$mac"] && mac="00:11:22:33:44:55"
|
[ -z "$mac"] && mac="00:11:22:33:44:55"
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ do_flash_emmc() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
echo erase $4
|
echo erase $4 / $emmcblock
|
||||||
dd if=/dev/zero of=${emmcblock} 2> /dev/null
|
dd if=/dev/zero of=${emmcblock} 2> /dev/null
|
||||||
echo flash $4
|
echo flash $4
|
||||||
tar Oxf $tar_file ${board_dir}/$part | dd of=${emmcblock}
|
tar Oxf $tar_file ${board_dir}/$part | dd of=${emmcblock}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "qcom-ipq6018.dtsi"
|
#include "qcom-ipq6018.dtsi"
|
||||||
#include <dt-bindings/input/input.h>
|
#include <dt-bindings/input/input.h>
|
||||||
#include <dt-bindings/gpio/gpio.h>
|
#include <dt-bindings/gpio/gpio.h>
|
||||||
|
#include <dt-bindings/pwm/pwm.h>
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
#address-cells = <0x2>;
|
#address-cells = <0x2>;
|
||||||
@@ -38,6 +39,11 @@
|
|||||||
ethernet2 = "/soc/dp3";
|
ethernet2 = "/soc/dp3";
|
||||||
ethernet3 = "/soc/dp4";
|
ethernet3 = "/soc/dp4";
|
||||||
ethernet4 = "/soc/dp5";
|
ethernet4 = "/soc/dp5";
|
||||||
|
|
||||||
|
led-boot = &led_power;
|
||||||
|
led-failsafe = &led_power;
|
||||||
|
led-running = &led_power;
|
||||||
|
led-upgrade = &led_power;
|
||||||
};
|
};
|
||||||
|
|
||||||
chosen {
|
chosen {
|
||||||
@@ -227,27 +233,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
leds_pins: leds_pins {
|
|
||||||
led_5g {
|
|
||||||
pins = "gpio35";
|
|
||||||
function = "gpio";
|
|
||||||
drive-strength = <8>;
|
|
||||||
bias-pull-down;
|
|
||||||
};
|
|
||||||
led_2g {
|
|
||||||
pins = "gpio37";
|
|
||||||
function = "gpio";
|
|
||||||
drive-strength = <8>;
|
|
||||||
bias-pull-down;
|
|
||||||
};
|
|
||||||
led_usb0 {
|
|
||||||
pins = "gpio50";
|
|
||||||
function = "gpio";
|
|
||||||
drive-strength = <8>;
|
|
||||||
bias-pull-down;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
hsuart_pins: hsuart_pins {
|
hsuart_pins: hsuart_pins {
|
||||||
mux {
|
mux {
|
||||||
pins = "gpio71", "gpio72";
|
pins = "gpio71", "gpio72";
|
||||||
@@ -298,11 +283,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
&soc {
|
&soc {
|
||||||
pwm {
|
pwm0: pwm {
|
||||||
pinctrl-0 = <&pwm_pins>;
|
pinctrl-0 = <&pwm_pins>;
|
||||||
pinctrl-names = "default";
|
pinctrl-names = "default";
|
||||||
used-pwm-indices = <1>, <1>, <1>, <0>;
|
used-pwm-indices = <1>, <1>, <1>, <0>;
|
||||||
status = "ok";
|
status = "ok";
|
||||||
|
#pwm-cells = <2>;
|
||||||
};
|
};
|
||||||
extcon_usb: extcon_usb {
|
extcon_usb: extcon_usb {
|
||||||
pinctrl-0 = <&extcon_usb_pins>;
|
pinctrl-0 = <&extcon_usb_pins>;
|
||||||
@@ -454,28 +440,25 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
leds {
|
pwmleds {
|
||||||
compatible = "gpio-leds";
|
compatible = "pwm-leds";
|
||||||
pinctrl-0 = <&leds_pins>;
|
|
||||||
pinctrl-names = "default";
|
|
||||||
|
|
||||||
led@35 {
|
led_power: led1 {
|
||||||
label = "led_5g";
|
label = "blue:status";
|
||||||
gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>;
|
pwms = <&pwm0 0 5000>;
|
||||||
linux,default-trigger = "led_5g";
|
max-brightness = <255>;
|
||||||
default-state = "off";
|
|
||||||
};
|
};
|
||||||
led@37 {
|
|
||||||
label = "led_2g";
|
led2 {
|
||||||
gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
|
label = "green:status";
|
||||||
linux,default-trigger = "led_2g";
|
pwms = <&pwm0 1 5000>;
|
||||||
default-state = "off";
|
max-brightness = <255>;
|
||||||
};
|
};
|
||||||
led@50 {
|
|
||||||
label = "led_usb0";
|
led3 {
|
||||||
gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
|
label = "red:status";
|
||||||
linux,default-trigger = "usb-host";
|
pwms = <&pwm0 2 5000>;
|
||||||
default-state = "off";
|
max-brightness = <255>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -30,12 +30,18 @@ boot() {
|
|||||||
[ -e /dev/ubi1 ] && mount -t ubifs ubi1:certificates /certificates
|
[ -e /dev/ubi1 ] && mount -t ubifs ubi1:certificates /certificates
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
case "$(board_name)" in
|
||||||
|
cig,wf660a)
|
||||||
|
mmc_dev=$(echo $(find_mmc_part "0:ETHPHYFW") | sed 's/^.\{5\}//')
|
||||||
|
[ -n $mmc_dev ] && mount -t ext4 /dev/$mmc_dev /certificates
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
copy_certificates
|
copy_certificates
|
||||||
|
|
||||||
# if we get here no valid certificates were found
|
# if we get here no valid certificates were found
|
||||||
|
|
||||||
. /lib/functions.sh
|
|
||||||
|
|
||||||
local PART_NAME
|
local PART_NAME
|
||||||
|
|
||||||
case "$(board_name)" in
|
case "$(board_name)" in
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
From 3353a474f9cda9a61101c7f57cec2b991503c73e Mon Sep 17 00:00:00 2001
|
From 7d2818e1e1b49b9172c66171e9a96f4cdb9418ff Mon Sep 17 00:00:00 2001
|
||||||
From: Ken <xshi@actiontec.com>
|
From: Ken <xshi@actiontec.com>
|
||||||
Date: Tue, 7 Feb 2023 14:39:52 +0800
|
Date: Tue, 7 Feb 2023 14:39:52 +0800
|
||||||
Subject: [PATCH] Add fw_printenv support for EMMC
|
Subject: [PATCH 1/9] Add fw_printenv support for EMMC
|
||||||
|
|
||||||
---
|
---
|
||||||
package/base-files/files/lib/functions.sh | 13 ++++++++++++
|
package/base-files/files/lib/functions.sh | 13 ++++++++++++
|
||||||
|
package/boot/uboot-envtools/files/ipq60xx | 24 +++++++++++++++++++----
|
||||||
package/boot/uboot-envtools/files/ipq807x | 24 +++++++++++++++++++----
|
package/boot/uboot-envtools/files/ipq807x | 24 +++++++++++++++++++----
|
||||||
2 files changed, 33 insertions(+), 4 deletions(-)
|
3 files changed, 53 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
|
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
|
||||||
index 2bad45324f..415e0763ed 100644
|
index 2bad45324f..415e0763ed 100644
|
||||||
@@ -32,8 +33,49 @@ index 2bad45324f..415e0763ed 100644
|
|||||||
append() {
|
append() {
|
||||||
local var="$1"
|
local var="$1"
|
||||||
local value="$2"
|
local value="$2"
|
||||||
|
diff --git a/package/boot/uboot-envtools/files/ipq60xx b/package/boot/uboot-envtools/files/ipq60xx
|
||||||
|
index 84ed73f288..8863df4225 100644
|
||||||
|
--- a/package/boot/uboot-envtools/files/ipq60xx
|
||||||
|
+++ b/package/boot/uboot-envtools/files/ipq60xx
|
||||||
|
@@ -13,16 +13,32 @@ ubootenv_mtdinfo () {
|
||||||
|
mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}')
|
||||||
|
mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}')
|
||||||
|
nor_flash=$(find /sys/bus/spi/devices/*/mtd -name ${mtd_dev})
|
||||||
|
-
|
||||||
|
- if [ -n "$nor_flash" ]; then
|
||||||
|
+ found_emmc=0
|
||||||
|
+
|
||||||
|
+ if [ -z "$UBOOTENV_PART" ]; then
|
||||||
|
+ mtd_dev=$(echo $(find_mmc_part "0:APPSBLENV") | sed 's/^.\{5\}//')
|
||||||
|
+ if [ -n "$mtd_dev" ]; then
|
||||||
|
+ EMMC_UBOOTENV_PART=$(cat /proc/partitions | grep $mtd_dev)
|
||||||
|
+ #convert block to bytes
|
||||||
|
+ emmc_ubootenv_size=`expr $(echo $EMMC_UBOOTENV_PART | awk '{print $3}') \* 1024`
|
||||||
|
+ ubootenv_size=0x`printf "%x" $emmc_ubootenv_size`
|
||||||
|
+ found_emmc=1
|
||||||
|
+ fi
|
||||||
|
+ mtd_erase=""
|
||||||
|
+
|
||||||
|
+ elif [ -n "$nor_flash" ]; then
|
||||||
|
ubootenv_size=$mtd_size
|
||||||
|
else
|
||||||
|
# size is fixed to 0x40000 in u-boot
|
||||||
|
ubootenv_size=0x40000
|
||||||
|
fi
|
||||||
|
+ if [ $found_emmc -eq 0 ]; then
|
||||||
|
+ sectors=$(printf '0x%x' $(( $ubootenv_size / $mtd_erase )))
|
||||||
|
+ echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors
|
||||||
|
+ else
|
||||||
|
+ echo /dev/$mtd_dev 0x0 $ubootenv_size
|
||||||
|
+ fi
|
||||||
|
|
||||||
|
- sectors=$(( $ubootenv_size / $mtd_erase ))
|
||||||
|
- echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$board" in
|
||||||
diff --git a/package/boot/uboot-envtools/files/ipq807x b/package/boot/uboot-envtools/files/ipq807x
|
diff --git a/package/boot/uboot-envtools/files/ipq807x b/package/boot/uboot-envtools/files/ipq807x
|
||||||
index 84ed73f288..539cafb3fd 100644
|
index 2dcd294964..8863df4225 100644
|
||||||
--- a/package/boot/uboot-envtools/files/ipq807x
|
--- a/package/boot/uboot-envtools/files/ipq807x
|
||||||
+++ b/package/boot/uboot-envtools/files/ipq807x
|
+++ b/package/boot/uboot-envtools/files/ipq807x
|
||||||
@@ -13,16 +13,32 @@ ubootenv_mtdinfo () {
|
@@ -13,16 +13,32 @@ ubootenv_mtdinfo () {
|
||||||
|
|||||||
Reference in New Issue
Block a user