设为首页 加入收藏

TOP

Tiny6410 下的USB移植(一)
2014-11-24 15:00:10 来源: 作者: 【 】 浏览:140
Tags:Tiny6410 USB 移植

终于做完usb的移植了,前前后后自己一共做了20几个zImage,其中也发现了很多问题,所幸的是问题都已得到解决,有很多问题是关于make menuconfig的,有这样那样的选项没有选上就会出现问题,以后要注意,还有就是网上的关于tiny6410的移植很少,还不全!


1、vi arch/arm/mach-s3c64xx/mach-mini6410.c


124行增加


/* Initializes OTG Phy. to output 48M clock */
void s3c_otg_phy_config(int enable) {
u32 val;


if (enable) {
__raw_writel(0x0, S3C_PHYPWR); /* Power up */


val = __raw_readl(S3C_PHYCLK);
val &= ~S3C_PHYCLK_CLKSEL_MASK;
__raw_writel(val, S3C_PHYCLK);


__raw_writel(0x1, S3C_RSTCON);
udelay(5);
__raw_writel(0x0, S3C_RSTCON); /* Finish the reset */
udelay(5);
} else {
__raw_writel(0x19, S3C_PHYPWR); /* Power down */
}
}


2、vi drivers/usb/host/ohci-s3c2410.c
修改方法
@@ -25,10 +25,14 @@


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


+#ifdef CONFIG_MACH_MINI6410
+extern void s3c_otg_phy_config(int enable);
+#endif
+
/* clock device associated with the hcd */


static struct clk *clk;
-static struct clk *usb_clk;
+static struct clk *otg_clk, *usb_clk;


/* forward definitions */


@@ -47,6 +51,11 @@


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


+ clk_enable(otg_clk);
+#ifdef CONFIG_MACH_MINI6410
+ s3c_otg_phy_config(1);
+#endif
+
clk_enable(usb_clk);
mdelay(2); /* let the bus clock stabilise */


@@ -79,6 +88,7 @@


clk_disable(clk);
clk_disable(usb_clk);
+ clk_disable(otg_clk);
}


/* ohci_s3c2410_hub_status_data
@@ -375,6 +385,13 @@
goto err_clk;
}


+ otg_clk = clk_get(&dev->dev, "otg");
+ if (IS_ERR(otg_clk)) {
+ dev_err(&dev->dev, "cannot get otg clock\n");
+ retval = -ENOENT;
+ goto err_otg;
+ }
+
s3c2410_start_hc(dev, hcd);


hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_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、make menuconfig


Device Drivers --->


SCSI device support --->
<*> SCSI device support
<*> SCSI disk support
<*> SCSI generic support


USB support
<*> Support for Host-side USB
[*] USB device filesystem (DEPRECATED)
<*> USB Monitor
<*> OHCI HCD support
<*> USB Mass Storage support


File systems --->
DOS/FAT/NT Filesystems --->
<*> MSDOS fs support
<*> VFAT (Windows-95) fs support
(936) Default codepage for FAT


(cp936) Default iocharset for FAT




问题1:


"usb device descriptor read/64, error -71"


linux-kernel/include/asm-generic/erron.h 可以发现是:#define EPROTO 71 /* Protocol error 协议错误*/


内核配置中添加:CONFIG_USB_EHCI_ROOT_HUB_TT=y 就可以了。


问题2:


U盘可以挂载但是只读:


解决:


--- SCSI device support │ │
│ │ [*] legacy /proc/scsi/ support



问题3:
不支持U盘里面的中文名称:
提示:NTFS-fs error (device uba1): ntfs_ucstonls(): Unicode name contains characters that cannot be converted to character set default. You might want to try to use the mount option nls=utf8.
解决:


--- Base native language support │ │

首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Tiny6410 的内核移植 下一篇Tiny6410 LCD的移植

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: