[Feature][ZXW-241]merge P56U01 version

Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I7985538dde6951dd824c36149bf9a1e3ca23c734
diff --git a/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/reset.c b/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/reset.c
old mode 100644
new mode 100755
index 0a50a21..777dfbf
--- a/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/reset.c
+++ b/ap/os/linux/linux-3.4.x/arch/arm/mach-zx297520v3/reset.c
@@ -23,7 +23,8 @@
 #include <linux/err.h>
 #include <linux/syscore_ops.h>
 #include <linux/gpio.h>
-
+#include <linux/miscdevice.h>	/* For handling misc devices */
+#include <linux/fs.h>		/* For file operations */
 #include <mach/board.h>
 #include <mach/iomap.h>
 #include <mach/spinlock.h>
@@ -31,6 +32,13 @@
 #include <linux/delay.h>
 
 
+#define ZX_RESET_DEV    "/dev/zx_reset"
+
+#define ZX_RESET_IOC_MAGIC     'W'
+/*ioctl cmd usd by device*/
+#define ZX_RESET_FAST_REBOOT         	_IOW(ZX_RESET_IOC_MAGIC, 1, char *)
+
+
 #define	GLOBAL_RESET_REG		(ZX_TOP_CRM_BASE)
 
 #define	USER_RST_UNDEFINE	 	0
@@ -172,3 +180,63 @@
 EXPORT_SYMBOL(zx29_restart);
 
 
+ /********************************************************************************
+ * Function:
+ * Description: 
+ * Parameters: 
+ * Returns: 
+ * Others:
+ ********************************************************************************/
+
+ static int zx_reset_open(struct inode *inode, struct file *file)
+{
+	return 0; 
+}
+
+static int zx_reset_close(struct inode *inode, struct file *file)
+{
+	return 0;
+}
+static long zx_reset_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{	
+	switch(cmd)
+	{
+		case ZX_RESET_FAST_REBOOT:
+			zx29_restart	(NULL, "at set fast reboot!\n\n");
+			break;
+			
+		default:
+			break;		
+	}
+
+	return 0;
+}
+
+
+ static const struct file_operations zx_reset_fops = {
+	.owner		= THIS_MODULE,
+	.unlocked_ioctl	= zx_reset_ioctl,
+	.open		= zx_reset_open,
+	.release	= zx_reset_close,
+};
+
+static struct miscdevice zx_reset_miscdev = {
+	.minor		= MISC_DYNAMIC_MINOR,
+	.name		= "zx_reset",
+	.fops		= &zx_reset_fops,
+};
+
+ static int __init zx_reset_init(void)
+ {
+ 	int ret=0;
+ 	ret = misc_register(&zx_reset_miscdev);
+	if (ret != 0) {
+		printk(KERN_ERR"reset cannot register miscdev on(err=%d)\n", ret);
+		return ret;
+	}
+	return 0;
+ }
+
+late_initcall_sync(zx_reset_init);
+
+ 
diff --git a/ap/os/linux/linux-3.4.x/arch/arm/mm/fault.c b/ap/os/linux/linux-3.4.x/arch/arm/mm/fault.c
index cced966..92b9163 100755
--- a/ap/os/linux/linux-3.4.x/arch/arm/mm/fault.c
+++ b/ap/os/linux/linux-3.4.x/arch/arm/mm/fault.c
@@ -21,12 +21,12 @@
 #ifdef CONFIG_MMU
 #ifdef CONFIG_KPROBES
 static inline int notify_page_fault(struct pt_regs*regs,unsigned int fsr){int 
-ret=(0x93f+4978-0x1cb1);if(!user_mode(regs)){preempt_disable();if(kprobe_running
-()&&kprobe_fault_handler(regs,fsr))ret=(0x7d1+6843-0x228b);preempt_enable();}
+ret=(0x180+4391-0x12a7);if(!user_mode(regs)){preempt_disable();if(kprobe_running
+()&&kprobe_fault_handler(regs,fsr))ret=(0x1da7+1721-0x245f);preempt_enable();}
 return ret;}
 #else
 static inline int notify_page_fault(struct pt_regs*regs,unsigned int fsr){return
-(0x19fd+1761-0x20de);}
+(0xf+3053-0xbfc);}
 #endif
 void show_pte(struct mm_struct*mm,unsigned long addr){pgd_t*pgd;if(!mm)mm=&
 init_mm;printk(KERN_ALERT"\x70\x67\x64\x20\x3d\x20\x25\x70" "\n",mm->pgd);pgd=
@@ -34,10 +34,10 @@
 "\x5b\x25\x30\x38\x6c\x78\x5d\x20\x2a\x70\x67\x64\x3d\x25\x30\x38\x6c\x6c\x78",
 addr,(long long)pgd_val(*pgd));do{pud_t*pud;pmd_t*pmd;pte_t*pte;if(pgd_none(*pgd
 ))break;if(pgd_bad(*pgd)){printk("\x28\x62\x61\x64\x29");break;}pud=pud_offset(
-pgd,addr);if(PTRS_PER_PUD!=(0x82a+6948-0x234d))printk(
+pgd,addr);if(PTRS_PER_PUD!=(0xbba+5234-0x202b))printk(
 "\x2c\x20\x2a\x70\x75\x64\x3d\x25\x30\x38\x6c\x6c\x78",(long long)pud_val(*pud))
 ;if(pud_none(*pud))break;if(pud_bad(*pud)){printk("\x28\x62\x61\x64\x29");break;
-}pmd=pmd_offset(pud,addr);if(PTRS_PER_PMD!=(0xe5c+2467-0x17fe))printk(
+}pmd=pmd_offset(pud,addr);if(PTRS_PER_PMD!=(0xb67+1542-0x116c))printk(
 "\x2c\x20\x2a\x70\x6d\x64\x3d\x25\x30\x38\x6c\x6c\x78",(long long)pmd_val(*pmd))
 ;if(pmd_none(*pmd))break;if(pmd_bad(*pmd)){printk("\x28\x62\x61\x64\x29");break;
 }if(PageHighMem(pfn_to_page(pmd_val(*pmd)>>PAGE_SHIFT)))break;pte=pte_offset_map
@@ -47,18 +47,18 @@
 printk("\x2c\x20\x2a\x70\x70\x74\x65\x3d\x25\x30\x38\x6c\x6c\x78",(long long)
 pte_val(pte[PTE_HWTABLE_PTRS]));
 #endif
-pte_unmap(pte);}while((0x15a5+631-0x181c));printk("\n");}
+pte_unmap(pte);}while((0x10f8+759-0x13ef));printk("\n");}
 #else					
 void show_pte(struct mm_struct*mm,unsigned long addr){}
 #endif					
 static void __do_kernel_fault(struct mm_struct*mm,unsigned long addr,unsigned 
 int fsr,struct pt_regs*regs){if(fixup_exception(regs))return;bust_spinlocks(
-(0x4c3+8549-0x2627));printk(KERN_ALERT
+(0x148f+3042-0x2070));printk(KERN_ALERT
 "\x55\x6e\x61\x62\x6c\x65\x20\x74\x6f\x20\x68\x61\x6e\x64\x6c\x65\x20\x6b\x65\x72\x6e\x65\x6c\x20\x25\x73\x20\x61\x74\x20\x76\x69\x72\x74\x75\x61\x6c\x20\x61\x64\x64\x72\x65\x73\x73\x20\x25\x30\x38\x6c\x78" "\n"
 ,(addr<PAGE_SIZE)?
 "\x4e\x55\x4c\x4c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x64\x65\x72\x65\x66\x65\x72\x65\x6e\x63\x65"
 :"\x70\x61\x67\x69\x6e\x67\x20\x72\x65\x71\x75\x65\x73\x74",addr);show_pte(mm,
-addr);die("\x4f\x6f\x70\x73",regs,fsr);bust_spinlocks((0x497+3142-0x10dd));
+addr);die("\x4f\x6f\x70\x73",regs,fsr);bust_spinlocks((0x36f+1475-0x932));
 do_exit(SIGKILL);}static void __do_user_fault(struct task_struct*tsk,unsigned 
 long addr,unsigned int fsr,unsigned int sig,int code,struct pt_regs*regs){struct
  siginfo si;
@@ -69,7 +69,7 @@
 ,tsk->comm,sig,addr,fsr);show_pte(tsk->mm,addr);show_regs(regs);}
 #endif
 tsk->thread.address=addr;tsk->thread.error_code=fsr;tsk->thread.trap_no=
-(0x38d+3694-0x11ed);si.si_signo=sig;si.si_errno=(0x1832+3224-0x24ca);si.si_code=
+(0x1e27+305-0x1f4a);si.si_signo=sig;si.si_errno=(0x38f+5541-0x1934);si.si_code=
 code;si.si_addr=(void __user*)addr;force_sig_info(sig,&si,tsk);}void do_bad_area
 (unsigned long addr,unsigned int fsr,struct pt_regs*regs){struct task_struct*tsk
 =current;struct mm_struct*mm=tsk->active_mm;if(user_mode(regs))__do_user_fault(
@@ -91,8 +91,8 @@
 static int __kprobes do_page_fault(unsigned long addr,unsigned int fsr,struct 
 pt_regs*regs){struct task_struct*tsk;struct mm_struct*mm;int fault,sig,code;int 
 write=fsr&FSR_WRITE;unsigned int flags=FAULT_FLAG_ALLOW_RETRY|
-FAULT_FLAG_KILLABLE|(write?FAULT_FLAG_WRITE:(0xcfc+4929-0x203d));if(
-notify_page_fault(regs,fsr))return(0xe67+6073-0x2620);tsk=current;mm=tsk->mm;if(
+FAULT_FLAG_KILLABLE|(write?FAULT_FLAG_WRITE:(0xb19+1830-0x123f));if(
+notify_page_fault(regs,fsr))return(0x468+7141-0x204d);tsk=current;mm=tsk->mm;if(
 interrupts_enabled(regs))local_irq_enable();if(!mm||pagefault_disabled())goto 
 no_context;if(!down_read_trylock(&mm->mmap_sem)){if(!user_mode(regs)&&!
 search_exception_tables(regs->ARM_pc))goto no_context;retry:down_read(&mm->
@@ -101,22 +101,22 @@
 if(!user_mode(regs)&&!search_exception_tables(regs->ARM_pc))goto no_context;
 #endif
 }fault=__do_page_fault(mm,addr,fsr,flags,tsk);if((fault&VM_FAULT_RETRY)&&
-fatal_signal_pending(current))return(0x1108+1641-0x1771);perf_sw_event(
-PERF_COUNT_SW_PAGE_FAULTS,(0x159d+3344-0x22ac),regs,addr);if(!(fault&
+fatal_signal_pending(current))return(0x1dcc+716-0x2098);perf_sw_event(
+PERF_COUNT_SW_PAGE_FAULTS,(0xd5b+2358-0x1690),regs,addr);if(!(fault&
 VM_FAULT_ERROR)&&flags&FAULT_FLAG_ALLOW_RETRY){if(fault&VM_FAULT_MAJOR){tsk->
-maj_flt++;perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ,(0xc0a+6112-0x23e9),regs,
-addr);}else{tsk->min_flt++;perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN,
-(0x1ea0+1997-0x266c),regs,addr);}if(fault&VM_FAULT_RETRY){flags&=~
+maj_flt++;perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ,(0x632+69-0x676),regs,addr
+);}else{tsk->min_flt++;perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN,
+(0x1072+1414-0x15f7),regs,addr);}if(fault&VM_FAULT_RETRY){flags&=~
 FAULT_FLAG_ALLOW_RETRY;goto retry;}}up_read(&mm->mmap_sem);if(likely(!(fault&(
-VM_FAULT_ERROR|VM_FAULT_BADMAP|VM_FAULT_BADACCESS))))return(0x322+877-0x68f);if(
-fault&VM_FAULT_OOM){pagefault_out_of_memory();return(0xc0b+3332-0x190f);}if(!
+VM_FAULT_ERROR|VM_FAULT_BADMAP|VM_FAULT_BADACCESS))))return(0xed7+981-0x12ac);if
+(fault&VM_FAULT_OOM){pagefault_out_of_memory();return(0x8f3+6782-0x2371);}if(!
 user_mode(regs))goto no_context;if(fault&VM_FAULT_SIGBUS){sig=SIGBUS;code=
 BUS_ADRERR;}else{sig=SIGSEGV;code=fault==VM_FAULT_BADACCESS?SEGV_ACCERR:
-SEGV_MAPERR;}__do_user_fault(tsk,addr,fsr,sig,code,regs);return(0x826+883-0xb99)
-;no_context:__do_kernel_fault(mm,addr,fsr,regs);return(0xb25+4796-0x1de1);}
+SEGV_MAPERR;}__do_user_fault(tsk,addr,fsr,sig,code,regs);return(0x8f9+500-0xaed)
+;no_context:__do_kernel_fault(mm,addr,fsr,regs);return(0x1ad7+822-0x1e0d);}
 #else					
 static int do_page_fault(unsigned long addr,unsigned int fsr,struct pt_regs*regs
-){return(0x2f0+2220-0xb9c);}
+){return(0x245d+469-0x2632);}
 #endif					
 #ifdef CONFIG_MMU
 static int __kprobes do_translation_fault(unsigned long addr,unsigned int fsr,
@@ -129,21 +129,21 @@
 bad_area;if(!pud_present(*pud))set_pud(pud,*pud_k);pmd=pmd_offset(pud,addr);
 pmd_k=pmd_offset(pud_k,addr);
 #ifdef CONFIG_ARM_LPAE
-index=(0xef9+3662-0x1d47);
+index=(0xdc+3416-0xe34);
 #else
-index=(addr>>SECTION_SHIFT)&(0x214f+1030-0x2554);
+index=(addr>>SECTION_SHIFT)&(0x92+2410-0x9fb);
 #endif
 if(pmd_none(pmd_k[index]))goto bad_area;copy_pmd(pmd,pmd_k);return
-(0x1ba7+2731-0x2652);bad_area:do_bad_area(addr,fsr,regs);return
-(0x802+3502-0x15b0);}
+(0x126a+1523-0x185d);bad_area:do_bad_area(addr,fsr,regs);return
+(0x104f+4245-0x20e4);}
 #else					
 static int do_translation_fault(unsigned long addr,unsigned int fsr,struct 
-pt_regs*regs){return(0xad2+644-0xd56);}
+pt_regs*regs){return(0x13b1+1997-0x1b7e);}
 #endif					
 static int do_sect_fault(unsigned long addr,unsigned int fsr,struct pt_regs*regs
 ){if(interrupts_enabled(regs))local_irq_enable();do_bad_area(addr,fsr,regs);
-return(0x12c7+3422-0x2025);}static int do_bad(unsigned long addr,unsigned int 
-fsr,struct pt_regs*regs){return(0x157d+1947-0x1d17);}struct fsr_info{int(*fn)(
+return(0x5e1+3395-0x1324);}static int do_bad(unsigned long addr,unsigned int fsr
+,struct pt_regs*regs){return(0xc4f+2381-0x159b);}struct fsr_info{int(*fn)(
 unsigned long addr,unsigned int fsr,struct pt_regs*regs);int sig;int code;const 
 char*name;};
 #ifdef CONFIG_ARM_LPAE
@@ -152,21 +152,21 @@
 #include "fsr-2level.c"
 #endif
 void __init hook_fault_code(int nr,int(*fn)(unsigned long,unsigned int,struct 
-pt_regs*),int sig,int code,const char*name){if(nr<(0xe90+4895-0x21af)||nr>=
+pt_regs*),int sig,int code,const char*name){if(nr<(0x1a21+696-0x1cd9)||nr>=
 ARRAY_SIZE(fsr_info))BUG();fsr_info[nr].fn=fn;fsr_info[nr].sig=sig;fsr_info[nr].
 code=code;fsr_info[nr].name=name;}
 #ifdef CONFIG_MODEM_CODE_IS_MAPPING
 static DECLARE_RWSEM(shrinker_rwsem);atomic_t _code_page_count=ATOMIC_INIT(
-(0x9ad+1603-0xff0));struct addr_info{struct list_head node;unsigned long vaddr;
+(0xfd1+1670-0x1657));struct addr_info{struct list_head node;unsigned long vaddr;
 unsigned long kaddr;unsigned long page_index;};enum modem_access_technology{GSM=
-(0x140+9320-0x25a8),UTRAN=(0x173b+3236-0x23de),LTE=(0x175f+3613-0x257a),COM=
-(0x1155+3868-0x206e),NR_MODEM_ACCESS=(0x375+5265-0x1802)};struct list_head 
+(0x1128+3741-0x1fc5),UTRAN=(0x57f+1951-0xd1d),LTE=(0xc85+1783-0x137a),COM=
+(0x5b1+6459-0x1ee9),NR_MODEM_ACCESS=(0x18a8+817-0x1bd5)};struct list_head 
 modem_page_list[NR_MODEM_ACCESS]={LIST_HEAD_INIT(modem_page_list[
-(0xfc0+179-0x1073)]),LIST_HEAD_INIT(modem_page_list[(0x213c+714-0x2405)]),
-LIST_HEAD_INIT(modem_page_list[(0x1f2a+681-0x21d1)]),LIST_HEAD_INIT(
-modem_page_list[(0x1ca0+165-0x1d42)]),};unsigned int page_used[
-(0x1091+3756-0x1f15)];struct completion page_completion[(0x1e62+726-0x2110)*
-(0x22bd+799-0x25bc)];static void unmap_pte_range(pmd_t*pmd,unsigned long addr,
+(0x992+4592-0x1b82)]),LIST_HEAD_INIT(modem_page_list[(0xb25+1503-0x1103)]),
+LIST_HEAD_INIT(modem_page_list[(0x8b9+4411-0x19f2)]),LIST_HEAD_INIT(
+modem_page_list[(0x6a3+2369-0xfe1)]),};unsigned int page_used[
+(0x208+9204-0x25d4)];struct completion page_completion[(0xb08+1958-0x1286)*
+(0x16c7+4070-0x268d)];static void unmap_pte_range(pmd_t*pmd,unsigned long addr,
 unsigned long end){pte_t*pte;pte=pte_offset_kernel(pmd,addr);do{pte_t ptent=
 ptep_get_and_clear(&init_mm,addr,pte);WARN_ON(!pte_none(ptent)&&!pte_present(
 ptent));}while(pte++,addr+=PAGE_SIZE,addr!=end);}static void unmap_pmd_range(
@@ -180,14 +180,14 @@
 addr,unsigned long end){pgd_t*pgd;unsigned long next;BUG_ON(addr>=end);pgd=
 pgd_offset_k(addr);do{next=pgd_addr_end(addr,end);if(pgd_none_or_clear_bad(pgd))
 continue;unmap_pud_range(pgd,addr,next);}while(pgd++,addr=next,addr!=end);}void 
-shrink_modem_mem(unsigned int access_type){int i=(0x650+7924-0x2544);unsigned 
+shrink_modem_mem(unsigned int access_type){int i=(0x449+7294-0x20c7);unsigned 
 long vaddr;struct addr_info*addr,*tmp_addr;struct list_head tmp_page_list;for(i=
-(0x776+6013-0x1ef3);i<NR_MODEM_ACCESS;i++){if(i==access_type)continue;down_write
+(0x573+4473-0x16ec);i<NR_MODEM_ACCESS;i++){if(i==access_type)continue;down_write
 (&shrinker_rwsem);list_replace_init(&modem_page_list[i],&tmp_page_list);up_write
 (&shrinker_rwsem);list_for_each_entry_safe(addr,tmp_addr,&tmp_page_list,node){
 list_del_init(&addr->node);page_completion[addr->page_index].done=
-(0x126b+4818-0x253d);page_used[addr->page_index/BITS_PER_LONG]&=~(
-(0x174+1177-0x60c)<<(addr->page_index%BITS_PER_LONG));vaddr=addr->vaddr&
+(0xa77+6608-0x2447);page_used[addr->page_index/BITS_PER_LONG]&=~(
+(0xc24+2978-0x17c5)<<(addr->page_index%BITS_PER_LONG));vaddr=addr->vaddr&
 PAGE_MASK;if(vaddr<cpps_global_var.cpko_text_start||vaddr>cpps_global_var.
 modem_text_end){panic(
 "\x61\x64\x64\x72\x5f\x69\x6e\x66\x6f\x3a\x20\x25\x30\x38\x78\x20\x69\x73\x20\x20\x64\x65\x73\x74\x72\x6f\x79"
@@ -195,14 +195,14 @@
 PAGE_SIZE);flush_tlb_kernel_range(vaddr,vaddr+PAGE_SIZE);
 #ifdef CONFIG_DEBUG_RODATA
 unsigned int flags;local_irq_save(flags);set_memory_rw(addr->kaddr,
-(0x1254+2865-0x1d84));local_irq_restore(flags);
+(0xf45+5537-0x24e5));local_irq_restore(flags);
 #endif
 free_page(addr->kaddr);kfree(addr);atomic_dec(&_code_page_count);};}}
 EXPORT_SYMBOL(shrink_modem_mem);phys_addr_t virt_is_mapping(unsigned long addr){
 pgd_t*pgd;pmd_t*pmd;pte_t*ptep,pte;unsigned long pfn;pgd=pgd_offset_k(addr);if(!
 pgd_none(*pgd)){pmd=pmd_offset(pgd,addr);if(!pmd_none(*pmd)){ptep=pte_offset_map
 (pmd,addr);pte=*ptep;if(pte_present(pte)){pfn=pte_pfn(pte);return __pfn_to_phys(
-pfn);}}}return(0x158b+2513-0x1f5c);}static int sync_pgd(unsigned long addr,
+pfn);}}}return(0x17d+5982-0x18db);}static int sync_pgd(unsigned long addr,
 unsigned int fsr,struct pt_regs*regs){unsigned int index;pgd_t*pgd,*pgd_k;pud_t*
 pud,*pud_k;pmd_t*pmd,*pmd_k;index=pgd_index(addr);pgd=cpu_get_pgd()+index;pgd_k=
 init_mm.pgd+index;if(pgd_none(*pgd_k))goto bad_area;if(!pgd_present(*pgd))
@@ -210,13 +210,13 @@
 pud_none(*pud_k))goto bad_area;if(!pud_present(*pud))set_pud(pud,*pud_k);pmd=
 pmd_offset(pud,addr);pmd_k=pmd_offset(pud_k,addr);
 #ifdef CONFIG_ARM_LPAE
-index=(0x1c66+637-0x1ee3);
+index=(0x88b+2904-0x13e3);
 #else
-index=(addr>>SECTION_SHIFT)&(0x3cb+932-0x76e);
+index=(addr>>SECTION_SHIFT)&(0x1bc7+2608-0x25f6);
 #endif
 if(pmd_none(pmd_k[index]))goto bad_area;copy_pmd(pmd,pmd_k);return
-(0x1c0+1357-0x70d);bad_area:do_bad_area(addr,fsr,regs);return(0x732+2365-0x106f)
-;}unsigned long*read_code_file(unsigned long page_index){unsigned long*code_buf;
+(0xe4+1098-0x52e);bad_area:do_bad_area(addr,fsr,regs);return(0x192+8777-0x23db);
+}unsigned long*read_code_file(unsigned long page_index){unsigned long*code_buf;
 ssize_t result;code_buf=get_zeroed_page(GFP_ATOMIC);if(!code_buf)panic(
 "\x6d\x65\x6d\x65\x6f\x72\x79\x20\x6e\x6f\x74\x20\x65\x6e\x6f\x75\x67\x68\x21\x21"
 );atomic_inc(&_code_page_count);if(IS_ERR(cpps_global_var.fp_code)||
@@ -224,23 +224,23 @@
 "\x6f\x70\x65\x6e\x20\x66\x69\x6c\x65\x20\x65\x72\x72\x6f\x72" "\n");}
 mm_segment_t old_fs;old_fs=get_fs();set_fs(KERNEL_DS);loff_t pos;pos=page_index*
 PAGE_SIZE+cpps_global_var.modem_offset;result=vfs_read(cpps_global_var.fp_code,(
-char*)code_buf,PAGE_SIZE,&pos);if(result<(0x473+2894-0xfc1)){panic(
+char*)code_buf,PAGE_SIZE,&pos);if(result<(0x1008+1240-0x14e0)){panic(
 "\x72\x65\x61\x64\x20\x63\x6f\x64\x65\x20\x66\x69\x6c\x65\x20\x65\x72\x72\x6f\x72" "\n"
 );}
 #ifdef CONFIG_DEBUG_RODATA
 unsigned int flags;local_irq_save(flags);set_memory_ro((unsigned long)code_buf,
-(0x1653+299-0x177d));local_irq_restore(flags);
+(0xba2+1301-0x10b6));local_irq_restore(flags);
 #endif
 set_fs(old_fs);return code_buf;}void read_code_mapping(unsigned long addr,
 unsigned int fsr,struct pt_regs*regs){unsigned long offset;unsigned long vaddr;
 const struct mem_type*mtype;unsigned long*vir_codebuf;unsigned long page_index;
-unsigned long page_shift;if(virt_is_mapping(addr&PAGE_MASK)!=(0x271+4686-0x14bf)
+unsigned long page_shift;if(virt_is_mapping(addr&PAGE_MASK)!=(0x296+8148-0x226a)
 ){sync_pgd(addr&PAGE_MASK,fsr,regs);return;}vaddr=addr&PAGE_MASK;offset=vaddr&(~
 cpps_global_var.cpko_text_start);page_index=offset>>PAGE_SHIFT;page_shift=
 page_index%BITS_PER_LONG;if((page_used[page_index/BITS_PER_LONG]>>page_shift)&
-(0x16d9+964-0x1a9c)){wait_for_completion(&page_completion[page_index]);sync_pgd(
-vaddr,fsr,regs);return;}else page_used[page_index/BITS_PER_LONG]|=(
-(0x8eb+2380-0x1236)<<page_shift);local_irq_enable();vir_codebuf=read_code_file(
+(0x14d7+1130-0x1940)){wait_for_completion(&page_completion[page_index]);sync_pgd
+(vaddr,fsr,regs);return;}else page_used[page_index/BITS_PER_LONG]|=(
+(0xf86+1290-0x148f)<<page_shift);local_irq_enable();vir_codebuf=read_code_file(
 page_index);struct addr_info*addr_info;addr_info=kzalloc(sizeof(struct addr_info
 ),GFP_KERNEL);addr_info->kaddr=vir_codebuf;addr_info->vaddr=addr;addr_info->
 page_index=page_index;down_write(&shrinker_rwsem);if(vaddr<cpps_global_var.
@@ -258,46 +258,46 @@
 struct pt_regs*regs){const struct fsr_info*inf=fsr_info+fsr_fs(fsr);struct 
 siginfo info;
 #ifdef CONFIG_MODEM_CODE_IS_MAPPING
-if(addr!=(0x16cd+2408-0x2035)&&addr>=cpps_global_var.cpko_text_start&&addr<=
+if(addr!=(0x17fc+2588-0x2218)&&addr>=cpps_global_var.cpko_text_start&&addr<=
 cpps_global_var.modem_text_end){read_code_mapping(addr,fsr&~FSR_LNX_PF,regs);
 return;}
 #endif
 if(!inf->fn(addr,fsr&~FSR_LNX_PF,regs))return;printk(KERN_ALERT
 "\x55\x6e\x68\x61\x6e\x64\x6c\x65\x64\x20\x66\x61\x75\x6c\x74\x3a\x20\x25\x73\x20\x28\x30\x78\x25\x30\x33\x78\x29\x20\x61\x74\x20\x30\x78\x25\x30\x38\x6c\x78" "\n"
-,inf->name,fsr,addr);info.si_signo=inf->sig;info.si_errno=(0x1942+1864-0x208a);
+,inf->name,fsr,addr);info.si_signo=inf->sig;info.si_errno=(0x6a4+5067-0x1a6f);
 info.si_code=inf->code;info.si_addr=(void __user*)addr;arm_notify_die("",regs,&
-info,fsr,(0x1069+4485-0x21ee));}void __init hook_ifault_code(int nr,int(*fn)(
+info,fsr,(0x888+4338-0x197a));}void __init hook_ifault_code(int nr,int(*fn)(
 unsigned long,unsigned int,struct pt_regs*),int sig,int code,const char*name){if
-(nr<(0xb51+5748-0x21c5)||nr>=ARRAY_SIZE(ifsr_info))BUG();ifsr_info[nr].fn=fn;
+(nr<(0xf64+5639-0x256b)||nr>=ARRAY_SIZE(ifsr_info))BUG();ifsr_info[nr].fn=fn;
 ifsr_info[nr].sig=sig;ifsr_info[nr].code=code;ifsr_info[nr].name=name;}
 asmlinkage void __exception do_PrefetchAbort(unsigned long addr,unsigned int 
 ifsr,struct pt_regs*regs){const struct fsr_info*inf=ifsr_info+fsr_fs(ifsr);
 struct siginfo info;
 #ifdef CONFIG_MODEM_CODE_IS_MAPPING
-if(addr!=(0x16b6+333-0x1803)&&addr>=cpps_global_var.cpko_text_start&&addr<=
+if(addr!=(0x99b+1934-0x1129)&&addr>=cpps_global_var.cpko_text_start&&addr<=
 cpps_global_var.modem_text_end){read_code_mapping(addr,ifsr|FSR_LNX_PF,regs);
 return;}
 #endif
 if(!inf->fn(addr,ifsr|FSR_LNX_PF,regs))return;printk(KERN_ALERT
 "\x55\x6e\x68\x61\x6e\x64\x6c\x65\x64\x20\x70\x72\x65\x66\x65\x74\x63\x68\x20\x61\x62\x6f\x72\x74\x3a\x20\x25\x73\x20\x28\x30\x78\x25\x30\x33\x78\x29\x20\x61\x74\x20\x30\x78\x25\x30\x38\x6c\x78" "\n"
-,inf->name,ifsr,addr);info.si_signo=inf->sig;info.si_errno=(0x466+4584-0x164e);
+,inf->name,ifsr,addr);info.si_signo=inf->sig;info.si_errno=(0x1ae7+638-0x1d65);
 info.si_code=inf->code;info.si_addr=(void __user*)addr;arm_notify_die("",regs,&
-info,ifsr,(0xbac+5846-0x2282));}
+info,ifsr,(0xd39+653-0xfc6));}
 #ifndef CONFIG_ARM_LPAE
 static int __init exceptions_init(void){if(cpu_architecture()>=CPU_ARCH_ARMv6){
-hook_fault_code((0x9c9+4338-0x1ab7),do_translation_fault,SIGSEGV,SEGV_MAPERR,
+hook_fault_code((0x117a+644-0x13fa),do_translation_fault,SIGSEGV,SEGV_MAPERR,
 "\x49\x2d\x63\x61\x63\x68\x65\x20\x6d\x61\x69\x6e\x74\x65\x6e\x61\x6e\x63\x65\x20\x66\x61\x75\x6c\x74"
-);}if(cpu_architecture()>=CPU_ARCH_ARMv7){hook_fault_code((0x169c+2480-0x2049),
+);}if(cpu_architecture()>=CPU_ARCH_ARMv7){hook_fault_code((0x1adc+134-0x1b5f),
 do_bad,SIGSEGV,SEGV_MAPERR,
 "\x73\x65\x63\x74\x69\x6f\x6e\x20\x61\x63\x63\x65\x73\x73\x20\x66\x6c\x61\x67\x20\x66\x61\x75\x6c\x74"
-);hook_fault_code((0x908+417-0xaa3),do_bad,SIGSEGV,SEGV_MAPERR,
+);hook_fault_code((0x17bc+1887-0x1f15),do_bad,SIGSEGV,SEGV_MAPERR,
 "\x73\x65\x63\x74\x69\x6f\x6e\x20\x61\x63\x63\x65\x73\x73\x20\x66\x6c\x61\x67\x20\x66\x61\x75\x6c\x74"
 );}
 #ifdef CONFIG_MODEM_CODE_IS_MAPPING
-int index=(0xc6b+4048-0x1c3b);for(index=(0x713+2892-0x125f);index<
-(0x36f+5900-0x1a53)*(0x10d9+4448-0x2219);index++)init_completion(&
+int index=(0x1395+4146-0x23c7);for(index=(0x15fb+3774-0x24b9);index<
+(0x1642+3952-0x258a)*(0x70d+6231-0x1f44);index++)init_completion(&
 page_completion[index]);
 #endif
-return(0x18ab+1624-0x1f03);}arch_initcall(exceptions_init);
+return(0x91+1966-0x83f);}arch_initcall(exceptions_init);
 #endif
 
diff --git a/ap/os/linux/linux-3.4.x/drivers/cpko/cpko_main.c b/ap/os/linux/linux-3.4.x/drivers/cpko/cpko_main.c
index 7a9c22c..341d668 100755
--- a/ap/os/linux/linux-3.4.x/drivers/cpko/cpko_main.c
+++ b/ap/os/linux/linux-3.4.x/drivers/cpko/cpko_main.c
@@ -77,36 +77,37 @@
 extern SINT32 zDrvVp_AudioDataWrite(const VOID*pBuf,UINT32 uiLen);extern SINT32 
 zDrvVp_AudioDataOpen(UINT32 audioType,UINT32 sampleRate);extern SINT32 
 zDrvVp_AudioDataClose(void);extern SINT32 zDrvVp_GetVpLoop_Wrap(VOID);extern 
-VOID zDrvVp_Status(UINT32*sample_rate,UINT32*voice_status);typedef struct 
-cpko_section{unsigned int cpko_text_start;unsigned int cpko_rodata_start;
-unsigned int __utran_modem_text_start;unsigned int __lte_modem_text_start;
-unsigned int __comm_modem_text_start;unsigned int modem_text_end;unsigned int 
-cpko_data_start;unsigned int cpko_bss_start;unsigned int cpko_text_offset;}
-cpko_section_layout;cpko_section_layout cpko_ps_section;int raise(int signo){
-return(0x404+8970-0x270e);}extern unsigned int SysEntry(void);static int 
-ko_Main_Thread(void*data){struct sched_param param={.sched_priority=
-MAX_USER_RT_PRIO/(0xafb+4511-0x1c98)-(0x1633+3815-0x2517)};int ret=
-(0x1f43+402-0x20d5);sched_setscheduler(current,SCHED_FIFO,&param);ret=SysEntry()
-;if(ret!=(0x10b8+3966-0x2036))panic("Main_Thread\n");param.sched_priority=
-MAX_USER_RT_PRIO-(0xfb3+2852-0x1aa9);sched_setscheduler(kthreadd_task,SCHED_FIFO
-,&param);return(0xaa6+6401-0x23a7);}int zte_modem_ko_start(void){kthread_run(
-ko_Main_Thread,NULL,"\x5a\x54\x45\x4d\x61\x69\x6e\x54\x68\x72\x65\x61\x64");
-return(0x8b9+1955-0x105c);}static void cpko_sectioninfo_set(void){int ret;struct
- file*fp;mm_segment_t old_fs;loff_t cpko_pos=(0x6ed+5503-0x1c6c);struct 
+VOID zDrvVp_Status(UINT32*sample_rate,UINT32*voice_status);extern VOID 
+zDrvVp_UpdateVoiceNv(UINT8*voice_nv_update);typedef struct cpko_section{unsigned
+ int cpko_text_start;unsigned int cpko_rodata_start;unsigned int 
+__utran_modem_text_start;unsigned int __lte_modem_text_start;unsigned int 
+__comm_modem_text_start;unsigned int modem_text_end;unsigned int cpko_data_start
+;unsigned int cpko_bss_start;unsigned int cpko_text_offset;}cpko_section_layout;
+cpko_section_layout cpko_ps_section;int raise(int signo){return(0x6ed+448-0x8ad)
+;}extern unsigned int SysEntry(void);static int ko_Main_Thread(void*data){struct
+ sched_param param={.sched_priority=MAX_USER_RT_PRIO/(0x81a+3335-0x151f)-
+(0x931+4823-0x1c05)};int ret=(0x138+9138-0x24ea);sched_setscheduler(current,
+SCHED_FIFO,&param);ret=SysEntry();if(ret!=(0x4c9+1313-0x9ea))panic(
+"Main_Thread\n");param.sched_priority=MAX_USER_RT_PRIO-(0x7a1+7631-0x2542);
+sched_setscheduler(kthreadd_task,SCHED_FIFO,&param);return(0x1239+1857-0x197a);}
+int zte_modem_ko_start(void){kthread_run(ko_Main_Thread,NULL,
+"\x5a\x54\x45\x4d\x61\x69\x6e\x54\x68\x72\x65\x61\x64");return
+(0x1050+3114-0x1c7a);}static void cpko_sectioninfo_set(void){int ret;struct file
+*fp;mm_segment_t old_fs;loff_t cpko_pos=(0x160b+1733-0x1cd0);struct 
 cpps_globalModem globalVar;fp=filp_open(
 "\x2f\x6c\x69\x62\x2f\x63\x70\x6b\x6f\x2f\x63\x70\x6b\x6f\x5f\x73\x65\x63\x69\x6e\x66\x6f\x2e\x62\x69\x6e"
-,(0xf28+2571-0x1933),(0xa59+1171-0xeec));if(IS_ERR(fp)||fp==NULL)panic(
+,(0xd6c+3198-0x19ea),(0x655+5701-0x1c9a));if(IS_ERR(fp)||fp==NULL)panic(
 "\x6f\x70\x65\x6e\x20\x66\x69\x6c\x65\x20\x65\x72\x72\x6f\x72" "\n");old_fs=
 get_fs();set_fs(KERNEL_DS);ret=vfs_read(fp,(char*)&cpko_ps_section,sizeof(
-cpko_section_layout),&cpko_pos);if(ret<=(0x304+3756-0x11b0))panic(
+cpko_section_layout),&cpko_pos);if(ret<=(0x235f+23-0x2376))panic(
 "\x72\x65\x61\x64\x20\x66\x69\x6c\x65\x20\x65\x72\x72\x6f\x72" "\n");filp_close(
 fp,NULL);
 #ifdef CONFIG_MODEM_CODE_IS_MAPPING
 fp=filp_open(
 "\x2f\x6c\x69\x62\x2f\x63\x70\x6b\x6f\x2f\x63\x70\x6b\x6f\x2e\x6b\x6f",
-(0x1019+4563-0x21ec),(0x1cf2+1837-0x241f));if(IS_ERR(fp)||fp==NULL)panic(
+(0x940+3724-0x17cc),(0xb2a+3215-0x17b9));if(IS_ERR(fp)||fp==NULL)panic(
 "\x6f\x70\x65\x6e\x20\x66\x69\x6c\x65\x20\x65\x72\x72\x6f\x72" "\n");fp->f_ra.
-ra_pages=(0x53f+4485-0x16c4);
+ra_pages=(0x15a8+769-0x18a9);
 #endif
 if(cpko_ps_section.cpko_text_start){globalVar.cpko_text_start=(unsigned long)
 cpko_ps_section.cpko_text_start;globalVar.cpko_rodata_start=(unsigned long)
@@ -126,7 +127,7 @@
 vfree_modem_section(globalVar.cpko_text_start,globalVar.modem_text_end);
 #endif
 }else panic("\x66\x69\x6c\x65\x20\x65\x72\x72\x6f\x72" "\n");}static int 
-cpko_start(void){struct cpps_callbacks callback={(0x913+4588-0x1aff)};callback.
+cpko_start(void){struct cpps_callbacks callback={(0x66f+4526-0x181d)};callback.
 zOss_ResetNVFactory=zOss_ResetNVFactory;callback.zOss_NvramFlush=zOss_NvramFlush
 ;callback.zOss_NvItemWrite=zOss_NvItemWrite;callback.zOss_NvItemWriteFactory=
 zOss_NvItemWriteFactory;callback.zOss_NvItemRead=zOss_NvItemRead;callback.
@@ -190,7 +191,8 @@
 mmp_AmrDecClose;callback.mmp_AmrEncClose=mmp_AmrEncClose;callback.
 zDrvVp_AudioDataOpen=zDrvVp_AudioDataOpen;callback.zDrvVp_AudioDataWrite=
 zDrvVp_AudioDataWrite;callback.zDrvVp_AudioDataClose=zDrvVp_AudioDataClose;
-callback.zDrvVp_Status=zDrvVp_Status;
+callback.zDrvVp_Status=zDrvVp_Status;callback.zDrvVp_UpdateVoiceNv=
+zDrvVp_UpdateVoiceNv;
 #endif	
 callback.psm_ModemDevSleep=psm_ModemDevSleep;callback.psm_ModemSleepCheck=
 psm_ModemSleepCheck;callback.psm_ModemSleepTimeGet=psm_ModemSleepTimeGet;
@@ -198,5 +200,5 @@
 psm_GetModemSleepFlagStatus=psm_GetModemSleepFlagStatus;
 #endif
 cpps_callbacks_register(&callback);cpko_sectioninfo_set();zte_modem_ko_start();
-return(0xb43+4520-0x1ceb);}static int cpko_stop(void){return(0x20cd+460-0x2299);
-}module_init(cpko_start);module_exit(cpko_stop);
+return(0x1a6d+2639-0x24bc);}static int cpko_stop(void){return(0x62+561-0x293);}
+module_init(cpko_start);module_exit(cpko_stop);
diff --git a/ap/os/linux/linux-3.4.x/drivers/mfd/zx234290-regulator-wrapper.c b/ap/os/linux/linux-3.4.x/drivers/mfd/zx234290-regulator-wrapper.c
index c5d99db..f6bf3c4 100755
--- a/ap/os/linux/linux-3.4.x/drivers/mfd/zx234290-regulator-wrapper.c
+++ b/ap/os/linux/linux-3.4.x/drivers/mfd/zx234290-regulator-wrapper.c
@@ -157,13 +157,13 @@
     //zx234290_set_buck4_sleep_mode(BUCK234_SLP_SHUTDOWN);   /*PA 3V6*/

     //zx234290_set_ldo1_sleep_mode(LDOA_SLP_SHUTDOWN);       /*USB 0V9*/

     //zx234290_set_ldo5_sleep_mode(LDOA_SLP_SHUTDOWN);       /*USB 3V3*/

-	zx234290_set_ldo2_sleep_mode(LDOA_SLP_ECO_VOLT_SLP);    /*io1.8v/mcp1.8v/sd01.8v*/

-	zx234290_set_ldo3_sleep_mode(LDOA_SLP_ECO_VOLT_SLP);	/*vp111.8v/vddr_pll1.8v/*/

+	zx234290_set_ldo2_sleep_mode(LDOA_SLP_ECO_VOLT);    /*io1.8v/mcp1.8v/sd01.8v*/

+	zx234290_set_ldo3_sleep_mode(LDOA_SLP_ECO_VOLT);	/*vp111.8v/vddr_pll1.8v/*/

 	zx234290_set_ldo4_sleep_mode(LDOA_SLP_SHUTDOWN);		/*vcxo*/

     //zx234290_set_ldo6_sleep_mode(LDOA_SLP_SHUTDOWN);       /*SIM1 1V8*/

-    zx234290_set_ldo7_sleep_mode(LDOA_SLP_ECO_VOLT_SLP);  /*RF 2V85 -- 26M */

-    zx234290_set_ldo8_sleep_mode(LDOA_SLP_ECO_VOLT_SLP);       /*ZSP JTAG/SD 2V85/LCD*/

-    zx234290_set_ldo9_sleep_mode(LDOA_SLP_ECO_VOLT_SLP);       /*PLL 0V9*/

+    zx234290_set_ldo7_sleep_mode(LDOA_SLP_ECO_VOLT);  /*RF -- 26M */

+    zx234290_set_ldo8_sleep_mode(LDOA_SLP_ECO_VOLT);       /*ZSP JTAG/SD 2V85/LCD*/

+    zx234290_set_ldo9_sleep_mode(LDOA_SLP_ECO_VOLT);       /*PLL 0V9*/

     //zx234290_set_ldo10_sleep_mode(LDOA_SLP_SHUTDOWN);      /*ABB DIG*/

 

 	return 0;

@@ -191,9 +191,16 @@
 	ret += zDrvZx234290_DischargerConfig();

 

 	//zDrvZx234290_SleepConfig();

+#ifdef _USE_VEHICLE_DC	

+	ret += zx234290_SetTllpToDo(LLP_RESTART);

+	ret += zx234290_SetLlpTime(LLP_TIME_6S);

 

-    ret += zx234290_SetLlpEnable(LLP_ENABLE);

+#else

     ret += zx234290_SetTllpToDo(LLP_SHUTDOWN);

+	ret += zx234290_SetLlpTime(LLP_TIME_10S);

+#endif

+	ret += zx234290_SetLlpEnable(LLP_ENABLE);

+

    // ret += zx234290_SetRestartDly(LLP_DLY_500MS);  //LLP_DLY_250MS 

     if(ret != 0)

 	{

diff --git a/ap/os/linux/linux-3.4.x/drivers/mmc/host/zx29_mmc.c b/ap/os/linux/linux-3.4.x/drivers/mmc/host/zx29_mmc.c
index 425d6a7..4724b88 100755
--- a/ap/os/linux/linux-3.4.x/drivers/mmc/host/zx29_mmc.c
+++ b/ap/os/linux/linux-3.4.x/drivers/mmc/host/zx29_mmc.c
@@ -40,7 +40,7 @@
 
 #include <linux/sched.h>
 #include <linux/kthread.h>
-
+#include <linux/ramdump/ramdump.h>
 
 #include <mach/zx29_mmc.h>
 #include "mmc_xlog.h"
@@ -4020,9 +4020,9 @@
 
 #if (defined CONFIG_ARCH_ZX297520V2)||(defined CONFIG_ARCH_ZX297520V3)
 	if (host->host_id == 0){
-		ramdump_ram_conf_table_add("sd0_reg_0x01210000.bin", 0x01210000, 0x110, (unsigned long)host->regs, 0, 0);
+		ramdump_ram_conf_table_add("sd0_reg_0x01210000.bin", 0x01210000, 0x110, (unsigned long)host->regs, RAMDUMP_FLAG_LEVEL_MEDIUM, 0);
 	}else{
-		ramdump_ram_conf_table_add("sd1_reg_0x01211000.bin", 0x01211000, 0x110, (unsigned long)host->regs, 0, 0);
+		ramdump_ram_conf_table_add("sd1_reg_0x01211000.bin", 0x01211000, 0x110, (unsigned long)host->regs, RAMDUMP_FLAG_LEVEL_MEDIUM, 0);
 	}
 #endif
 
diff --git a/ap/os/linux/linux-3.4.x/drivers/net/psnet/psnet_dev.c b/ap/os/linux/linux-3.4.x/drivers/net/psnet/psnet_dev.c
index 09a1b2b..f47694b 100755
--- a/ap/os/linux/linux-3.4.x/drivers/net/psnet/psnet_dev.c
+++ b/ap/os/linux/linux-3.4.x/drivers/net/psnet/psnet_dev.c
@@ -271,6 +271,7 @@
 	buff = buff + sizeof(struct in6_addr);
 	memcpy(&g_ipv4_local_subnet, buff, sizeof(struct in_addr));
 	g_xlat_dev = dev_get_by_name(&init_net, dev_name);
+	return 0;
 }
 
 int fill_ip_header(struct iphdr *ip, const struct ipv6hdr *old_header) {
diff --git a/ap/os/linux/linux-3.4.x/drivers/net/psnet/psnet_io.c b/ap/os/linux/linux-3.4.x/drivers/net/psnet/psnet_io.c
index 7033685..b5ffada 100755
--- a/ap/os/linux/linux-3.4.x/drivers/net/psnet/psnet_io.c
+++ b/ap/os/linux/linux-3.4.x/drivers/net/psnet/psnet_io.c
@@ -12,8 +12,7 @@
 #include <net/ipv6.h>
 #include <net/protocol.h>
 #include <net/ndisc.h>
-
-extern struct psnet *global_psnet[DDR_DEV_MAX];
+#include <linux/netdevice.h>
 
 #define ZATI2_DATA_CHANNEL_ID_NUM_START		(CHANNEL_AP2PS_MAXID)//+1
 #define ZATI2_DATA_CHANNEL_BASE 90
@@ -70,6 +69,14 @@
 	struct in6_addr nd_opt_pi_prefix;
 };
 
+struct nd_opt_mtu_info     /* mtu information */
+{
+	uint8_t   nd_opt_mi_type;
+	uint8_t   nd_opt_mi_len;
+	uint16_t  nd_opt_mi_reserved2;
+	uint32_t  nd_opt_mi_mtu;
+};
+
 struct psnet_RA_info
 {
 	unsigned int flag;
@@ -85,6 +92,10 @@
 extern int zAti2_IsExCid(unsigned char cid, unsigned char *pcid);
 struct psnet_RA_info g_psnet_ipv6_prefix[DDR_DEV_MAX] = {0};
 
+int ra_mtu_enable;
+module_param(ra_mtu_enable, int, 0644);
+extern struct psnet *global_psnet[DDR_DEV_MAX];
+
 void psnet_parse_RA_pkt(unsigned char cid, unsigned char* pkt, int len)
 {
 	//warn("cid=%d flag=%d\n", cid, g_psnet_ipv6_prefix[cid-1].flag);
@@ -130,7 +141,17 @@
 					g_psnet_ipv6_prefix[ext_cid-1].flag = 1;
 					up(&g_psnet_ipv6_prefix[ext_cid-1].sem);
 					warn("cid=%d prefix_len=%d\n", ext_cid, pinfo->nd_opt_pi_prefix_len);
-					return;
+					//return;
+				}
+				if((nd_opt->nd_opt_type) == ND_OPT_MTU){
+					if(ra_mtu_enable) {
+						int err;
+						struct nd_opt_mtu_info *minfo = (struct nd_opt_mtu_info *)nd_opt;
+						warn("mtu: %u, dev: %s\n", ntohl(minfo->nd_opt_mi_mtu), global_psnet[cid-1]->net->name);
+						err = dev_set_mtu(global_psnet[cid-1]->net, ntohl(minfo->nd_opt_mi_mtu));
+						warn("err: %d", err);
+					}					
+					//return;
 				}
 				opt_len -= l;
 				nd_opt = ((void *)nd_opt) + l;
diff --git a/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/Makefile b/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/Makefile
index 7caf507..1a5c814 100755
--- a/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/Makefile
+++ b/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/Makefile
@@ -152,6 +152,7 @@
 CONFIG_TXRX_THREAD_PRIO = y
 CONFIG_DPD = y
 CONFIG_FORCE_DPD_CALIB = y
+CONFIG_TEMP_PW = y
 
 # Support of MU-MIMO transmission (need FW support)
 ifeq ($(CONFIG_RWNX_BFMER), y)
@@ -267,6 +268,7 @@
 ccflags-$(CONFIG_TXRX_THREAD_PRIO) += -DCONFIG_TXRX_THREAD_PRIO
 ccflags-$(CONFIG_DPD)  += -DCONFIG_DPD
 ccflags-$(CONFIG_FORCE_DPD_CALIB) += -DCONFIG_FORCE_DPD_CALIB -DCONFIG_DPD
+ccflags-$(CONFIG_TEMP_PW) += -DCONFIG_TEMP_PW
 
 ifeq ($(CONFIG_LESS_SKB), y)
 ccflags-y += -DLESS_SKB
diff --git a/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/aicwf_sdio.c b/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/aicwf_sdio.c
index a9c7fb5..d300096 100755
--- a/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/aicwf_sdio.c
+++ b/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/aicwf_sdio.c
@@ -334,11 +334,13 @@
     struct aic_sdio_dev *sdiodev = NULL;
 
     sdio_dbg("%s\n", __func__);
+#ifdef CONFIG_TEMP_PW
 	if (timer_pending(&g_rwnx_plat->sdiodev->tp_timer)) {
 		printk("%s del_timer\n", __func__);
 		del_timer_sync(&g_rwnx_plat->sdiodev->tp_timer);
 	}
 	cancel_work_sync(&g_rwnx_plat->sdiodev->tp_work);
+#endif
     host = func->card->host;
     host->caps &= ~MMC_CAP_NONREMOVABLE;
     bus_if = dev_get_drvdata(&func->dev);
@@ -1835,50 +1837,9 @@
     sdio_release_host(sdiodev->func);
 }
 
+#ifdef CONFIG_TEMP_PW
 extern void set_txpwr_ctrl(struct aic_sdio_dev *sdiodev, s8_l value);
-#if 0
-static void set_txpwr_ctrl(struct aic_sdio_dev *sdiodev, s8_l value)
-{
-	nvram_info.txpwr_loss.loss_enable = 1;
-	if (value > TEMP_THD_1 && value <= TEMP_THD_2) {
-		if (sdiodev->range == 0) {
-			nvram_info.txpwr_loss.loss_value += -TEMP_STEP_1;
-			sdiodev.range = 1;
-			rwnx_send_txpwr_lvl_req(sdiodev->rwnx_hw);
-		} else if (sdiodev->range == 1) {
-			continue;
-		} else if (sdiodev->range == 2) {
-			nvram_info.txpwr_loss.loss_value += TEMP_STEP_1;
-			sdiodev.range = 1;
-			rwnx_send_txpwr_lvl_req(sdiodev->rwnx_hw);
-		}
-	} else if (value > TEMP_THD_2) {
-		if (sdiodev->range == 0) {
-			nvram_info.txpwr_loss.loss_value += -TEMP_STEP_2;
-			sdiodev.range = 2;
-			rwnx_send_txpwr_lvl_req(sdiodev->rwnx_hw);
-		} else if (sdiodev->range == 1) {
-			nvram_info.txpwr_loss.loss_value += -TEMP_STEP_1;
-			sdiodev.range = 2;
-			rwnx_send_txpwr_lvl_req(sdiodev->rwnx_hw);
-		} else {
-			continue;
-		}
-	} else {
-		if (sdiodev->range == 0) {
-			continue;
-		} else if (sdiodev->range == 1) {
-			nvram_info.txpwr_loss.loss_value += TEMP_STEP_1;
-			sdiodev.range = 0;
-			rwnx_send_txpwr_lvl_req(sdiodev->rwnx_hw);
-		} else if (sdiodev->range == 2) {
-			nvram_info.txpwr_loss.loss_value += TEMP_STEP_2;
-			sdiodev.range = 0;
-			rwnx_send_txpwr_lvl_req(sdiodev->rwnx_hw);
-		}
-	}
-}
-#endif
+
 void aicwf_temp_worker(struct work_struct *work)
 {
 	struct rwnx_hw *rwnx_hw;
@@ -1904,6 +1865,7 @@
 		schedule_work(&sdiodev->tp_work);
 	return;
 }
+#endif
 void *aicwf_sdio_bus_init(struct aic_sdio_dev *sdiodev)
 {
     int ret;
@@ -1947,6 +1909,7 @@
     init_waitqueue_head(&tx_priv->cmd_txdone_wait);
     atomic_set(&tx_priv->tx_pktcnt, 0);
 
+#ifdef CONFIG_TEMP_PW
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
 		init_timer(&sdiodev->tp_timer);
 		sdiodev->tp_timer.data = (ulong) sdiodev;
@@ -1958,6 +1921,7 @@
 		INIT_WORK(&sdiodev->tp_work, aicwf_temp_worker);
 		mod_timer(&sdiodev->tp_timer, jiffies + msecs_to_jiffies(10 * 1000));
 		sdiodev->range = 0;
+#endif
 #if defined(CONFIG_SDIO_PWRCTRL)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
     init_timer(&sdiodev->timer);
diff --git a/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/aicwf_sdio.h b/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/aicwf_sdio.h
index 9a10cd4..fd98dcc 100755
--- a/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/aicwf_sdio.h
+++ b/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/aicwf_sdio.h
@@ -84,9 +84,11 @@
     u8 flowctrl;
     spinlock_t tx_flow_lock;
 #endif
+#ifdef CONFIG_TEMP_PW
 	struct timer_list tp_timer;
 	struct work_struct tp_work;
 	u8 range;
+#endif
     #if defined(CONFIG_SDIO_PWRCTRL)
     //for sdio pwr ctrl
     struct timer_list timer;
@@ -100,7 +102,9 @@
 int aicwf_sdio_writeb(struct aic_sdio_dev *sdiodev, uint regaddr, u8 val);
 void aicwf_sdio_hal_irqhandler(struct sdio_func *func);
 void aicwf_sdio_hal_irqhandler_func2(struct sdio_func *func);
+#ifdef CONFIG_TEMP_PW
 void aicwf_temp_worker(struct work_struct *work);
+#endif
 
 #if defined(CONFIG_SDIO_PWRCTRL)
 void aicwf_sdio_pwrctl_timer(struct aic_sdio_dev *sdiodev, uint duration);
diff --git a/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/rwnx_platform.c b/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/rwnx_platform.c
index e1703a4..ea9abb7 100755
--- a/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/rwnx_platform.c
+++ b/ap/os/linux/linux-3.4.x/drivers/net/wireless/aic8800/rwnx_platform.c
@@ -110,13 +110,9 @@
     },
 };
 
-extern u8 chip_id;
+#ifdef CONFIG_TEMP_PW
 void set_txpwr_ctrl(struct aic_sdio_dev *sdiodev, s8_l value)
 {
-	if (!IS_CHIP_ID_H()) {
-		printk("%s  !h\n", __func__);
-		return;
-	}
 	nvram_info.txpwr_loss.loss_enable = 1;
 	if (value > TEMP_THD_1 && value <= TEMP_THD_2) {
 		if (sdiodev->range == 0) {
@@ -157,6 +153,7 @@
 	}
 	return;
 }
+#endif
 
 #ifdef VENDOR_SPECIFIED_FW_PATH
 int rwnx_load_firmware(u32 **fw_buf, const char *name, struct device *device)
@@ -802,7 +799,7 @@
 void set_txpwr_loss_ofst(s8_l value)
 {
     nvram_info.txpwr_loss.loss_enable = 1;
-    nvram_info.txpwr_loss.loss_value += value;
+    nvram_info.txpwr_loss.loss_value = value;
     printk("%s:value:%d\r\n",      __func__, value);
 }
 void get_userconfig_txpwr_ofst(txpwr_ofst_conf_t *txpwr_ofst)
diff --git a/ap/os/linux/linux-3.4.x/drivers/net/wireless/ssv6x5x/smac/dev.c b/ap/os/linux/linux-3.4.x/drivers/net/wireless/ssv6x5x/smac/dev.c
index 64335ed..38c1bc9 100755
--- a/ap/os/linux/linux-3.4.x/drivers/net/wireless/ssv6x5x/smac/dev.c
+++ b/ap/os/linux/linux-3.4.x/drivers/net/wireless/ssv6x5x/smac/dev.c
@@ -1089,6 +1089,8 @@
 	    if (sta) {
 	        if (ssv6xxx_compare_ether_addr(hdr->addr1, sta->addr)) {
 	            ssv_skb_free(sc, skb);
+		    if (wsid <= SSV_SW_TXQ_ID_STAMAX)
+	        	HCI_TXQ_UNLOCK_BY_STA(sc->sh, wsid);
 	            continue;
 	        } else {
 	            ssv6xxx_setup_ampdu_session((void *)sc, sta, skb);
diff --git a/ap/os/linux/linux-3.4.x/drivers/rtc/zx234290-rtc.c b/ap/os/linux/linux-3.4.x/drivers/rtc/zx234290-rtc.c
index 54428db..1ea194c 100755
--- a/ap/os/linux/linux-3.4.x/drivers/rtc/zx234290-rtc.c
+++ b/ap/os/linux/linux-3.4.x/drivers/rtc/zx234290-rtc.c
@@ -279,7 +279,7 @@
 	zte_send_hour_irq_event();

 	return IRQ_HANDLED;

 }

-/*alarm enable/disable, 0:disable 1:enable*/

+/*alarm enable/disable, 1:disable 0:enable*/

 int zx234290_rtc_alarm_enable(zx234290_alarm_type type, unsigned int enabled)

 {

     int ret = 0;

@@ -351,7 +351,15 @@
 	int reg_val=0, mask=0;

 

 	pr_debug("%s: aie=%d\n", __func__, enabled);

-

+	

+	if(0==enabled)//disable alarm

+	{

+		zx234290_rtc_alarm_enable(ALARM_SECOND, 1);		

+		zx234290_rtc_alarm_enable(ALARM_MINUTE, 1);		

+		zx234290_rtc_alarm_enable(ALARM_HOUR, 1);		

+		zx234290_rtc_alarm_enable(ALARM_DAY, 1);	

+		zx234290_rtc_alarm_enable(ALARM_WEEKDAY, 1);

+	};

     /*enable/disable AIE bit*/

 	mask = ZX234290_BITFMASK(ZX234290_RTC_AIE_WID, ZX234290_RTC_AIE_LSH);

 	reg_val= ZX234290_BITFVAL(enabled, ZX234290_RTC_AIE_LSH);

diff --git a/ap/os/linux/linux-3.4.x/drivers/soc/zte/otp/otp_zx.c b/ap/os/linux/linux-3.4.x/drivers/soc/zte/otp/otp_zx.c
index 87ef398..fba3f50 100755
--- a/ap/os/linux/linux-3.4.x/drivers/soc/zte/otp/otp_zx.c
+++ b/ap/os/linux/linux-3.4.x/drivers/soc/zte/otp/otp_zx.c
@@ -26,6 +26,7 @@
 #include <linux/dmaengine.h>

 #include <mach/iomap.h>

 #include <mach/gpio.h>

+#include <linux/sched.h>

 

 extern struct mutex otpMutex;

 extern char *nor_cmdline;

@@ -542,43 +543,7 @@
 	  return 0;

    }

    

-   int nor_write(u32 to, u32 len, u32 buf)

-  {

-	  int ret;

-	  u32 page_offset, page_size, i;

-	  struct nor_info *info = spi_nor_flash;

-

-	  soft_spin_lock(NAND_SFLOCK);

-	  mutex_lock(&otpMutex);

- 

-	  nor_write_reg(CMD_WREN, NULL, 0);

-	  

-	  page_offset = to & (info->page_size - 1);

   

-	  /* do all the bytes fit onto one page? */

-	  if (page_offset + len <= info->page_size) {

-		  ret = spi_nor_write(to, len, (uint8_t *)buf);

-	  } else {

-		  /* the size of data remaining on the first page */

-		  page_size = info->page_size - page_offset;

-		  ret = spi_nor_write(to, page_size, (uint8_t *)buf);

-  

-		  /* read everything in nor->page_size chunks */

-		  for (i = page_size; i < len; i += page_size) {

-			  page_size = len - i;

-			  if (page_size > info->page_size)

-				  page_size = info->page_size;

- 

-			  nor_write_reg(CMD_WREN, NULL, 0);

-			  ret = spi_nor_write(to + i, page_size, ((uint8_t *)buf + i));

-		  }

-	  }

-

-	  mutex_unlock(&otpMutex);

-	  soft_spin_unlock(NAND_SFLOCK);

-  

-	  return ret;

-  }

   int spi_nor_read(uint32_t from, size_t len, u_char *buf)

   {

 	  int ret;

@@ -613,7 +578,61 @@
 	  cs_close();//spp

 	  return 0;

   }

+

+   int nor_write(u32 to, u32 len, u32 buf)

+  {

+	  int ret;

+	  u32 page_offset, page_size, i;

+	  struct nor_info *info = spi_nor_flash;

+	  char temp_addr[4096] = {0};

+	  unsigned long long start_time,end_time,delta_time = 0;

+

+	  soft_spin_lock(NAND_SFLOCK);

+	  mutex_lock(&otpMutex);

+ 

+	  nor_write_reg(CMD_WREN, NULL, 0);

+	  

+	  page_offset = to & (info->page_size - 1);

   

+	  /* do all the bytes fit onto one page? */

+	  if (page_offset + len <= info->page_size) {

+		  ret = spi_nor_write(to, len, (uint8_t *)buf);

+	  } else {

+		  /* the size of data remaining on the first page */

+		  page_size = info->page_size - page_offset;

+		  ret = spi_nor_write(to, page_size, (uint8_t *)buf);

+  

+		  /* read everything in nor->page_size chunks */

+		  for (i = page_size; i < len; i += page_size) {

+			  page_size = len - i;

+			  if (page_size > info->page_size)

+				  page_size = info->page_size;

+ 

+			  nor_write_reg(CMD_WREN, NULL, 0);

+			  start_time = cpu_clock(0)>>10;

+			  ret = spi_nor_write(to + i, page_size, ((uint8_t *)buf + i));

+			  end_time = cpu_clock(0)>>10;

+			  delta_time = end_time - start_time;

+			  //printk("time consumed: %lld\n",delta_time);

+			  spi_nor_read(to + i, page_size, ((uint8_t *)temp_addr)); 

+			  while(memcmp(((uint8_t *)buf + i), ((uint8_t *)temp_addr),info->page_size)) {

+			  	    printk("addr 0x%x write fail.\n",to+i);

+					nor_write_reg(CMD_WREN, NULL, 0);

+					start_time = cpu_clock(0)>>10;

+					ret = spi_nor_write(to + i, page_size, ((uint8_t *)buf + i));

+					end_time = cpu_clock(0)>>10;

+					delta_time = end_time - start_time;

+				    printk("time consumed: %lld\n",delta_time);

+			        spi_nor_read(to + i, page_size, ((uint8_t *)temp_addr)); 

+			  }

+		  }

+	  }

+

+	  mutex_unlock(&otpMutex);

+	  soft_spin_unlock(NAND_SFLOCK);

+  

+	  return ret;

+  }

   int nor_read(u32 from, u32 len, u32 to)

   {

 	  int ret;

diff --git a/ap/os/linux/linux-3.4.x/drivers/soc/zte/tsc/zx-tsc-strategy.c b/ap/os/linux/linux-3.4.x/drivers/soc/zte/tsc/zx-tsc-strategy.c
index bf90b0b..3ad800c 100755
--- a/ap/os/linux/linux-3.4.x/drivers/soc/zte/tsc/zx-tsc-strategy.c
+++ b/ap/os/linux/linux-3.4.x/drivers/soc/zte/tsc/zx-tsc-strategy.c
@@ -107,6 +107,8 @@
 extern int zx29_set_frequency(unsigned int old_index,unsigned int new_index);

 extern unsigned int zx_getspeed(unsigned int cpu);

 #endif

+

+extern void zx29_restart(char str,const char * cmd);

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

 *                                       functions                                     *

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

@@ -178,17 +180,21 @@
 		{

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_UPTRANSIMITPOWER2, g_bit_probe[probe_num] ,STRTEGY_START);

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_START);

+			tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_START);

 		}

 		else if(temperature>=TsNvData.Threshods[probe_num].THROSHOLD_3)

 		{   

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_START);

+			tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_START);

 		}

 		else if(temperature>=TsNvData.Threshods[probe_num].THROSHOLD_1)

 		{	

-			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_START);

+			//tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_START);

+			tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_START);

 		}   

 		else if(temperature>=TsNvData.Threshods[probe_num].THROSHOLD_0)

 		{

+			tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_HOLD);

 		}

 		else

 		{	

@@ -202,12 +208,14 @@
 			tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT, g_bit_probe[probe_num], STRTEGY_STOP);

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_UPTRANSIMITPOWER2, g_bit_probe[probe_num], STRTEGY_STOP);

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_STOP);

+			tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_STOP);

 		}

 		else if(temperature<TsNvData.Threshods[probe_num].THROSHOLD_2)

 		{

 			tsctrl_set_strategy2Iram(TSCTRL_SHUTDOWN,g_bit_probe[probe_num],STRTEGY_STOP);

 			tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT, g_bit_probe[probe_num], STRTEGY_STOP);

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_UPTRANSIMITPOWER2 ,g_bit_probe[probe_num], STRTEGY_STOP);

+			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_STOP);

 		}

 		else if(temperature<TsNvData.Threshods[probe_num].THROSHOLD_4)

 		{

@@ -241,24 +249,20 @@
 		else if(temperature>=TsNvData.Threshods[probe_num].THROSHOLD_5)

 		{

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_UPTRANSIMITPOWER2, g_bit_probe[probe_num] ,STRTEGY_START);

-			//	tsctrl_set_strategy2Iram(TSCTRL_LIMIT_W_UPTRANSIMITPOWER2, g_bit_probe[probe_num] ,STRTEGY_START);	   

 			tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_START);

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_START);

-			//	tsctrl_set_strategy2Iram(TSCTRL_LIMIT_W_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_START);

 			tsctrl_set_strategy2Iram(TSCTRL_DFS, g_bit_probe[probe_num], STRTEGY_START);//zDrvPow_SetArmPsCoreFreq(CLK312M);	   

 		}

 		else if(temperature>=TsNvData.Threshods[probe_num].THROSHOLD_3)

 		{   

 			tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_START);

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_START);

-			//	tsctrl_set_strategy2Iram(TSCTRL_LIMIT_W_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_START);	   

 			tsctrl_set_strategy2Iram(TSCTRL_DFS, g_bit_probe[probe_num], STRTEGY_START);//zDrvPow_SetArmPsCoreFreq(CLK312M);	   

 		}

 		else if(temperature>=TsNvData.Threshods[probe_num].THROSHOLD_1)

 		{	

 			tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_START);

-			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_START);

-			//	   tsctrl_set_strategy2Iram(TSCTRL_LIMIT_W_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_START);	  		

+			//tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_START);

 		}   

 		else if(temperature>=TsNvData.Threshods[probe_num].THROSHOLD_0)

 		{

@@ -274,10 +278,8 @@
 			tsctrl_set_strategy2Iram(TSCTRL_SHUTDOWN,g_bit_probe[probe_num],STRTEGY_STOP);

 			tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT, g_bit_probe[probe_num], STRTEGY_STOP);

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_UPTRANSIMITPOWER2, g_bit_probe[probe_num], STRTEGY_STOP);

-			//	   tsctrl_set_strategy2Iram(TSCTRL_LIMIT_W_UPTRANSIMITPOWER2, g_bit_probe[probe_num], STRTEGY_STOP);	   	   	   

 			tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_STOP);

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_STOP);

-			//	   tsctrl_set_strategy2Iram(TSCTRL_LIMIT_W_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_STOP);	   

 			tsctrl_set_strategy2Iram(TSCTRL_DFS, g_bit_probe[probe_num], STRTEGY_STOP);// zDrvPow_SetArmPsCoreFreq(CLK624M);

 		}

 		else if(temperature<TsNvData.Threshods[probe_num].THROSHOLD_2)

@@ -285,7 +287,7 @@
 			tsctrl_set_strategy2Iram(TSCTRL_SHUTDOWN,g_bit_probe[probe_num],STRTEGY_STOP);

 			tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT, g_bit_probe[probe_num], STRTEGY_STOP);

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_UPTRANSIMITPOWER2 ,g_bit_probe[probe_num], STRTEGY_STOP);

-			//	   tsctrl_set_strategy2Iram(TSCTRL_LIMIT_W_UPTRANSIMITPOWER2 ,g_bit_probe[probe_num], STRTEGY_STOP);	   	   

+			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_DOWNRATE2, g_bit_probe[probe_num], STRTEGY_STOP);

 			tsctrl_set_strategy2Iram(TSCTRL_DFS, g_bit_probe[probe_num], STRTEGY_STOP);// zDrvPow_SetArmPsCoreFreq(CLK624M);

 		}

 		else if(temperature<TsNvData.Threshods[probe_num].THROSHOLD_4)

@@ -294,7 +296,6 @@
 			tsctrl_set_strategy2Iram(TSCTRL_SHUTDOWN,g_bit_probe[probe_num],STRTEGY_STOP);

 			tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT,g_bit_probe[probe_num],STRTEGY_STOP);

 			tsctrl_set_strategy2Iram(TSCTRL_LIMIT_LTE_UPTRANSIMITPOWER2,g_bit_probe[probe_num],STRTEGY_STOP);

-			//	tsctrl_set_strategy2Iram(TSCTRL_LIMIT_W_UPTRANSIMITPOWER2,g_bit_probe[probe_num],STRTEGY_STOP);	   

 		}

 		else if(temperature<TsNvData.Threshods[probe_num].THROSHOLD_6)

 		{

@@ -398,25 +399,26 @@
    }	

    else if(temperature>=TsNvData.Threshods[probe_num].THROSHOLD_7)

    {

-	   tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT, g_bit_probe[probe_num] ,STRTEGY_START);

+	 //  tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT, g_bit_probe[probe_num] ,STRTEGY_START);

+	tsctrl_set_strategy2Iram(TSCTRL_DFS, g_bit_probe[probe_num], STRTEGY_START);	   

    }

    else if(temperature>=TsNvData.Threshods[probe_num].THROSHOLD_5)

    {

-	tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_START);

-	tsctrl_set_strategy2Iram(TSCTRL_DFS, g_bit_probe[probe_num], STRTEGY_START);//zDrvPow_SetArmPsCoreFreq(CLK312M);	   

+	//tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_START);

+	tsctrl_set_strategy2Iram(TSCTRL_DFS, g_bit_probe[probe_num], STRTEGY_START);	   

    }

    else if(temperature>=TsNvData.Threshods[probe_num].THROSHOLD_3)

    {   

-	tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_START);

-	tsctrl_set_strategy2Iram(TSCTRL_DFS, g_bit_probe[probe_num], STRTEGY_START);//zDrvPow_SetArmPsCoreFreq(CLK312M);	   

+	//tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_START);

+	tsctrl_set_strategy2Iram(TSCTRL_DFS, g_bit_probe[probe_num], STRTEGY_START);	   

    }

 	else if(temperature>=TsNvData.Threshods[probe_num].THROSHOLD_1)

 	{	

-	   tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_START);

+	   //tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_START);

 	}   

 	else if(temperature>=TsNvData.Threshods[probe_num].THROSHOLD_0)

    {

-		tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_HOLD);

+		//tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_HOLD);

    }

    else

    {	

@@ -427,25 +429,25 @@
    if(temperature<TsNvData.Threshods[probe_num].THROSHOLD_0)

    {

 	   tsctrl_set_strategy2Iram(TSCTRL_SHUTDOWN,g_bit_probe[probe_num],STRTEGY_STOP);

-	   tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT, g_bit_probe[probe_num], STRTEGY_STOP);

-	   tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_STOP);

+	//   tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT, g_bit_probe[probe_num], STRTEGY_STOP);

+	 //  tsctrl_set_strategy2Iram(TSCTRL_PS_RATE, g_bit_probe[probe_num], STRTEGY_STOP);

 	  tsctrl_set_strategy2Iram(TSCTRL_DFS, g_bit_probe[probe_num], STRTEGY_STOP);// zDrvPow_SetArmPsCoreFreq(CLK624M);

    }

    else if(temperature<TsNvData.Threshods[probe_num].THROSHOLD_2)

    {

 	   tsctrl_set_strategy2Iram(TSCTRL_SHUTDOWN,g_bit_probe[probe_num],STRTEGY_STOP);

-	   tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT, g_bit_probe[probe_num], STRTEGY_STOP);

+	  // tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT, g_bit_probe[probe_num], STRTEGY_STOP);

 	  tsctrl_set_strategy2Iram(TSCTRL_DFS, g_bit_probe[probe_num], STRTEGY_STOP);// zDrvPow_SetArmPsCoreFreq(CLK624M);

    }

    else if(temperature<TsNvData.Threshods[probe_num].THROSHOLD_4)

    {

   	tsctrl_set_strategy2Iram(TSCTRL_SHUTDOWN,g_bit_probe[probe_num],STRTEGY_STOP); 

-	tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT,g_bit_probe[probe_num],STRTEGY_STOP);

+	//tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT,g_bit_probe[probe_num],STRTEGY_STOP);

    }

    else if(temperature<TsNvData.Threshods[probe_num].THROSHOLD_6)

    {

 	   tsctrl_set_strategy2Iram(TSCTRL_SHUTDOWN,g_bit_probe[probe_num],STRTEGY_STOP);

-	   tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT,g_bit_probe[probe_num],STRTEGY_STOP);

+	  // tsctrl_set_strategy2Iram(TSCTRL_PS_ANYRESIDENT,g_bit_probe[probe_num],STRTEGY_STOP);

    }   

    else if(temperature<TsNvData.Threshods[probe_num].THROSHOLD_8)

    {

@@ -587,14 +589,15 @@
 	if(zDrvTsc_GetTscEn() == 0xB2)

 	{

 		if(TsNvData.User_En == 0xB2){

-

 			/*USER*/

 			if(tsc_read_reg(TSCTRL_SHUTDOWN)!=0){

 				/*user strategy start*/

 				tsc_set_reg_bits(TSCTRL_AP,BIT_SHUTDOWN,BITS_FOR_APPIRAM,STRTEGY_START);			

+				sc_debug_info_record(MODULE_ID_AP_TSC, "tsc_reboot!!!\n" );

+				zx29_restart(NULL, "tsc_reboot!!!\n");

 				

 				if(g_tsc_print_log_debug)

-					tsc_print_log("user strategy start reserve \n")

+					tsc_print_log("user strategy start \n");

 			}

 			else{

 				//tsc_print_log("user strategy stop reserve \n")

diff --git a/ap/os/linux/linux-3.4.x/drivers/soc/zte/tsc/zx-tsc.c b/ap/os/linux/linux-3.4.x/drivers/soc/zte/tsc/zx-tsc.c
index 5d3bbba..7bd4b4a 100755
--- a/ap/os/linux/linux-3.4.x/drivers/soc/zte/tsc/zx-tsc.c
+++ b/ap/os/linux/linux-3.4.x/drivers/soc/zte/tsc/zx-tsc.c
@@ -39,6 +39,10 @@
 #define IRAM_TEMPCOMP_RFDDAC (IRAM_BASE_ADDR_SLAVE_AFC+0x8)  //high16bit: the ADC value of temp	

 #define IRAM_TEMPCOMP_RFDTEMP (IRAM_BASE_ADDR_SLAVE_AFC+0xc)  //temp of adcrfd

 

+#define RFDDAC_LOW	1

+#define RFDDAC_LOWE	1591

+#define RFDDAC_HIGHE 6096

+#define RFDDAC_HIGH	8191

 

 volatile u32 g_adc1_flag = 0;//¨¨?adc1¨®?¨®¨²¨¬?2apa2¨¤???¨¨¡ê??¨°g_adc1_flag=1

 volatile u32 g_adc2_flag = 0;//¨¨?adc2¨®?¨®¨²¨¬?2apa2¨¤???¨¨¡ê??¨°g_adc2_flag=1

@@ -557,11 +561,40 @@
 		if(g_adc3_flag==1){

 			adcRfValue = tsc_dac_read(IRAM_TEMPCOMP_DAC); 

 			tsc_get_probe_adcvalue(adcRfValue,&tempRf, 0);

+			if((adcRfValue<RFDDAC_LOW)||(adcRfValue>RFDDAC_HIGH))

+			{

+				printk("!!!!!!!(adcRfValue < %d)||(adcRfValue > %d)\n", RFDDAC_LOW, RFDDAC_HIGH);

+				tempRf=25;

+			}

+			if((adcRfValue>=RFDDAC_LOW)&&(adcRfValue<=RFDDAC_LOWE))

+			{

+				printk("curcuit breakage(%d<=adcRfValue<= %d)\n", RFDDAC_LOW, RFDDAC_LOWE);

+				tempRf= -100 ;

+			}

+			if((adcRfValue>=RFDDAC_HIGHE)&&(adcRfValue<=RFDDAC_HIGH))

+			{

+				printk("curcuit short(%d<=adcRfValue<= %d)\n", RFDDAC_HIGHE, RFDDAC_HIGH);

+				tempRfd= -75 ;

+			}			

 		}

 		if(TsNvData.AdcRFd_En==0xB2){	

 			adcRfdValue =(zx_read_reg(IRAM_TEMPCOMP_RFDDAC)&0xffff0000)>>16; 

 			tsc_get_probe_adcvalue(adcRfdValue,&tempRfd, 1);

-			//tempRfd = zx_read_reg(IRAM_TEMPCOMP_RFDTEMP)>>10; 

+			if((adcRfdValue<RFDDAC_LOW)||(adcRfdValue>RFDDAC_HIGH))

+			{

+				printk("!!!!!!!(adcRfdValue < %d)||(adcRfdValue > %d)\n", RFDDAC_LOW, RFDDAC_HIGH);

+				tempRfd=25;

+			}

+			if((adcRfdValue>=RFDDAC_LOW)&&(adcRfdValue<=RFDDAC_LOWE))

+			{

+				printk("curcuit breakage(%d<=adcRfdValue<= %d)\n", RFDDAC_LOW, RFDDAC_LOWE);

+				tempRfd= -100 ;

+			}

+			if((adcRfdValue>=RFDDAC_HIGHE)&&(adcRfdValue<=RFDDAC_HIGH))

+			{

+				printk("curcuit short(%d<=adcRfdValue<= %d)\n", RFDDAC_HIGHE, RFDDAC_HIGH);

+				tempRfd= -75 ;

+			}			

 		}

 

 		tsc_lock();

@@ -598,6 +631,8 @@
 				tsc_print_log("adc1Value=%d,adc2Value=%d,adcRfValue=%d,temp1 = %d.temp2 = %d.temprf = %d.\n",

 				adc1Value,adc2Value,adcRfValue,temp1,temp2, g_ts_data_info[PROBE_ADCRF][TS_MEMBER_TEMP] );

 			}

+			tsc_print_log("DetectEn:0x%x; AdcRFd_En:0x%x; Modemrate_En:0x%x; TansmitPower_En:0x%x; Dfs_En:0x%x; User_En:0x%x;",

+				TsNvData.DetectEn, TsNvData.AdcRFd_En, TsNvData.Modemrate_En, TsNvData.TansmitPower_En, TsNvData.Dfs_En, TsNvData.User_En );

 		}

 

 		if((((tsc_record_time_cnt*TS_POLLING_TIME_S)%tsc_record_time)==0) && tsc_record_flag)

diff --git a/ap/os/linux/linux-3.4.x/drivers/staging/voicedrv/Makefile b/ap/os/linux/linux-3.4.x/drivers/staging/voicedrv/Makefile
old mode 100644
new mode 100755
index 2a540eb..f1622df
--- a/ap/os/linux/linux-3.4.x/drivers/staging/voicedrv/Makefile
+++ b/ap/os/linux/linux-3.4.x/drivers/staging/voicedrv/Makefile
@@ -4,6 +4,7 @@
 
 
 ccflags-y += -Idrivers/staging/voicedrv/include
+ccflags-y += -I$(TOPDIR)/pub/project/$(CHIP_NAME)/include/nv
 
 obj-$(CONFIG_VOICE_DRV)	+= voice_drv.o
 voice_drv-$(CONFIG_VOICE_DRV) := voice.o
diff --git a/ap/os/linux/linux-3.4.x/drivers/staging/voicedrv/voice.c b/ap/os/linux/linux-3.4.x/drivers/staging/voicedrv/voice.c
old mode 100644
new mode 100755
index a4e39a0..a47acf0
--- a/ap/os/linux/linux-3.4.x/drivers/staging/voicedrv/voice.c
+++ b/ap/os/linux/linux-3.4.x/drivers/staging/voicedrv/voice.c
@@ -11,6 +11,7 @@
 
 #include "voice.h"
 
+#include "RWNvConfig.h"
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("xxq");
@@ -44,6 +45,34 @@
 
 #ifdef _USE_VEHICLE_DC
 
+#define VOICE_NVRW_MAX_LEN (8 * 1024)
+
+static unsigned char *voice_nvrw_param = NULL;
+
+static void voice_SetVoiceNVRW(void)
+{
+	unsigned char voice_nv_update = 0;
+
+    while(1){
+        CPPS_FUNC(cpps_callbacks, zDrvVp_UpdateVoiceNv)(&voice_nv_update);
+        
+        if(1 == voice_nv_update){
+            print_audio("voice_SetVoiceNVRW voice_nv_update = %d!\n", voice_nv_update); 
+            break;
+        }
+    }
+
+    if(CPPS_FUNC(cpps_callbacks, zOss_NvItemWrite)(OS_FLASH_VOICE_RW_NONFAC_BASE_ADDR, \
+        (voice_nvrw_param + 8), *((int*)voice_nvrw_param + 1))){
+    	print_audio("voice_SetVoiceNVRW zOss_NvItemWrite error, update voice_nvrw fail!\n");
+    }
+    else{
+        print_audio("voice_SetVoiceNVRW zOss_NvItemWrite end, write len = %d!\n", *((int*)voice_nvrw_param + 1));
+    }
+    
+	return;
+}
+
 static int voice_SetMute(bool enable)
 {
 	int ret = 0;
@@ -324,7 +353,7 @@
 		T_Voice_Para para;
 		//pr_info("start volte read \n");
 		if (copy_from_user(&para, argp, sizeof(para))) {
-			print_audio("volte_ioctl  stop copy_to_user err!\n");
+			print_audio("voice_ioctl  stop copy_to_user err!\n");
 			return -EFAULT;
 		}
 
@@ -338,7 +367,7 @@
 		T_Voice_Para para;
 
 		if (copy_from_user(&para, argp, sizeof(para))) {
-			print_audio("volte_ioctl  stop copy_to_user err!\n");
+			print_audio("voice_ioctl  stop copy_to_user err!\n");
 			return -EFAULT;
 		}
 		ret =  voice_stop(para);
@@ -352,7 +381,7 @@
 		int para;
 
 		if (copy_from_user(&para, argp, sizeof(para))) {
-			print_audio("volte_ioctl  set vol copy_to_user err!\n");
+			print_audio("voice_ioctl  set vol copy_to_user err!\n");
 			return -EFAULT;
 		}
 		ret = voice_SetVol(para);
@@ -377,7 +406,7 @@
 		bool para;
 
 		if (copy_from_user(&para, argp, sizeof(para))) {
-			print_audio("volte_ioctl  set vol copy_to_user err!\n");
+			print_audio("voice_ioctl  set vol copy_to_user err!\n");
 			return -EFAULT;
 		}
 		ret = voice_SetMute(para);
@@ -402,7 +431,7 @@
 		int para;
 
 		if (copy_from_user(&para, argp, sizeof(para))) {
-			print_audio("volte_ioctl  set path copy_to_user err!\n");
+			print_audio("voice_ioctl  set path copy_to_user err!\n");
 			return -EFAULT;
 		}
 		ret = voice_SetPath(para);
@@ -421,6 +450,28 @@
 		}
 		break;
 	}
+
+    case VOICE_IOCTL_SET_VOICE_NVRW: {
+        voice_nvrw_param = kzalloc((2 * sizeof(int) + VOICE_NVRW_MAX_LEN), GFP_KERNEL);
+        if(!voice_nvrw_param){
+            print_audio("voice_ioctl voice_nvrw_param malloc fail!\n");
+            return -EFAULT;
+        }
+    
+		if (copy_from_user(voice_nvrw_param, argp, 2 * sizeof(int) + VOICE_NVRW_MAX_LEN)){
+			print_audio("voice_ioctl  set voice nvrw copy_from_user err!\n");
+			return -EFAULT;
+		}
+
+        voice_SetVoiceNVRW();
+
+        if(voice_nvrw_param){
+            kfree(voice_nvrw_param);
+            voice_nvrw_param = NULL;
+        }
+        
+		break;
+	}
 #endif
 
 	case VOICE_IOCTL_GET_SLIC_USE_FLAG: {
@@ -441,7 +492,7 @@
 		int path;
 
 		if (copy_from_user(&path, argp, sizeof(path))) {
-			print_audio("volte_ioctl  zDrvVp_Loop copy_to_user err!\n");
+			print_audio("voice_ioctl  zDrvVp_Loop copy_to_user err!\n");
 			return -EFAULT;
 		}
 		ret = CPPS_FUNC(cpps_callbacks, zDrvVp_Loop)(path);
diff --git a/ap/os/linux/linux-3.4.x/drivers/tty/serial/zx29_uart.c b/ap/os/linux/linux-3.4.x/drivers/tty/serial/zx29_uart.c
index e599f79..bb6e1c6 100755
--- a/ap/os/linux/linux-3.4.x/drivers/tty/serial/zx29_uart.c
+++ b/ap/os/linux/linux-3.4.x/drivers/tty/serial/zx29_uart.c
@@ -3366,11 +3366,11 @@
 #endif
 
 #if CONFIG_SERIAL_ZX29_DMA
-	if(pdev->id != 1) //zw.wang modify for T106BUG-531 on 20240304
-		{
+	if(pdev->id != DEBUG_CONSOLE)
+	{
 		uart_dma_init(port);
 		printk(KERN_INFO "[%s][%d]UART DMA is OPENED%d\n",__func__,__LINE__,pdev->id);
-		}
+	}
 #endif
 
     ret=uart_add_one_port(&zx29_uart_driver, &port->port);
diff --git a/ap/os/linux/linux-3.4.x/drivers/usb/dwc_otg/dwc_otg_driver.c b/ap/os/linux/linux-3.4.x/drivers/usb/dwc_otg/dwc_otg_driver.c
index 997ad3c..3c5fedb 100755
--- a/ap/os/linux/linux-3.4.x/drivers/usb/dwc_otg/dwc_otg_driver.c
+++ b/ap/os/linux/linux-3.4.x/drivers/usb/dwc_otg/dwc_otg_driver.c
@@ -800,9 +800,9 @@
 	dwc_otg_device->os_dep.base= ioremap(iomem->start, resource_size(iomem));
 
 #ifdef CONFIG_RAMDUMP
-	ramdump_ram_conf_table_add("usb_global.bin", ZX29_USB_GLOBAL_REG, USB_GLOBAL_SIZE, 0, RAMDUMP_FLAG_HAS_EXTERNAL, usb_global_reg);
-	ramdump_ram_conf_table_add("usb_device.bin", ZX29_USB_DEVICE_REG, USB_DEVICE_SIZE, 0, RAMDUMP_FLAG_HAS_EXTERNAL, usb_device_reg);
-	ramdump_ram_conf_table_add("usb_pwr_clk.bin", ZX29_USB_PWR_CLK_REG, USB_PWR_CLK_SIZE, 0, RAMDUMP_FLAG_HAS_EXTERNAL, usb_pwr_clk_reg);
+	ramdump_ram_conf_table_add("usb_global.bin", ZX29_USB_GLOBAL_REG, USB_GLOBAL_SIZE, 0, RAMDUMP_FLAG_HAS_EXTERNAL|RAMDUMP_FLAG_LEVEL_LOW, usb_global_reg);
+	ramdump_ram_conf_table_add("usb_device.bin", ZX29_USB_DEVICE_REG, USB_DEVICE_SIZE, 0, RAMDUMP_FLAG_HAS_EXTERNAL|RAMDUMP_FLAG_LEVEL_LOW, usb_device_reg);
+	ramdump_ram_conf_table_add("usb_pwr_clk.bin", ZX29_USB_PWR_CLK_REG, USB_PWR_CLK_SIZE, 0, RAMDUMP_FLAG_HAS_EXTERNAL|RAMDUMP_FLAG_LEVEL_LOW, usb_pwr_clk_reg);
 #endif
 
 #if 0
diff --git a/ap/os/linux/linux-3.4.x/drivers/usb/dwc_otg/dwc_otg_pwr.c b/ap/os/linux/linux-3.4.x/drivers/usb/dwc_otg/dwc_otg_pwr.c
old mode 100644
new mode 100755
index cb0b488..b2b9a8f
--- a/ap/os/linux/linux-3.4.x/drivers/usb/dwc_otg/dwc_otg_pwr.c
+++ b/ap/os/linux/linux-3.4.x/drivers/usb/dwc_otg/dwc_otg_pwr.c
@@ -270,7 +270,7 @@
 		}
 		dwc_otg_hal_state.clk_state = 1;
 		clk_enable(pclk);
-//		dwc_chg_udelay(20);
+		dwc_chg_udelay(20);
 		clk_enable(wclk);
 		USBHAL_DBG("**ENABLE CLOCK**");
 	}else{
@@ -281,6 +281,7 @@
 		dwc_otg_hal_state.clk_state = 0;
 //		dwc_chg_udelay(5);
 		clk_disable(pclk);
+		dwc_chg_udelay(20);
 		clk_disable(wclk);
 		USBHAL_DBG("**DISABLE CLOCK**");
 	}
@@ -337,6 +338,7 @@
 	//usb  clock enable
 	dwc_otg_clk_enable(1);
 	
+	dwc_chg_udelay(2000);
 	// usb  ahb bus reset
 	reg_spin_lock();
 	value = ioread32(ZX29_SOC_USB_RSTEN);
@@ -382,7 +384,7 @@
 	value  |= (1<<3);
 	iowrite32(value,ZX29_SOC_USB_RSTEN);
 	reg_spin_unlock();
-	dwc_chg_udelay(10);
+	dwc_chg_udelay(1000);
 
 	value = 0;
 	while((ioread32(ZX29_SOC_USB_RESET_STATE)&0x02) == 0)
diff --git a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/adb_server.c b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/adb_server.c
index 8426431..e3a24fe 100755
--- a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/adb_server.c
+++ b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/adb_server.c
@@ -544,7 +544,7 @@
 	while(!kthread_should_stop()){	
 		/* we will block until we're online */
 		while (!dev->agent_start) {
-			USBSTACK_DBG("adb_rpmsg_recv_thread: waiting foragt_start_wait\n");
+			USBSTACK_DBG("adb_rpmsg_recv_thread: waiting for agt_start_wait\n");
 			ret = wait_event_interruptible(dev->agt_start_wait,
 					( dev->agent_start ||kthread_should_stop()));
 			if (ret < 0) {
@@ -558,18 +558,27 @@
 			USBSTACK_DBG("unbind thread stop");
 			break;
 		}
+		if(!dev->agent_start){
+			USBSTACK_DBG("adb_rpmsg_recv_thread: agent_start not start\n");
+			continue;
+		}
 			USBSTACK_DBG("adb_rpmsg_recv_thread: now send request\n");
 
 requeue_req:
+
+		if(!dev->online){
+			USBSTACK_DBG("rpmsg_recv dev is offline, agent_start:%d\n", dev->agent_start);
+			r = -EIO;
+			goto done;
+		}	
+		if(!dev->rx_req){
+			USBSTACK_DBG("adb_rpmsg_recv_thread, rx_req is NULL\n");
+			continue;
+		}
 		/* queue a request */
 		req = dev->rx_req;
 		req->length = ADB_BULK_BUFFER_SIZE;
 		dev->rx_done = 0;
-		if(!dev->online){
-			USBSTACK_DBG("rpmsg_recv dev is offline\n");
-			r = -EIO;
-			goto done;
-		}
 #if 0		
 		if(atomic_read(&dev->adb_read_flag)){
 			printk("\nadb_rpmsg_recv_thread adb_read_flag, wait_read_wq\n");
diff --git a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/android.c b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/android.c
index cb4a4cc..d456ddd 100755
--- a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/android.c
+++ b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/android.c
@@ -79,6 +79,7 @@
 
 #ifndef CONFIG_SYSTEM_RECOVERY
 int zDrvNand_WriteBootflag( int flag );
+unsigned int zDrvNand_ReadBootflag(void);
 #endif
 
 #define pr_err		USB_DEBUG
@@ -3193,8 +3194,16 @@
 			spin_unlock_irqrestore(&cdev->lock, flags);
 			
 			break;
-		//case :
-		//	break;
+		case USB_RPMSG_GET_USB_DL_STATE:
+			t_resp->cmd = USB_RPMSG_GET_USB_DL_STATE;
+			spin_lock_irqsave(&cdev->lock, flags);
+#ifndef CONFIG_SYSTEM_RECOVERY			
+			//1:dl_off;0:dl_oen
+			n = zDrvNand_ReadBootflag();			
+			sprintf(t_resp->param, "%d\n",n);
+#endif			
+			spin_unlock_irqrestore(&cdev->lock, flags);			
+			break;
 		//case :
 		//	break;
 		default:
diff --git a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/f_adb.c b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/f_adb.c
index a2ae7c9..91c1c62 100755
--- a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/f_adb.c
+++ b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/f_adb.c
@@ -375,15 +375,16 @@
 #endif	
 
 requeue_req:
-	/* queue a request */
-	req = dev->rx_req;
-	req->length = count;
-	dev->rx_done = 0;
 	if(!dev->online){
 		USBSTACK_DBG("adb_read dev is offline\n");
 		r = -EIO;
 		goto done;
 	}
+	/* queue a request */
+	req = dev->rx_req;
+	req->length = count;
+	dev->rx_done = 0;
+
 		USBSTACK_DBG("adb_read waiting usb_ep_queue \n");
 	ret = usb_ep_queue(dev->ep_out, req, GFP_ATOMIC);
 	if (ret < 0) {
@@ -711,6 +712,7 @@
 	}
 #endif	
 	adb_request_free(dev->rx_req, dev->ep_out);
+	dev->rx_req = NULL;
 	while ((req = adb_req_get(dev, &dev->tx_idle)))
 		adb_request_free(req, dev->ep_in);
 }
diff --git a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/usb_netlink.c b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/usb_netlink.c
index c042a78..9aafd3b 100755
--- a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/usb_netlink.c
+++ b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/usb_netlink.c
@@ -32,8 +32,9 @@
 

 extern int adb_enable_rpmsg_agent(int flag);

 extern int adb_rpmsg_agent_state(void);

-	int switch_mode = 0;

-	int simulate_plug = 0;

+int switch_mode = 0;

+

+int simulate_plug = 0;

 	struct work_struct switch_usbmode;

 extern int usb_plug_notify_ap(e_usb_rpmsg_cmd_type plug_type);

 	struct delayed_work plug_notify_dwork;

@@ -1040,7 +1041,7 @@
 }

 EXPORT_SYMBOL_GPL(usb_set_rpmsg_resp);

 

-void usb_parse_cap_notify(int type)

+void usb_parse_cap_notify(int type, int param)

 {	

 	int cur_usbmode = 0;

 	

@@ -1146,8 +1147,27 @@
 #endif			

 			break;

 		case USB_RPMSG_SIMULATE_PLUG:

-			simulate_plug = 1;

-			usb_record_dbginfo(USB_SIMULATE_PLUG, 0, 0);

+			if(param != 0){

+				/*this is for vehicle   

+				 *on usermode,open/close net/adb need to take effect immediately,

+				 *so while param not 0, means we need to do this action.

+				 * and send netlink change sg to user thread   to reread the nv config

+				 * and reenum again

+				 */

+				cur_usbmode = get_usb_enum_mode();	

+				printk("USB_RPMSG_SIMULATE_PLUG, cur_mode:%d\n", cur_usbmode);

+				if(cur_usbmode == 1){	

+					//only user mode need to do so

+					switch_mode = USB_SWITCH_USER;

+					schedule_work(&switch_usbmode);

+					

+				}

+				break;

+			}else{

+				//here just send except to do simulate plug

+				simulate_plug = 1;

+			}

+			usb_record_dbginfo(USB_SIMULATE_PLUG, 0, param);

 			schedule_work(&switch_usbmode);

 			

 			break;

diff --git a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/usb_rpmsg_server.c b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/usb_rpmsg_server.c
index c7daeda..32719e1 100755
--- a/ap/os/linux/linux-3.4.x/drivers/usb/gadget/usb_rpmsg_server.c
+++ b/ap/os/linux/linux-3.4.x/drivers/usb/gadget/usb_rpmsg_server.c
@@ -35,7 +35,7 @@
 
 extern void usb_set_rpmsg_resp(int type, char*resp);
 extern void android_set_rpmsg_resp(int type, char*resp);
-extern void usb_parse_cap_notify(int type);
+extern void usb_parse_cap_notify(int type, int param);
 
 struct task_struct	*rpmsg_thread;
 wait_queue_head_t usb_agt_wq;
@@ -138,7 +138,7 @@
 {
 	int i;
 	unsigned char *data;
-	
+	int v_param = 0;
 	char*tmp= (char*)buf;
 	usb_rpmsg_cmd *msg = NULL; 
 
@@ -163,8 +163,10 @@
 	memcpy(usb_msg,buf, len);
 	//usb_rpmsg2ap((char *)buf, len);
 	msg = (usb_rpmsg_cmd *)usb_msg;
-	if(msg->cmd > USB_RPMSG_CMD_MAX){
-		usb_parse_cap_notify(msg->cmd);
+	if(msg->cmd > USB_RPMSG_CMD_MAX){		
+		v_param = simple_strtoul(msg->param, NULL, 10);
+		
+		usb_parse_cap_notify(msg->cmd, v_param);
 		return;
 	}
 	atomic_set(&rpmsg_flag, 1);
diff --git a/ap/os/linux/linux-3.4.x/include/linux/android_notify.h b/ap/os/linux/linux-3.4.x/include/linux/android_notify.h
index c18981d..d4f5ef8 100755
--- a/ap/os/linux/linux-3.4.x/include/linux/android_notify.h
+++ b/ap/os/linux/linux-3.4.x/include/linux/android_notify.h
@@ -79,6 +79,7 @@
 	USB_RPMSG_GET_USB_LINK_STATE,

 	USB_RPMSG_GET_USB_ENUM_MODE,

 	USB_RPMSG_GET_USB_CURR_CONFIG,

+	USB_RPMSG_GET_USB_DL_STATE,

 	//USB_RPMSG_GET_,

 	//USB_RPMSG_GET_,

 	

diff --git a/ap/os/linux/linux-3.4.x/include/linux/module.h b/ap/os/linux/linux-3.4.x/include/linux/module.h
index 698a636..787ad7b 100755
--- a/ap/os/linux/linux-3.4.x/include/linux/module.h
+++ b/ap/os/linux/linux-3.4.x/include/linux/module.h
@@ -759,6 +759,7 @@
     int (*zDrvVp_AudioDataClose)(void);
 
     void (*zDrvVp_Status)(unsigned int *, unsigned int *);
+    void (*zDrvVp_UpdateVoiceNv)(unsigned char *);
     
 	unsigned char (*zDrvEdcp_IsBusy)(int);
 };
diff --git a/ap/os/linux/linux-3.4.x/include/linux/ramdump/ramdump.h b/ap/os/linux/linux-3.4.x/include/linux/ramdump/ramdump.h
index 01cefef..86d5e2c 100755
--- a/ap/os/linux/linux-3.4.x/include/linux/ramdump/ramdump.h
+++ b/ap/os/linux/linux-3.4.x/include/linux/ramdump/ramdump.h
@@ -26,6 +26,7 @@
 /*******************************************************************************
 *                                   ºê¶¨Òå                                     *
 *******************************************************************************/
+#define RAMDUMP_CLEAR_PRIO_FLAG  (0x7)
 
 /*******************************************************************************
 *                                Êý¾ÝÀàÐͶ¨Òå                                  *
@@ -39,7 +40,10 @@
     RAMDUMP_FLAG_NEED_COPY      = 0x01, /* Copy destination address */
     RAMDUMP_FLAG_HAS_EXTERNAL   = 0x02, /* External address         */
     RAMDUMP_FLAG_HAS_CALLBACK   = 0x04, /* Callback funtion         */
-};
+	RAMDUMP_FLAG_LEVEL_HIGH     = 0x08, /* High prior level         */
+    RAMDUMP_FLAG_LEVEL_MEDIUM   = 0x10, /* Medium prior level       */
+    RAMDUMP_FLAG_LEVEL_LOW      = 0x20, /* Low prior level          */
+ };
 
 /*******************************************************************************
 *                                È«¾Ö±äÁ¿ÉùÃ÷                                  *
diff --git a/ap/os/linux/linux-3.4.x/include/linux/ramdump/ramdump_oss.h b/ap/os/linux/linux-3.4.x/include/linux/ramdump/ramdump_oss.h
index f05f996..7251507 100755
--- a/ap/os/linux/linux-3.4.x/include/linux/ramdump/ramdump_oss.h
+++ b/ap/os/linux/linux-3.4.x/include/linux/ramdump/ramdump_oss.h
@@ -83,6 +83,8 @@
 #define RAMDUMP_EMMC_TRANS_FLAG_ADDR    (IRAM_BASE_ADDR_RAMDUMP_MODE)
 /*¹²ÏíÄÚ´æµØÖ·*/
 #ifdef _USE_VEHICLE_DC
+#define RAMDUMP_MODE_EMMC                   (1)
+#define RAMDUMP_MODE_SPINAND                (2)
 #define RAMDUMP_MEM_BASE                    (RAMDUMP_AP_TO_CAP_BUF_ADDR_PA)
 #define RAMDUMP_MEM_LEN                     (RAMDUMP_AP_TO_CAP_BUF_LEN)
 #define RAMDUMP_COMPRESS_LEN                (LZO1X_MEM_COMPRESS)
@@ -115,6 +117,7 @@
 /*******************************************************************************
 *                                È«¾Ö±äÁ¿ÉùÃ÷                                  *
 *******************************************************************************/
+extern unsigned int  ramdump_export_mode;
 
 /*******************************************************************************
 *                                È«¾Öº¯ÊýÉùÃ÷                                  *
diff --git a/ap/os/linux/linux-3.4.x/include/linux/volte_drv.h b/ap/os/linux/linux-3.4.x/include/linux/volte_drv.h
index 114b561..47a6c01 100755
--- a/ap/os/linux/linux-3.4.x/include/linux/volte_drv.h
+++ b/ap/os/linux/linux-3.4.x/include/linux/volte_drv.h
@@ -85,7 +85,6 @@
 #define VOICE_IOCTL_GET_SLIC_USE_FLAG	_IOR ('v', 12, int)
 #define VOICE_IOCTL_VPLOOP	_IOW('v', 13, int)
 
-#ifdef _USE_VEHICLE_DC
 #define VOICE_IOCTL_SET_VOL	_IOW('v', 14, int)
 #define VOICE_IOCTL_GET_VOL	_IOR('v', 15, int) 
 
@@ -94,9 +93,9 @@
 
 #define VOICE_IOCTL_SET_PATH	_IOW('v', 18, int)
 #define VOICE_IOCTL_GET_PATH	_IOR('v', 19, int) 
-#endif
 
 #define VOICE_IOCTL_GET_FS	_IOR('v', 20, int)
+#define VOICE_IOCTL_SET_VOICE_NVRW	_IOW('v', 21, int)
 
 #ifdef __KERNEL__
 #define  print_audio(fmt, ...)  \
diff --git a/ap/os/linux/linux-3.4.x/kernel/relay.c b/ap/os/linux/linux-3.4.x/kernel/relay.c
old mode 100644
new mode 100755
index 56ba44f..e00cbea
--- a/ap/os/linux/linux-3.4.x/kernel/relay.c
+++ b/ap/os/linux/linux-3.4.x/kernel/relay.c
@@ -1050,7 +1050,8 @@
 	size_t consumed = buf->subbufs_consumed % n_subbufs;
 
 	if (!read_pos)
-		read_pos = consumed * subbuf_size + buf->bytes_consumed;
+		read_pos = (consumed * subbuf_size + buf->bytes_consumed)
+				% (n_subbufs * subbuf_size);
 	read_subbuf = read_pos / subbuf_size;
 	padding = buf->padding[read_subbuf];
 	padding_start = (read_subbuf + 1) * subbuf_size - padding;
diff --git a/ap/os/linux/linux-3.4.x/kernel/sched/rt.c b/ap/os/linux/linux-3.4.x/kernel/sched/rt.c
old mode 100644
new mode 100755
index 89a985a..f07101d
--- a/ap/os/linux/linux-3.4.x/kernel/sched/rt.c
+++ b/ap/os/linux/linux-3.4.x/kernel/sched/rt.c
@@ -1371,6 +1371,8 @@
 	BUG_ON(idx >= MAX_RT_PRIO);
 
 	queue = array->queue + idx;
+	if (SCHED_WARN_ON(list_empty(queue)))
+		return NULL;
 	next = list_entry(queue->next, struct sched_rt_entity, run_list);
 
 	return next;
@@ -1392,7 +1394,8 @@
 
 	do {
 		rt_se = pick_next_rt_entity(rq, rt_rq);
-		BUG_ON(!rt_se);
+		if (unlikely(!rt_se))
+			return NULL;
 		rt_rq = group_rt_rq(rt_se);
 	} while (rt_rq);
 
diff --git a/ap/os/linux/linux-3.4.x/kernel/sched/sched.h b/ap/os/linux/linux-3.4.x/kernel/sched/sched.h
old mode 100644
new mode 100755
index ed2bab5..7260678
--- a/ap/os/linux/linux-3.4.x/kernel/sched/sched.h
+++ b/ap/os/linux/linux-3.4.x/kernel/sched/sched.h
@@ -6,6 +6,12 @@
 
 #include "cpupri.h"
 
+#ifdef CONFIG_SCHED_DEBUG
+# define SCHED_WARN_ON(x)	WARN_ONCE(x, #x)
+#else
+# define SCHED_WARN_ON(x)	({ (void)(x), 0; })
+#endif
+
 extern __read_mostly int scheduler_running;
 
 /*
diff --git a/ap/os/linux/linux-3.4.x/lib/flags_utils/flags_utils.c b/ap/os/linux/linux-3.4.x/lib/flags_utils/flags_utils.c
index 7dde200..e433296 100755
--- a/ap/os/linux/linux-3.4.x/lib/flags_utils/flags_utils.c
+++ b/ap/os/linux/linux-3.4.x/lib/flags_utils/flags_utils.c
@@ -392,6 +392,7 @@
     T_FLAGS_INFO main_flag = {0};

     T_FLAGS_INFO backup_flag = {0};

 	T_FLAGS_INFO p_flags_info_tmp = {0};

+	char delta_F[IMG_NAME_LEN] = {0};

 

     int main_index = 0;

     int backup_index = 1;

@@ -414,37 +415,34 @@
         return -1;

     }

 	

-	flags_info("main_flag crc32=%u", main_flag.crc32);

-	flags_info("backup_flag crc32=%u", backup_flag.crc32);

-	

-	if ((0 == main_flag.crc32) && (0 == backup_flag.crc32))

+	flags_info("main_flag crc32=%u, crc32_1=%u", main_flag.crc32, main_flag.crc32_1);

+	flags_info("backup_flag crc32=%u, crc32_1=%u", backup_flag.crc32, backup_flag.crc32_1);

+

+	memset(delta_F, 0xFF, IMG_NAME_LEN);

+

+	if ((0 == memcmp(main_flag.img_size[0].name, delta_F, IMG_NAME_LEN)) && (0 == memcmp(backup_flag.img_size[0].name, delta_F, IMG_NAME_LEN)))

 	{

-		if ((FLAGS_MAGIC == main_flag.magic_start) && (FLAGS_MAGIC == main_flag.magic_end))

+		memcpy(&p_flags_info_tmp, &main_flag, sizeof(T_FLAGS_INFO));

+		memset(p_flags_info_tmp.img_size[0].name, 0, sizeof(T_FLAGS_INFO)-512);

+

+		p_flags_info_tmp.crc32_1 = crc32_le(0, (unsigned char const *)(&p_flags_info_tmp), sizeof(T_FLAGS_INFO));

+		flags_info("fix old, set crc32_1=%u", p_flags_info_tmp.crc32_1);

+		

+		if (set_flags_info(&p_flags_info_tmp, &main_index, &backup_index) != 0)

 		{

-			if ((FLAGS_MAGIC == backup_flag.magic_start) && (FLAGS_MAGIC == backup_flag.magic_end))

-			{

-				memcpy(&p_flags_info_tmp, &main_flag, sizeof(T_FLAGS_INFO));

-				p_flags_info_tmp.crc32 = 0;

-				p_flags_info_tmp.crc32 = crc32_le(0, (unsigned char const *)(&p_flags_info_tmp), sizeof(T_FLAGS_INFO));

-				flags_info("old version, set crc32=%u", p_flags_info_tmp.crc32);

-				

-				if (set_flags_info(&p_flags_info_tmp, &main_index, &backup_index) != 0)

-				{

-					flags_err("old version, set flags info fail");

-					return -1;

-				}

-				

-				copy_flags_info(p_flags_info, &main_flag);

-				return 0;

-			}

+			flags_err("fix old, set flags info fail");

+			return -1;

 		}

+		

+		copy_flags_info(p_flags_info, &main_flag);

+		return 0;

 	}

 

-	crc32_main = main_flag.crc32;

-	crc32_backup = backup_flag.crc32;

+	crc32_main = main_flag.crc32_1;

+	crc32_backup = backup_flag.crc32_1;

 

-	main_flag.crc32 = 0;

-	backup_flag.crc32 = 0;

+	main_flag.crc32_1 = 0;

+	backup_flag.crc32_1 = 0;

 		

 	crc32_le_main = crc32_le(0, (unsigned char const *)(&main_flag), sizeof(main_flag));

 	flags_info("crc32_le_main crc32=%u", crc32_le_main);

@@ -495,8 +493,12 @@
     }

 	

 	p_flags_info->crc32 = 0;

-	p_flags_info->crc32 = crc32_le(0, (unsigned char const *)p_flags_info, sizeof(T_FLAGS_INFO));

+	p_flags_info->crc32 = crc32_le(0, (unsigned char const *)p_flags_info, 512);

 	flags_info("set crc32=%u", p_flags_info->crc32);

+	

+	p_flags_info->crc32_1 = 0;

+	p_flags_info->crc32_1 = crc32_le(0, (unsigned char const *)p_flags_info, sizeof(T_FLAGS_INFO));

+	flags_info("set crc32_1=%u", p_flags_info->crc32_1);

 

     if (set_flags_info(p_flags_info, &main_index, &backup_index) != 0)

     {

diff --git a/ap/os/linux/linux-3.4.x/mm/ramdump/ramdump_oss.c b/ap/os/linux/linux-3.4.x/mm/ramdump/ramdump_oss.c
index 8f50688..5f17b0e 100755
--- a/ap/os/linux/linux-3.4.x/mm/ramdump/ramdump_oss.c
+++ b/ap/os/linux/linux-3.4.x/mm/ramdump/ramdump_oss.c
@@ -53,6 +53,7 @@
 *******************************************************************************/
 unsigned char *ramdump_mem_base = NULL;
 unsigned char *ramdump_shared_mem_base = NULL;
+unsigned int  ramdump_export_mode = 0xFF;
 #endif
 
 /*******************************************************************************
@@ -359,8 +360,8 @@
 {
 #ifdef _OS_LINUX 
 #ifdef _USE_VEHICLE_DC
-
-	if(*(unsigned int *)RAMDUMP_EMMC_TRANS_FLAG_ADDR != 1)
+	if((ramdump_export_mode != RAMDUMP_MODE_EMMC) 
+		&&(ramdump_export_mode != RAMDUMP_MODE_SPINAND))
 	{
 #endif
     	zDrvUsbPoll_Init();                 /* ³õʼ»¯USB        */
@@ -549,8 +550,8 @@
 void ramdump_oss_data_trans_read(unsigned char *buffer, unsigned int size)
 {
 #ifdef _USE_VEHICLE_DC
-
-	if(*(unsigned int *)RAMDUMP_EMMC_TRANS_FLAG_ADDR == 1)
+	if ((ramdump_export_mode == RAMDUMP_MODE_EMMC)
+		|| (ramdump_export_mode == RAMDUMP_MODE_SPINAND))
 		ramdump_shm_trans_read(buffer, size);
 	else
 #endif
@@ -569,8 +570,8 @@
 void ramdump_oss_data_trans_write(unsigned char *buffer, unsigned int size)
 {
 #ifdef _USE_VEHICLE_DC
-
-	if(*(unsigned int *)RAMDUMP_EMMC_TRANS_FLAG_ADDR == 1)
+	if ((ramdump_export_mode == RAMDUMP_MODE_EMMC)
+		|| (ramdump_export_mode == RAMDUMP_MODE_SPINAND))
 		ramdump_shm_trans_write(buffer, size);
 	else
 #endif
@@ -581,7 +582,8 @@
 void ramdump_oss_data_trans_write_data(unsigned char *buffer, unsigned int size)
 {
 #ifdef _USE_VEHICLE_DC
-	if(*(unsigned int *)RAMDUMP_EMMC_TRANS_FLAG_ADDR == 1){
+	if ((ramdump_export_mode == RAMDUMP_MODE_EMMC)
+		|| (ramdump_export_mode == RAMDUMP_MODE_SPINAND)){
 			ramdump_shm_trans_write_data(buffer, size);
 	}
 	else
@@ -603,8 +605,9 @@
 #ifdef _OS_LINUX
 #ifdef _USE_VEHICLE_DC
 
-    /* µÈ´ýÊý¾Ý·¢ËÍÍêºó£¬ÔÙÖØÆô */
-	if(*(unsigned int *)RAMDUMP_EMMC_TRANS_FLAG_ADDR == 1)
+	/* µÈ´ýÊý¾Ý·¢ËÍÍêºó£¬ÔÙÖØÆô */
+	if ((ramdump_export_mode == RAMDUMP_MODE_EMMC)
+		|| (ramdump_export_mode == RAMDUMP_MODE_SPINAND))
 		return;
 	else
 #endif
@@ -619,15 +622,15 @@
 
 	unsigned long addr;
 	unsigned long size;
-	
+
 	get_logbuf_info(&addr, &size);
-	
+
 	ramdump_ram_conf_table_add(
 		"ap_log_buf", 
 		(unsigned long)OSS_VIRT_TO_PHY(addr), 
 		size, 
 		addr,
-		RAMDUMP_FLAG_NONE,
+		RAMDUMP_FLAG_LEVEL_HIGH,
 		0);
 #endif
 #endif
diff --git a/ap/os/linux/linux-3.4.x/mm/ramdump/ramdump_trans_server.c b/ap/os/linux/linux-3.4.x/mm/ramdump/ramdump_trans_server.c
index a186867..59f6656 100755
--- a/ap/os/linux/linux-3.4.x/mm/ramdump/ramdump_trans_server.c
+++ b/ap/os/linux/linux-3.4.x/mm/ramdump/ramdump_trans_server.c
@@ -32,14 +32,14 @@
 *******************************************************************************/
 #define RAMDUMP_ON_DEFAULT_VAL  (1)
 
-#define RAMDUMP_MMAP_SUCCESS (RAMDUMP_SUCCESS)
-#define RAMDUMP_MMAP_FAILED  (RAMDUMP_FAILED)
+#define RAMDUMP_MMAP_SUCCESS    (RAMDUMP_SUCCESS)
+#define RAMDUMP_MMAP_FAILED     (RAMDUMP_FAILED)
 
-#define RP_MSG_PS_PHY_RAMDUMP_CHANNEL       channel_40     //arm¡¢zspÖ®¼äµÄramdumpͨµÀ
-#define RP_MSG_PS_PHY_RAMDUMP_SIZE          0x40     //arm¡¢zspÖ®¼äµÄramdumpͨµÀ
+#define RP_MSG_PS_PHY_RAMDUMP_CHANNEL  channel_40 //arm¡¢zspÖ®¼äµÄramdumpͨµÀ
+#define RP_MSG_PS_PHY_RAMDUMP_SIZE     0x40       //arm¡¢zspÖ®¼äµÄramdumpͨµÀ
 
 #ifdef _USE_CAP_SYS
-#define RAMDUMP_ICP_MSG_CAP_SIZE          	0x40 
+#define RAMDUMP_ICP_MSG_CAP_SIZE       0x40 
 #endif
 
 /* ramdump ºÍ PCÇý¶¯´úÀí½»»¥ÃüÁîÔ¼¶¨ */
@@ -83,7 +83,6 @@
 /*******************************************************************************
 *                                Êý¾ÝÀàÐͶ¨Òå                                  *
 *******************************************************************************/
-
 /*
  * struct TRANS WITH PC
  */
@@ -187,13 +186,15 @@
 {
 	"cap_ddr.bin",
 	"cap.cmm",
+#if 0 
 	"cap_err_log.txt"
+#endif
 };
 
 unsigned int ramdump_shm_file_num = 0;
 unsigned int ramdump_exprot_file_num = 0;
 unsigned int ramdump_export_file_index[RAMDUMP_RAMCONF_TABLE_MAX_ENTRYS] = {0};
-unsigned int *cap_ddr_size = (unsigned int *)IRAM_BASE_ADDR_BOOT_DDR;;
+unsigned int *cap_ddr_size = (unsigned int *)IRAM_BASE_ADDR_BOOT_DDR;
 
 /*******************************************************************************
 *                                ¾Ö²¿º¯ÊýʵÏÖ                                  *
@@ -632,34 +633,34 @@
     if (ret != RAMDUMP_SUCCESS) 
         return ret;
 #endif
-	ret = ramdump_oss_icp_create_channel(
-			ramdump_cpu_id[RAMDUMP_CPU_2], 
-			RP_MSG_PS_PHY_RAMDUMP_CHANNEL, 
-			RP_MSG_PS_PHY_RAMDUMP_SIZE);
-	if (ret != RAMDUMP_SUCCESS) 
-		return ret;
+    ret = ramdump_oss_icp_create_channel(
+            ramdump_cpu_id[RAMDUMP_CPU_2], 
+            RP_MSG_PS_PHY_RAMDUMP_CHANNEL, 
+            RP_MSG_PS_PHY_RAMDUMP_SIZE);
+    if (ret != RAMDUMP_SUCCESS) 
+        return ret;
 
-	ret = ramdump_oss_icp_regcallback(
-			ramdump_cpu_id[RAMDUMP_CPU_2],
-			RP_MSG_PS_PHY_RAMDUMP_CHANNEL, 
-			ramdump_icp_msg_from_zsp);
-	if (ret != RAMDUMP_SUCCESS) 
-		return ret;
+    ret = ramdump_oss_icp_regcallback(
+            ramdump_cpu_id[RAMDUMP_CPU_2],
+            RP_MSG_PS_PHY_RAMDUMP_CHANNEL, 
+            ramdump_icp_msg_from_zsp);
+    if (ret != RAMDUMP_SUCCESS) 
+        return ret;
 
-	ret = ramdump_oss_icp_create_channel(
-			M0_ID, 
-			channel_3, 
-			0x14);
-	if (ret != RAMDUMP_SUCCESS) 
-		return ret;
+    ret = ramdump_oss_icp_create_channel(
+            M0_ID, 
+            channel_3, 
+            0x14);
+    if (ret != RAMDUMP_SUCCESS) 
+        return ret;
 
-	ret = ramdump_oss_icp_regcallback(
-			M0_ID,
-			channel_3, 
-			ramdump_icp_msg_from_m0);
+    ret = ramdump_oss_icp_regcallback(
+            M0_ID,
+            channel_3, 
+            ramdump_icp_msg_from_m0);
 
-	if (ret != RAMDUMP_SUCCESS) 
-		return ret;
+    if (ret != RAMDUMP_SUCCESS) 
+        return ret;
 
 #endif
 
@@ -698,6 +699,26 @@
 }
 
 /*******************************************************************************
+* ¹¦ÄÜÃèÊö:     ramdump_file_skip
+* ²ÎÊý˵Ã÷:     
+*   (´«Èë²ÎÊý)  index 
+*   (´«³ö²ÎÊý)  void
+* ·µ »Ø Öµ:     ÊÇ·ñÌø¹ý
+* ÆäËü˵Ã÷:     This function is used for judge file is skip or not
+*******************************************************************************/
+bool ramdump_file_skip(unsigned int index)
+{
+    unsigned int cnt = 0;
+    ramdump_shm_file_num = sizeof(ramdump_shm_export_file)/sizeof(ramdump_shm_export_file[0]);
+
+    for (; cnt < ramdump_shm_file_num; cnt++) {
+        if(strcmp(ramdump_trans_server_ram_conf[index].name, ramdump_shm_export_file[cnt]) == 0)
+            return true;
+    }
+    return false;
+}
+
+/*******************************************************************************
 * ¹¦ÄÜÃèÊö:    ramdump_server_store_ram_conf
 * ²ÎÊý˵Ã÷:     
 *   (´«Èë²ÎÊý) mem: addr
@@ -707,24 +728,34 @@
 *******************************************************************************/
 static unsigned char *ramdump_server_store_ram_conf(unsigned char *mem)
 {
-    unsigned long i_ram_conf = 0;
+    unsigned long        i_ram_conf    = 0;
+    ramdump_ram_config_t *config_entry = NULL;
+
     while (ramdump_trans_server_ram_conf[i_ram_conf].vir != 0 && 
-           ramdump_trans_server_ram_conf[i_ram_conf].size != 0)
-    {
-        ramdump_ram_config_t *config_entry = &(ramdump_trans_server_ram_conf[i_ram_conf]);
+           ramdump_trans_server_ram_conf[i_ram_conf].size != 0) {
+#ifdef _USE_VEHICLE_DC 
+        if ((ramdump_export_mode == RAMDUMP_MODE_EMMC)
+            || (ramdump_export_mode == RAMDUMP_MODE_SPINAND)){
+            if (ramdump_file_skip(i_ram_conf) == true) {
+                i_ram_conf++;
+                continue;
+            }
+        }
+#endif
+        config_entry = &(ramdump_trans_server_ram_conf[i_ram_conf]);
         /* session can be access */
         if (config_entry->callback == NULL ||
-            (config_entry->callback != NULL &&
-            (*(config_entry->callback))() == RAMDUMP_TRUE))
+        (config_entry->callback != NULL &&
+        (*(config_entry->callback))() == RAMDUMP_TRUE))
             mem += sprintf(
-                    mem, 
-                    "data.load.binary &ramdump_dir\\%s 0x%x--0x%x /noclear\n",
-                    (config_entry->name),
+                mem, 
+                "data.load.binary &ramdump_dir\\%s 0x%x--0x%x /noclear\n",
+                (config_entry->name),
                     (unsigned int)config_entry->phy, 
-                    (unsigned int)(config_entry->phy + config_entry->size));
+                (unsigned int)(config_entry->phy + config_entry->size));
+        
         i_ram_conf++;
     }
-
     return mem;
 }
 
@@ -769,7 +800,7 @@
             (unsigned long)OSS_VIRT_TO_PHY(ramdump_server_cmm_buf), 
             cmm_buf_len, 
             (unsigned long)ramdump_server_cmm_buf,
-            RAMDUMP_FLAG_NONE,
+            RAMDUMP_FLAG_LEVEL_HIGH,
             0);
     else
         ramdump_ram_conf_table_add(
@@ -777,7 +808,7 @@
             (unsigned long)OSS_VIRT_TO_PHY(ramdump_server_cmm_buf), 
             RAMDUMP_CMM_SIZE, 
             (unsigned long)ramdump_server_cmm_buf,
-            RAMDUMP_FLAG_NONE,
+            RAMDUMP_FLAG_LEVEL_HIGH,
             0);
 }
 
@@ -793,16 +824,16 @@
 {
     int offset = 0;
     char err_log_name[RAMDUMP_RAMCONF_FILENAME_MAXLEN] = {0};
-	
+    
     if (ramdump_trans_server_force_panic_flag == RAMDUMP_CLIENT_ZSP)
         offset = sprintf(ramdump_server_error_log, "trans server received force dump request from ZSP client !\n");
-	else if (ramdump_trans_server_force_panic_flag == RAMDUMP_CLIENT_M0)
-		offset = sprintf(ramdump_server_error_log, "trans server received force dump request from M0 client !\n");
+    else if (ramdump_trans_server_force_panic_flag == RAMDUMP_CLIENT_M0)
+        offset = sprintf(ramdump_server_error_log, "trans server received force dump request from M0 client !\n");
     else if (ramdump_trans_server_force_panic_flag == RAMDUMP_CLIENT_CAP)
-		offset = sprintf(ramdump_server_error_log, "trans server received force dump request from CAP client !\n");
-	else
+        offset = sprintf(ramdump_server_error_log, "trans server received force dump request from CAP client !\n");
+    else
         offset = sprintf(ramdump_server_error_log, "AP server breakdown happens !\n");
-	
+    
     ramdump_oss_error_log_creat(ramdump_server_error_log + offset);
     // generate err_log name
     sprintf(
@@ -816,42 +847,46 @@
         ((strlen(ramdump_server_error_log) >= RAMDUMP_ERROR_LOG_SIZE) ? 
         RAMDUMP_ERROR_LOG_SIZE : strlen(ramdump_server_error_log)),
         (unsigned long)ramdump_server_error_log,
-        RAMDUMP_FLAG_NONE,
+        RAMDUMP_FLAG_LEVEL_HIGH,
         0);
 }
 
-unsigned int ramdump_calc_total_regions(void)
+unsigned int ramdump_calc_total_regions(unsigned int prio_exp)
 {
-	unsigned int index;
-	unsigned int cnt;
-	int skip = 0;
-
-	ramdump_shm_file_num = sizeof(ramdump_shm_export_file)/sizeof(ramdump_shm_export_file[0]);
-
-	for (index = 0; index < ramdump_file_num; index++){
+    unsigned int  index;
+    unsigned int  cnt;
+    unsigned long flag;
+    bool  skip         = false;
+     bool  export_order = false;
+      
+    for (index = 0; index < ramdump_file_num; index++){
 #ifdef _USE_VEHICLE_DC
-		if(*(unsigned int *)RAMDUMP_EMMC_TRANS_FLAG_ADDR == 1){
-			for (cnt = 0; cnt < ramdump_shm_file_num; cnt++){
-				if(strcmp(ramdump_trans_server_ram_conf[index].name, ramdump_shm_export_file[cnt]) == 0){
-					skip = 1;
-					break;
-				}
-			}
-			if (skip == 0){
-				ramdump_export_file_index[ramdump_exprot_file_num] = index;
-				ramdump_exprot_file_num++;
-			}
-			else
-				skip = 0;
-		}else{
+        if ((ramdump_export_mode == RAMDUMP_MODE_EMMC)
+            || (ramdump_export_mode == RAMDUMP_MODE_SPINAND)) {
+
+            skip = ramdump_file_skip(index);
+            flag = ramdump_trans_server_ram_conf[index].flag;
+
+            if (prio_exp == RAMDUMP_FLAG_NONE)
+                export_order = ((flag & RAMDUMP_CLEAR_PRIO_FLAG) == flag);
+            else
+                export_order =  ((flag & prio_exp) == prio_exp);
+
+            if (skip == false && (export_order == true)) {
+                ramdump_export_file_index[ramdump_exprot_file_num] = index;
+                ramdump_exprot_file_num++;
+            }
+            else
+                skip = false;
+        }else{
 #endif
-			ramdump_export_file_index[ramdump_exprot_file_num] = index;
-			ramdump_exprot_file_num++;
+            ramdump_export_file_index[ramdump_exprot_file_num] = index;
+            ramdump_exprot_file_num++;
 #ifdef _USE_VEHICLE_DC
-		}
+        }
 #endif
-	}
-	return ramdump_exprot_file_num;
+    }
+    return ramdump_exprot_file_num;
 }
 
 static inline void ramdump_wait_delay(unsigned long ms)
@@ -860,6 +895,26 @@
     for (j = 0; j < 50000 * ms; j++);
 }
 
+void ramdump_sortprio_getnum(void)
+{
+#ifdef _USE_VEHICLE_DC
+    if((ramdump_export_mode != RAMDUMP_MODE_EMMC) 
+        &&(ramdump_export_mode != RAMDUMP_MODE_SPINAND))
+    {
+#endif
+        ramdump_calc_total_regions(RAMDUMP_FLAG_NONE);
+#ifdef _USE_VEHICLE_DC
+    }
+    else
+    {
+        ramdump_calc_total_regions(RAMDUMP_FLAG_LEVEL_HIGH);
+        ramdump_calc_total_regions(RAMDUMP_FLAG_LEVEL_MEDIUM);
+        ramdump_calc_total_regions(RAMDUMP_FLAG_LEVEL_LOW);
+        ramdump_calc_total_regions(RAMDUMP_FLAG_NONE);
+    }
+#endif
+}
+
 /*******************************************************************************
 * ¹¦ÄÜÃèÊö:    ramdump_data_transfer_to_pc
 * ²ÎÊý˵Ã÷:     
@@ -870,14 +925,12 @@
 *******************************************************************************/
 static void ramdump_data_transfer_to_pc(void)
 {
-	int file_id = 0;
-	unsigned int ramdump_file_nr = 0;
+    int file_id = 0;
     char req_buf[RAMDUMP_INTERACTIVE_DATA_LEN] = {0};
 
     /* interactive begin */
     ramdump_oss_data_trans_init();
-
-	ramdump_file_nr = ramdump_calc_total_regions();
+    ramdump_sortprio_getnum();
 
     for(;;)
     {
@@ -888,7 +941,7 @@
             {
                 ramdump_trans_server_interactive_rsp server_to_pc_msg = {0};
                 server_to_pc_msg.cmd = RAMDUMP_TRANS_SERVER_INTERACTIVE_RSP;
-                server_to_pc_msg.file_num = ramdump_file_nr;
+                server_to_pc_msg.file_num = ramdump_exprot_file_num;
 
                 ramdump_oss_data_trans_write(
                     (unsigned char*)(&server_to_pc_msg),
@@ -1024,22 +1077,22 @@
         unsigned long ram_extra)
 {
     static unsigned int i_entry  = 0;
-	
+    
     if ((ram_phy == 0) && (ram_size == 0))
         return;
 
     mutex_lock(&ramdump_mutex);
-	
+    
     strncpy(ramdump_trans_server_ram_conf[i_entry].name, 
             ram_name, 
             RAMDUMP_RAMCONF_FILENAME_MAXLEN - 1);
-	ramdump_trans_server_ram_conf[i_entry].name[RAMDUMP_RAMCONF_FILENAME_MAXLEN - 1] = '\0';
+    ramdump_trans_server_ram_conf[i_entry].name[RAMDUMP_RAMCONF_FILENAME_MAXLEN - 1] = '\0';
     ramdump_trans_server_ram_conf[i_entry].phy   = ram_phy;
     ramdump_trans_server_ram_conf[i_entry].size  = ram_size;
     ramdump_trans_server_ram_conf[i_entry].vir   = ram_virt;
     ramdump_trans_server_ram_conf[i_entry].flag  = ram_flag;
 
-    switch (ram_flag)
+    switch (ram_flag & RAMDUMP_CLEAR_PRIO_FLAG)
     {
         case RAMDUMP_FLAG_NEED_COPY:
             ramdump_trans_server_ram_conf[i_entry].exter  = ram_extra;
@@ -1058,12 +1111,12 @@
     if (ram_phy != 0 && ram_size != 0)
         ramdump_trans_server_ram_conf[i_entry].vir = ramdump_phy_to_vir(&ramdump_trans_server_ram_conf[i_entry]);
     
-	i_entry++;
-	
+    i_entry++;
+    
     if (i_entry >= RAMDUMP_RAMCONF_TABLE_MAX_ENTRYS)      
-		i_entry = 0;
+        i_entry = 0;
 
-	ramdump_file_num ++;
+    ramdump_file_num ++;
     mutex_unlock(&ramdump_mutex); 
 }
 EXPORT_SYMBOL(ramdump_ram_conf_table_add);
@@ -1087,18 +1140,18 @@
         return RAMDUMP_SUCCESS;
 
     int ret = 0;
-	int i = 0;
+    int i = 0;
     char bin_name[RAMDUMP_RAMCONF_FILENAME_MAXLEN] = {0};
-	
-	for(i = 0;i < meminfo.nr_banks;i++) {
-		if(meminfo.bank[i].start == RAMDUMP_SERVER_DDR_BASE)
-			ddr_ap_size = meminfo.bank[i].size;
-	}
-	BUG_ON(ddr_ap_size == 0);
+    
+    for(i = 0;i < meminfo.nr_banks;i++) {
+        if(meminfo.bank[i].start == RAMDUMP_SERVER_DDR_BASE)
+            ddr_ap_size = meminfo.bank[i].size;
+    }
+    BUG_ON(ddr_ap_size == 0);
 
     /* change the interactive cpu value */
-	ramdump_cpu_id[RAMDUMP_CPU_2] = ICP_MSG_ACTOR_ZSP;
-	
+    ramdump_cpu_id[RAMDUMP_CPU_2] = ICP_MSG_ACTOR_ZSP;
+    
     /* client icp init */
     ret = ramdump_icp_init();
     if (ret != RAMDUMP_ICP_SUCCESS)
@@ -1114,7 +1167,7 @@
         RAMDUMP_SERVER_DDR_BASE, 
         ddr_ap_size, 
         (unsigned long)OSS_PHY_TO_VIRT(RAMDUMP_SERVER_DDR_BASE),
-        RAMDUMP_FLAG_NONE,
+        RAMDUMP_FLAG_LEVEL_MEDIUM,
         0);
 
     ramdump_ram_conf_table_add(
@@ -1122,81 +1175,81 @@
         RAMDUMP_SERVER_DDR_BASE, 
         0x1000, 
         (unsigned long)OSS_PHY_TO_VIRT(RAMDUMP_SERVER_DDR_BASE),
-        RAMDUMP_FLAG_HAS_CALLBACK,
+        RAMDUMP_FLAG_HAS_CALLBACK|RAMDUMP_FLAG_LEVEL_LOW,
         test_fun);
-	
-#ifdef CONFIG_MEM_TRACKER	
-	ramdump_ram_conf_table_add(
-		"mem_tracker.bin", 
-		ZX29_MEM_TRACKER_PHYS, 
-		ZX_MEM_TRACKER_SIZE,
-		ZX_MEM_TRACKER_BASE,
-		RAMDUMP_FLAG_NONE,
-		0);
-	ramdump_ram_conf_table_add(
-		"kmalloc_tracker.bin", 
-		ZX29_KMALLOC_TRACKER_PHYS,
-		ZX_KMALLOC_TRACKER_SIZE,
-		ZX_KMALLOC_TRACKER_BASE,
-		RAMDUMP_FLAG_NONE,
-		0);
+    
+#ifdef CONFIG_MEM_TRACKER    
+    ramdump_ram_conf_table_add(
+        "mem_tracker.bin", 
+        ZX29_MEM_TRACKER_PHYS, 
+        ZX_MEM_TRACKER_SIZE,
+        ZX_MEM_TRACKER_BASE,
+        RAMDUMP_FLAG_LEVEL_LOW,
+        0);
+    ramdump_ram_conf_table_add(
+        "kmalloc_tracker.bin", 
+        ZX29_KMALLOC_TRACKER_PHYS,
+        ZX_KMALLOC_TRACKER_SIZE,
+        ZX_KMALLOC_TRACKER_BASE,
+        RAMDUMP_FLAG_LEVEL_LOW,
+        0);
 #endif
 #ifdef _USE_CAP_SYS
-	/* cap ramdump cmm */
-	ramdump_ram_conf_table_add(
-			"cap_ddr.bin", 
-			DDR_BASE_CAP_ADDR_PA, 
-			*cap_ddr_size,
-			0,
-			RAMDUMP_FLAG_NONE,
-			0);
+    /* cap ramdump cmm */
+    ramdump_ram_conf_table_add(
+            "cap_ddr.bin", 
+            DDR_BASE_CAP_ADDR_PA, 
+            *cap_ddr_size,
+            0,
+            RAMDUMP_FLAG_LEVEL_LOW,
+            0);
 
-	ramdump_ram_conf_table_add(
+    ramdump_ram_conf_table_add(
         "cap.cmm", 
         RAMDUMP_CAP_CMM_BUF_ADDR_PHY,
         RAMDUMP_CAP_CMM_BUF_LEN_REAL,
         0,
-        RAMDUMP_FLAG_NONE,
+        RAMDUMP_FLAG_LEVEL_LOW,
         0);
-	ramdump_ram_conf_table_add(
+    ramdump_ram_conf_table_add(
         "cap_err_log.txt", 
         RAMDUMP_CAP_LOG_BUF_ADDR,
         RAMDUMP_CAP_LOG_BUF_LEN,
         0,
-        RAMDUMP_FLAG_NONE,
+        RAMDUMP_FLAG_LEVEL_LOW,
         0);
-	ramdump_ram_conf_table_add(
+    ramdump_ram_conf_table_add(
         "rpmsg_cap.bin", 
         ICP_CAP_BUF_ADDR_PA,
         ICP_CAP_BUF_LEN,
         0,
-        RAMDUMP_FLAG_NONE,
+        RAMDUMP_FLAG_LEVEL_LOW,
         0);
-	ramdump_ram_conf_table_add(
+    ramdump_ram_conf_table_add(
         "phy_log_buffer.bin", 
         TOOL_ZSP_TO_CAP_LOG_ADDR_PA,
         TOOL_ZSP_TO_CAP_LOG_LEN,
         0,
-        RAMDUMP_FLAG_NONE,
+        RAMDUMP_FLAG_LEVEL_LOW,
         0);
-	ramdump_ram_conf_table_add(
+    ramdump_ram_conf_table_add(
         "TEE.bin", 
         TEE_SHARE_BUF_ADDR_PA,
         TEE_SHARE_BUF_LEN,
         0,
-        RAMDUMP_FLAG_NONE,
+        RAMDUMP_FLAG_LEVEL_LOW,
         0);
-	ramdump_ram_conf_table_add(
+    ramdump_ram_conf_table_add(
         "cap_kapp_log.bin", 
         TOOL_CAP_BUF_ADDR_PA,
         TOOL_CAP_BUF_LEN,
         0,
-        RAMDUMP_FLAG_NONE,
+        RAMDUMP_FLAG_LEVEL_LOW,
         0);
 #endif
 
 #ifdef _USE_VEHICLE_DC
-	ramdump_shared_mem_init();
+    ramdump_shared_mem_init();
 #endif
 
     /* set trans ram data done flag */
@@ -1234,6 +1287,21 @@
 }
 
 /*******************************************************************************
+* ¹¦ÄÜÃèÊö:     ramdump_get_trans_mode
+* ²ÎÊý˵Ã÷:     
+*   (´«Èë²ÎÊý)  void
+*   (´«³ö²ÎÊý)  void
+* ·µ »Ø Öµ:     void
+* ÆäËü˵Ã÷:     This function is used for read ramdump mode
+*******************************************************************************/
+void ramdump_get_trans_mode(void)
+{
+#ifdef _USE_VEHICLE_DC 
+    ramdump_export_mode = *(unsigned int *)RAMDUMP_EMMC_TRANS_FLAG_ADDR; 
+#endif
+}
+
+/*******************************************************************************
 * ¹¦ÄÜÃèÊö:     ramdump_entry
 * ²ÎÊý˵Ã÷:     
 *   (´«Èë²ÎÊý)  void
@@ -1252,14 +1320,14 @@
             CPPS_FUNC(cpps_callbacks, zSys_ExceptReboot)(0);
     }
 #else
-	emergency_restart();
+    emergency_restart();
 #endif
 
 #ifdef CONFIG_ZX29_WATCHDOG
-	zx_wdt_m0_stop();
+    zx_wdt_m0_stop();
 #endif
 
-	if (sysctl_ramdump_on_panic == FALSE)
+    if (sysctl_ramdump_on_panic == FALSE)
         return;
 
     /*
@@ -1275,6 +1343,8 @@
     if (++ramdump_count > 1)
         while(TRUE); /* endless circle */
 
+    ramdump_get_trans_mode();
+
     /*
      * save all regs first.
      */
@@ -1286,8 +1356,8 @@
     /* error log file */
     ramdump_trans_server_error_log_create();
 
-	/* log buf */
-	ramdump_oss_logbuf_create();
+    /* log buf */
+    ramdump_oss_logbuf_create();
 
     /* notify client ramdump */
     ramdump_notify_client_dump();
diff --git a/ap/os/linux/linux-3.4.x/net/socket_rpmsg.c b/ap/os/linux/linux-3.4.x/net/socket_rpmsg.c
index 8b225b6..e7b2076 100755
--- a/ap/os/linux/linux-3.4.x/net/socket_rpmsg.c
+++ b/ap/os/linux/linux-3.4.x/net/socket_rpmsg.c
@@ -241,8 +241,8 @@
 	spin_lock(&sock_table_lock);

 	if(hlist_empty(&g_ipc_sockets))

 	{

-		sk_soc_warn("sock_print_ipc_socket_info  g_ipc_sockets is empty");

 		spin_unlock(&sock_table_lock);

+		sk_soc_warn("sock_print_ipc_socket_info  g_ipc_sockets is empty");

 		return 0;

 	}

 	hlist_for_each_entry_safe(p, pos, n, &g_ipc_sockets, hlist_node) {

@@ -328,8 +328,8 @@
 	spin_lock(&sock_table_lock);

 	if(hlist_empty(&g_ipc_sockets))

 	{

-		sk_soc_info("sock_soc_get_ipcsocket_by_proxysock  g_ipc_sockets is empty");

 		spin_unlock(&sock_table_lock);

+		sk_soc_info("sock_soc_get_ipcsocket_by_proxysock  g_ipc_sockets is empty");

 		return NULL;

 	}

 	hlist_for_each_entry_safe(p, pos, n, &g_ipc_sockets, hlist_node) {

@@ -350,8 +350,8 @@
 	spin_lock(&sock_table_lock);

 	if(hlist_empty(&g_ipc_sockets))

 	{

-		sk_soc_info("sock_soc_get_ipcsocket_by_proxysock  g_ipc_sockets is empty");

 		spin_unlock(&sock_table_lock);

+		sk_soc_info("sock_soc_get_ipcsocket_by_proxysock  g_ipc_sockets is empty");

 		return NULL;

 	}

 	hlist_for_each_entry_safe(p, pos, n, &g_ipc_sockets, hlist_node) {

@@ -372,8 +372,8 @@
 	spin_lock(&sock_table_lock);

 	if(hlist_empty(&g_ipc_sockets))

 	{

-		sk_soc_info("sock_get_ipcsocket_by_local_and_remote  g_ipc_sockets is empty");

 		spin_unlock(&sock_table_lock);

+		sk_soc_info("sock_get_ipcsocket_by_local_and_remote  g_ipc_sockets is empty");

 		return NULL;

 	}

 	hlist_for_each_entry_safe(p, pos, n, &g_ipc_sockets, hlist_node) {

@@ -393,8 +393,8 @@
 	spin_lock(&sock_table_lock);

 	if(hlist_empty(&g_ipc_sockets))

 	{

-		sk_soc_info("sock_del_ipc_socket_by_proxysocket  g_ipc_sockets is empty");

 		spin_unlock(&sock_table_lock);

+		sk_soc_info("sock_del_ipc_socket_by_proxysocket  g_ipc_sockets is empty");

 		return -1;

 	}

 	hlist_for_each_entry_safe(p, pos, n, &g_ipc_sockets, hlist_node) {

@@ -417,8 +417,8 @@
 	spin_lock(&sock_table_lock);

 	if(hlist_empty(&g_ipc_sockets))

 	{

-		sk_soc_info("sock_is_valide_ipc_socket  g_ipc_sockets is empty");

 		spin_unlock(&sock_table_lock);

+		sk_soc_info("sock_is_valide_ipc_socket  g_ipc_sockets is empty");

 		return -1;

 	}

 	hlist_for_each_entry_safe(p, pos, n, &g_ipc_sockets, hlist_node) {

@@ -541,8 +541,8 @@
 	spin_lock(&sock_table_lock);

 	if(hlist_empty(&g_ipc_sockets))

 	{

-		sk_soc_info("sock_soc_socket_is_valid  g_ipc_sockets is empty");

 		spin_unlock(&sock_table_lock);

+		sk_soc_info("sock_soc_socket_is_valid  g_ipc_sockets is empty");

 		return -1;

 	}

 	hlist_for_each_entry_safe(p, pos, n, &g_ipc_sockets, hlist_node) {

@@ -563,8 +563,8 @@
 	spin_lock(&sock_table_lock);

 	if(hlist_empty(&g_ipc_sockets))

 	{

-		sk_soc_info("sock_soc_del_socket_info  g_ipc_sockets is empty");

 		spin_unlock(&sock_table_lock);

+		sk_soc_info("sock_soc_del_socket_info  g_ipc_sockets is empty");

 		return -1;

 	}

 	hlist_for_each_entry_safe(p, pos, n, &g_ipc_sockets, hlist_node) {

@@ -593,8 +593,8 @@
 	spin_lock(&sock_table_lock);

 	if(hlist_empty(&g_ipc_sockets))

 	{

-		sk_soc_info("sock_soc_socket_is_valid_ipc  g_ipc_sockets is empty");

 		spin_unlock(&sock_table_lock);

+		sk_soc_info("sock_soc_socket_is_valid_ipc  g_ipc_sockets is empty");

 		return -1;

 	}

 	hlist_for_each_entry_safe(p, pos, n, &g_ipc_sockets, hlist_node) {

@@ -677,13 +677,13 @@
 		if((p->sockaddr.sun_family == psockaddr_un->sun_family) && (0 == ret)){

 			hlist_del(&p->hlist_node);			

 			kfree(p);

-			sk_soc_info("sun_path=%s, del sucess.", psockaddr_un->sun_path);

 			spin_unlock(&sock_socketaddr_table_lock);

+			sk_soc_info("sun_path=%s, del sucess.", psockaddr_un->sun_path);

 			return 0;

 		}

 	}

-	sk_soc_info("sun_path=%s, del failed", psockaddr_un->sun_path);

 	spin_unlock(&sock_socketaddr_table_lock);

+	sk_soc_info("sun_path=%s, del failed", psockaddr_un->sun_path);

 	return -1;

 }

 

@@ -2309,8 +2309,8 @@
 	spin_lock(&sock_release_lock);

 	//ÅжÏsocketÐÅÏ¢ÊÇ·ñ»¹ÔÚ´úÀíÁ´±íÖÐ

 	if(0 != sock_is_valide_ipc_socket(psock_rpmsg->serversock, psock_rpmsg->serverproxysock, psock_rpmsg->clientsock)){

-		sk_soc_info("sock_soc_release_peer_proc failed, sock_is_valide_ipc_socket=false \n");

 		spin_unlock(&sock_release_lock);

+		sk_soc_info("sock_soc_release_peer_proc failed, sock_is_valide_ipc_socket=false \n");

 		return -1;

 	}