add rmvb support
author杜坤明 <dkm@rock-chips.com>
Fri, 11 Jun 2010 05:23:01 +0000 (05:23 +0000)
committer黄涛 <huangtao@rock-chips.com>
Mon, 21 Jun 2010 05:35:26 +0000 (13:35 +0800)
drivers/staging/rk2818/rk2818_dsp/rk2818_dsp.c
drivers/staging/rk2818/rk2818_dsp/rk2818_dsp.h

index ac15d5ccac7bd4be2393c7f820065819951c9320..ea719e2cbc61f04d8a9c25b83ed6c3619e116ef6 100644 (file)
@@ -96,6 +96,9 @@ struct rk28dsp_inf {
 /* CEVA memory map base address for ARM */
 #define DSP_L2_IMEM_BASE   (RK2818_DSP_PHYS + 0x200000)
 #define DSP_L2_DMEM_BASE   (RK2818_DSP_PHYS + 0x400000)
+#define APB_SCU_BASE                           0x18018000
+#define APB_REG_FILE_BASE   0x18019000
+
 #define PIU_BASE_ADDR      (RK2818_DSP_PHYS + 0x132000)
 #define PMU_BASE_ADDR      (RK2818_DSP_PHYS + 0x130000)
 
@@ -143,6 +146,38 @@ static DECLARE_MUTEX(sem);
 
 static int rcv_quit = 0;
 
+
+//add by Charles Chen for test 281x play RMVB
+static void setRegValueForVideo(unsigned long type)
+{
+       /*
+               0x18018020 »òÉÏ 0x08000000
+               0x18018028  ÏÈ»òÉÏ 0x00000110
+               µÈ´ýһЩʱ¼äÔÙÓëÉÏ     ¡«0x00000110
+               0x18019018 »òÉÏ 0x00200000
+       */
+
+       __raw_writel((__raw_readl(RK2818_SCU_BASE+0x20) | (0x08000000)) , RK2818_SCU_BASE+0x20);        
+       printk("------->0x18018020 value 0x%08x\n",__raw_readl(RK2818_SCU_BASE+0x20));
+               if(!type)
+               {
+       __raw_writel((__raw_readl(RK2818_SCU_BASE+0x28) | (0x00000100)) , RK2818_SCU_BASE+0x28);
+    
+           mdelay(5);
+    
+       __raw_writel((__raw_readl(RK2818_SCU_BASE+0x28) & (~0x00000100)) , RK2818_SCU_BASE+0x28);
+       __raw_writel((__raw_readl(RK2818_REGFILE_BASE+0x14) | (0x20002000)) , RK2818_REGFILE_BASE+0x14);
+    
+       __raw_writel((__raw_readl(RK2818_SCU_BASE+0x1c) & (~0x400)) , RK2818_SCU_BASE+0x1c);
+      printk("this is rm 9 video\n");
+               }
+               else
+               {
+                       printk("this is h264 video\n");
+               }
+    return;
+}
+
 static int CheckDSPLIBHead(char *buff)
 {
     if ((buff[0] != 'r')
@@ -507,7 +542,7 @@ static long dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        if(!g_inf)   return -EAGAIN;
     inf = g_inf;
 
-       if(DSP_IOCTL_RES_REQUEST!=cmd && DSP_IOCTL_GET_TABLE_PHY!=cmd) {
+       if(DSP_IOCTL_RES_REQUEST!=cmd && DSP_IOCTL_GET_TABLE_PHY!=cmd&&cmd !=DSP_IOCTL_SET_CODEC) {
                if(inf->cur_pid!=current->tgid) {
                    dspprintk("res is obtain by pid %d, refuse this req(pid=%d cmd=0x%08x) \n",
                        inf->cur_pid, current->tgid, cmd);
@@ -655,7 +690,12 @@ static long dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
             if(copy_to_user((void __user *)arg, (void*)&table_phy, 4))  ret = -EFAULT;
         }
         break;
-
+   case DSP_IOCTL_SET_CODEC:
+       {
+               dspprintk("------>firmware name ------------------------>");
+                               setRegValueForVideo(arg);
+       }
+       break;
        default:
                break;
        }
index 4f54ccf5451a1dd459d9b5afd7c3fea545993613..9dea6de5cfadda19f611ae475b5c7118bf2817e7 100644 (file)
@@ -36,7 +36,7 @@
 #define DSP_IOCTL_RECV_MSG              (0x00800003)
 #define DSP_IOCTL_SET_FREQ              (0x00800004)
 #define DSP_IOCTL_GET_TABLE_PHY         (0x00800005)
-
+#define DSP_IOCTL_SET_CODEC                            (0x00800006)
 
 struct rk28dsp_req {
        int reqno;