RK3399 Excavator Board has an USB 3.0 PHY power on issue
when Type-A USB 3.0 Host port connects with an USB 3.0
device and do system PM suspend/resume test.
When the issue happens, we gets the following error log:
phy phy-ff800000.phy.4: phy poweron failed --> -110
dpm_run_callback(): platform_pm_resume+0x0/0x54 returns -110
PM: Device fe900000.dwc3 failed to resume: error -110
xhci-hcd xhci-hcd.12.auto: port 0 resume PLC timeout
It's because that the Type-C PHY docs say that the DWC3
controller "needs to be held in reset to set the PIPE
power state in P2 before initializing the Type-C PHY",
but actually the PIPE is in P0 state because an USB 3.0
device is connected, and the current code doesn't reset
the DWC3 controller upon PM resume.
This patch prevents powering off the USB 3.0 PHY of
RK3399 Type-A USB 3.0 Host port when system enters
syspend. As a side effect, the power consumption in
standby mode will increase. However, if you want to
optimize the power consumption in standby mode and
allow the USB device to be reenumerated upon PM resume,
you can add a property "needs-reset-on-resume" in
DWC3 DTS like this:
&usbdrd3_1 {
needs-reset-on-resume;
};
Change-Id: Ia1cdf6e09cac520e99931a15423b8de7be2ba52b
Signed-off-by: William Wu <william.wu@rock-chips.com>
This patch adds a new property "needs-reset-on-resume" for
Rockchip DWC3 IP. We can use it if we want to reset the DWC3
controller upon PM resume.
Change-Id: I8ae7f8fe46388cdc9e265e758d9edeb82840d284
Signed-off-by: William Wu <william.wu@rock-chips.com>
If the discard_granularity of the NAND flash block device has not
been initialized, then the DM device will not set max_discard_sectors
while it is created,and f2fs will have exceptions when it performs
the discard function.
bug:
WARNING: at fs/f2fs/segment.c:1212
[ 28.075747] Hardware name: Rockchip rk3326 863 avb board (DT)
[ 28.075767] task: ffffffc03b08d100 task.stack: ffffffc02f0b4000
[ 28.075802] PC is at __submit_discard_cmd+0x1b4/0x4ec
[ 28.075840] LR is at __issue_discard_cmd+0x1b8/0x248
[ 28.075859] pc : [<ffffff800831f218>] lr : [<ffffff800831f8d0>] pstate: 60400145
[ 28.075874] sp : ffffffc02f0b7be0
Change-Id: I940728a675e7a30a05742bf2a7dcace92f7a2354
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
From the TRM, the MIC PGA gains for 8 ADCs:
- version A:
0dB, 20dB
- version B:
0dB, 6.6dB, 13dB, 20dB
Change-Id: I9cf758708ec80afe06340f48a2f71f24654f36fe
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
rk817/rk809 must restore the PMIC_POWER_EN OTP value before the system reboot.
Change-Id: I2ccfbb4d47eb41cdcea048111873b6ab85477d64
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
rk3308k supports wide temperature feature, it makes system suspend
stable in extrem low temperature.
Change-Id: I07427c21263e5a48bc07c935291f8494e50ec9e3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
The dwc3_rockchip_probe() spends lots of time to initialize
the dwc3 host and pm runtime. It significantly lengthen the
boot time.
I test on RK3399 Excavator Board, the execution time of the
dwc3_rockchip_probe() on Type-C0 is about 220ms without this
patch (Type-C0 connect to PC USB port at the same time). Most
of the time is spent on remove hcd(~16ms) and pm runtime
suspend (~180ms).
1. remove hcd (~16ms)
When do usb_remove_hcd(), the xHCI should wait 16ms to
enter the stopped state with the following log:
xhci-hcd xhci-hcd.11.auto: Host not halted after 16000 microseconds
2. pm runtime suspend (~180ms)
Race condition is observed during pm runtiem suspend.
CPU0 CPU1
---- ----
rockchip_chg_detect_work() pm_runtime_suspend
-> mutex_lock(&rport->mutex) -> dwc3_runtime_suspend()
|| -> dwc3_suspend_common()
\/ -> dwc3_core_exit()
USB_CHG_STATE_UNDEFINED -> phy_power_off(dwc->usb2_generic_phy)
|| -> rockchip_usb2phy_power_off()
\/(100ms) -> wait for rport->mutex
USB_CHG_STATE_WAIT_FOR_DCD .
|| .
\/(40ms) .
USB_CHG_STATE_DCD_DONE
||
\/(40ms)
USB_CHG_STATE_PRIMARY_DONE
-> mutex_unlock(&rport->mutex)
-> mutex_lock(&rport->mutex)
This patch runs the remove hcd operation and pm runtime
suspend in an async_domain to speed up the boot time. With
this patch, the dwc3_rockchip_probe() spends only ~12ms.
Change-Id: Ic60774e5c3e7be9f718c18ade86b2d95a9134b4c
Signed-off-by: William Wu <william.wu@rock-chips.com>
Split DT source files to separate out android firmware for Android Pie & Oreo
Change-Id: Ib16858996e236bb292bc380c0fddea2f5213c15b
Signed-off-by: wu jingchen <oven.wu@rock-chips.com>
The Seagate Expansion Portable Drive HDD (ext4 file system,
idVendor=0bc2, idProduct=2321) is reported to fail to work
on the rk3399/rk3328 platforms USB 3.0 interface with the
following error message when do read/write operation by dd
command:
xhci-hcd xhci-hcd.11.auto: Ring expansion failed
It's because that xHCI use the dma_pool_alloc() to allocate
DMA buffer for segment_pool with GFP_ATOMIC flag, however,
the default 256 KiB coherent pool is too small for the USB
HDD, so increase it to 1024 KiB to make sure that devices
will be able to allocate their DMA buffers with GFP_ATOMIC
flag.
Change-Id: Ic94c9ceeeb4adabe860af46546550aa8f73f11ca
Signed-off-by: William Wu <william.wu@rock-chips.com>
Set CPU voltage to low temperature voltage before system suspend,
so that it can resume successfully at low temperature.
Change-Id: Ib9ab16558ff69ea80e862473ef9ec6bfa7cd61ad
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
If support wide temperature, it necessary to set voltage to low temperature
voltage before system suspend, so that it can resume successfully at low
temperature.
Change-Id: Ie6787092c9510788054217bd830b5ae1e4dd6bc2
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Because uart does not have high requirements
for the clk Jitter, the fractional frequency
divider does not need to meet the 20-fold relationship.
(If uart clk rate < 24M,Use 24M as the fractional
clock source.)
Change-Id: I3f55f8a4ba5dc4c950c2742dc914c41e7b6e4ee6
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Numerator is greater than 4,the clk jitter is better.
Change-Id: I9fda9ddeb7b26c6b8559b4126e2ad1d29bb850d1
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
ROCKCHIP_DRM_DEBUG will call API from debugfs, need to select DEBUG_FS.
Change-Id: I06a7c7c2ce9179796e551727fdd2e08313bfe6ff
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
The referenced voltage is not changed after initiation, so just only
get referenced voltage once.
Change-Id: I1eeab03f68855fafe010db328ec7bbcfa7d52310
Signed-off-by: David Wu <david.wu@rock-chips.com>
from isp specification, only semi-planar with
uv swap.
Change-Id: I3fc713cd6cbab1e12a94d7b8144d7d43a6de5530
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
sp rgb888 format is bgrx 32bit in memory, change to BGRX.
sp rgb666 format is 2bit unused + 6bit data as b/g/r,
append 1bits unused, 32bit in memory, no V4L2 format
apply to it, so delete it.
Change-Id: Iff8c2e560030d76b26d81faff19a3bd49ca33643
Signed-off-by: Cai YiWei <cyw@rock-chips.com>