From 7de5480e5c5673db30ab629b59ba00ab8b02dd11 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E6=9D=9C=E5=9D=A4=E6=98=8E?= Date: Fri, 11 Jun 2010 05:23:01 +0000 Subject: [PATCH] add rmvb support --- .../staging/rk2818/rk2818_dsp/rk2818_dsp.c | 44 ++++++++++++++++++- .../staging/rk2818/rk2818_dsp/rk2818_dsp.h | 2 +- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rk2818/rk2818_dsp/rk2818_dsp.c b/drivers/staging/rk2818/rk2818_dsp/rk2818_dsp.c index ac15d5ccac7b..ea719e2cbc61 100644 --- a/drivers/staging/rk2818/rk2818_dsp/rk2818_dsp.c +++ b/drivers/staging/rk2818/rk2818_dsp/rk2818_dsp.c @@ -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; } diff --git a/drivers/staging/rk2818/rk2818_dsp/rk2818_dsp.h b/drivers/staging/rk2818/rk2818_dsp/rk2818_dsp.h index 4f54ccf5451a..9dea6de5cfad 100644 --- a/drivers/staging/rk2818/rk2818_dsp/rk2818_dsp.h +++ b/drivers/staging/rk2818/rk2818_dsp/rk2818_dsp.h @@ -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; -- 2.34.1