Commit Graph

847460 Commits

Author SHA1 Message Date
Tao Huang
c653aafaf9 video: rockchip: remove unused vcodec driver
Change-Id: Ibc186e02c2e3d390056fd79066e27af61233798e
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-11-18 15:25:12 +08:00
Tao Huang
79a601c2be arm64: rockchip_defconfig: enable CPU_FREQ_STAT and CPU_FREQ_TIMES
Change-Id: I0fa41814e2501cff95fc2e743725b0635b2503d5
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-11-18 15:24:44 +08:00
Tao Huang
f44b4ac6a0 ARM: rockchip_defconfig: enable CPU_FREQ_STAT and CPU_FREQ_TIMES
Change-Id: I8dd538d0c55bfbfc71f10af56645b13796390ec6
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-11-18 14:35:38 +08:00
Tao Huang
316a419908 ARM: rockchip_defconfig: cleanup by savedefconfig
Change-Id: I7219025f62661c886e4cb287a05cfc30e85211a8
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-11-18 14:31:53 +08:00
Tao Huang
cdc6f7d0b0 media: remove unused video drivers
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ic8d08dc1c2e41a97fd1baf874efaa05f9b5de9d9
2019-11-18 14:13:42 +08:00
Sandy Huang
5dad1298c3 drm/rockchip: vop: reset 10bit config after exit 10bit video
Change-Id: I4bf0a68c7f851e745607901ff2cf426902edf467
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-11-18 14:12:01 +08:00
Sandy Huang
c28375d507 drm/rockchip: vop: use pm_runtime_put_sync
Change-Id: Id1a67096a12518c24f6cf7a548fe78cf40fa25e1
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-11-18 14:04:56 +08:00
Zhen Chen
a803fa6605 Mali: utgard: fix memory(fences) leaks
In deed, Zhixiong Lin missed these codes when he picking source codes
from DDK r9 to port utgard device driver of r7 to kernel 4.19.

Change-Id: If140b478b4ea8a4f72d532b8e8216ab53856be08
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2019-11-18 09:10:15 +08:00
Wang Panzhenzhuan
1e178b2030 arm64: dts: rk3399-evb-ind-lpddr4-android: add camera configs
Change-Id: Ie0d008eb3ef839ff526c242e2412fbf879268659
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2019-11-15 19:13:48 +08:00
Ding Wei
1bbea0db47 video: rockchip: mpp: fix error when queue_work
When different devices are running, there will be use wrong
device to deal with task.The reasion is that the true device
is task->queue->mpp.

Change-Id: I8fe4dd59d2525f02d010b32299ee0b82815d210a
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2019-11-15 14:00:22 +08:00
Wyon Bi
6f86fc8c00 drm/rockchip: cdn-dp: Reject non-32-bits-aligned mode widths
Change-Id: I8f6b94baef9fd5db2090e36dc8974769b7d469f7
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-11-15 08:52:28 +08:00
Wenping Zhang
43fd724887 drm/rockchip: cdn_dp: fix issue 1 lane dp device can't output audio.
Change-Id: Ic148a2c5a5bf12ded9f83201d9a4dffe406b4e3f
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2019-11-15 08:52:22 +08:00
Wang Jie
8c51e8bb0e arm64: dts: rockchip: modify rk3399-evb-ind.dtsi.
modify the layout value of mpu6500 and ak8963.

Change-Id: I2968a71343ad2c004690b6cd9ecab4e900ba320b
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
2019-11-14 19:24:57 +08:00
Weiguo Hu
0e3aed9b03 net: rockchip_wlan: add rtl8822bs driver: v5.8.7_35628.20191031_COEX20190625-7272
Change-Id: If9d481a4873d7bd3b6255f0d68723374281f73ee
Signed-off-by: Weiguo Hu <hwg@rock-chips.com>
2019-11-14 19:23:17 +08:00
Nick Bray
008704c50f ANDROID: initramfs: call free_initrd() when skipping init
Memory allocated for initrd would not be reclaimed if initializing ramfs
was skipped.

Bug: 69901741
Test: "grep MemTotal /proc/meminfo" increases by a few MB on an Android
device with a/b boot.

Change-Id: Ifbe094d303ed12cfd6de6aa004a8a19137a2f58a
Signed-off-by: Nick Bray <ncbray@google.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-11-14 19:17:07 +08:00
Rom Lemarchand
79f3326944 ANDROID: initramfs: Add skip_initramfs command line option
Add a skip_initramfs option to allow choosing whether to boot using
the initramfs or not at runtime.

Change-Id: If30428fa748c1d4d3d7b9d97c1f781de5e4558c3
Signed-off-by: Rom Lemarchand <romlem@google.com>
Signed-off-by: Dayao Ji <jdy@rock-chips.com>
2019-11-14 19:17:07 +08:00
Ding Wei
7f124ab617 arm64: dts: rockchip: rk3328: dtsi for video codec
Change-Id: I08b2be091c85a4ccf005f835da09657df66f815b
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2019-11-14 17:04:34 +08:00
Ding Wei
9dc4984769 video: rockchip: mpp: clear cache before run hardware
Change-Id: Ifbac051031433106c26de82d1fe691e5b7ac2429
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2019-11-14 17:04:14 +08:00
Zhen Chen
69c7c17655 MALI: rockchip: upgrade bifrost DDK to r21p0-01rel0, from r20p0-01rel0
Change-Id: Ibdb2508859f24df1014fc485097685bcecb7b31b
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2019-11-14 11:38:21 +08:00
Sandy Huang
6704c0590d drm/rockchip: vop: fix plane number calc error
before this commit, the plane number to dmc is error, this
will lead to DDR freq is too low and lead to display splash.

Change-Id: Iaa285b36d41b6e86c97260ac83c5d9a21ef62a05
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-11-14 11:37:34 +08:00
William Wu
b43b8174c1 usb: gadget: composite: fix dead lock when uvc disconnect
When test uvc hotplug, it may caused a dead lock in the
following case:

1. Test on Rockchip platforms used USB DWC2 controller.
2. Set USB as UVC gadget and connect to PC.
3. Open UVC to preview picture, and then disconnect USB.

Then a dead lock happens.

1. usb_function_deactivate() hold the cdev->lock;
2. usb_function_deactivate() --> usb_gadget_deactivate()
   --> usb_gadget_disconnect() --> dwc2_hsotg_disconnect()
   --> composite_disconnect() try to get the cdev->lock again.

According to the comment for cdev->lock, it's used to protect
deactivations and delayed_status count, so we can drop the
spinlock safely before do usb_gadget_deactivate(), and hold
the spinlock again after usb_gadget_deactivate() done to
protect the deactivations.

Change-Id: I24310434f0a11f9e981817de5e31b36cdbad7344
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:17:26 +08:00
Zain Wang
78bbe26092 dt-bindings: phy-rockchip-inno-usb2: add wakeup-source property for u2phy
Change-Id: I4a7e5ec96a4244ee74f9560baacc1d25bf451c5c
Signed-off-by: Zain Wang <wzz@rock-chips.com>
2019-11-14 11:17:26 +08:00
Zain Wang
c34ee93382 phy: phy-rockchip-inno-usb2: add force IRQ wakeup control
Some chips like rk3328 not support wakeup-config in dts,
So we should set wakeup IRQ enable in driver if we need
new wakeup source.

Change-Id: I735eee54bb4943b8c85a9a477f1cf9d255fc4312
Signed-off-by: Zain Wang <wzz@rock-chips.com>
2019-11-14 11:17:26 +08:00
William Wu
2249412583 usb: gadget: f_uac1: add iad descriptor
According to the spec "USB Interface Association Descriptor Device
Class Code and Use Model"[1], the Interface Association Descriptor
(IAD) is needed for composite device which has multiple interfaces
controlled independently of each other. Without the IAD, the device
may not work as expected because the USB system software will not
properly bind the interfaces with drivers (e.g UAC1 && UVC composite
device not recognized in Win10).

[1] https://www.usb.org/sites/default/files/iadclasscode_r10.pdf

Change-Id: I446c771fe182bd556a054d9ae0ada1374442d1d0
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:17:26 +08:00
William Wu
503cd7b1b7 usb: dwc3: gadget: support to resize TxFIFOs dynamically
We need to dynamically resize the TxFIFOs for some cases
where the default values don't match.

Test on RK1808-stick board, configurate the usb with four
functions "rndis, ntb, mass_storage, acm", the default
values of TxFIFOs is:

GTXFIFOSIZ(0) = 0x00000042
GTXFIFOSIZ(1) = 0x00420184
GTXFIFOSIZ(2) = 0x01c60184
GTXFIFOSIZ(3) = 0x034a0184
GTXFIFOSIZ(4) = 0x04ce0184
GTXFIFOSIZ(5) = 0x06520184
GTXFIFOSIZ(6) = 0x07d6002a

The ep6-in is used for acm ep-in which maxpacket is 1024B,
but the default fifo size of ep6-in is only 336B, less than
the length of the ep maxpacket, it cause acm works abnormally.

This patch creates a simple function to allocate enough TxFIFO
space for each of the enabled endpoints.

Change-Id: I389ffdba4f3721ed6ef192f0c85f41fdeff645ce
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:17:26 +08:00
William Wu
268d32fef4 dt-bindings: usb: dwc3: add a property to resize tx fifo
This patch adds a new property "snps,tx-fifo-resize" to
enable resize the TxFIFOs dynamically.

Change-Id: I0714b8a5b3a7f461ae0527c99729db8cf202e066
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:17:26 +08:00
William Wu
3f2358d458 usb: dwc3: gadget: avoid multiple calls to free_irq
When we use /sys/class/udc/<udc>/soft_connect to do
a logical disconnection from the USB Host on RK3399
Excavator Board, it dumps the warning log:

Trying to free already-free IRQ 231
WARNING: CPU: 2 PID: 1308 at kernel/irq/manage.c:1628 __free_irq+0xa0/0x2e0
Modules linked in:
CPU: 2 PID: 1308 Comm: adbd Not tainted 4.19.80 #49
Hardware name: Rockchip RK3399 Excavator Board edp avb (Android) (DT)
pstate: 40400085 (nZcv daIf +PAN -UAO)
pc : __free_irq+0xa0/0x2e0
lr : __free_irq+0xa0/0x2e0
...
Call trace:
__free_irq+0xa0/0x2e0
free_irq+0x38/0x90
dwc3_gadget_stop+0x58/0x80
usb_gadget_remove_driver+0x50/0x70
usb_gadget_unregister_driver+0xc0/0x110
unregister_gadget+0x20/0x50
unregister_gadget_item+0x24/0x38
ffs_data_clear+0x120/0x130
ffs_data_reset+0x14/0x50
ffs_data_closed+0x88/0xd8
ffs_epfile_release+0x20/0x30

To solve the problem, don't call free_irq() in
dwc3_gadget_stop() if dwc->gadget_driver is NULL.

Change-Id: I9d5b5b354612c3ce3677b3d15cf6af1fcbf3f399
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:17:26 +08:00
William Wu
b7d5426deb usb: gadget: uvc: support streaming bulk transfer
This patch adds bulk endpoint for uvc to be used as
video streaming transfer. By default, the uvc gadget
still uses isoc endpoint for video streaming.

The important difference between the bulk and isoc
method is that, alt-settings in a video streaming
interface are supported only for isoc endpoints as
there are different alt-settings for zero-bandwidth
and full-bandwidth use-cases, but the same is not
true for bulk endpoints, as they support only a single
alt-setting.

How to use:
1. Enable the bulk transfer:
   echo 1 >  /config/usb-gadget/g1/functions/uvc.name/streaming_bulk

2. Disable the bulk transfer:
   echo 0 >  /config/usb-gadget/g1/functions/uvc.name/streaming_bulk

3. Testing the uvc bulk function transfer:
   device: run the uvc-gadget program
   # uvc-gadget -b -u /dev/video<uvc video node #> -v /dev/video<vivid video node #>

   where uvc-gadget is this program:
        http://git.ideasonboard.org/uvc-gadget.git

   with these patches:

        http://www.spinics.net/lists/linux-usb/msg99220.html

Change-Id: Ifedfe3f5c4354dd2bdf07382290107e9bcc89f59
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:17:26 +08:00
William Wu
dc70652f46 usb: gadget: f_uac2: fix some issues for Windows recognized
We find that the UAC2 gadget can't be recognized on Windows 10.
It's because that the descriptors of UAC2 doesn't meet the
requirements of Windows.

According to the USB Audio 2.0 Drivers of Windows [1], if the
bmAttributes of OUT-EP in the audio stream interface is set
to asynchronous (use USB_ENDPOINT_SYNC_ASYNC), then a feedback
endpoint must be implemented in the respective alternate setting
of the AS interface. The Windows driver does not support implicit
feedback.

However, it's difficult to implement the feedback endpoint now.
So the patch changes the bmAttributes of OUT-EP to adaptive, and
changes the bmAttributes of IN-EP to synchronous at the same time.

This patch also sets the wTerminalType of terminal descriptor to
microphone and speaker by default.

With this patch, we also fix the wTotalLength of the ac_hdr_desc.

[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/audio/usb-2-0-audio-drivers

Change-Id: I3597d5f321235fcbce56dbfbfe95172d02e58892
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
Andreas Pape
01c1d8f735 UPSTREAM: usb: gadget: f_uac2: disable IN/OUT ep if unused
Via p_chmask/c_chmask the user can define whether uac2 shall support
playback and/or capture. This has only effect on the  created ALSA device,
but not on the USB descriptor. This patch adds playback/capture descriptors
dependent on that parameter.

Change-Id: I396b4238e6a8f2b4a32a57780acea4f23dc0c081
Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 3fa4eaa6c0)
2019-11-14 11:15:51 +08:00
William Wu
f3db2b6e55 usb: uas: ignore UAS for Seagate Expansion Portable Drive
The Seagate Expansion Portable Drive HDD (idVendor=0bc2, idProduct=2321) is reported to fail to work on rockchip platforms
with the following error message when do read/write operation by dd command:

xhci-hcd xhci-hcd.11.auto: Ring expansion failed

According to tkaiser's suggestion[1], we can try to increase the kernel's
coherent-pool memory size to fix this issue. The kernel coherent-pool memory
size was limited at 256KB by default. When set the DEFAULT_DMA_COHERENT_POOL_SIZE
to 1MB, the error "Ring expansion failed" can be fixed, but it still not
work with the other error message:

xhci-hcd xhci-hcd.12.auto: ERROR Unknown event condition 34 for slot 1 ep 3 , HC probably busted
sd 0:0:0:0: [sda] tag#16 uas_eh_abort_handler 0 uas-tag 17 inflight: CMD OUT
...
scsi host0: uas_eh_bus_reset_handler start
xhci-hcd xhci-hcd.12.auto: ERROR Transfer event for disabled endpoint slot 1 ep 6 or incorrect stream ring

Falling back to USB mass storage can solve this problem, so ignore UAS
function of this HDD.

[1] https://forum.armbian.com/topic/4811-uas-mainline-kernel-coherent-pool-memory-size/

Change-Id: I0d817cc3aaea548c2060b323c3077c6cbbd3bb6e
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
Wu Liang feng
349bb1466b usb: gadget: accessory: add compat_ioctl
Add compat_ioctl for accessory to work on 64-bit platforms.

Change-Id: I805395c35017111bf0c462847f11765c7088d266
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2019-11-14 11:15:51 +08:00
William Wu
ccc5c5b34c usb: gadget: uvc: add compat_ioctl
This allows 32 bit owners of uvc video to make ioctls
into a 64 bit kernel.

All of the current uvc ioctls can be handled with the
same struct definitions as regular ioctl.

Change-Id: Ia31b26147ab619f0673f94b6662eaf181a9eb5dd
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
William Wu
cbb0b7c4f6 phy: rockchip-inno-combphy: avoid reinit usb3 phy
When the combphy work as USB3 PHY (e.g. RK1808 EVB USB3 port),
the PHY init and exit ops are called dynamically in the runtime
process of USB3 controller driver.

Because it only needs to init the USB3 PHY once in the PHY init,
and reinit the USB3 PHY in the runtime process may cause USB3 work
abnormally, so this patch doesn't clear the phy_initialized flag
for USB3 in the PHY exit ops.

Change-Id: Ifc2eb3edac25bd10db6d47b4c9e197cc15c4aef7
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
William Wu
a69578350c usb: storage: add Genesys Logic 05e3:0749 to unusual_devs.h
When test more than three Genesys Logic usb3 storages
(VID : PID = 0x05e3 : 0x0749) on rockchip platforms with
usb3 host port (e.g. rk3328/rk3399) at the same time,

test commands like this:
for dev in `ls /dev/sd?1 | sed -e 's,1$,,'`; do
	echo dd if=$dev of=/dev/null
	dd if=$dev of=/dev/null &
	sleep 1
done

The test fail with the following error log:
xhci-hcd xhci-hcd.9.auto: xHCI host not responding to stop endpoint command.
xhci-hcd xhci-hcd.9.auto: Assuming host is dying, halting host.
xhci-hcd xhci-hcd.9.auto: Host not halted after 16000 microseconds.
xhci-hcd xhci-hcd.9.auto: Non-responsive xHCI host is not halting.
xhci-hcd xhci-hcd.9.auto: Completing active URBs anyway.
xhci-hcd xhci-hcd.9.auto: HC died; cleaning up

This patch sets the max_sectors to 128 (64K) to workaround
this issue, and it doesn't affect the transmission rate.

Change-Id: Idd9cc81659d27c12b142f6c4375558c2262e800d
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
William Wu
e33b4f652b usb: gadget: f_uvc: add extension unit descriptor
Add extension unit descriptor for uvc. Support 3
controls in this extension unit. The rockchip IQ
tool use it to transfer vendor specific control
data.

Change-Id: I219e12616629bc75548b30ce63d46136aeac6561
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
William Wu
e93bc82bf2 usb: quirks: add quirk for Kingston DataTraveler 3.0 with broken LPM
Kingston DataTraveler 3.0 sometime would be disconnected
or not be enumerated successfully by xHCI controller when
LPM was enabled.

This patch adds an USB_QUIRK_NO_LPM quirk for this device.

Change-Id: I8ffa8d46ee242ab9665ce70565df7718b20ca87c
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
William Wu
d0365ad742 dt-bindings: phy: rockchip: add support of rk1808 usb
Support rockchip,rk1808-usb2phy-grf for rk1808 board.

Change-Id: I9f3cc8300bf2653689c07734b81bcf7ff9aac4eb
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
William Wu
a8f399e965 usb: uas: Add JMicron JMS583 and CHIPFANCIER to unusual device
These two devices give the following error on detection.
Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
xhci-hcd xhci-hcd.5.auto: ERROR Transfer event for disabled endpoint
or incorrect stream ring

The same error is not seen when it is added to unusual_device
list with US_FL_NO_REPORT_OPCODES and US_FL_BROKEN_FUA passed.

Change-Id: Ia1035ea597c65ad7112f68f5cbdd792875ee2995
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
William Wu
154e7b74ec usb: gadget: uvc: fix bFrameIndex of streaming interface descriptor
The bFrameIndex of video streaming interface descriptor
is initialized to 1 in uvcg_frame_make(), but never be
setted for different frame resolutions, this cause host
to fail to select the correct frame resolution. This patch
increases the bFrameIndex in order.

Change-Id: Ic0609976e09d9e3d6f82595c00e2ac7b356e4f5f
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
William Wu
9bf1f56462 usb: gadget: f_uac1_legacy: set period size and buffer size
The default period size is only 64 frames, this
will cause usb audio playback with noise via
internal audio codec. This patch sets the period
size to (snd->rate / 10), and also sets the buffer
size to snd->rate.

Change-Id: I4a4eb1b4dd79aec65f5c44eacd8a2fa101dfbd1b
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
William Wu
200de9028d usb: gadget: f_uac1_legacy: disable ep in f_audio_disable()
The f_audio_disable() doesn't disable usb ep, and
this cause usb enumeration fail. So add usb ep
disable operation.

This patch also reinitializes the opts->bound flag
to false in f_audio_free(), and then it can setup
ALSA audio device again in f_audio_bind().

Change-Id: I7b10630f5085b1a03792bc4b9e7eabb02d2bd5a2
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
William Wu
7ce0853813 uvcvideo: add quirk for dev parent with broken auto suspend
If the parent of uvc device has a quirk for broken
auto-suspend function (e.g. rk3328 usb 3.0 root hub),
we also need to disable auto-suspend for the uvc device.

Change-Id: Ida8d05a411f49f39e13cad3ec837a56598b4a630
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
Meng Dongyang
fe8c3cd311 usb: gadget: configfs: send connect detective event when get descriptor
In current code, the connect detective event will be send before the
connect state of controller change. The event is sent when receive
the first setup packet and the connect state of controller is changed
when receive set address command. So if disconnect interrupt trigger
between the first setup packet and set address command, the disconnect
process will not be done, while the application state has been changed
and keep in connected. As a result, the UI may still show the USB connect
option event if the device has been disconnect from PC. This patch send
the connect uevent when get descriptor of configuration which follow
set address command to make sure the application state change after
controller.

Change-Id: Icf2124327db93687b4b644672edb0dbecc8f127a
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2019-11-14 11:15:51 +08:00
Meng Dongyang
6bcccf1b5b dt-bindings: rockchip: usb: Document for px30
Change-Id: I3d1ca71cad98226999dd115f515df4a31b095ee1
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2019-11-14 11:15:51 +08:00
Frank Wang
d92128c853 phy: rockchip: disable commononn for ehci-phy on rk3288
We found that the system was blocked in EHCI when perform suspend or
reboot on RK3288 platform, the root cause is that EHCI (auto) suspend
causes the corresponding usb-phy into suspend mode which would power
down the inner PLL blocks in usb-phy if the COMMONONN is set to 1'b1.

The PLL output clocks contained CLK480M, CLK12MOHCI, CLK48MOHCI, PHYCLOCK0
and so on, these clocks are not only supplied for EHCI and OHCI, but also
supplied for GPU and other external modules, so setting COMMONONN to 1'b0
to keep the inner PLL blocks in usb-phy always powered.

Change-Id: Ifb7f3d233cf72155aa54d20b15a62b683944a526
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2019-11-14 11:15:51 +08:00
Douglas Anderson
23bcddc7ff FROMLIST: phy: rockchip-typec: Try to turn the PHY on several times
Bind / unbind stress testing of the USB controller on rk3399 found
that we'd often end up with lots of failures that looked like this:

  phy phy-ff800000.phy.9: phy poweron failed --> -110
  dwc3 fe900000.dwc3: failed to initialize core
  dwc3: probe of fe900000.dwc3 failed with error -110

Those errors were sometimes seen at bootup too, in which case USB
peripherals wouldn't work until unplugged and re-plugged in.

I spent some time trying to figure out why the PHY was failing to
power on but I wasn't able to.  Possibly this has to do with the fact
that the PHY docs say that the USB controller "needs to be held in
reset to hold pipe power state in P2 before initializing the Type C
PHY" but that doesn't appear to be easy to do with the dwc3 driver
today.  Messing around with the ordering of the reset vs. the PHY
initialization in the dwc3 driver didn't seem to fix things.

I did, however, find that if I simply retry the power on it seems to
have a good chance of working.  So let's add some retries.  I ran a
pretty tight bind/unbind loop overnight.  When I did so, I found that
I need to retry between 1% and 2% of the time.  Overnight I found only
a small handful of times where I needed 2 retries.  I never found a
case where I needed 3 retries.

I'm completely aware of the fact that this is quite an ugly hack and I
wish I didn't have to resort to it, but I have no other real idea how
to make this hardware reliable.  If Rockchip in the future can come up
with a solution we can always revert this hack.  Until then, let's at
least have something that works.

This patch is tested atop Enric's latest dwc3 patch series ending at:
  https://patchwork.kernel.org/patch/10095527/
...but it could be applied independently of that series without any
bad effects.

For some more details on this bug, you can refer to:
  https://bugs.chromium.org/p/chromium/issues/detail?id=783464

Change-Id: I7909731247739694f56bf89ab3064889f2b34d3c
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(am from https://patchwork.kernel.org/patch/10105833/)
2019-11-14 11:15:51 +08:00
William Wu
f33248649a usb: quirks: add device quirk for Sonix FaceBlack device
We found that some Sonix usb cameras(e.g. idVendor=0c45,
idProduct=64ab or idProduct=64ac) can't support auto-suspend
well on rockchip platforms(e.g. rk3399).With auto-suspend,
these usb cameras MJPEG will display abnormally on all usb
controllers(DWC2/DWC3/EHCI). So we need to disable auto-
suspend for these special usb cameras.

Change-Id: I08c87cf5c9fa5ebe076b5dd3e873b74c5ec2cb83
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
William Wu
0c4afad15b usb: quirks: add device quirk for HD Camera PID 0x9320
The commit 62b2a34a21 ("uvcvideo: add quirk for devices
with broken auto suspend") introduced quirk to workaround
an issue with some HD Cameras.

There is one more model that has the same issue - idProduct
=0x9320, so applying the same quirk as well.

Change-Id: I24e3fc1746a9d21d529bc91f52fd5822e998bd93
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-11-14 11:15:51 +08:00
Wu Liang feng
1c31f7e10e uvcvideo: add quirk for devices with broken auto suspend
We found that some usb cameras(e.g. Manufacturer: HD Camera
Manufacturer, idVendor=05a3, idProduct=9230) can't support
auto-suspend well on rockchip platforms. With auto-suspend,
these usb cameras MJPEG will display abnormally on all usb
controllers(DWC2/DWC3/EHCI). So we need to disable auto
suspend for these special usb cameras.

Change-Id: Ibf50ed77edff0012a112dc42f09e022055908829
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2019-11-14 11:15:51 +08:00