Merge "[Bugfix]Fixed the issue that the request execution failed after a while of booting without USB plugged in."
diff --git a/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/lynq_ap_nv_cfg.c b/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/lynq_ap_nv_cfg.c
index 7fae817..4689865 100755
--- a/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/lynq_ap_nv_cfg.c
+++ b/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/lynq_ap_nv_cfg.c
@@ -175,7 +175,7 @@
         printk("enter use local default values\n");

         ret = (struct nv_cfg_info *)kzalloc(sizeof (struct nv_cfg_info), GFP_KERNEL);

         memset(ret, 0, sizeof(struct nv_cfg_info));

-        ret->mmc0_enable = 1;

+        ret->mmc0_enable = 0;

         ret->mmc1_enable = 1;

     }

 

diff --git a/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/lynq_default_nv_cfg.h b/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/lynq_default_nv_cfg.h
index 85ebb80..f2d267d 100755
--- a/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/lynq_default_nv_cfg.h
+++ b/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/lynq_default_nv_cfg.h
@@ -1,18 +1,16 @@
 #ifndef LYNQ_DEFAULT_NV_CFG_H

 #define LYNQ_DEFAULT_NV_CFG_H

 

-static const char lynq_default_nv_cfg_value1[] = {

-    '\x55', '\xaa', '\x0b', '\x00', '\xff', '\xff', '\xff', '\xff', '\x00', '\xaa', '\x55', '\x0b', '\x00', '\x05', '\x10', '\x0c', '\x03'

-};

-

 static const char lynq_default_nv_cfg_value[] = {

-    '\x55', '\xaa', '\x09', '\x00', '\xc0', '\x80', '\x80', '\x00', '\xaa', '\x55', '\x09', '\x00', '\x05', '\x10', '\x0c', '\x03'

+    '\x55', '\xaa', '\x09', '\x00', '\x40', '\x80', '\x00', '\x00', '\xaa', '\x55', '\x09', '\x00', '\x01', '\x00', '\x14', '\x28'

 };

 

 static const char lynq_nv_cfg_bitmap[] = {

-    '\xC0', '\x80', '\x80', '\x80'

+    '\xc0', '\x80', '\x80', '\x80'

 };

 

 static int lynq_default_soft_version = 1;

 

+static int lynq_default_hard_version = 0;

+

 #endif // LYNQ_DEFAULT_NV_CFG_H

diff --git a/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/pwr_ctrl.c b/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/pwr_ctrl.c
index 0ba80af..a5d27f4 100755
--- a/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/pwr_ctrl.c
+++ b/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/pwr_ctrl.c
@@ -291,7 +291,7 @@
 	   }
 
 	   // zw.wang The WiFi-related control pins gpio132 and gpio91 are still affected after the uboot removes mmc0 on 20240531 on start
-	   if (get_mmc0_enable() == 1)
+	   if (get_wifi_enable() == 1)
 	   {
 		   gpio_direction_output(ZX29_GPIO_132, 1);
 		   gpio_direction_output(ZX29_GPIO_91, 1);
diff --git a/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/zx297520v3-mdl-devices.c b/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/zx297520v3-mdl-devices.c
index 74cba0d..e0ad7ac 100755
--- a/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/zx297520v3-mdl-devices.c
+++ b/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/zx297520v3-mdl-devices.c
@@ -1406,8 +1406,7 @@
 };
 #else
 int ts_temp_value_table[TS_ADC_TEMP_NUMBER][TS_ADC_TEMP_VOLTAGE_NUMBER]={
-{
- -45,-44,-43,-42,-41,		
+{		
  -40,-39,-38,-37,-36, -35,-34,-33,-32,-31,		
  -30,-29,-28,-27,-26, -25,-24,-23,-22,-21,		
  -20,-19,-18,-17,-16, -15,-14,-13,-12,-11,		
@@ -1427,24 +1426,23 @@
  120,121,122,123,124,125},
 
 {
-5849,5842,5835,5828,5821,
-5814,5807,5800,5794,5787,5780,5770,5761,5751,5742,
-5732,5720,5707,5695,5682,5670,5654,5638,5623,5607,
-5591,5571,5550,5530,5509,5489,5461,5432,5404,5375,
-5347,5318,5290,5261,5233,5204,5179,5154,5129,5104,
-5079,5040,5001,4961,4922,4883,4838,4794,4749,4705,
-4660,4618,4576,4534,4492,4450,4416,4383,4349,4316,
-4282,4238,4193,4149,4104,4060,4015,3971,3926,3882,
-3837,3798,3759,3719,3680,3641,3603,3565,3526,3488,
-3450,3419,3387,3356,3324,3293,3262,3232,3201,3171,
-3140,3112,3085,3057,3030,3002,2978,2954,2931,2907,
-2883,2862,2841,2819,2798,2777,2759,2740,2722,2703,
-2685,2669,2653,2636,2620,2604,2590,2575,2561,2546,
-2532,2520,2508,2495,2483,2471,2461,2451,2442,2432,
-2422,2414,2406,2398,2390,2380,2373,2366,2359,2352,
-2345,2339,2333,2327,2321,2315,2310,2305,2300,2295,
-2290,2286,2282,2278,2274,2270,2267,2264,2261,2258,
-2255,2254,2253,2252,2251,2250  }
+5753,5743,5732,5721,5709,5697,5684,5671,5658,5643,
+5629,5614,5598,5581,5564,5547,5529,5510,5491,5471,
+5450,5429,5407,5385,5362,5338,5314,5289,5263,5237,
+5211,5183,5155,5127,5097,5068,5037,5007,4975,4944,
+4912,4879,4846,4813,4779,4745,4710,4676,4641,4605,
+4570,4534,4498,4462,4426,4389,4353,4317,4280,4244,
+4207,4171,4135,4099,4063,4027,3992,3956,3921,3886,
+3851,3817,3783,3749,3716,3683,3650,3618,3587,3555,
+3524,3494,3464,3434,3405,3376,3348,3320,3292,3265,
+3239,3213,3188,3163,3138,3114,3091,3068,3045,3023,
+3001,2980,2960,2940,2920,2901,2883,2864,2847,2829,
+2812,2796,2779,2763,2748,2733,2718,2704,2690,2676,
+2662,2649,2637,2624,2612,2601,2589,2578,2567,2556,
+2546,2536,2526,2516,2507,2498,2489,2480,2471,2463,
+2455,2447,2440,2432,2425,2418,2411,2404,2398,2391,
+2385,2379,2373,2367,2362,2356,2351,2346,2341,2336,
+2331,2326,2322,2317,2313,2309}
 };
 #endif
 volatile u32 ts_adc_flag=3;// 1:adc1; 2:adc2, other:adc rf;  
diff --git a/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800d80l/aicwf_sdio.c b/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800d80l/aicwf_sdio.c
index 177bb92..95c40dc 100755
--- a/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800d80l/aicwf_sdio.c
+++ b/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800d80l/aicwf_sdio.c
@@ -2062,7 +2062,7 @@
 	struct mmc_host *host;
 	u8 byte_mode_disable = 0x1;//1: no byte mode
 	int ret = 0;
-	uint32_t sdio_clock = 100000000;
+	uint32_t sdio_clock = 78000000; //zw.wang WiFi low temperature -40 degrees failure on 20240716
     u8 val;
 	u8 val1 = 0;
 	//struct aicbsp_feature_t feature;
diff --git a/ap/os/linux/linux-3.4.x/drivers/soc/zte/tsc/zx-tsc.h b/ap/os/linux/linux-3.4.x/drivers/soc/zte/tsc/zx-tsc.h
index cad1254..aec0eb1 100755
--- a/ap/os/linux/linux-3.4.x/drivers/soc/zte/tsc/zx-tsc.h
+++ b/ap/os/linux/linux-3.4.x/drivers/soc/zte/tsc/zx-tsc.h
@@ -206,7 +206,7 @@
 //#define  TS_ADC_TEMP_NUMBER   2
 //#define  TS_ADC_TEMP_VOLTAGE_NUMBER  110
 #define  TS_TEMP_NUMBER_SMALLEST   0
-#define  TS_TEMP_NUMBER_BIGGEST  171
+#define  TS_TEMP_NUMBER_BIGGEST  166
 
 #define TEMP_PERCENT_INTERVAL  (10) //ζȰٷֱȼä¸ô
 
diff --git a/ap/os/linux/linux-3.4.x/include/lynq/lynq_ap_nv_cfg.h b/ap/os/linux/linux-3.4.x/include/lynq/lynq_ap_nv_cfg.h
index e13fb05..9eda420 100755
--- a/ap/os/linux/linux-3.4.x/include/lynq/lynq_ap_nv_cfg.h
+++ b/ap/os/linux/linux-3.4.x/include/lynq/lynq_ap_nv_cfg.h
@@ -8,7 +8,8 @@
     unsigned short valid_flag:1;

     unsigned short content_len:15;

 };

-struct nv_cfg_info{

+struct nv_cfg_info

+{

     unsigned char reserved_0:6;

     unsigned char mmc1_enable:1;

     unsigned char mmc0_enable:1;

@@ -18,9 +19,11 @@
     unsigned char rndis_mac_convert:1;

     unsigned char reserved_3:7;

     unsigned char rndis_ip_map:1;

+

 };

 

-struct version_info{

+struct version_info

+{

     unsigned short soft_ver:12;

     unsigned short hard_ver:4;

     unsigned short crc;

@@ -38,24 +41,26 @@
 

 extern struct nv_cfg_info *get_ap_nv_cfg_info();

 

-static inline int get_mmc0_enable() {

+static inline unsigned char get_mmc0_enable() {

     return get_ap_nv_cfg_info()->mmc0_enable;

 }

 

-static inline int get_mmc1_enable() {

+static inline unsigned char get_mmc1_enable() {

     return get_ap_nv_cfg_info()->mmc1_enable;

 }

 

-static inline int get_wifi_enable() {

+static inline unsigned char get_wifi_enable() {

     return get_ap_nv_cfg_info()->wifi_enable;

 }

 

-static inline int get_rndis_mac_convert() {

+static inline unsigned char get_rndis_mac_convert() {

     return get_ap_nv_cfg_info()->rndis_mac_convert;

 }

 

-static inline int get_rndis_ip_map() {

+static inline unsigned char get_rndis_ip_map() {

     return get_ap_nv_cfg_info()->rndis_ip_map;

 }

 

+

+

 #endif // LYNQ_AP_NV_CFG_H

diff --git a/ap/project/zx297520v3/prj_vehicle_dc_ref/fs/normal/rootfs/etc/rc b/ap/project/zx297520v3/prj_vehicle_dc_ref/fs/normal/rootfs/etc/rc
index ae9328b..e60ab5d 100755
--- a/ap/project/zx297520v3/prj_vehicle_dc_ref/fs/normal/rootfs/etc/rc
+++ b/ap/project/zx297520v3/prj_vehicle_dc_ref/fs/normal/rootfs/etc/rc
@@ -292,3 +292,9 @@
 
 cat /tmp/nvro_check.txt
 
+rndis_ip_map=`cat /sys/class/lynq_nv_cfg/cdev_lynq_nv_cfg/rndis_ip_map`
+if [ "$rndis_ip_map" == "1" ];then
+    iptables -t nat -A PREROUTING -s 192.168.225.10 -d 192.168.225.1 -j DNAT --to-destination 192.168.225.2
+    iptables -t nat -A POSTROUTING -s 192.168.225.2 -d 192.168.225.10 -j SNAT --to-source 192.168.225.1
+fi
+
diff --git a/boot/common/src/uboot/drivers/peripheral/lynq_uboot_nv_cfg.h b/boot/common/src/uboot/drivers/peripheral/lynq_uboot_nv_cfg.h
index d2f0da9..20e98c2 100755
--- a/boot/common/src/uboot/drivers/peripheral/lynq_uboot_nv_cfg.h
+++ b/boot/common/src/uboot/drivers/peripheral/lynq_uboot_nv_cfg.h
@@ -1,60 +1,60 @@
-#ifndef __LYNQ_UBOOT_NV_CFG__H__
-#define __LYNQ_UBOOT_NV_CFG__H__
-
-#define RAS_BIT_LEN 1024
-#define RSA_BYTE_LEN (RAS_BIT_LEN / 8)
-#define RSA_U32_LEN (RSA_BYTE_LEN / sizeof(u32))
-#define LYNQ_NV_CFG_SIGN_LEN RSA_BYTE_LEN
-#define LYNQ_NV_CFG_PUBLICKEY_LEN (RSA_BYTE_LEN + sizeof(u32))
-
-#pragma pack(1)
-
-struct lynq_nv_cfg_header
-{
-    unsigned short magic_flag;
-    unsigned short valid_flag:1;
-    unsigned short content_len:15;
-};
-struct lynq_nv_cfg
-{
-    struct lynq_nv_cfg_header head;
-    unsigned char content[4];
-    struct lynq_nv_cfg_header tail;
-    unsigned int lynq_reserved[1];
-};
-#pragma pack()
-
-static const char lynq_nv_cfg_version[] = "T106_CN_20240617";
-static const char lynq_nv_cfg_value[] = {
-   '\x55', '\xaa', '\x09', '\x00', '\xc0', '\x00', '\x00', '\x00', '\xaa', '\x55', '\x09', '\x00', '\x01', '\x00', '\x3c', '\x00'
-};
-
-static const char lynq_nv_cfg_bitmap[] = {
-    '\xC0', '\x80', '\x80', '\x80'
-};
-static const char oem_nv_cfg_bitmap[] = {
-    '\x40', '\x80', '\x80', '\x80'
-};
-static const char lynq_nv_cfg_publickey[] = {
-    '\x92', '\x95', '\xf0', '\xc7', '\x36', '\x68', '\xad', '\xd0', '\x0f', '\xdb', '\x5c', '\xfd', '\x58', '\xf0', '\xc0', '\xa0',
-    '\x0b', '\x89', '\x6b', '\xa0', '\x05', '\x93', '\xa9', '\xb3', '\x54', '\x0f', '\x68', '\x24', '\x3e', '\x2d', '\xfd', '\x02',
-    '\x05', '\xf7', '\xe7', '\x48', '\xad', '\x39', '\x13', '\x6f', '\x71', '\xef', '\x6e', '\xcf', '\xc6', '\xcf', '\x5f', '\xc9',
-    '\x24', '\xa2', '\xd8', '\x2d', '\x17', '\xd6', '\x2b', '\x96', '\x7b', '\x48', '\x98', '\x12', '\xd5', '\x28', '\x4c', '\x72',
-    '\xcd', '\x34', '\xd5', '\xdb', '\x89', '\x87', '\x34', '\xe2', '\xab', '\x29', '\xe4', '\x56', '\x40', '\xe5', '\x92', '\x76',
-    '\xa5', '\xee', '\xb4', '\xbc', '\x37', '\x93', '\xb7', '\xe4', '\x30', '\x4d', '\x92', '\x7b', '\x2c', '\x11', '\x94', '\xd9',
-    '\x8b', '\xe8', '\x0d', '\x96', '\xed', '\x64', '\xd1', '\x0a', '\x7d', '\x4a', '\xd8', '\x1b', '\xf5', '\x0f', '\x4c', '\xfb',
-    '\x07', '\xde', '\xfa', '\xf9', '\xae', '\x42', '\x68', '\x6d', '\xe9', '\xe4', '\x58', '\x80', '\xdb', '\x0b', '\x84', '\xab',
-    '\x01', '\x00', '\x01', '\x00'
-};
-static const char lynq_nv_cfg_sign[] = {
-    '\xef', '\x87', '\xd6', '\x86', '\xea', '\xe6', '\x7f', '\xbd', '\x01', '\x57', '\xe4', '\x94', '\xfa', '\x86', '\xcd', '\xdb',
-    '\x75', '\xe2', '\xc0', '\x94', '\xe0', '\x3f', '\x30', '\x90', '\x9d', '\x24', '\x6e', '\x29', '\x8f', '\x90', '\x52', '\x86',
-    '\x19', '\xfc', '\x83', '\x7f', '\x1d', '\x9f', '\x32', '\x4b', '\xb9', '\x01', '\x5d', '\xb3', '\xf3', '\xcd', '\x30', '\xc5',
-    '\xf6', '\x2f', '\xc5', '\x68', '\x7e', '\x87', '\xae', '\xf2', '\x70', '\x54', '\xff', '\xe6', '\x60', '\xcb', '\xfe', '\xec',
-    '\x68', '\xaa', '\x01', '\x49', '\xd2', '\x93', '\x7b', '\x6e', '\x31', '\x0f', '\x91', '\xad', '\xdf', '\x81', '\x62', '\x04',
-    '\x36', '\x21', '\x22', '\xb6', '\x79', '\xfd', '\x61', '\xcf', '\x3a', '\xb9', '\x40', '\xba', '\x7c', '\xdf', '\x6e', '\xba',
-    '\x1e', '\xc2', '\x27', '\xb9', '\x49', '\x35', '\xd6', '\x5d', '\xc9', '\xe5', '\xed', '\x27', '\xa4', '\x70', '\x59', '\x41',
-    '\x4c', '\x84', '\x72', '\x7a', '\x06', '\xc7', '\x16', '\xcb', '\x56', '\x6a', '\x39', '\xeb', '\x0f', '\xa9', '\x59', '\xcc'
-};
-
-#endif
+#ifndef __LYNQ_UBOOT_NV_CFG__H__

+#define __LYNQ_UBOOT_NV_CFG__H__

+

+#define RAS_BIT_LEN 1024

+#define RSA_BYTE_LEN (RAS_BIT_LEN / 8)

+#define RSA_U32_LEN (RSA_BYTE_LEN / sizeof(u32))

+#define LYNQ_NV_CFG_SIGN_LEN RSA_BYTE_LEN

+#define LYNQ_NV_CFG_PUBLICKEY_LEN (RSA_BYTE_LEN + sizeof(u32))

+

+#pragma pack(1)

+

+struct lynq_nv_cfg_header

+{

+    unsigned short magic_flag;

+    unsigned short valid_flag:1;

+    unsigned short content_len:15;

+};

+struct lynq_nv_cfg

+{

+    struct lynq_nv_cfg_header head;

+    unsigned char content[4];

+    struct lynq_nv_cfg_header tail;

+    unsigned int lynq_reserved[1];

+};

+#pragma pack()

+

+static const char lynq_nv_cfg_version[] = "T106_CN_20240627";

+static const char lynq_nv_cfg_value[] = {

+    '\x55', '\xaa', '\x09', '\x00', '\x40', '\x00', '\x00', '\x00', '\xaa', '\x55', '\x09', '\x00', '\x01', '\x00', '\x15', '\xc0'

+};

+

+static const char lynq_nv_cfg_bitmap[] = {

+    '\xc0', '\x80', '\x80', '\x80'

+};

+static const char oem_nv_cfg_bitmap[] = {

+    '\x80', '\x80', '\x80', '\x80'

+};

+static const char lynq_nv_cfg_publickey[] = {

+    '\xe7', '\x09', '\xa3', '\x94', '\x19', '\x39', '\x46', '\x55', '\x59', '\x0f', '\x1b', '\x81', '\xa3', '\x61', '\x45', '\x3b', 

+    '\x74', '\x07', '\x9a', '\x21', '\x4a', '\xb3', '\x63', '\x1b', '\x96', '\x32', '\xf8', '\xbb', '\xc2', '\x4e', '\xf1', '\xa6', 

+    '\x0c', '\x77', '\x43', '\xe0', '\x45', '\x15', '\xb2', '\x1c', '\x2d', '\xf1', '\xf9', '\x22', '\xdb', '\xbc', '\xfb', '\x5c', 

+    '\xef', '\x3d', '\x4b', '\xc3', '\x91', '\xfa', '\x1f', '\xe8', '\x36', '\xc9', '\xd8', '\xcf', '\x79', '\xf3', '\xe8', '\xbe', 

+    '\x30', '\x7e', '\x11', '\x8b', '\x7f', '\xc9', '\x22', '\xfb', '\x3c', '\x77', '\x7a', '\xa2', '\xd8', '\x23', '\x60', '\xc5', 

+    '\x79', '\x97', '\xbf', '\x8d', '\x21', '\xee', '\x87', '\xd3', '\xdf', '\x2c', '\xc3', '\x34', '\xd8', '\xa2', '\x3d', '\xca', 

+    '\x40', '\xf3', '\x83', '\x23', '\x28', '\x82', '\xb3', '\x67', '\xf8', '\x34', '\xdd', '\x9c', '\x40', '\x35', '\x61', '\x85', 

+    '\x89', '\xae', '\xc2', '\x26', '\xfb', '\xbd', '\x77', '\xe6', '\xfe', '\x81', '\x39', '\xc3', '\xd1', '\x7b', '\xe0', '\x39', 

+    '\x01', '\x00', '\x01', '\x00'

+};

+static const char lynq_nv_cfg_sign[] = {

+    '\x79', '\xc0', '\x04', '\x03', '\xb3', '\x6b', '\x18', '\x12', '\x1d', '\x09', '\xf7', '\x7f', '\xb0', '\x56', '\x86', '\x9c', 

+    '\x26', '\x21', '\x75', '\xbd', '\x0e', '\x93', '\xe1', '\x3d', '\xae', '\x35', '\x68', '\x6f', '\xfc', '\x0a', '\x0a', '\x40', 

+    '\x48', '\x40', '\xf3', '\x95', '\x7c', '\x26', '\xb8', '\xd7', '\xc3', '\xd0', '\xc9', '\x99', '\x35', '\x0f', '\x0f', '\x36', 

+    '\x77', '\xe4', '\x98', '\x41', '\x25', '\xa1', '\xff', '\xbd', '\x4c', '\xad', '\x41', '\xe3', '\x9c', '\x73', '\x92', '\x66', 

+    '\xaa', '\xad', '\x3e', '\x17', '\x78', '\xaa', '\x86', '\x78', '\x61', '\x56', '\x63', '\x2a', '\xa4', '\xc0', '\x49', '\x28', 

+    '\x25', '\x3a', '\xb5', '\x53', '\x23', '\xe4', '\x2c', '\x79', '\x69', '\x6a', '\x45', '\x86', '\xbc', '\x5c', '\x08', '\x57', 

+    '\xa4', '\xc6', '\x7f', '\xf5', '\x0e', '\x32', '\xf5', '\x46', '\x9a', '\xa1', '\xef', '\x07', '\xc3', '\x5d', '\x09', '\x75', 

+    '\xc0', '\x87', '\x8d', '\x1d', '\x0d', '\x0a', '\x07', '\xca', '\xb2', '\xb8', '\xe8', '\x75', '\x9d', '\x37', '\xcf', '\xeb'

+};

+

+#endif

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 8400655..0bea4fc 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
@@ -455,6 +455,9 @@
 #cz.li@20240221 add for MOBILETEK_GNSS_UPDATE_ENABLE value: "yes","no"
 MOBILETEK_GNSS_UPDATE_ENABLE = "no"
 
+#xf.li@20240716 add for MOBILETEK_LOG_ENCRYPT value: "enable","disable"
+MOBILETEK_LOG_ENCRYPT = "disable"
+
 LYNQ_CONFIG_COMMITID = "e2a3410390ff0ad762462ccb6af8faa5e16dcd61"
 LYNQ_CONFIG_VERSION = "T106_ap_version_cap_0425"
 LYNQ_CONFIG_SW_VERSION = "T106_ap_version_MR3.02b06.00"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/zxic-image.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/zxic-image.bb
index b9d6b78..f15ad14 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/zxic-image.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/zxic-image.bb
@@ -256,7 +256,17 @@
     ${@bb.utils.contains("DISTRO_FEATURES", "oemfs", "do_oemfs_oemdata;", "", d)} \
     ${@bb.utils.contains("IMAGE_FSTYPES", "squashfs", "do_rootfs_squashfs;", "", d)} \
     "
-
+#xf.li@20240716 add start
+do_oem_config() {
+	if [ "${MOBILETEK_LOG_ENCRYPT}" = "enable" ]; then
+		touch ${IMAGE_ROOTFS}/etc/syslog_encrypt_flag
+	else
+		rm -rf ${IMAGE_ROOTFS}/etc/syslog_encrypt_flag
+		touch ${IMAGE_ROOTFS}/etc/no_log_encrypt
+	fi
+}
+addtask  do_oem_config after do_rootfs before do_image
+#xf.li@20240716 add end
 addtask  cprootfs after do_dm_verity before do_build
 addtask  do_dm_verity after do_image_complete  before do_build
 addtask  cleanrootfs after do_clean  before do_cleansstate
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
index 23bb8e4..5fff5eb 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
@@ -32,6 +32,7 @@
 #define FOTA_SYNC_FLAG    1

 #define FOTA_CURRENT_SYS  "/mnt/userdata/.fota_current_sys"

 

+#define USER_LOG_TAG "LYNQ_FOTA_BACKUP"

 

 extern int lynq_sync_system();

 extern int lynq_fota_get_addr_value(char *tmp_value);

@@ -49,7 +50,7 @@
     fp = fopen(FOTA_REBOOT_FLAG,"w+");

     if(fp == NULL)

     {

-        printf("Open reboot flag file failed\n");

+        LYERRLOG("Open reboot flag file failed\n");

         return;

     }

     

@@ -70,33 +71,34 @@
     //not fota 

     if(access(FOTA_FLAG_FILE, F_OK) == -1)

     {

-        printf("Fota flag file no exist\n");

+        LYINFLOG("Fota flag file no exist\n");

 

         //file no exist,get current sys write to file

         if(access(FOTA_CURRENT_SYS,F_OK) == -1)

         {

-            printf("Record current sys file no exist\n");

+            LYINFLOG("Record current sys file no exist\n");

             

             fp = fopen(FOTA_CURRENT_SYS,"w");

             if(fp == NULL)

              {

-                printf("creat  record current file failed\n");

+                LYERRLOG("creat  record current file failed\n");

                 return -1;

             }

             current_sys = lynq_get_current_system();

             if(current_sys < 0)

             {

-                printf("Get current system failed %d\n",current_sys);

+                LYERRLOG("Get current system failed %d\n",current_sys);

                 fclose(fp);

                 return -1;

             }

             else

             {

                 

-                printf("Get current system success  %d\n",current_sys);

+                LYINFLOG("Get current system success  %d\n",current_sys);

                 fprintf(fp, "%d", current_sys);

-                system("sync");

                 fclose(fp);

+                system("sync");

+                

                 return 0;

             }

         }

@@ -105,16 +107,16 @@
             current_sys = lynq_get_current_system();

             if(current_sys < 0)

             {

-                printf("Get current system failed %d\n",current_sys);

+                LYERRLOG("Get current system failed %d\n",current_sys);

                 return -1;

             }

 

-            printf("Get current system success  %d\n",current_sys);

+            LYINFLOG("Get current system success  %d\n",current_sys);

             

             fp = fopen(FOTA_CURRENT_SYS,"r");

             if(fp == NULL)

             {

-                printf("read file failed \n");

+                LYERRLOG("read file failed \n");

                 return -1;

             }

         

@@ -124,37 +126,39 @@
             }

             else

             {

-                printf("tmp_sys is NULL");

+                LYERRLOG("tmp_sys is NULL");

                 fclose(fp);

                 return -1;

             }

             

             if( record_sys == current_sys)

             {

-                printf("System not need sync \n");

+                LYINFLOG("System not need sync \n");

                 fclose(fp);

                 return 0;

             }

             else 

             {

-                fp = fopen(FOTA_CURRENT_SYS,"w");

-                if(fp == NULL)

-                {

-                    printf("creat file failed  \n");

-                    return -1;

-                }

-                

-                printf("System need sync \n");

-                fprintf(fp,"%d",current_sys);

-                system("sync");

-                fclose(fp);

+                LYINFLOG("System need sync \n");

                 ret = lynq_sync_system();

                 if(ret < 0 )

                 {

-                    printf("A/B sync system failed \n");

+                    LYERRLOG("A/B sync system failed \n");

                     return -1;

                 }

-                printf("A/B sync system success \n");

+                LYINFLOG("A/B sync system success,record current sys \n");

+                fp = fopen(FOTA_CURRENT_SYS,"w");

+                if(fp == NULL)

+                {

+                    LYERRLOG("creat file failed  \n");

+                    return -1;

+                }

+                

+                fprintf(fp,"%d",current_sys);

+                fclose(fp);

+                system("sync");

+                

+                

                 return 0;

             }

         }

@@ -166,20 +170,20 @@
         fp = fopen(FOTA_CURRENT_SYS,"w");

         if(fp == NULL)

         {

-            printf("Creat file failed \n");

+            LYERRLOG("Creat file failed \n");

             return -1;

         }

-        printf("fota flag file exist,record current sys \n");

+        LYINFLOG("fota flag file exist,record current sys \n");

         current_sys = lynq_get_current_system();

         if(current_sys < 0)

         {

-            printf("Get current system failed %d\n",current_sys);

+            LYERRLOG("Get current system failed %d\n",current_sys);

             return -1;

         }

         

         fprintf(fp,"%d",current_sys);

-        system("sync");

         fclose(fp);

+        system("sync");

         return 0;

     }

            

@@ -198,7 +202,7 @@
     fp = fopen(FOTA_FLAG_FILE,"r");

     if(fp == NULL)

     {

-        printf("No need fota sync\n");

+        LYERRLOG("No need fota sync\n");

         return -1;

 

     }

@@ -213,7 +217,7 @@
         ret = lynq_sync_system();

         if(ret != 0)

         {

-            printf("sync faild\n");

+            LYERRLOG("sync faild\n");

         }

        system("rm -rf /mnt/userdata/.back_up_flag");

         

@@ -223,20 +227,20 @@
         ret = lynq_fota_get_addr_value(tmp_addr);

         if(ret != 0)

         {

-            printf("Get addr failed\n");

+            LYERRLOG("Get addr failed\n");

             return -1;

         }

-        printf("tmp_addr is %s\n",tmp_addr);

+        LYINFLOG("tmp_addr is %s\n",tmp_addr);

         ret = lynq_fota_set_addr_value(tmp_addr,10);

         if(ret != 0)

         {

-            printf("Set addr failed\n");

+            LYERRLOG("Set addr failed\n");

             return -1;

         }

         ret = lynq_fota_nrestart();

         if(ret != 0)

         {

-            printf("Upgrade failed\n");

+            LYERRLOG("Upgrade failed\n");

             return -1;

         }

         

@@ -245,6 +249,7 @@
     return 0;

 

 }

+DEFINE_LYNQ_LIB_LOG(LYNQ_FOTA_BACKUP)

 

 #ifdef __cplusplus

 }

diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp
index c116e65..949c1f3 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp
@@ -13,6 +13,7 @@
 #include <syslog.h>
 #include <pthread.h>
 
+#include <include/lynq-qser-autosuspend.h>
 #include <include/lynq-qser-wifi.h>
 
 void lynq_wifi_event_handle_demo(lynq_wifi_event_s *event, void *arg)
@@ -51,6 +52,12 @@
 
 int main(int argc, char *argv[])
 {
+    int num = qser_wakelock_create("wifi_lock", 10);
+    if(num < 0)
+    {
+        printf("wakelock create fail\n");
+        printf("num=%d\n", num);
+    }
     lynq_wifi_ap_index_e type;
     if (strcmp(argv[0], "lynq-wifi-demo") == 0)
         type = LYNQ_WIFI_AP_INDEX_AP0; // 2.4G
@@ -63,6 +70,18 @@
             qser_wifi_enable();      // enable wifi
             qser_wifi_ap_stop(type); // Disable ap mode for 2.4G/5G
             qser_wifi_disable();     // Turn off WiFi
+            int ret = qser_wakelock_unlock(num);
+            if(ret != 0)
+            {
+                printf("wakelock unlock fail\n");
+                printf("ret=%d\n", ret);
+            }
+            ret = qser_wakelock_destroy(num);
+            if(ret != 0)
+            {
+                printf("wakelock destroy fail\n");
+                printf("ret=%d\n", ret);
+            }
         }
         else if (strcmp(argv[1], "1") == 0) //Load WiFi and turn on WiFi
         {
@@ -93,6 +112,12 @@
             }
             qser_wifi_ap_auth_set(type, LYNQ_WIFI_AUTH_WPA2_PSK, pw); // Set the authentication of 2.4G/5G to wpa2 and the password to lynq123456
             qser_wifi_ap_start(type);                                 // Set the ap mode of 2.4G/5G
+            int ret = qser_wakelock_lock(num);
+            if(ret != 0)
+            {
+                printf("wakelock lock fail\n");
+                printf("ret=%d\n", ret);
+            }
         }
         else if (strcmp(argv[1], "2") == 0) //Callback query that only covers WiFi as an ap
         {
@@ -195,7 +220,12 @@
             qser_wifi_sta_start();
             qser_wifi_sta_start_scan(); // When this function is executed once, sta's scan is called once
             memset(cmdstr, 0, sizeof(cmdstr));
-
+            ret = qser_wakelock_lock(num);
+            if(ret != 0)
+            {
+                printf("wakelock lock fail\n");
+                printf("ret=%d\n", ret);
+            }
             while (1)
             {
                 printf("[lynq-wifi-demo]Enter the ssid and password as shown in the following example:ssid auth paris pw ||sta_pkt_get ||sta_param_get || sta_scan ||sta_stop\n");
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/makefile b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/makefile
index bac0c42..e3ec151 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/makefile
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/makefile
@@ -29,6 +29,7 @@
     -lstdc++ \
     -lpthread \
     -llynq-qser-wifi \
+    -llynq-qser-autosuspend \
 
 SOURCES = lynq-wifi-demo.cpp
 
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/lynq-wifi-demo.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/lynq-wifi-demo.bb
index 2b48617..ffd0288 100644
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/lynq-wifi-demo.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/lynq-wifi-demo.bb
@@ -8,6 +8,7 @@
            file://makefile \
 "
 DEPENDS += "liblynq-qser-wifi"
+DEPENDS += "liblynq-qser-autosuspend"
 
 SRC-DIR = "${S}/../lynq-wifi-demo"
 FILES_${PN} += "${bindir}/"
diff --git a/cap/zx297520v3/sources/meta-zxic/recipes-core/busybox/busybox/busybox-1.33.1/0103-syslogd-data-encryption.patch b/cap/zx297520v3/sources/meta-zxic/recipes-core/busybox/busybox/busybox-1.33.1/0103-syslogd-data-encryption.patch
new file mode 100755
index 0000000..32a47fa
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic/recipes-core/busybox/busybox/busybox-1.33.1/0103-syslogd-data-encryption.patch
@@ -0,0 +1,32 @@
+From 8e37145dcc28a46f9c1ebc85c8c2df269635677c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=E5=AE=8B=E4=BA=91=E9=9C=9E0318000489?=
+ <song.yunxia@sanechips.com.cn>
+Date: Thu, 18 Apr 2024 21:40:23 +0800
+Subject: [PATCH] syslogd data encryption
+
+---
+ sysklogd/syslogd.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+ mode change 100644 => 100755 sysklogd/syslogd.c
+
+diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
+old mode 100644
+new mode 100755
+index 76c0991..ca7cef8
+--- a/sysklogd/syslogd.c
++++ b/sysklogd/syslogd.c
+@@ -695,7 +695,12 @@ static void log_locally(time_t now, char *msg, logFile_t *log_file)
+ 	struct flock fl;
+ #endif
+ 	int len = strlen(msg);
++	int index;
+
++	if(access("/etc/syslog_encrypt_flag", F_OK) == 0){
++		for(index = 0; index < len; index++)
++			msg[index] ^= 1;
++	}					
+ 	/* fd can't be 0 (we connect fd 0 to /dev/log socket) */
+ 	/* fd is 1 if "-O -" is in use */
+ 	if (log_file->fd > 1) {
+-- 
+2.17.1
diff --git a/cap/zx297520v3/sources/meta-zxic/recipes-core/busybox/busybox_1.33.1.bb b/cap/zx297520v3/sources/meta-zxic/recipes-core/busybox/busybox_1.33.1.bb
index 82866eb..a0e8bef 100755
--- a/cap/zx297520v3/sources/meta-zxic/recipes-core/busybox/busybox_1.33.1.bb
+++ b/cap/zx297520v3/sources/meta-zxic/recipes-core/busybox/busybox_1.33.1.bb
@@ -59,6 +59,7 @@
 SRC_URI += "file://busybox-1.33.1/0101-zxic-bb_get_chunk_from_file-limit-10MB.patch"
 #SRC_URI += "file://busybox-1.33.1/0102-zxic-ash-read-etc-profile.patch"
 SRC_URI += "file://busybox-1.33.1/0103-top-short-lived-processes-optimize.patch"
+SRC_URI += "file://busybox-1.33.1/0103-syslogd-data-encryption.patch"
 
 SRC_URI_append_libc-musl = " file://busybox-1.33.1/musl.cfg "
 
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call.cpp
index 404acb7..05550f1 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call.cpp
@@ -91,6 +91,7 @@
 

 static int s_module_call_state =CALL_OFF;

 static int s_call_auto_answer = 0;

+static char g_hungup_addr[LYNQ_PHONE_NUMBER_MAX] = {0};

 

 typedef enum{

     LYNQ_E_VOLUMN_SET_DTMF,

@@ -308,6 +309,7 @@
     s_call_lists[lynq_call_id].toa = 0;

     s_call_lists[lynq_call_id].direction = 0;

     s_call_lists[lynq_call_id].used = 0;

+    memcpy(g_hungup_addr,s_call_lists[lynq_call_id].addr,strlen(s_call_lists[lynq_call_id].addr)+1);

     memset(s_call_lists[lynq_call_id].addr,0,sizeof(s_call_lists[lynq_call_id].addr));

 }

 

@@ -468,6 +470,9 @@
                 if(call_end == 0)

                 {

                     LYINFLOG("MT/MO hungup,then clean call info local idx is %d id is %d",i, s_call_lists[i].call_id);

+

+                    s_CallId = s_call_lists[i].call_id;

+                    

                     //update_end_state(i);//lei modify for:update end state for this call

                     cleanCallList(i);

                     send_call_state_change();//means mt/mo call is end

@@ -538,6 +543,7 @@
                     LYINFLOG("state changed from %d to %d",s_call_lists[n].call_state,call_list[i].call_state);

                     

                     updateCallList(&s_call_lists[n],call_list[i].call_id,call_list[i].call_state,call_list[i].toa,call_list[i].direction);//update mt call

+                    s_CallId = call_list[i].call_id;

                     send_call_state_change();

                 }                            

             }

@@ -1032,8 +1038,11 @@
     if(lynq_call_id!=INVALID_ID)

     {

         cleanCallList(lynq_call_id);

-    }        

-

+    } 

+    

+    

+    s_CallId = call_id;

+    

     //fix bug T106BUG-56

     send_call_state_change();

     return RESULT_OK;     

@@ -1114,6 +1123,7 @@
         if((*handle) >= 0)

         {

             *call_state = (int)LYNQ_CALL_END;

+            memcpy(addr,g_hungup_addr,strlen(g_hungup_addr)+1);

             return RESULT_OK; 

         }

         else

diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
index 995b7e4..421383b 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
@@ -17,6 +17,8 @@
 #define APN_DB_READED 0
 #define APN_DB_ERR 1
 #define APN_DB_CREATE 2
+#define APN_TABLE_CREATE 3
+#define APN_TABLE_NEED_CREATE 4
 #define RESULT_OK (0)
 #define RESULT_ERROR (-1)
 
@@ -721,9 +723,69 @@
     pthread_mutex_unlock(&s_qser_data_database_mutex);
     return 0;
 }
+check_apn_table_cb(void *data, int argc, char **argv, char **azColName)
+{
+    if(data==NULL)
+    {
+        return 1;
+    }
+    int *temp = (int *)data;
+    for(int i=0; i<argc; i++){
+       LYINFLOG("[%s]%s = %s", __FUNCTION__,azColName[i], argv[i] ? argv[i] : "NULL");
+    }
+    *temp = atoi(argv[0]);
+    LYINFLOG("\nThe number is %d\n", *temp);
+    return 0;
+}
+int check_apn_table(char*path)
+{
+    char *zErrMsg = 0;
+    int rc;
+    char *sql;
+    int num = -1;
+
+    /* Open database */
+    pthread_mutex_lock(&s_qser_data_database_mutex);
+    rc = sqlite3_open(path, &apnDb);
+    if( rc )
+    {
+        LYERRLOG("[%s] Can't open database: %s\n", __FUNCTION__,sqlite3_errmsg(apnDb));
+        pthread_mutex_unlock(&s_qser_data_database_mutex);
+        return 1;
+    }
+    LYINFLOG("[%s] Opened database successfully\n",__FUNCTION__);
+    /* Create SQL statement */
+    sql = "SELECT COUNT(*) FROM sqlite_master where type ='table' and name = 'LYNQAPN'";
+    /* Execute SQL statement */
+    rc = sqlite3_exec(apnDb, sql, check_apn_table_cb, &num, &zErrMsg);
+    if( rc != SQLITE_OK )
+    {
+        LYERRLOG("SQL error: %s\n", zErrMsg);
+        sqlite3_free(zErrMsg);
+        sqlite3_close(apnDb);
+        pthread_mutex_unlock(&s_qser_data_database_mutex);
+        return 1;
+    }
+    LYINFLOG("Table LYNQAPN check successfully\n");
+    sqlite3_close(apnDb);
+    pthread_mutex_unlock(&s_qser_data_database_mutex);
+    if(num <= 0)
+    {
+        LYINFLOG("No table LYNQAPN, num = %d\n", num);
+        return APN_TABLE_NEED_CREATE;
+    }
+    else
+    {
+        LYINFLOG("The table LYNQAPN exist, num = %d\n", num);
+        return APN_TABLE_CREATE;
+    }
+
+    return 0;
+}
 static int init_apn_db()
 {
     int db_ret=0;
+    int check_ret=0;
     int table_ret=0;
 
     pthread_mutex_init(&s_qser_data_database_mutex, NULL);   
@@ -741,7 +803,26 @@
     }
     else if(db_ret==APN_DB_READED)
     {
-        LYERRLOG("[%s] apn db has be build!!!",__FUNCTION__);
+        LYINFLOG("[%s] apn db has be build!!!",__FUNCTION__);
+        check_ret = check_apn_table(APN_DB_PATH);
+        if(check_ret == APN_TABLE_NEED_CREATE)
+        {
+            table_ret = create_apn_table(APN_DB_PATH);
+            if(table_ret!=0)
+            {
+                LYERRLOG("create apn table fail!!!");
+                return 1;
+            }
+            apn_db_add(0, &default_apn);
+        }
+        else if(check_ret == APN_TABLE_CREATE)
+        {
+            LYINFLOG("Table LYNQAPN has created");
+        }
+        else
+        {
+            LYERRLOG("check table fail!!!, ret = %d", check_ret);
+        }
     }
     else
     {
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp
index 1589c5f..811e7e7 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp
@@ -123,7 +123,7 @@
 int lynq_get_upgrade_type();

 int lynq_get_sync_status();

 int lynq_set_sync_status(char *option_para);

-

+int  calculate_md5_sum( char *md5_sum,int md5_size);

 

 /*****************************************

 * @brief:rock_update_main

@@ -145,6 +145,7 @@
     time_t endTime;

     struct tm *localTime;

     double elapsed = 0;

+    char md5_sum[48] = {0};

 

     FILE *fp = NULL;

     fp = fopen(FOTA_FLAG_FILE,"w+");

@@ -192,6 +193,12 @@
         return -1;

     }

 

+    ret = calculate_md5_sum(md5_sum,sizeof(md5_sum));

+    if(ret != 0)

+    {

+        LYINFLOG("Calculate md5 sum failed");

+    }

+

     startTime = time(NULL);

     if(startTime == (time_t)-1) 

     {

@@ -211,7 +218,7 @@
     if(ret != 0)

     {

         LYERRLOG("Upgrade failed");

-        ret =  sc_debug_info_record(MODULE_ID_CAP_FOTA,"failed,spendtime: %.2lf seconds,package size:%d,finished time %s", elapsed,total_size,asctime(localTime));

+        ret =  sc_debug_info_record(MODULE_ID_CAP_FOTA,"failed,spendtime: %.2lf seconds,finished time %s,md5:%s", elapsed,asctime(localTime),md5_sum);

         if(ret <= 0)

         {

             LYERRLOG("lynq_record_debug_info failed");

@@ -221,7 +228,7 @@
     else

     {

         LYINFLOG("Upgrade success");

-        ret =  sc_debug_info_record(MODULE_ID_CAP_FOTA,"success,spendtime: %.2lf seconds,package size:%d,finished time %s", elapsed,total_size,asctime(localTime));

+        ret =  sc_debug_info_record(MODULE_ID_CAP_FOTA,"success,spendtime: %.2lf seconds,finished time %s,md5:%s", elapsed,asctime(localTime),md5_sum);

         if(ret <= 0)

         {

             LYERRLOG("lynq_record_debug_info failed");

@@ -1006,6 +1013,58 @@
      return ration;

 }

 

+int  calculate_md5_sum( char *md5_sum,int md5_size)

+{

+    FILE *fp = NULL;

+    char package_path[256] = {0};

+    char command[64] = {0};

+    char *space_pos = NULL;

+    int length = 0;

+    char command_result[64] = {0};

+    

+    fp = fopen(FOTA_ADDR_FILE, "rb");

+    if(fp == NULL)

+    {

+        LYERRLOG("Open file failed", FOTA_ADDR_FILE);

+        return -1;

+    }

+    if(fgets(package_path, sizeof(package_path), fp) == NULL)

+    {

+        LYERRLOG("Read file %s failed", package_path);

+    }

+    fclose(fp);

+    

+    snprintf(command, sizeof(command), "md5sum %s",package_path);

+

+    fp = popen(command, "r");

+    if (fp == NULL) 

+    {

+        LYERRLOG("Failed to run command\n");

+        return -1;

+    }

+    if (fgets(command_result, sizeof(command_result), fp) != NULL) 

+    {

+       

+        space_pos = strchr(command_result, ' ');

+        if (space_pos != NULL) 

+        {

+            length = space_pos - command_result;

+             if(length >= md5_size) 

+             {

+                pclose(fp);

+                return -1;

+            }

+            strncpy(md5_sum, command_result, length);

+            md5_sum[length] = '\0';

+        } 

+    } 

+    

+    pclose(fp);

+    

+    return 0;

+

+}

+

 DEFINE_LYNQ_LIB_LOG(LYNQ_FOTA)

 

 #ifdef __cplusplus

diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/spi/spi-zx29.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/spi/spi-zx29.c
index d570db1..3d371ea 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/spi/spi-zx29.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/spi/spi-zx29.c
@@ -158,8 +158,6 @@
 #define SPI_INTR_EN_MASK_TX_EMPTY_IE  		(0x1UL << 3)
 #define SPI_INTR_EN_MASK_RX_THRES_IE  		(0x1UL << 4)
 #define SPI_INTR_EN_MASK_TX_THRES_IE  		(0x1UL << 5)
-//yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme.
-#define SPI_INTR_EN_MASK_MST_EOT_IE  		(0x1UL << 6)
 
 /*
  * SPI Interrupt Status Register OR Interrupt Clear Register - SPI_INTR_SR_SCLR
@@ -1984,24 +1982,25 @@
 	return ret;
 }
 
+/* yu.dong@20240715 [T106BUG-641] SPI packet loss problem, merged into ZXW patch start */
 /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme start */
-#define SPI_SLVAE_RX_BUFF_SIZE        4096
-#define SPI_SLVAE_RX_MAX_PACK_NUM     15
-#define SPI_SLVAE_RX_PACK_LEN         146
-#define SPI_SLVAE_RX_LIST_BUFF_LEN    (SPI_SLVAE_RX_MAX_PACK_NUM*SPI_SLVAE_RX_PACK_LEN)
-static dma_channel_def slave_rx_conf[SPI_SLVAE_RX_MAX_PACK_NUM] = {0};
+#define SPI_SLAVE_RX_BUFF_SIZE        4096
+#define SPI_SLAVE_RX_MAX_PACK_NUM     15
+#define SPI_SLAVE_RX_PACK_LEN         146
+#define SPI_SLAVE_RX_LIST_BUFF_LEN    (SPI_SLAVE_RX_MAX_PACK_NUM*SPI_SLAVE_RX_PACK_LEN)
+static dma_channel_def slave_rx_conf[SPI_SLAVE_RX_MAX_PACK_NUM] = {0};
 //yu.dong@20240617 [T106BUG-641] SPI packet loss issue, increase kernel buffer and read all cached data away, no data loss.
 #define SPI_MAGIC 0x55555555
 static bool rxbuf_is_free_space(struct spi_device *spi)
 {
 	if (spi->recv_pos < spi->rd_pos) {
-        if ((spi->rd_pos - spi->recv_pos) > SPI_SLVAE_RX_PACK_LEN)
+        if ((spi->rd_pos - spi->recv_pos) > SPI_SLAVE_RX_PACK_LEN)
 			return 1;
 		else
 			return 0;
 	}
 	else {
-		if ((SPI_SLVAE_RX_BUFF_SIZE - spi->recv_pos + spi->rd_pos ) > SPI_SLVAE_RX_PACK_LEN)
+		if ((SPI_SLAVE_RX_BUFF_SIZE - spi->recv_pos + spi->rd_pos ) > SPI_SLAVE_RX_PACK_LEN)
 			return 1;
 		else
 			return 0;
@@ -2018,26 +2017,26 @@
 
 	zx29spi = spi_master_get_devdata(spi->master);
 	zx29spi->spi_poll_cnt++;
-	end = *(volatile unsigned int *)(spi->cyc_buf +spi->cyc_index * SPI_SLVAE_RX_PACK_LEN + SPI_SLVAE_RX_PACK_LEN - 4);
-	while((end != SPI_MAGIC) && index < SPI_SLVAE_RX_MAX_PACK_NUM) {
+	end = *(volatile unsigned int *)(spi->cyc_buf +spi->cyc_index * SPI_SLAVE_RX_PACK_LEN + SPI_SLAVE_RX_PACK_LEN - 4);
+	while((end != SPI_MAGIC) && index < SPI_SLAVE_RX_MAX_PACK_NUM) {
 		if(!rxbuf_is_free_space(spi)) {
 			printk("rx_buff not enough space!!!!!");
 			zx29spi->spi_dma_cnt++;
 			break;
 		}else {
-			if((spi->recv_pos + SPI_SLVAE_RX_PACK_LEN) <= SPI_SLVAE_RX_BUFF_SIZE) {
-				memcpy(spi->rx_buf + spi->recv_pos,spi->cyc_buf + spi->cyc_index * SPI_SLVAE_RX_PACK_LEN,SPI_SLVAE_RX_PACK_LEN);
+			if((spi->recv_pos + SPI_SLAVE_RX_PACK_LEN) <= SPI_SLAVE_RX_BUFF_SIZE) {
+				memcpy(spi->rx_buf + spi->recv_pos,spi->cyc_buf + spi->cyc_index * SPI_SLAVE_RX_PACK_LEN,SPI_SLAVE_RX_PACK_LEN);
 			}else {
-				memcpy(spi->rx_buf + spi->recv_pos,spi->cyc_buf + spi->cyc_index * SPI_SLVAE_RX_PACK_LEN,SPI_SLVAE_RX_BUFF_SIZE - spi->recv_pos);
-				memcpy(spi->rx_buf,spi->cyc_buf + spi->cyc_index * SPI_SLVAE_RX_PACK_LEN + (SPI_SLVAE_RX_BUFF_SIZE - spi->recv_pos),SPI_SLVAE_RX_PACK_LEN-(SPI_SLVAE_RX_BUFF_SIZE-spi->recv_pos));
+				memcpy(spi->rx_buf + spi->recv_pos,spi->cyc_buf + spi->cyc_index * SPI_SLAVE_RX_PACK_LEN,SPI_SLAVE_RX_BUFF_SIZE - spi->recv_pos);
+				memcpy(spi->rx_buf,spi->cyc_buf + spi->cyc_index * SPI_SLAVE_RX_PACK_LEN + (SPI_SLAVE_RX_BUFF_SIZE - spi->recv_pos),SPI_SLAVE_RX_PACK_LEN-(SPI_SLAVE_RX_BUFF_SIZE-spi->recv_pos));
 			}
-			*(volatile unsigned int *)(spi->cyc_buf +spi->cyc_index * SPI_SLVAE_RX_PACK_LEN + SPI_SLVAE_RX_PACK_LEN - 4) = SPI_MAGIC;
-			spi->recv_pos = (spi->recv_pos + SPI_SLVAE_RX_PACK_LEN)%SPI_SLVAE_RX_BUFF_SIZE;
-			spi->cyc_index = (spi->cyc_index + 1)%SPI_SLVAE_RX_MAX_PACK_NUM;
+			*(volatile unsigned int *)(spi->cyc_buf +spi->cyc_index * SPI_SLAVE_RX_PACK_LEN + SPI_SLAVE_RX_PACK_LEN - 4) = SPI_MAGIC;
+			spi->recv_pos = (spi->recv_pos + SPI_SLAVE_RX_PACK_LEN)%SPI_SLAVE_RX_BUFF_SIZE;
+			spi->cyc_index = (spi->cyc_index + 1)%SPI_SLAVE_RX_MAX_PACK_NUM;
 
 			zx29spi->spi_dma_cnt++;
 			index++;
-			end = *(volatile unsigned int *)(spi->cyc_buf +spi->cyc_index * SPI_SLVAE_RX_PACK_LEN + SPI_SLVAE_RX_PACK_LEN - 4);
+			end = *(volatile unsigned int *)(spi->cyc_buf +spi->cyc_index * SPI_SLAVE_RX_PACK_LEN + SPI_SLAVE_RX_PACK_LEN - 4);
 		}
 
 		if(spi->is_rd_waiting == true && spi->recv_done == 0) {
@@ -2045,7 +2044,7 @@
 			spi->recv_done = 1;
 		}
 	}
-	if((end != SPI_MAGIC) && index == SPI_SLVAE_RX_MAX_PACK_NUM)
+	if((end != SPI_MAGIC) && index == SPI_SLAVE_RX_MAX_PACK_NUM)
 		printk("cyc_buf be covered!!!!!");
 	return;
 }
@@ -2056,7 +2055,7 @@
 	struct chip_data *chip = NULL;
 	struct dma_chan *rxchan = NULL;
 	struct dma_async_tx_descriptor *rxdesc;
-	unsigned short transfer_len = SPI_SLVAE_RX_PACK_LEN;
+	unsigned short transfer_len = SPI_SLAVE_RX_PACK_LEN;
 	int i;
 
 	chip = zx29spi->cur_chip = spi->controller_state;
@@ -2079,7 +2078,7 @@
 	 * not trigger on 2 elements this needs explicit mapping rather than
 	 * calculation.
 	 */
-	for(i = 0;i < SPI_SLVAE_RX_MAX_PACK_NUM;i++) {
+	for(i = 0;i < SPI_SLAVE_RX_MAX_PACK_NUM;i++) {
 		switch (zx29spi->rx_lev_trig) {
 		case SPI_RX_1_OR_MORE_ELEM:
 			slave_rx_conf[i].dma_control.src_burst_len = DMA_BURST_LEN_1;
@@ -2144,7 +2143,7 @@
 
 	/* Submit and fire RX and TX with TX last so we're ready to read! */
 	if (spi->rx_dma) {
-		rxdesc = rxchan->device->device_prep_dma_cyclic(rxchan,NULL,SPI_SLVAE_RX_MAX_PACK_NUM * SPI_SLVAE_RX_PACK_LEN, SPI_SLVAE_RX_PACK_LEN,0,0);
+		rxdesc = rxchan->device->device_prep_dma_cyclic(rxchan,NULL,SPI_SLAVE_RX_MAX_PACK_NUM * SPI_SLAVE_RX_PACK_LEN, SPI_SLAVE_RX_PACK_LEN,0,0);
 		if (!rxdesc) {
 			printk(KERN_INFO "!!ERROR DESC !!![%s][%d]\n",__func__,__LINE__);
 			dmaengine_terminate_all(rxchan);
@@ -2170,14 +2169,13 @@
 	printk("zx29_slave_rd_start...\r\n");
 
 	zx29spi = spi_master_get_devdata(spi->master);
-	dev = &zx29spi->pdev->dev;
 	if (!zx29spi)
 		return -EINVAL;
-
+	dev = &zx29spi->pdev->dev;
 	spi->cyc_index = 0;
 	spi->rd_pos = spi->recv_pos = 0;
 
-	spi->cyc_buf = dma_alloc_coherent(dev, SPI_SLVAE_RX_BUFF_SIZE, &spi->rx_dma, GFP_KERNEL);
+	spi->cyc_buf = dma_alloc_coherent(dev, SPI_SLAVE_RX_BUFF_SIZE, &spi->rx_dma, GFP_KERNEL);
 	if (dma_mapping_error(dev, spi->rx_dma)) {
 		dev_err(dev, "dma_map_single spi rx failed\n");
 		return -ENOMEM;
@@ -2203,10 +2201,9 @@
 	struct dma_chan *rxchan = NULL;
 
 	zx29spi = spi_master_get_devdata(spi->master);
-	dev = &zx29spi->pdev->dev;
 	if (!zx29spi)
 		return -EINVAL;
-
+	dev = &zx29spi->pdev->dev;
 	chip = zx29spi->cur_chip= spi->controller_state;
 	writel(chip->fifo_ctrl, (SPI_FIFO_CTRL_OFFSET+zx29spi->virtbase));
 	rxchan = zx29spi->dma_rx_channel;
@@ -2217,7 +2214,7 @@
 	}
 
 	if(spi->cyc_buf != NULL && spi->rx_dma) {
-		dma_free_coherent(dev, SPI_SLVAE_RX_BUFF_SIZE, spi->cyc_buf, spi->rx_dma);
+		dma_free_coherent(dev, SPI_SLAVE_RX_BUFF_SIZE, spi->cyc_buf, spi->rx_dma);
 		spi->cyc_buf = NULL;
 	}
 
@@ -2230,6 +2227,7 @@
 	return status;
 }
 /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme end */
+/* yu.dong@20240715 [T106BUG-641] SPI packet loss problem, merged into ZXW patch end*/
 
 static int zx29_prepare_transfer_hardware(struct spi_master *master)
 {
@@ -2611,7 +2609,10 @@
 	ktime_t k_time_start = 0;
 	ktime_t k_time_end = 0;
 	ktime_t diff_ns = 0;
-        /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme start */
+    /* yu.dong@20240715 [T106BUG-641] SPI packet loss problem, merged into ZXW patch start */
+    /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme start */
+	if(false == zx29spi->master->slave)
+		pm_stay_awake(&zx29spi->pdev->dev);
 	regval = readl((SPI_COM_CTRL_OFFSET+zx29spi->virtbase)) & (~SPI_COM_CTRL_MASK_SSPE);
 	writel(regval, (SPI_COM_CTRL_OFFSET+zx29spi->virtbase));
 	
@@ -2635,7 +2636,10 @@
 	if(diff_ns >= 10000000) {
 		dev_info(&zx29spi->pdev->dev, " zx29_setup_to_regs failed! diff_ns=%lld \n",diff_ns);
 	}
-	
+
+	if(false == zx29spi->master->slave)
+		pm_relax(&zx29spi->pdev->dev);
+    /* yu.dong@20240715 [T106BUG-641] SPI packet loss problem, merged into ZXW patch end */
 }
 /**
  * zx29_setup - setup function registered to SPI master framework
@@ -2821,7 +2825,10 @@
 		zx29_setup_to_regs(chip,zx29spi);
 	}
 
-        //yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme.
+	if(zx29spi->mode == ZX29_SSP_MASTER_TYPE) {
+		if(spi->setup_immediately == 1)
+			zx29_setup_to_regs(chip,zx29spi);
+	}
 
 	return status;
  err_config_params:
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/spi/spidev.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/spi/spidev.c
index 1522a21..2a7cdbc 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/spi/spidev.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/spi/spidev.c
@@ -217,48 +217,30 @@
 		return -EMSGSIZE;
 
 	spidev = filp->private_data;
+    /* yu.dong@20240715 [T106BUG-641] SPI packet loss problem, merged into ZXW patch start */
+	if(spidev->spi->master->slave) {
+		#ifdef SPI_SLAVE_FOR_YK
+		size_t total = 0;
 
+		if (spidev->spi->rd_pos == spidev->spi->recv_pos) {
 
-
-	#ifdef SPI_SLAVE_FOR_YK
-	size_t total = 0;
-
-	if (spidev->spi->rd_pos == spidev->spi->recv_pos) {
-
-		status = 0;
-		spidev->spi->is_rd_waiting = true;
-		if(0 != wait_event_freezable(spidev->spi->rd_wait, spidev->spi->recv_done)) {
-			if(spidev->spi->controller->spi_slave_rd_stop)
-				spidev->spi->controller->spi_slave_rd_stop(spidev->spi);
-			spidev->spi->is_rd_waiting = false;
-			return 	status;
-		}else {
-			spidev->spi->recv_done = false;
-			spidev->spi->is_rd_waiting = false;
+			status = 0;
+			spidev->spi->is_rd_waiting = true;
+			if(0 != wait_event_freezable(spidev->spi->rd_wait, spidev->spi->recv_done)) {
+				if(spidev->spi->controller->spi_slave_rd_stop)
+					spidev->spi->controller->spi_slave_rd_stop(spidev->spi);
+				spidev->spi->is_rd_waiting = false;
+				return 	status;
+			}else {
+				spidev->spi->recv_done = false;
+				spidev->spi->is_rd_waiting = false;
+			}
 		}
-	}
-	mutex_lock(&spidev->buf_lock);
-	if(spidev->spi->rd_pos < spidev->spi->recv_pos) {
+		mutex_lock(&spidev->buf_lock);
+		if(spidev->spi->rd_pos < spidev->spi->recv_pos) {
 
-		total = spidev->spi->recv_pos - spidev->spi->rd_pos;
-		status = (total > count) ? count : total;
-	
-		missing = copy_to_user(buf, spidev->rx_buffer+spidev->spi->rd_pos, status);
-		if (missing == status) {
-			status = -EFAULT;
-		}
-		else {
-			status = status - missing;
-			spidev->spi->rd_pos += status;
-		}
-
-	}else if(spidev->spi->rd_pos > spidev->spi->recv_pos) {
-
-		total = bufsiz - (spidev->spi->rd_pos - spidev->spi->recv_pos);
-		status = (total > count) ? count : total;
-
-		if((spidev->spi->rd_pos + status) <= bufsiz) {
-
+			total = spidev->spi->recv_pos - spidev->spi->rd_pos;
+			status = (total > count) ? count : total;
 			missing = copy_to_user(buf, spidev->rx_buffer+spidev->spi->rd_pos, status);
 			if (missing == status) {
 				status = -EFAULT;
@@ -266,48 +248,81 @@
 			else {
 				status = status - missing;
 				spidev->spi->rd_pos += status;
-				spidev->spi->rd_pos = spidev->spi->rd_pos%bufsiz;
-			}
-		}else {
-
-			unsigned long first,rest;
-
-			first = bufsiz - spidev->spi->rd_pos;
-			missing = copy_to_user(buf, spidev->rx_buffer+spidev->spi->rd_pos, first);
-			if (missing == first) {
-				status = -EFAULT;
-			} else {
-				status = status - missing;
 			}
 
-			rest = status-first;
-			missing = copy_to_user(buf+first, spidev->rx_buffer, rest);
-			if (missing == rest) {
-				status = -EFAULT;
-			} else {
-				status = status - missing;
+		}else if(spidev->spi->rd_pos > spidev->spi->recv_pos) {
+
+			total = bufsiz - (spidev->spi->rd_pos - spidev->spi->recv_pos);
+			status = (total > count) ? count : total;
+
+			if((spidev->spi->rd_pos + status) <= bufsiz) {
+
+				missing = copy_to_user(buf, spidev->rx_buffer+spidev->spi->rd_pos, status);
+				if (missing == status) {
+					status = -EFAULT;
+				}
+				else {
+					status = status - missing;
+					spidev->spi->rd_pos += status;
+					spidev->spi->rd_pos = spidev->spi->rd_pos%bufsiz;
+				}
+			}else {
+
+				unsigned long first,rest;
+
+				first = bufsiz - spidev->spi->rd_pos;
+				missing = copy_to_user(buf, spidev->rx_buffer+spidev->spi->rd_pos, first);
+				if (missing == first) {
+					status = -EFAULT;
+				} else {
+					status = status - missing;
+				}
+
+				rest = status-first;
+				missing = copy_to_user(buf+first, spidev->rx_buffer, rest);
+				if (missing == rest) {
+					status = -EFAULT;
+				} else {
+					status = status - missing;
+				}
+				spidev->spi->rd_pos = rest;
 			}
-			spidev->spi->rd_pos = rest;
 		}
-	}
-	#else
-	mutex_lock(&spidev->buf_lock);
-	if(spidev->rd_from_rx_buffer) 
-		status = count;
-	else 
-		status = spidev_sync_read(spidev, count);
-	
-	if (status > 0) {
-
-		missing = copy_to_user(buf, spidev->rx_buffer, status);
-		if (missing == status)
-			status = -EFAULT;
+		#else
+		mutex_lock(&spidev->buf_lock);
+		if(spidev->rd_from_rx_buffer)
+			status = count;
 		else
-			status = status - missing;
-	}
-	#endif
-	mutex_unlock(&spidev->buf_lock);
+			status = spidev_sync_read(spidev, count);
 
+		if (status > 0) {
+
+			missing = copy_to_user(buf, spidev->rx_buffer, status);
+			if (missing == status)
+				status = -EFAULT;
+			else
+				status = status - missing;
+		}
+		#endif
+		mutex_unlock(&spidev->buf_lock);
+    }else {
+		mutex_lock(&spidev->buf_lock);
+
+		if(spidev->rd_from_rx_buffer) 
+			status = count;
+		else
+			status = spidev_sync_read(spidev, count);
+
+		if(status > 0) {
+			missing = copy_to_user(buf, spidev->rx_buffer, status);
+			if (missing == status)
+				status = -EFAULT;
+			else
+				status = status - missing;
+		}
+		mutex_unlock(&spidev->buf_lock);
+	}
+    /* yu.dong@20240715 [T106BUG-641] SPI packet loss problem, merged into ZXW patch end */
 	return status;
 }
 /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme end*/
@@ -783,15 +798,19 @@
 		}
 	}
 
-        /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme start */
-	#ifdef SPI_SLAVE_FOR_YK
-	if(spidev->rx_buffer) {
-		spidev->spi->rx_buf = spidev->rx_buffer;
-		if(spidev->spi->controller->spi_slave_rd_start)
-			spidev->spi->controller->spi_slave_rd_start(spidev->spi);
-	}
-	#endif
-        /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme end */
+    /* yu.dong@20240715 [T106BUG-641] SPI packet loss problem, merged into ZXW patch start */
+    /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme start */
+	if(spidev->spi->master->slave) {
+		#ifdef SPI_SLAVE_FOR_YK
+		if(spidev->rx_buffer) {
+			spidev->spi->rx_buf = spidev->rx_buffer;
+			if(spidev->spi->controller->spi_slave_rd_start)
+				spidev->spi->controller->spi_slave_rd_start(spidev->spi);
+		}
+		#endif
+    }
+    /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme end */
+    /* yu.dong@20240715 [T106BUG-641] SPI packet loss problem, merged into ZXW patch end */
 	spidev->users++;
 	filp->private_data = spidev;
 	stream_open(inode, filp);
@@ -838,14 +857,18 @@
 		spi = spi_dev_get(spidev->spi);
 		spin_unlock_irq(&spidev->spi_lock);
 
-                /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme start */
-		#ifdef SPI_SLAVE_FOR_YK
-		if(spidev->rx_buffer) {
-			if(spi->controller->spi_slave_rd_stop)
-				spi->controller->spi_slave_rd_stop(spi);
-		}
-		#endif

-                /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme end */
+        /* yu.dong@20240715 [T106BUG-641] SPI packet loss problem, merged into ZXW patch start */
+        /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme start */
+        if(spidev->spi->master->slave) {
+			#ifdef SPI_SLAVE_FOR_YK
+			if(spidev->rx_buffer) {
+				if(spi->controller->spi_slave_rd_stop)
+					spi->controller->spi_slave_rd_stop(spi);
+			}
+			#endif
+        }
+        /* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme end */
+        /* yu.dong@20240715 [T106BUG-641] SPI packet loss problem, merged into ZXW patch end*/
 		if(spi && spi->master->slave) 
 			pm_relax(&spi->dev);
 		kfree(spidev->tx_buffer);
@@ -2257,7 +2280,14 @@
 		dev_info(&spi->dev,"trans_gap_num = 0x%x",val);
 	}
 
-	// yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme.
+	if (device_property_read_u32(&spi->dev, "setup-immediately",&val)) {
+		spi->setup_immediately = 0;
+		dev_err(&spi->dev,"setup-immediately get failed");
+	}
+	else {
+		spi->setup_immediately = val;
+		dev_info(&spi->dev,"setup-immediately = 0x%x",val);
+	}
 
 	/* If we can allocate a minor number, hook up this device.
 	 * Reusing minors is fine so long as udev or mdev is working.
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/include/linux/spi/spi.h b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/include/linux/spi/spi.h
index 569ba92..6135a82 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/include/linux/spi/spi.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/include/linux/spi/spi.h
@@ -210,7 +210,8 @@
 	u8 		trans_gaped;
 	u8 		trans_gap_num;
 	/* yu.dong@20240617 [T106BUG-641] SPI packet loss problem, add kernel buffer scheme start */
-	u32		rd_pos;
+    u8      setup_immediately;
+    u32     rd_pos;
 	u32     recv_pos;
 	u8 *    rx_buf;
 	u8 *    cyc_buf;
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libtinyalsa/audio_mixer_ctrl.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libtinyalsa/audio_mixer_ctrl.c
index 0ff24e3..c6ae463 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libtinyalsa/audio_mixer_ctrl.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libtinyalsa/audio_mixer_ctrl.c
@@ -788,19 +788,69 @@
 
 /* yu.dong@20240627 [T106BUG-615]CODEC 8311 using voice_demo to set codec volume has no effect start */
 
-/*
-static int output_vol_conversion(int vol)
-{
-	return 255;
-
-}
-*/
+/* yu.dong@20240716 [T106BUG-615]Abnormal whistling tone heard on the side of the phone when dialing in 3G network start */
+enum t_input_vol {
+    T_INPUT_VOL_MINUS_96DB = 0,
+    T_INPUT_VOL_MINUS_95DB = 2,
+    T_INPUT_VOL_MINUS_90DB = 12,
+    T_INPUT_VOL_MINUS_85DB = 22,
+    T_INPUT_VOL_MINUS_80DB = 32,
+    T_INPUT_VOL_MINUS_75DB = 42,
+    T_INPUT_VOL_MINUS_70DB = 52,
+    T_INPUT_VOL_MINUS_65DB = 62,
+    T_INPUT_VOL_MINUS_60DB = 72,
+    T_INPUT_VOL_MINUS_55DB = 82,
+    T_INPUT_VOL_MINUS_50DB = 92,
+    T_INPUT_VOL_MINUS_45DB = 102,
+    T_INPUT_VOL_MINUS_40DB = 112,
+    T_INPUT_VOL_MINUS_35DB = 122,
+    T_INPUT_VOL_MINUS_30DB = 132,
+    T_INPUT_VOL_MINUS_25DB = 142,
+    T_INPUT_VOL_MINUS_20DB = 152,
+    T_INPUT_VOL_MINUS_15DB = 162,
+    T_INPUT_VOL_MINUS_10DB = 172,
+    T_INPUT_VOL_MINUS_7DB  = 178,
+    T_INPUT_VOL_MINUS_6DB  = 180,
+    T_INPUT_VOL_MINUS_5DB  = 182,
+    T_INPUT_VOL_MINUS_4DB  = 184,
+    T_INPUT_VOL_MINUS_3DB  = 186,
+    T_INPUT_VOL_MINUS_2DB  = 188,
+    T_INPUT_VOL_MINUS_1DB  = 190,
+    T_INPUT_VOL_0DB        = 192
+};
 
 static int input_vol_conversion(int vol)
 {
-	return 255;
-
+    switch(vol) {
+    case T_AUDIO_INPUT_VOL_LEVEL_0:
+        return T_INPUT_VOL_MINUS_96DB;
+    case T_AUDIO_INPUT_VOL_LEVEL_1:
+        return T_INPUT_VOL_MINUS_30DB;
+    case T_AUDIO_INPUT_VOL_LEVEL_2:
+        return T_INPUT_VOL_MINUS_25DB;
+    case T_AUDIO_INPUT_VOL_LEVEL_3:
+        return T_INPUT_VOL_MINUS_20DB;
+    case T_AUDIO_INPUT_VOL_LEVEL_4:
+        return T_INPUT_VOL_MINUS_15DB;
+    case T_AUDIO_INPUT_VOL_LEVEL_5:
+        return T_INPUT_VOL_MINUS_10DB;
+    case T_AUDIO_INPUT_VOL_LEVEL_6:
+        return T_INPUT_VOL_MINUS_7DB;
+    case T_AUDIO_INPUT_VOL_LEVEL_7:
+        return T_INPUT_VOL_MINUS_4DB;
+    case T_AUDIO_INPUT_VOL_LEVEL_8:
+        return T_INPUT_VOL_MINUS_3DB;
+    case T_AUDIO_INPUT_VOL_LEVEL_9:
+        return T_INPUT_VOL_MINUS_2DB;
+    case T_AUDIO_INPUT_VOL_LEVEL_10:
+        return T_INPUT_VOL_MINUS_1DB;
+    case T_AUDIO_INPUT_VOL_LEVEL_11:
+        return T_INPUT_VOL_0DB;
+    default:
+        return T_INPUT_VOL_MINUS_30DB;
+    }
 }
+/* yu.dong@20240716 [T106BUG-615]Abnormal whistling tone heard on the side of the phone when dialing in 3G network end */
 
 enum t_output_vol {
     T_OUTPUT_VOL_MINUS_96DB = 0,
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/include/log/logd.h b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/include/log/logd.h
index 9fbcbc5..973cb60 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/include/log/logd.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/include/log/logd.h
@@ -38,6 +38,13 @@
 extern "C" {
 #endif
 
+/*cz.li add on 2024/7/8 for control RLOGD start*/
+#define SLOG_DEBUG	1	//研发个体行为log输出,量很大
+#define SLOG_NORMAL 2	//集成测试阶段log输出,量适中
+#define SLOG_ERR	3	//致命或快照类log输出,量小
+#define SLOG_OFF	4	//全部关闭打印
+/*cz.li add on 2024/7/8 for control RLOGD start*/
+
 int __android_log_bwrite(int32_t tag, const void *payload, size_t len);
 int __android_log_btwrite(int32_t tag, char type, const void *payload,
                           size_t len);
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/liblog/logd_write.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/liblog/logd_write.c
index dbe869f..8e86270 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/liblog/logd_write.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/binder/liblog/logd_write.c
@@ -440,7 +440,7 @@
     return LOG_NAME[log_id];
 }
 #endif
-
+int sys_log_levle = 4;
 static int __write_to_log_init(log_id_t log_id, struct iovec *vec, size_t nr)
 {
 #ifdef HAVE_PTHREADS
@@ -466,7 +466,38 @@
 #ifdef HAVE_PTHREADS
     pthread_mutex_unlock(&log_init_lock);
 #endif
-
+/*cz.li add on 2024/7/8 for control RLOGD start*/    
+    char nv_syslog_level[10];
+    char buffer[32];
+    FILE *output = popen("nv show | grep syslog_level", "r");
+    while (fgets(buffer, sizeof(buffer), output) != NULL)
+    {
+        char *equal_sign = strchr(buffer, '=');
+        strncpy(nv_syslog_level,equal_sign + 1,1);
+    }
+    pclose(output);
+    sys_log_levle = atoi(nv_syslog_level);
+    if(sys_log_levle == SLOG_DEBUG)
+    {
+        sys_log_levle = ANDROID_LOG_DEBUG;
+    }
+    else if(sys_log_levle == SLOG_NORMAL)
+    {
+        sys_log_levle = ANDROID_LOG_INFO;
+    }
+    else if(sys_log_levle == SLOG_ERR)
+    {
+        sys_log_levle = ANDROID_LOG_ERROR;
+    }
+    else if(sys_log_levle == SLOG_OFF)
+    {
+        sys_log_levle = ANDROID_LOG_SILENT;
+    }
+    else
+    {
+        sys_log_levle = ANDROID_LOG_INFO;
+    }
+/*cz.li add on 2024/7/8 for control RLOGD end*/
     return write_to_log(log_id, vec, nr);
 }
 
@@ -475,7 +506,12 @@
     struct iovec vec[3];
     log_id_t log_id = LOG_ID_MAIN;
     char tmp_tag[32];
-
+/*cz.li add on 2024/7/8 for control RLOGD start*/
+    if(prio < sys_log_levle)
+    {
+        return 0;
+    }
+/*cz.li add on 2024/7/8 for control RLOGD end*/
     if (!tag)
         tag = "";
 
@@ -517,7 +553,12 @@
 {
     struct iovec vec[3];
     char tmp_tag[32];
-
+/*cz.li add on 2024/7/8 for control RLOGD start*/
+    if(prio < sys_log_levle)
+    {
+        return 0;
+    }
+/*cz.li add on 2024/7/8 for control RLOGD end*/
     if (!tag)
         tag = "";
 
diff --git a/update_version.sh b/update_version.sh
index b60c396..f82d336 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-V2.01.01.02P56U06.AP.15.06"
-LYNQ_CAP_INSIDE_VERSION="CAP.15.06"
-LYNQ_CAP_VERSION="CAP.15.06"
+LYNQ_AP_VERSION="T106-V2.01.01.02P56U06.AP.15.08"
+LYNQ_CAP_INSIDE_VERSION="CAP.15.08"
+LYNQ_CAP_VERSION="CAP.15.08"
 COMMIT_ID="$(git rev-parse HEAD)"
 
 LYNQ_SW_INSIDE_VERSION="LYNQ_CONFIG_VERSION = \"${LYNQ_AP_VERSION}_${LYNQ_CAP_INSIDE_VERSION}\""