ipq806x: restore swconfig device tweaks
SqTER-PL <r.napierala@asta-net.pl>
This commit is contained in:
		| @@ -20,6 +20,9 @@ case "$board" in | |||||||
| 	linksys,ea7500-v1 |\ | 	linksys,ea7500-v1 |\ | ||||||
| 	linksys,ea8500) | 	linksys,ea8500) | ||||||
| 		macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) $(($PHYNBR + 1)) > /sys${DEVPATH}/macaddress | 		macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) $(($PHYNBR + 1)) > /sys${DEVPATH}/macaddress | ||||||
|  | 	ubnt,unifi-ac-hd) | ||||||
|  | 		macaddr_add $(mtd_get_mac_binary EEPROM 0x6) $(($PHYNBR + 1)) > /sys${DEVPATH}/macaddress | ||||||
|  | 		;; | ||||||
| esac | esac | ||||||
|  |  | ||||||
| OPATH=${DEVPATH##/devices/platform/} | OPATH=${DEVPATH##/devices/platform/} | ||||||
|   | |||||||
| @@ -13,9 +13,6 @@ boot() { | |||||||
| 	ignitenet,ss-w2-ac2600) | 	ignitenet,ss-w2-ac2600) | ||||||
| 		fw_setenv bootcount 0 | 		fw_setenv bootcount 0 | ||||||
| 		;; | 		;; | ||||||
| 	extreme,ap3935) |  | ||||||
| 		fw_setenv WATCHDOG_COUNT 0x00000000 |  | ||||||
| 		;; |  | ||||||
| 	linksys,ea7500-v1 |\ | 	linksys,ea7500-v1 |\ | ||||||
| 	linksys,ea8500) | 	linksys,ea8500) | ||||||
| 		mtd resetbc s_env || true | 		mtd resetbc s_env || true | ||||||
|   | |||||||
| @@ -1,17 +1,69 @@ | |||||||
| #!/bin/sh /etc/rc.common | #!/bin/sh /etc/rc.common | ||||||
|  |  | ||||||
| START=15 | START=98 | ||||||
|  |  | ||||||
| boot() { | # ipq806x_power_auto() | ||||||
|   local governor | #   Changes the governor to ondemand and sets the default parameters for cpu ondemand governor. | ||||||
|  | #   The parameters are tuned for best performance than for power. | ||||||
|  | #   Also, the up_thresholds have been set to low value, to workaround the cpu | ||||||
|  | #   utilization anamolies we are seeing with kcpustat with tickless kernel. | ||||||
|  | ipq806x_power_auto() { | ||||||
|  | 	echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor | ||||||
|  | 	echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor | ||||||
|  |  | ||||||
|   governor=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor) | 	# Change the minimum operating frequency for CPU0. | ||||||
|  | 	# This is required for cases where large amount of network traffic is sent | ||||||
|  | 	# instantaneously  without any ramp-up time , when CPU is at minimum perf level. | ||||||
|  | 	# At 384 MHz, CPU0 stays fully busy in softirq context and doesn't move to ksoftirqd, and | ||||||
|  | 	# doesn't give any other thread including cpufreq thread a chance to run. | ||||||
|  | 	# Hence, the CPU frequency is locked up at 384MHz till the traffic is stopped. | ||||||
|  | 	# Increasing the min frequency for CPU0 to 800 MHz (L2=1GHz), allows 4 Gbps instantaneous | ||||||
|  | 	# traffic without any hangs/lockups. | ||||||
|  | 	# | ||||||
|  | 	# CPU1 min frequency also has to be increased because there is a hardware constraint | ||||||
|  | 	# kraits cannot operate at 384MHz when L2 is at 1GHz. | ||||||
|  | 	# | ||||||
|  | 	# The impact on idle-state power with this change is about ~40-45mW. | ||||||
|  | 	# echo "800000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq | ||||||
|  | 	# echo "800000" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq | ||||||
|  |  | ||||||
|   if [ "$governor" = "ondemand" ]; then | 	# Change sampling rate for frequency scaling decisions to 0,5s, from 10 ms | ||||||
|     # Effective only with ondemand | 	echo "500000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate | ||||||
|     echo 600000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq |  | ||||||
|     echo 600000 > /sys/devices/system/cpu/cpufreq/policy1/scaling_min_freq | 	# Change sampling rate for frequency down scaling decision to 10s | ||||||
| 	echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor | 	echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor | ||||||
|  |  | ||||||
|  | 	# Change the CPU load threshold above which frequency is up-scaled to | ||||||
|  | 	# turbo frequency,to 50% | ||||||
| 	echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold | 	echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold | ||||||
|   fi | } | ||||||
|  |  | ||||||
|  | ipq40xx_power_auto() { | ||||||
|  | 	# change scaling governor as ondemand to enable clock scaling based on system load | ||||||
|  | 	echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor | ||||||
|  |  | ||||||
|  | 	# set scaling min freq as 200 MHz | ||||||
|  | 	echo "200000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq | ||||||
|  |  | ||||||
|  | 	# Change sampling rate for frequency scaling decisions to 1s, from 10 ms | ||||||
|  | 	echo "1000000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate | ||||||
|  |  | ||||||
|  | 	# Change sampling rate for frequency down scaling decision to 10s | ||||||
|  | 	echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor | ||||||
|  |  | ||||||
|  | 	# Change the CPU load threshold above which frequency is up-scaled to | ||||||
|  | 	# turbo frequency,to 50% | ||||||
|  | 	echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold | ||||||
|  | } | ||||||
|  |  | ||||||
|  | start() { | ||||||
|  | 	. /lib/functions/uci-defaults.sh | ||||||
|  |  | ||||||
|  | 	local board=$(board_name) | ||||||
|  | 	case "$board" in | ||||||
|  | 	zyxel,nbg6817 | netgear,r7800 | db149 | ap148 | ap145 | ap148_1xx | db149_1xx | db149_2xx | ap145_1xx | ap160 | ap160_2xx | ap161 | ak01_1xx) | ||||||
|  | 		ipq806x_power_auto ;; | ||||||
|  | 	ap-dk01.1-c1 | ap-dk01.1-c2 | ap-dk04.1-c1 | ap-dk04.1-c2 | ap-dk04.1-c3 | ap-dk04.1-c4 | ap-dk04.1-c5 | ap-dk05.1-c1 | ap-dk06.1-c1 | ap-dk07.1-c1 | ap-dk07.1-c2 | ap-dk07.1-c3) | ||||||
|  | 		ipq40xx_power_auto ;; | ||||||
|  | 	esac | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,3 +1,19 @@ | |||||||
|  | # CONFIG_NF_CONNTRACK_DSCPREMARK_EXT is not set | ||||||
|  | CONFIG_REGULATOR_NSS_VOLT=y | ||||||
|  | CONFIG_64BIT_TIME=y | ||||||
|  | CONFIG_CRYPTO_SHA1=y | ||||||
|  | CONFIG_CRYPTO_SHA1_ARM=y | ||||||
|  | CONFIG_CRYPTO_SHA1_ARM_NEON=y | ||||||
|  | CONFIG_CRYPTO_SHA256_ARM=y | ||||||
|  | CONFIG_CRYPTO_SHA512_ARM=y | ||||||
|  | CONFIG_CRYPTO_BLAKE2B_NEON=y | ||||||
|  | CONFIG_CRYPTO_AES_ARM_BS=y | ||||||
|  | CONFIG_CRYPTO_CRYPTD=y | ||||||
|  | CONFIG_CRYPTO_SIMD=y | ||||||
|  | CONFIG_CRYPTO_CBC=y | ||||||
|  | CONFIG_CRYPTO_BLAKE2B=y | ||||||
|  | CONFIG_SWCONFIG=y | ||||||
|  | CONFIG_SWCONFIG_LEDS=y | ||||||
| CONFIG_AR8216_PHY=y | CONFIG_AR8216_PHY=y | ||||||
| CONFIG_ALIGNMENT_TRAP=y | CONFIG_ALIGNMENT_TRAP=y | ||||||
| # CONFIG_APQ_GCC_8084 is not set | # CONFIG_APQ_GCC_8084 is not set | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Lucas Asvio
					Lucas Asvio