您尚未登录。

楼主 #1 2019-07-20 12:08:18

flash
会员
注册时间: 2019-05-17
已发帖子: 14
积分: 14

allwinner h3 otg做host 连接外设usb

用h3的otg口做host连接usb设备,设备枚举失败。
使用的软件linux内核版本是linux4.9,设备树配置如下:

&usb_otg {
    dr_mode = "otg";
    status = "okay";
};

&usbphy {
    /* USB VBUS is always on except for the OTG port */
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&usb0_id_detect_pin>;
    usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
    usb0_vbus-supply = <&reg_usb0_vbus>;
};

&ohci0 {
    status = "okay";
};

&ehci0 {
    status = "okay";
};

这是设么情况???

离线

#2 2019-07-20 14:41:44

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: allwinner h3 otg做host 连接外设usb

失败的日志是什么?
用香橙派 lite 板子吗?





离线

#3 2019-07-20 20:34:13

arychen
会员
注册时间: 2019-04-06
已发帖子: 275
积分: 250.5

Re: allwinner h3 otg做host 连接外设usb

H3  android4.4的时候老的系统,我有用otg做host过   写个指令直接可以转换模式。

离线

楼主 #4 2019-07-22 09:20:19

flash
会员
注册时间: 2019-05-17
已发帖子: 14
积分: 14

Re: allwinner h3 otg做host 连接外设usb

晕哥 说:

失败的日志是什么?
用香橙派 lite 板子吗?

使用的是orangepi one ,日志信息如下:

[    0.029246] reg-fixed-voltage usb0-vbus: could not find pctldev for node /soe
[    0.030528] usbcore: registered new interface driver usbfs                   
[    0.030605] usbcore: registered new interface driver hub                     
[    0.030694] usbcore: registered new device driver usb                       
[    0.057387] sun4i-usb-phy 1c19400.phy: could not find pctldev for node /soc/e
[    0.827676] usbcore: registered new interface driver cdc_acm                 
[    0.841437] usbcore: registered new interface driver usblp                   
[    0.846984] usbcore: registered new interface driver cdc_wdm                 
[    0.852704] usbcore: registered new interface driver usbtmc                 
[    0.858319] usbcore: registered new interface driver uas                     
[    0.863711] usbcore: registered new interface driver usb-storage             
[    0.869757] usbcore: registered new interface driver ums-alauda             
[    0.875730] usbcore: registered new interface driver ums-cypress             
[    0.881773] usbcore: registered new interface driver ums-datafab             
[    0.887832] usbcore: registered new interface driver ums_eneub6250           
[    0.894064] usbcore: registered new interface driver ums-freecom             
[    0.900106] usbcore: registered new interface driver ums-isd200             
[    0.906077] usbcore: registered new interface driver ums-jumpshot           
[    0.912205] usbcore: registered new interface driver ums-karma               
[    0.918091] usbcore: registered new interface driver ums-onetouch           
[    0.924249] usbcore: registered new interface driver ums-realtek             
[    0.930291] usbcore: registered new interface driver ums-sddr09             
[    0.936271] usbcore: registered new interface driver ums-sddr55             
[    0.942229] usbcore: registered new interface driver ums-usbat               
[    0.948127] usbcore: registered new interface driver mdc800                 
[    0.961429] usbcore: registered new interface driver microtekX6             
[    0.967469] usbcore: registered new interface driver usbserial               
[    0.973384] usbip_core: usbip_core_init:776: USB/IP Core v1.0.0             
[    1.009725] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002   
[    1.016543] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    1.023794] usb usb1: Product: USB/IP Virtual Host Controller               
[    1.029548] usb usb1: Manufacturer: Linux 4.9.0-rc1 vhci_hcd                 
[    1.035227] usb usb1: SerialNumber: vhci_hcd                                 
[    1.435067] usbcore: registered new device driver usbip-host                 
[    1.440745] usbip_host: usbip_host_init:302: USB/IP Host Driver v1.0.0       
[    1.728410] usbcore: registered new interface driver usbhid                 
[    1.734017] usbhid: USB HID core driver                                     
[    1.969537] ehci-platform 1c1a000.usb: EHCI Host Controller                 
[    1.975510] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus 2
[    1.989707] ehci-platform 1c1a000.usb: irq 28, io mem 0x01c1a000             
[    2.001630] usb usb1: vhci_bus_suspend                                       
[    2.027504] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00           
[    2.039566] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002   
[    2.046402] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.053657] usb usb2: Product: EHCI Host Controller                         
[    2.058543] usb usb2: Manufacturer: Linux 4.9.0-rc1 ehci_hcd                 
[    2.064223] usb usb2: SerialNumber: 1c1a000.usb                             
[    2.080888] ehci-platform 1c1b000.usb: EHCI Host Controller                 
[    2.086761] ehci-platform 1c1b000.usb: new USB bus registered, assigned bus 3
[    2.094767] ehci-platform 1c1b000.usb: irq 30, io mem 0x01c1b000             
[    2.122553] ehci-platform 1c1b000.usb: USB 2.0 started, EHCI 1.00           
[    2.134951] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002   
[    2.141768] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.149036] usb usb3: Product: EHCI Host Controller                         
[    2.153937] usb usb3: Manufacturer: Linux 4.9.0-rc1 ehci_hcd                 
[    2.159603] usb usb3: SerialNumber: 1c1b000.usb                             
[    2.207139] ehci-platform 1c1c000.usb: EHCI Host Controller                 
[    2.213128] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus 4
[    2.221076] ehci-platform 1c1c000.usb: irq 32, io mem 0x01c1c000             
[    2.252342] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00           
[    2.258647] usb usb4: New USB device found, idVendor=1d6b, idProduct=0002   
[    2.265464] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.272716] usb usb4: Product: EHCI Host Controller                         
[    2.277601] usb usb4: Manufacturer: Linux 4.9.0-rc1 ehci_hcd                 
[    2.283279] usb usb4: SerialNumber: 1c1c000.usb                             
[    2.296794] ehci-platform 1c1d000.usb: EHCI Host Controller                 
[    2.302642] ehci-platform 1c1d000.usb: new USB bus registered, assigned bus 5
[    2.310563] ehci-platform 1c1d000.usb: irq 34, io mem 0x01c1d000             
[    2.342332] ehci-platform 1c1d000.usb: USB 2.0 started, EHCI 1.00           
[    2.348615] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002   
[    2.355432] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.362683] usb usb5: Product: EHCI Host Controller                         
[    2.367570] usb usb5: Manufacturer: Linux 4.9.0-rc1 ehci_hcd                 
[    2.373248] usb usb5: SerialNumber: 1c1d000.usb                             
[    2.386624] ohci-platform 1c1a400.usb: Generic Platform OHCI controller     
[    2.393508] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus 6
[    2.401381] ohci-platform 1c1a400.usb: irq 29, io mem 0x01c1a400             
[    2.476487] usb usb6: New USB device found, idVendor=1d6b, idProduct=0001   
[    2.483306] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.490545] usb usb6: Product: Generic Platform OHCI controller             
[    2.496491] usb usb6: Manufacturer: Linux 4.9.0-rc1 ohci_hcd                 
[    2.502158] usb usb6: SerialNumber: 1c1a400.usb                             
[    2.515656] ohci-platform 1c1b400.usb: Generic Platform OHCI controller     
[    2.522535] ohci-platform 1c1b400.usb: new USB bus registered, assigned bus 7
[    2.530403] ohci-platform 1c1b400.usb: irq 31, io mem 0x01c1b400             
[    2.606578] usb usb7: New USB device found, idVendor=1d6b, idProduct=0001   
[    2.613396] usb usb7: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.620635] usb usb7: Product: Generic Platform OHCI controller             
[    2.626575] usb usb7: Manufacturer: Linux 4.9.0-rc1 ohci_hcd                 
[    2.632242] usb usb7: SerialNumber: 1c1b400.usb                             
[    2.645659] ohci-platform 1c1c400.usb: Generic Platform OHCI controller     
[    2.652529] ohci-platform 1c1c400.usb: new USB bus registered, assigned bus 8
[    2.660425] ohci-platform 1c1c400.usb: irq 33, io mem 0x01c1c400             
[    2.736586] usb usb8: New USB device found, idVendor=1d6b, idProduct=0001   
[    2.743406] usb usb8: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.750645] usb usb8: Product: Generic Platform OHCI controller             
[    2.756586] usb usb8: Manufacturer: Linux 4.9.0-rc1 ohci_hcd                 
[    2.762252] usb usb8: SerialNumber: 1c1c400.usb                             
[    2.775715] ohci-platform 1c1d400.usb: Generic Platform OHCI controller     
[    2.782603] ohci-platform 1c1d400.usb: new USB bus registered, assigned bus 9
[    2.790474] ohci-platform 1c1d400.usb: irq 35, io mem 0x01c1d400             
[    2.866505] usb usb9: New USB device found, idVendor=1d6b, idProduct=0001   
[    2.873333] usb usb9: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.880573] usb usb9: Product: Generic Platform OHCI controller             
[    2.886516] usb usb9: Manufacturer: Linux 4.9.0-rc1 ohci_hcd                 
[    2.892183] usb usb9: SerialNumber: 1c1d400.usb                             
[    3.112351] usb 7-1: new full-speed USB device number 2 using ohci-platform 
[    3.222443] usb 8-1: new full-speed USB device number 2 using ohci-platform 
[    3.322431] usb 9-1: new full-speed USB device number 2 using ohci-platform 
[    3.381463] usb 7-1: New USB device found, idVendor=04d8, idProduct=00de     
[    3.388273] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.395430] usb 7-1: Product: MCP2210 USB to SPI Master                     
[    3.400663] usb 7-1: Manufacturer: Microchip Technology Inc.                 
[    3.406344] usb 7-1: SerialNumber: 0000893622                               
[    3.451685] hid-generic 0003:04D8:00DE.0001: hidraw0: USB HID v1.11 Device [0
[    3.511460] usb 8-1: New USB device found, idVendor=04d8, idProduct=00de     
[    3.518275] usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.525432] usb 8-1: Product: MCP2210 USB to SPI Master                     
[    3.530666] usb 8-1: Manufacturer: Microchip Technology Inc.                 
[    3.536347] usb 8-1: SerialNumber: 0000890804                               
[    3.581700] hid-generic 0003:04D8:00DE.0002: hidraw1: USB HID v1.11 Device [0
[    3.615415] usb 9-1: New USB device found, idVendor=04d8, idProduct=00de     
[    3.622158] usb 9-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.629360] usb 9-1: Product: MCP2210 USB to SPI Master                     
[    3.634606] usb 9-1: Manufacturer: Microchip Technology Inc.                 
[    3.640273] usb 9-1: SerialNumber: 0000890805                               
[    3.681660] hid-generic 0003:04D8:00DE.0003: hidraw2: USB HID v1.11 Device [0

离线

楼主 #5 2019-07-22 09:22:32

flash
会员
注册时间: 2019-05-17
已发帖子: 14
积分: 14

Re: allwinner h3 otg做host 连接外设usb

arychen 说:

H3  android4.4的时候老的系统,我有用otg做host过   写个指令直接可以转换模式。

使用的是什么指令??

离线

#6 2019-07-22 09:28:07

路漫漫
会员
注册时间: 2019-07-22
已发帖子: 65
积分: 54

Re: allwinner h3 otg做host 连接外设usb

你这个看起来驱动没有问题, 估计是硬件问题, 可能是某些原因被复位了.

最近编辑记录 路漫漫 (2019-07-22 09:28:21)

离线

楼主 #7 2019-07-22 09:36:05

flash
会员
注册时间: 2019-05-17
已发帖子: 14
积分: 14

Re: allwinner h3 otg做host 连接外设usb

路漫漫 说:

你这个看起来驱动没有问题, 估计是硬件问题, 可能是某些原因被复位了.

使用的bsp包是https://github.com/orangepi-xunlong/orangepi_h3_linux,其中包含了两个内核版本,
一个是3.4的,它是用fex文件配置资源的,
另一个是4.9的,它是用device tree配置资源的。

使用linux 3.4是可以正常枚举的,说明硬件没问题啊。
现在一直用的是4.9,设备树配置后使用异常,郁闷啊。

离线

#8 2019-07-22 10:02:07

路漫漫
会员
注册时间: 2019-07-22
已发帖子: 65
积分: 54

Re: allwinner h3 otg做host 连接外设usb

插入的这个是 hub 还是 U盘?

离线

楼主 #9 2019-07-22 10:18:43

flash
会员
注册时间: 2019-05-17
已发帖子: 14
积分: 14

Re: allwinner h3 otg做host 连接外设usb

路漫漫 说:

插入的这个是 hub 还是 U盘?

hub跟u盘结果都是一样的。

离线

#10 2019-07-22 10:20:56

路漫漫
会员
注册时间: 2019-07-22
已发帖子: 65
积分: 54

Re: allwinner h3 otg做host 连接外设usb

这就有点尴尬, 有空我也拿出吃灰很久的 橙子派lite出来晒晒跑一跑4.9。

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn