资源描述:
《linux-2.6.38到tiny6410的移植手册(连载4)__usb设备(u盘,摄像头,wifi)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、linux-2.6.38到tiny6410的移植手册(连载4)__USB设备(U盘,摄像头,wifi)今天来讲讲一些USB设备(U盘,摄像头,wifi)的驱动吧,它的特点是内核已经带非常完善的驱动了,我们需要的就是配置而已,和很少的修改而已。一、首先是U盘得支持。1、viarch/arm/mach-s3c64xx/mach-mini6410.c124行增加/*InitializesOTGPhy.tooutput48Mclock*/voids3c_otg_phy_config(intenable){ u32val; if
2、(enable){ __raw_writel(0x0,S3C_PHYPWR); /*Powerup*/ val=__raw_readl(S3C_PHYCLK); val&=~S3C_PHYCLK_CLKSEL_MASK; __raw_writel(val,S3C_PHYCLK); __raw_writel(0x1,S3C_RSTCON); udelay(5);
3、 __raw_writel(0x0,S3C_RSTCON); /*Finishthereset*/ udelay(5); }else{ __raw_writel(0x19,S3C_PHYPWR);/*Powerdown*/ }}2、vidrivers/usb/host/ohci-s3c2410.c修改方法@@-25,10+25,14@@#definevalid_port(idx)((idx)==1
4、
5、(idx)==2)+#ifdefCO
6、NFIG_MACH_MINI6410+externvoids3c_otg_phy_config(intenable);+#endif+/*clockdeviceassociatedwiththehcd*/staticstructclk*clk;-staticstructclk*usb_clk;+staticstructclk*otg_clk,*usb_clk;/*forwarddefinitions*/@@-47,6+51,11@@ dev_dbg(&dev->dev,"s3c2410_start_hc:");+ clk_enab
7、le(otg_clk);+#ifdefCONFIG_MACH_MINI6410+ s3c_otg_phy_config(1);+#endif+ clk_enable(usb_clk); mdelay(2); /*letthebusclockstabilise*/@@-79,6+88,7@@ clk_disable(clk); clk_disable(usb_clk);+ clk_disable(otg_clk);}/*ohci_s3c2410_hub_status_data@@-375,6
8、+385,13@@ gotoerr_clk; }+ otg_clk=clk_get(&dev->dev,"otg");+ if(IS_ERR(otg_clk)){+ dev_err(&dev->dev,"cannotgetotgclock");+ retval=-ENOENT;+ gotoerr_otg;+ }+ s3c2410_start_hc(dev,hcd); hcd->regs=ioremap(hcd->rsrc_start,hcd->rsrc
9、_len);@@-395,6+412,10@@ err_ioremap: s3c2410_stop_hc(dev); iounmap(hcd->regs);++ clk_put(otg_clk);++err_otg: clk_put(usb_clk); err_clk:3、makemenuconfigDeviceDrivers ---> SCSIdevicesupport ---> <*>SCSIdevicesupport <*>SCSIdisksupport <*
10、>SCSIgenericsupport USBsupport <*> SupportforHost-sideUSB