[Letux-kernel] [PATCH 2/5] DTS: MIPS: JZ4780: add USB PHY&OTG

H. Nikolaus Schaller hns at goldelico.com
Tue Sep 22 17:14:41 CEST 2020


Hi,

> Am 21.09.2020 um 19:59 schrieb Zhou Yanjie <zhouyanjie at wanyeetech.com>:
> 
> Hi,
> 
> 在 2020/9/22 上午1:46, H. Nikolaus Schaller 写道:
>> Hi,
>> 
>>> Am 21.09.2020 um 19:08 schrieb Zhou Yanjie <zhouyanjie at wanyeetech.com>:
>>> 
>>> 在 2020/9/22 上午12:58, H. Nikolaus Schaller 写道:
>>>> Hi,
>>>> 
>>>>> Am 21.09.2020 um 18:36 schrieb Zhou Yanjie <zhouyanjie at wanyeetech.com>:
>>>>> 
>>>>>> What *is* working is connecting the USB port to a host PC and running
>>>>>> the CI20 in client mode (e.g. g_ether).
>>>>>> 
>>>>>> That is already good progress!
>>>>> Maybe you can try this patch. I tested it on CU1000-Neo and CU1830-Neo, and it can works in host mode, but I haven't tested it on CI20. My CI20 won't be able to come back to me until the weekend.
>>>>> 
>>>>> Thanks and best regards!
>>>> Mayby it was scrubbed somewhere... Please can you send it again?
>>> 
>>> Ah, my fault, I forgot to add attachments.
>> Thanks! It is a new generic-PHY driver, that is nice!
>> 
>> Unfortunately:
>> 
>> [   10.961565] dwc2 13500000.usb: supply vusb_a not found, using dummy regulator
>> [   10.994543] dwc2_lowlevel_hw_init: 8
>> [   10.998163] dwc2_driver_probe: 2
>> [   11.001509] dwc2_driver_probe: 3
>> [   11.007437] dwc2 13500000.usb: registering common handler for irq21
>> [   11.025963] dwc2_driver_probe: 4
>> [   11.030817] dwc2 13500000.usb: Looking up vbus-supply from device tree
>> [   11.043473] dwc2 13500000.usb: Looking up vbus-supply property in node /usb at 13500000 failed
>> [   11.052065] dwc2_driver_probe: 5
>> [   11.058226] CPU 0 Unable to handle kernel paging request at virtual address 00000014, epc == 8045b054, ra == 8045b05c
>> [   10.986077] Oops[#1]:
>> [   10.988413] CPU: 0 PID: 1298 Comm: systemd-udevd Not tainted 5.9.0-rc5-letux-l400+ #3478
>> [   10.996555] $ 0   : 00000000 00000001 8045b044 8fa3c820
>> [   11.001819] $ 4   : 8fae6200 00000000 00000000 fffffffd
>> [   11.007079] $ 8   : 00000000 00000c00 00000000 fefefeff
>> [   11.012339] $12   : 8eb05448 77d45dc0 00000000 7fc02d54
>> [   11.017599] $16   : 00000000 fffffdf4 8fae63b8 8fa35410
>> [   11.022859] $20   : c0390000 00000000 00000000 c0390000
>> [   11.028121] $24   : 556f4af8 8006a47c
>> [   11.033379] $28   : 8ec4c000 8ec4dad0 c0380000 8045b05c
>> [   11.038637] Hi    : 00000000
>> [   11.041542] Lo    : 000005dc
>> [   11.044459] epc   : 8045b054 ingenic_usb_phy_power_on+0x10/0x4c
>> [   11.050418] ra    : 8045b05c ingenic_usb_phy_power_on+0x18/0x4c
>> [   11.056363] Status: 10000c03 KERNEL EXL IE
>> [   11.060575] Cause : 80800008 (ExcCode 02)
>> [   10.977233] BadVA : 00000014
>> [   10.980139] PrId  : 3ee1024f (Ingenic XBurst)
>> [   10.984519] Modules linked in: ingenic_drm(+) dw_hdmi dm9000 gpio_ir_recv drm_kms_helper dwc2(+) gpio_keys mii pvrsrvkm_jz4780_sgx540_130 syscopyarea nvmem_jz4780_efuse rtc_pcf8563 sysfillrect sysimgblt fb_sys_fops drm drm_panel_orientation_quirks ipv6 autofs4
>> [   11.007710] Process systemd-udevd (pid: 1298, threadinfo=d81e60f6, task=be49d30b, tls=77e84790)
>> [   11.016463] Stack : 8ed66080 00000001 00000000 00000000 00000001 00000000 8fae6200 8045a7b8
>> [   11.024879]         8ed66080 8048eb04 8ed66080 8f829500 00000000 8ed66080 8ecb7700 c036e894
>> [   11.033302]         c0390000 80087a44 c0380000 c036f084 8ed66080 8ed66080 80087a10 8fa35400
>> [   11.041718]         c0380000 c036f0a0 8eb9e210 c0385d98 00000024 00000000 00000080 8fa39880
>> [   11.050133]         8ed66080 80a0f0c0 00000001 00000001 8fa39980 31c729d8 8fa35410 c038b354
>> [   11.058551]         ...
>> [   11.061025] Call Trace:
>> [   10.976129] [<8045b054>] ingenic_usb_phy_power_on+0x10/0x4c
>> [   10.981743] [<8045a7b8>] phy_power_on+0x94/0x114
>> [   10.986519] [<c036e894>] dwc2_lowlevel_hw_enable+0xf0/0x130 [dwc2]
>> [   10.992902] [<c036f0a0>] dwc2_driver_probe+0x514/0x9f4 [dwc2]
>> [   10.998799] [<804e3a6c>] platform_drv_probe+0x58/0xb4
>> [   11.003891] [<804e2380>] really_probe+0x1f0/0x470
>> [   11.008630] [<804e1b14>] driver_probe_device+0x1d8/0x224
>> [   11.013977] [<804e1dc8>] device_driver_attach+0x6c/0x94
>> [   11.019237] [<804e1f0c>] __driver_attach+0x11c/0x138
>> [   11.024250] [<804df818>] bus_for_each_dev+0x70/0xc0
>> [   11.029162] [<804e0ac0>] bus_add_driver+0x110/0x1f0
>> [   11.034067] [<804e2a30>] driver_register+0xcc/0x120
>> [   11.038974] [<80010e30>] do_one_initcall+0xb8/0x298
>> [   11.043882] [<800c7910>] do_init_module+0x74/0x204
>> [   11.048701] [<800c61e4>] load_module+0x139c/0x1934
>> [   11.053519] [<800c6974>] sys_finit_module+0xb0/0xe0
>> [   11.058429] [<80022498>] syscall_common+0x34/0x58
>> [   10.975779] Code: afbf001c  afb00018  8c900040 <0c1285b7> 8e040014  10400009  8fbf001c  3c05809e  8e040008
>> [   10.985591]
>> [   10.989159] ---[ end trace 3424477db7f6dae6 ]---
>> [   10.997115] Kernel panic - not syncing: Fatal exception
>> [   11.002439] Rebooting in 10 seconds..
>> 
>> Do we have to specify some power controller in DTS for using ingenic_usb_phy_power_on()?
> 
> 
> Emmm, I haven't encountered this problem when testing on CU1000-Neo and CU1830-Neo, neither of these two boards has "CONFIG_POWER_SUPPLY" set. Mybee you can try to unset this configuration in CI20? If it works, it probably means that we should still do some work related to power supply.

I think I have found it: a call to phy_set_drvdata() is missing to match phy_get_drvdata() in ingenic_usb_phy_power_on().

Now, I just have to remove the jumper to use the Mini-USB port in peripheral mode with RNDIS/g_ether.
And I have to replug it to make use the USB-A host port for e.g. a memory stick.
Both directions and sockets now work! Thanks!

Maybe it would work with a Mini-USB-OTG cable but I haven't found mine (is quite a while that I had used a device with Mini-USB-OTG plug).

So this is IMHO a good driver and setup ready for some more testing and upstreaming!

Next will be to find out how to make the other USB-A host port work. Maybe needs EHCI/OHCI driver setup. And a different PHY.

For my setup with a portable 7 inch HDMI display with touchscreen it would be the ideal port to power the panel (already works) and handle the touch screen and have the OTG port still available.

BR and thanks,
Nikolaus


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-PHY-Ingenic-add-missing-call-to-phy_set_drvdata.patch
Type: application/octet-stream
Size: 875 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20200922/3d122345/attachment.obj>
-------------- next part --------------




More information about the Letux-kernel mailing list