fmsmile
驱动牛犊
驱动牛犊
  • 注册日期2008-07-31
  • 最后登录2010-09-19
  • 粉丝0
  • 关注0
  • 积分6分
  • 威望41点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:2088回复:0

求助关于三星2451系统下的ac97驱动问题

楼主#
更多 发布于:2010-05-04 17:57
小弟在2451下面调试wm9715的驱动,发现很奇怪的问题,在设置完2451的AC97接口后,总是无法实现code ready。打印信息如下:
AC97 Power UP
WAVDEV_AC97::AC97_Init()++
WAVDEV_AC97::AC97_Init()--
+++InitCodec
CodecVendorID0 =:    0
CodecVendorID1 =:    0
代码如下:
// Kingfish2 AC97 Initialize function
BOOL HardwareContext::AC97_Init()
{
 RETAILMSG(AC97_DEBUG,(_T("WAVDEV_AC97::AC97_Init()++\r\n")));

 //AC97_GPIO_Init();
    v_pIOPregs->GPECON = (v_pIOPregs->GPECON & ~(0x3ff)) | 0x3ff;   //GPE[4:0]=AC_SDATA_OUT   AC_SDATA_IN   AC_nRESET   AC_BIT_CLK   AC_SYNC
 v_pIOPregs->GPEUDP  = v_pIOPregs->GPEUDP  & ~(0x3ff);    //The pull up function is disabled GPE[4:0] 0 0000
 v_pIOPregs->GPEDAT  = v_pIOPregs->GPEDAT  & ~(0x1f);
 // Write into the AC97 Global Control Register
 //Cold Reset
#if 0
 v_pAC97regs->AC_GLBCTRL = 0x1;
 Delay(10); //Sleep(5);
 v_pIOPregs->GPEDAT = v_pIOPregs->GPEDAT | (GPE0_BIT_AC97_nRST);//fmsmile 4.30

 v_pAC97regs->AC_GLBCTRL = 0x0;
 Delay(10); //Sleep(5);
#endif
  v_pAC97regs->AC_GLBCTRL |=  (0x1<<0);
 Delay(10); //Sleep(5);
 v_pIOPregs->GPEDAT = v_pIOPregs->GPEDAT |(GPE0_BIT_AC97_nRST);  //fmsmile 5.4
 v_pAC97regs->AC_GLBCTRL &= ~(0x1<<0);
 Delay(10); //Sleep(5);
 
 //Ajay
 //v_pAC97regs->AC_GLBCTRL = 0x1;
    //AC-link On
    v_pAC97regs->AC_GLBCTRL = (1<<2); //fmsmile 4.30
 Delay(10); //Sleep(5);
 //v_pAC97regs->AC_GLBCTRL = 0x0;
 //Delay(10); //Sleep(5);

 //Warm Reset WM9713 Need This!!!
 v_pAC97regs->AC_GLBCTRL |= (1<<1);
 Delay(10); //Sleep(5);
 v_pAC97regs->AC_GLBCTRL &= ~(1<<1);
 Delay(10); //Sleep(5);
 //AC-link On
 v_pAC97regs->AC_GLBCTRL = (1<<2);
 Delay(10); //Sleep(5);

 // WM9713 Need This !!!!
 //WriteCodecRegister(WM9713_POWER_CONTROL, 0x1000);

 //Transfer data enable using AC-link
 v_pAC97regs->AC_GLBCTRL = v_pAC97regs->AC_GLBCTRL | (1<<3);
 Delay(10); //Sleep(5);


 // Enable the Codec ready Interrupt Ajay
 v_pAC97regs->AC_GLBCTRL = v_pAC97regs->AC_GLBCTRL | (1<<22);
 Delay(10); //Sleep(5);


 
 while (!(v_pAC97regs->AC_GLBSTAT& 0x400000)){  //

  RETAILMSG(AC97_DEBUG,(_T("WAVEDEV_AC97::AC97 Codec  not Ready!\r\n")));
 }
 v_pAC97regs->AC_GLBCTRL &= ~(0x400000); // codec ready interrupt disable

 Delay(10); //Sleep(5);

#if AC97_RECORD_MICIN
   v_pAC97regs->AC_GLBCTRL = (v_pAC97regs->AC_GLBCTRL & ~(0x3f<<8)) | 0x2200; // PCM_OUT=DMA,PCM_IN=OFF,MIC=DMA;
#else
   v_pAC97regs->AC_GLBCTRL = (v_pAC97regs->AC_GLBCTRL & ~(0x3f<<10)) | 0x2800; // PCM_OUT=DMA,PCM_IN=DMA,MIC=OFF;
#endif
 RETAILMSG(AC97_DEBUG,(_T("WAVDEV_AC97::AC97_Init()--\r\n")));

 return TRUE;
}
就无法进行下去,好像和wm9715没有关系,还是和2451的设置有关系,我换了个2440板,发现硬件电路是没有问题。希望众位大侠不吝指教。
游客

返回顶部