亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 3258 | 回復(fù): 9
打印 上一主題 下一主題

USB設(shè)備問題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2013-07-24 16:06 |只看該作者 |倒序?yàn)g覽
LINUX內(nèi)核版本2.6.21,使用我的兩塊板子(cpu均為s3c2416),一塊作為USB HOST,一塊作為USB DEVICE,F(xiàn)在情況是將DEVICE設(shè)備連到HOST上出錯(cuò),錯(cuò)誤消息如下:
[root@urbetter /]# usb 1-1.1: new full speed USB device using s3c2410-ohci and address 3
usb 1-1.1: device descriptor read/64, error -62
usb 1-1.1: device descriptor read/64, error -62
usb 1-1.1: new full speed USB device using s3c2410-ohci and address 4
usb 1-1.1: device descriptor read/64, error -62
usb 1-1.1: device descriptor read/64, error -62
usb 1-1.1: new full speed USB device using s3c2410-ohci and address 5
usb 1-1.1: device not accepting address 5, error -62
usb 1-1.1: new full speed USB device using s3c2410-ohci and address 6
usb 1-1.1: device not accepting address 6, error -62
可確定HOST側(cè)是好的(因?yàn)槲疫B上U盤可正常識(shí)別),看來問題應(yīng)該在DEVICE這邊。
HOST和DEVICE側(cè)的驅(qū)動(dòng)都是移植的友堅(jiān)開發(fā)板自帶的驅(qū)動(dòng)。
由上述消息大概問題出在哪,我現(xiàn)在都沒有方向了。請(qǐng)指教。

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2013-07-24 16:52 |只看該作者
USB的時(shí)鐘有問題

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2013-07-24 16:56 |只看該作者
一種方法是在uboot中改,也可以在加載驅(qū)動(dòng)時(shí)加一下,

我把ret = platform_add_devices(s3c2440_devices, 1);中的usb加載,沒有放在啟動(dòng),而是用insmod加載
加載時(shí)初始化upll
static u64 samsung_device_dma_mask = DMA_BIT_MASK(32);

static struct resource s3c_usb_resource[] = {
        [0] = DEFINE_RES_MEM(S3C_PA_USBHOST, SZ_256),
        [1] = DEFINE_RES_IRQ(IRQ_USBH),
};

struct platform_device s3c_device_ohci = {
        .name           = "s3c2440-ohci",
        .id             = -1,
        .num_resources  = ARRAY_SIZE(s3c_usb_resource),
        .resource       = s3c_usb_resource,
        .dev            = {
                .dma_mask               = &samsung_device_dma_mask,
                .coherent_dma_mask      = DMA_BIT_MASK(32),
        }
};

static struct platform_device *s3c2440_devices[] __initdata =
{
    &s3c_device_ohci,
};

static void usb_s3c2440_init_pll(void)
{
    u32 upll_value;

    upll_value = ((0x38 << 12) | (0x02 << 4) | (0x02 << 0));
    do {
        printk(KERN_INFO "UPLLCON = %x, wxl add\n", upll_value);
        writel(upll_value, S3C2410_UPLLCON);
        mdelay(1);
    }while(upll_value != readl(S3C2410_UPLLCON));
}

static int __init s3c2440_usb_init(void)

    int ret;

    usb_s3c2440_init_pll();

    ret = platform_add_devices(s3c2440_devices, 1);

    return ret;
}

static void __exit s3c2440_usb_exit(void)
{
    //platform_device_put(&s3c2440_uart_device);
}

MODULE_LICENSE("GPL");
module_init(s3c2440_usb_init);
module_exit(s3c2440_usb_exit);

論壇徽章:
0
4 [報(bào)告]
發(fā)表于 2013-07-25 19:03 |只看該作者
你好,感謝回復(fù)。
請(qǐng)問以上代碼是添加到哪個(gè)文件?
另外以上配置為2440,2416也是一樣的嗎?

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2013-07-26 09:56 |只看該作者
在mach-smdk2416.c
中有platform_add_devices(smdk2416_devices, ARRAY_SIZE(smdk2416_devices));

static struct platform_device *smdk2416_devices[] __initdata = {
        &s3c_device_fb,
        &s3c_device_wdt,
        &s3c_device_ohci,
ohci的加載
2440類似
這是系統(tǒng)初始化時(shí)就加載了
我把&s3c_device_ohci,去掉
單獨(dú)寫了一個(gè)模塊,動(dòng)態(tài)加載。就你看到的。你應(yīng)該沒去掉吧
upll初始化主要是
static void usb_s3c2440_init_pll(void)
{
    u32 upll_value;

    upll_value = ((0x38 << 12) | (0x02 << 4) | (0x02 << 0));
    do {
        printk(KERN_INFO "UPLLCON = %x, wxl add\n", upll_value);
        writel(upll_value, S3C2410_UPLLCON);
        mdelay(1);
    }while(upll_value != readl(S3C2410_UPLLCON));
}
s3c2416的寄存器和s3c2440應(yīng)該差不多
主要是upll_value的值,要么自己算,要么查一下uboot中的值。

還有usb_s3c2440_init_pll放那里,你沒有把platform_add_devices單獨(dú),
你可以做一個(gè)簡單的模塊,init只做usb_s3c2440_init_pll,加載它。
也可以在ochi中的probe加載。

回復(fù) 4# thzhr2009


   

論壇徽章:
0
6 [報(bào)告]
發(fā)表于 2013-07-26 10:28 |只看該作者
我按照你的指點(diǎn),在/arch/arm/mach-s3c2416/mach-smdk2416.c中增加上述代碼:
static void usb_s3c2416_init_pull(void)
{
        u32 upll_value;
        upll_value=((0x38<<12)|(0x02<<4)|(0x02<<0));
        do
                {
                printk(KERN_INFO "upllcon=%x,wxl add\n",upll_value);
                writel(upll_value,S3C2410_UPLLCON);
                printk(KERN_INFO "read S3C2410_UPLLCON=%x\n",readl(S3C2410_UPLLCON));
                mdelay(1);
                }
        while(upll_value!=readl(S3C2410_UPLLCON));
}
將此函數(shù)增加到smdk2416_machine_init()中:
static void __init smdk2416_machine_init(void)
{
        /* SROM init for NFS */
        printk("^^^^smdk2416_machine_init()^^zhr^^^^^^\n");
        smdk2416_cs89x0_set();
        hsspi_set_gpio();
        usb_s3c2416_init_pull();
        smdk_machine_init();
       
        s3c_device_spi0.dev.platform_data= &s3c2416_spi0_platdata;
        spi_register_board_info(s3c2416_spi0_board, ARRAY_SIZE(s3c2416_spi0_board));     
}
但目前出現(xiàn)上電后出現(xiàn)usb_s3c2416_init_pull()函數(shù)中do while死循環(huán):
read S3C2410_UPLLCON=8022
upllcon=38022,wxl add
read S3C2410_UPLLCON=8022
upllcon=38022,wxl add
read S3C2410_UPLLCON=8022
看來upllcon就沒有寫入S3C2410_UPLLCON寄存器中,這是怎么回事?

論壇徽章:
0
7 [報(bào)告]
發(fā)表于 2013-07-26 10:37 |只看該作者
好的,我測試下。
另外我有些不明白的是ohci不是host端的嗎,現(xiàn)在問題是在device側(cè)?

論壇徽章:
0
8 [報(bào)告]
發(fā)表于 2013-07-26 10:41 |只看該作者
是你的主機(jī)的upll不對(duì)回復(fù) 7# thzhr2009


   

論壇徽章:
0
9 [報(bào)告]
發(fā)表于 2013-07-26 10:45 |只看該作者
本帖最后由 wwxxxxll 于 2013-07-26 10:50 編輯

你沒看到打印是寫進(jìn)去和讀出來不對(duì)
這確實(shí)有點(diǎn)奇怪,寫寄存器不成功!
回復(fù) 6# thzhr2009


   

論壇徽章:
0
10 [報(bào)告]
發(fā)表于 2013-07-26 10:57 |只看該作者
對(duì)
應(yīng)該是寄存器不一樣,我查下手冊(cè)。
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP