Chinaunix首页 | 论坛 | 博客
  • 博客访问: 20413
  • 博文数量: 4
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 75
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-08 14:30
文章分类
文章存档

2011年(1)

2008年(3)

我的朋友

分类: LINUX

2008-04-21 21:54:54

关于阳初2440超值版只能使用一个usb host问题的解决

---------硬件环境:阳初2440超值版

---------内核2.6.14 +linux_yc2440v2.patch

---------编译器arm-linux-gcc3.4.1

   这几天一直为自己开发板只能使用一个usb host而郁闷,一直找不到解决方法。今天参考了几个帖子发现主要是MISCCR寄存器没有被正确设置的缘故。于是修改ohci-s3c2440.c文件(含头文件):

    #include

    #include

    #include

    /*hedan add here*/

    #include

    #include

    #include

    #include

    /*hedan end here*/

#define valid_port(idx) ((idx) == 1 || (idx) == 2)

 

 

/*hedan add here*/

static void s3c2410_start_hc(struct platform_device *dev, struct usb_hcd *hcd)

  {

      unsigned long upllvalue = (0x78<<12)|(0x02<<4)|(0x03); //add upllvalue

      unsigned long misccr; //add misccr

      struct s3c2410_hcd_info *info = dev->dev.platform_data;

  

      while (upllvalue != __raw_readl(S3C2410_UPLLCON)) //setup UPLLCON

      {

      __raw_writel(upllvalue, S3C2410_UPLLCON);

      mdelay(1);

      }

  

      misccr = __raw_readl(S3C2410_MISCCR); //MISCCR

      misccr |= S3C2410_MISCCR_USBHOST;

    misccr&=~(S3C2410_MISCCR_USBSUSPND0|S3C2410_MISCCR_USBSUSPND1);

      __raw_writel(misccr,S3C2410_MISCCR);

  

      dev_dbg(&dev->dev, "s3c2410_start_hc:\n");

      clk_enable(clk);

  

      if (info != NULL) {

          info->hcd   = hcd;

          info->report_oc = s3c2410_hcd_oc;

 

         if (info->enable_oc != NULL) {

              (info->enable_oc)(info, 1);

          }

}

     }

。。。。。。。。。。。。。。。。。。。。。。。

之后编译完成ok

 

参考

   
阅读(1318) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2008-04-21 21:58:49

你文章的水平越来越高了啊。祝你将来取得更高的成就!