经过搜索得知,是UPLLCON没有设置好。根本问题在uboot。但是可以修改内核来弥补。
在drivers/usb/host/ohci-s3c2410.c 的函数 s3c2410_start_hc修改如下:
drivers/usb/host/ohci-s3c2410.cstatic void s3c2410_start_hc(struct platform_device *dev, struct usb_hcd *hcd)
{
struct s3c2410_hcd_info *info = dev->dev.platform_data;
unsigned long upllvalue = (0x38<< 12) | (0x02 << 4) | (0x01); // 添加的代码
unsigned long upllvalue1 = (0x38<< 12) | (0x02 << 4) | (0x02); // 添加的代码
dev_dbg(&dev->dev, "s3c2410_start_hc:\n");
__raw_writel(upllvalue, S3C2410_UPLLCON); // 添加的代码
mdelay(20); // 添加的代码
__raw_writel(upllvalue1, S3C2410_UPLLCON);// 添加的代码
mdelay(20); // 添加的代码
clk_enable(usb_clk);
mdelay(2); /* let the bus clock stabilise */
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); } }}
重新编译内核,然后在uboot中用新内核启动即可:
#nfs 30000000 192.168.1.131:/nfs/busybox/fs_mini2440/uImage_XXX
#bootm 30000000
参考:http://download.csdn.net/detail/wenxiaohua_113/4313893#comment
在网上查了下说是UPLLCON赋值的问题。
试了些办法,最终延长了MPLLCON寄存器赋值和UPLLCON寄存器赋值之间延迟后解决了错误。
具体修改了以下代码:
vi uboot1.1.4/board/fl2440/fl2440.c
修改board_init函数以下语句:
clk_power->MPLLCON = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);
/* some delay between MPLL and UPLL */
delay (4000);
/* configure UPLL */
clk_power->UPLLCON = ((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV);
将其改为:
clk_power->MPLLCON = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);
/* some delay between MPLL and UPLL */
delay (4000);
delay (4000);
/* configure UPLL */
clk_power->UPLLCON = ((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV);
也就是多加一个delay (4000);
联系客服