Merge "Revert "[Bugfix][bug-view-2083]Fixed the bug that gpio128(intest emmc power gpio) dropped to 0V after restart/ramdump"" into INTEST_PM_SDK6.1_2WIFI
diff --git a/ap/os/linux/linux-3.4.x/sound/soc/sanechips/Kconfig b/ap/os/linux/linux-3.4.x/sound/soc/sanechips/Kconfig
index baafde6..b481212 100644
--- a/ap/os/linux/linux-3.4.x/sound/soc/sanechips/Kconfig
+++ b/ap/os/linux/linux-3.4.x/sound/soc/sanechips/Kconfig
@@ -1,7 +1,10 @@
 config SND_SOC_SANECHIPS
 	tristate "ASoC support for Sanechips zx297520v3"
 	depends on ARCH_ZX297520V3 || ARCH_ZX297520V2 
+	select SND_SOC_ZX297520V3 if ARCH_ZX297520V3
 	select SND_SOC_ZX297520V2 if ARCH_ZX297520V2
+	select SND_SOC_ZX_I2S
+	select SND_SOC_ZX_PCM
 
 config SND_SOC_ZX297520V3_TI3100
 	tristate "SoC I2S Audio support for ZX297520V3 - TI3100"
diff --git a/ap/project/zx297520v3/prj_vehicle_dc_ref/config/normal/config.linux b/ap/project/zx297520v3/prj_vehicle_dc_ref/config/normal/config.linux
index e5764dc..12ca404 100755
--- a/ap/project/zx297520v3/prj_vehicle_dc_ref/config/normal/config.linux
+++ b/ap/project/zx297520v3/prj_vehicle_dc_ref/config/normal/config.linux
@@ -1375,9 +1375,9 @@
 # CONFIG_SND_SOC_ZX297520V3_NAU8810 is not set
 CONFIG_SND_SOC_ZX297520V3_DUMMY=y
 CONFIG_SND_SOC_ZX_VOICE=y
-# CONFIG_SND_SOC_ZX297520V3 is not set
-# CONFIG_SND_SOC_ZX_I2S is not set
-# CONFIG_SND_SOC_ZX_PCM is not
+CONFIG_SND_SOC_ZX297520V3=y
+CONFIG_SND_SOC_ZX_I2S=y
+CONFIG_SND_SOC_ZX_PCM=y
 CONFIG_SND_EXTRA_CTRL=y
 CONFIG_SND_SOC_DUMMY=y
 # CONFIG_HID_SUPPORT is not set
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf b/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
index 0ff4c1a..c7ed9ed 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
+++ b/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
@@ -95,6 +95,8 @@
 
 #dm-verity for squashfs
 DISTRO_FEATURES += " dm-verity "
+#support cgroup
+DISTRO_FEATURES += " cgroup "
 
 
 #CUSTOM_MACRO在各个产品不变的宏放到cpe-base.inc文件,变化的宏放在产品发布文件。
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/first.sh b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/first.sh
index 285cdd5..b01f11b 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/first.sh
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/zx297520v3/vehicle_dc_ref/fs/normal/rootfs/etc/init.d/first.sh
@@ -46,6 +46,22 @@
 mount   -t  devpts  devpts   /dev/pts
 
 mkdir -p /tmp/run
+#support cgroup
+if [ -e /sys/fs/cgroup ]; then
+    mount -t tmpfs cgroup  /sys/fs/cgroup
+    #mkdir -p /sys/fs/cgroup/cpuset
+    #mount -t cgroup -o cpuset cpuset /sys/fs/cgroup/cpuset
+    mkdir -p /sys/fs/cgroup/cpu,cpuacct
+    mount -t cgroup -o cpu,cpuacct cgroup /sys/fs/cgroup/cpu,cpuacct
+    mkdir -p /sys/fs/cgroup/memory
+    mount -t cgroup -o memory cgroup /sys/fs/cgroup/memory
+    cd /sys/fs/cgroup
+    ln -s /sys/fs/cgroup/cpu,cpuacct cpu
+    ln -s /sys/fs/cgroup/cpu,cpuacct cpuacct
+fi
+
+
+
 
 #软锁panic
 #echo 1 > /proc/sys/kernel/softlockup_panic
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-kernel/linux/files/zx297520v3/cgroup.cfg b/cap/zx297520v3/sources/meta-zxic-custom/recipes-kernel/linux/files/zx297520v3/cgroup.cfg
new file mode 100644
index 0000000..d72754a
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-kernel/linux/files/zx297520v3/cgroup.cfg
@@ -0,0 +1,7 @@
+CONFIG_CGROUP_SCHED=y
+CONFIG_CGROUP_PIDS=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_CFS_BANDWIDTH=y
+CONFIG_CGROUPS=y
+
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-kernel/linux/linux-zxic_5.10.bbappend b/cap/zx297520v3/sources/meta-zxic-custom/recipes-kernel/linux/linux-zxic_5.10.bbappend
index 3d328f4..ac8c86c 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-kernel/linux/linux-zxic_5.10.bbappend
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-kernel/linux/linux-zxic_5.10.bbappend
@@ -4,4 +4,5 @@
     file://${LINUX_CONFIG} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'OPTEE', 'file://optee.cfg', '', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'dm-verity', 'file://dm-verity.cfg', '', d)} \
-"
\ No newline at end of file
+    ${@bb.utils.contains('DISTRO_FEATURES', 'cgroup', 'file://cgroup.cfg', '', d)} \
+"
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-fota-backup/lynq-fota-backup.sh b/cap/zx297520v3/src/lynq/framework/lynq-fota-backup/lynq-fota-backup.sh
index 53eb20f..8013112 100644
--- a/cap/zx297520v3/src/lynq/framework/lynq-fota-backup/lynq-fota-backup.sh
+++ b/cap/zx297520v3/src/lynq/framework/lynq-fota-backup/lynq-fota-backup.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Run the daemon
+# Run the daemon with CPU cgroup limitation
 #
 
 DAEMON="lynq-fota-backup-service"
@@ -8,11 +8,52 @@
 EXEC="/usr/bin/lynq-fota-backup"
 EXEC_ARGS=""
 
+# Cgroup配置
+CGROUP_NAME="fota_backup"
+CGROUP_PATH="/sys/fs/cgroup/cpu/$CGROUP_NAME"
+CPU_LIMIT="20000"  # 20% CPU (100000 = 100%)
+
+# 创建Cgroup并设置CPU限制
+setup_cgroup() {
+	if [ ! -d "$CGROUP_PATH" ]; then
+		mkdir -p "$CGROUP_PATH"
+		echo "$CPU_LIMIT" > "$CGROUP_PATH/cpu.cfs_quota_us"
+		echo "100000" > "$CGROUP_PATH/cpu.cfs_period_us"
+		echo "Cgroup $CGROUP_NAME created with 20% CPU limit"
+	else
+		echo "Cgroup $CGROUP_NAME already exists, updating limit"
+		echo "$CPU_LIMIT" > "$CGROUP_PATH/cpu.cfs_quota_us"
+	fi
+}
+
+# 将进程添加到Cgroup
+add_to_cgroup() {
+	PID=$1
+	if [ -d "$CGROUP_PATH" ]; then
+		echo "$PID" > "$CGROUP_PATH/tasks"
+		echo -n "Process $PID added to Cgroup $CGROUP_NAME"
+	else
+		echo -n "ERROR: Cgroup $CGROUP_PATH does not exist!"
+	fi
+}
 
 start() {
-        echo -n "Starting $DAEMON... "
-        start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $EXEC_ARGS
-        [ $? -eq 0 ] && echo "OK" || echo "ERROR"
+	sleep 600
+	echo "Starting $DAEMON with 20% CPU limit... "
+	setup_cgroup
+	start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $EXEC_ARGS
+	RETVAL=$?
+	if [ $RETVAL -eq 0 ]; then
+		PID=$(cat $PIDFILE 2>/dev/null)
+		if [ -n "$PID" ]; then
+			add_to_cgroup "$PID"
+		else
+			echo "WARNING: Failed to read PID from $PIDFILE"
+		fi
+			echo "OK"
+		else
+			echo "ERROR"
+	fi
 }
 
 stop() {
@@ -22,18 +63,22 @@
 }
 
 restart() {
-        stop
-        start
+        stop 
+        start &
 }
 
 case "$1" in
-  start|stop|restart)
+	start)
+	start &
+	;;
+	stop|restart)
         "$1"
         ;;
-  *)
+	*)
         echo "Usage: $0 {start|stop|restart}"
         exit 1
 esac
 
 exit $?
 
+
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libscipc/sc_ipc.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libscipc/sc_ipc.c
index 9fa6d06..66404b7 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libscipc/sc_ipc.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/libscipc/sc_ipc.c
@@ -62,6 +62,7 @@
 static sc_ipc_event_ex s_evt_list;

 static sc_ipc_registrant s_registrant_list;

 static long s_ipc_msg_cnt = 0;

+static int s_ipc_ref_cnt = 0;

 

 static void sc_ipc_event_init(void);

 static void sc_ipc_event_set(sc_ipc_event *pevt, int fd, int msg_id, int persist, sc_ipc_event_cb func, void *param);

@@ -652,6 +653,7 @@
     pthread_attr_t attr;

 

     pthread_mutex_lock(&s_startupMutex);

+    s_ipc_ref_cnt++;

     if(s_started)

 		goto done;

 	sem_init(&terminate_sem, 0, 0);

@@ -677,8 +679,11 @@
 {

     int ret = 0;

     sc_ipc_msg msg = {0};

+    pthread_mutex_lock(&s_startupMutex);

+    s_ipc_ref_cnt--;

+    pthread_mutex_unlock(&s_startupMutex);

 

-	if(!s_started)

+	if(!s_started || s_ipc_ref_cnt > 0)

 		goto Done;

 

     msg.type = 0;

diff --git a/cp/phy/bin/zx297520v3/merge_lte_220a1_bin/ps/evb_cpuphy.bin b/cp/phy/bin/zx297520v3/merge_lte_220a1_bin/ps/evb_cpuphy.bin
index f6ea8e5..d403b21 100755
--- a/cp/phy/bin/zx297520v3/merge_lte_220a1_bin/ps/evb_cpuphy.bin
+++ b/cp/phy/bin/zx297520v3/merge_lte_220a1_bin/ps/evb_cpuphy.bin
Binary files differ
diff --git a/update_version.sh b/update_version.sh
index 7850e29..3a305d7 100755
--- a/update_version.sh
+++ b/update_version.sh
@@ -1,8 +1,8 @@
 #!/bin/bash
 #export LYNQ_VERSION="T106_lynq_version_ap_build_sh"
-LYNQ_AP_VERSION="T106-MXX-INTEST2WIFI-P56U11.AP.19.08"
-LYNQ_CAP_INSIDE_VERSION="CAP.19.08"
-LYNQ_CAP_VERSION="CAP.19.08"
+LYNQ_AP_VERSION="T106-MXX-INTEST2WIFI-P56U11.AP.19.09"
+LYNQ_CAP_INSIDE_VERSION="CAP.19.09"
+LYNQ_CAP_VERSION="CAP.19.09"
 COMMIT_ID="$(git rev-parse HEAD)"
 
 LYNQ_SW_INSIDE_VERSION="LYNQ_CONFIG_VERSION = \"${LYNQ_AP_VERSION}_${LYNQ_CAP_INSIDE_VERSION}\""