Commit Graph

615319 Commits

Author SHA1 Message Date
William Wu
323ccc3640 usb: dwc3: rockchip: fix rk3399 dwc3 host power on fail
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>
2019-02-12 15:22:27 +08:00
William Wu
b2c584c65b dt-bindings: usb: dwc3: add needs-reset-on-resume property
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>
2019-02-12 15:22:07 +08:00
XiaoDong Huang
f9d77e7b33 arm64: dts: rockchip: rk1808: support cpu idle
Change-Id: Ic72e2f01e81c0e8853b90158675092595973b94a
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2019-02-12 09:55:16 +08:00
Yifeng Zhao
6dfc7913e7 drivers: rk_nand: support SKHynix 14nm 2D 16GB Nand Flash
support SKHynix 14nm 2D 16GB NAND FLASH H27TDG8T2D8R.

Change-Id: Ic465d325e6660cf1dc6db686391005529dd8fbeb
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-02-12 09:30:03 +08:00
Yifeng Zhao
f7468ce49e drivers: rk_nand: fix the exception of f2fs execution discard function
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>
2019-02-12 09:29:48 +08:00
Wyon Bi
bc4c7f125e ARM: dts: rockchip: rk3288: assign clock rate for ACLK_VIO0 and ACLK_VIO1
Change-Id: I87fbbe3e043b040f8b9b9c79f21a8327b8e32bd0
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-01 17:03:07 +08:00
Xing Zheng
fb55546177 ARM: dts: rockchip: enable 2 micbias properties for rk3308 amic boards
Change-Id: I163f1a09cdaf9e9b4e6bb4c0d78e8a9af72acfa9
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-01 11:51:37 +08:00
Xing Zheng
fa272563f2 arm64: dts: rockchip: enable 2 micbias properties for rk3308 amic boards
Change-Id: I183025bebe9c6d041c7a883ab4c2ae06fe8f82ca
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-01 11:51:32 +08:00
Xing Zheng
9c163ef822 ASoC: rk3308_codec: Add the range of MICBIAS voltages
Change-Id: Ie9d1d4fc8854cc4111cbb1a324525f849c5c470a
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-01 11:51:21 +08:00
Xing Zheng
fdff04d652 ASoC: rk3308_codec: Add controls for main MICBIAS switch
Change-Id: I8a2a113df7fd427634e1a1f81632725d7d4ecdc0
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-01 11:51:16 +08:00
Xing Zheng
bfcfeef064 ASoC: rk3308_codec: Add controls for MICBIAS1 and MICBIAS2 Switch
Change-Id: I64dcc55a993e00eee91a6fdf9ec6cd18ef40d3e1
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-01 11:51:10 +08:00
Xing Zheng
c22df0a44e dt-bindings: sound: rk3308_codec: rename internal-micbias to rockchip,micbias1(2)
Change-Id: I2302100c4b4ebf1e4a38db8a3949c7dcbfaad711
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-01 11:51:05 +08:00
Xing Zheng
55aebfa23b ASoC: rk3308_codec: To clairfy micbias1 and micbias2
Change-Id: I38ce7b06ff265213908e45edcda38f146e78a736
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-01 11:50:59 +08:00
Xing Zheng
1feeff8758 ASoC: rk3308_codec: Clean up ADC MIC gains
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>
2019-02-01 11:50:42 +08:00
Xing Zheng
5f13e3c4ea ASoC: rk3308_codec: Clean up the order of enable_micbias by alphabetically
Change-Id: I35cd9fc3e237b5abd6c9a81099b3a35a01f427c0
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-01 10:56:39 +08:00
Shengfei Xu
eefa54c0db mfd: rk808: restore the OTP value to POWER_EN register of rk817/rk809
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>
2019-02-01 10:29:53 +08:00
Wyon Bi
e57a003936 ARM: dts: rockchip: rk3288-th804-avb: assign clock parent for DCLK_VOP0 and DCLK_VOP1
Change-Id: Ibfaf29a1f78c0fbfd538dc8bc2bc97075b77849e
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-01 09:11:52 +08:00
Wyon Bi
466b1dd984 ARM: dts: rockchip: rk3288-evb-android-rk808-edp-avb: assign clock parent for DCLK_VOP0 and DCLK_VOP1
Change-Id: I8712a64b56d7da9033e798e3dbfb435a70972b88
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-02-01 09:11:30 +08:00
Joseph Chen
af6ef89d6f arm64: dts: rockchip: set pwm regulator in default voltage for rk3308k
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>
2019-01-31 18:32:40 +08:00
Joseph Chen
c57746b0bb dt-bindings: suspend: rk3308: add pwm regulator voltage state configure
Change-Id: I7f90cb93c1bd82def832aa930daa0de4983af90e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-31 18:30:07 +08:00
Wang Panzhenzhuan
0133c23808 ARM: rockchip_defconfig: enable CONFIG_VIDEO_ROCKCHIP_ISP1
Change-Id: I2855147084ae062a030271fd587992e45d43ff60
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2019-01-31 18:29:46 +08:00
Finley Xiao
b3863a4e19 arm64: dts: rockchip: rk3368: Modify vop-bw-dmc-freq for rk3368-xikp
Change-Id: I38154474748e2e8156bbc76c03cc2efbf9c24e11
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-01-31 14:24:36 +08:00
Elaine Zhang
4e4c56833d mfd: rk808: init CLK32KOUT func for rk818
Change-Id: I1e5c261233c08dcbae29a543029fe6455044b9a4
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-01-30 18:42:38 +08:00
Elaine Zhang
f976947cbc ARM: dts: rockchip: rk3288: Add ACLK_GPU init clk freq
Change-Id: I247d4e01b12d90f462b2b4092e9be3b39dd5ed2f
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-01-30 17:42:01 +08:00
Finley Xiao
783e72e661 arm64: dts: rockchip: rk3368: Add devfreq property for display_subsystem
Change-Id: Ic69f578f35cf0adce188297594bbd2445dcb3131
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-01-30 11:55:38 +08:00
William Wu
f2a2b34e45 usb: dwc3: rockchip: use async_schedule for initial dwc3
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>
2019-01-30 11:25:15 +08:00
Wenping Zhang
ba4f1b7e41 ARM64: dts: rockchip: add voltage restriction during high temperature for rk3399K.
Change-Id: If0c3f6529cb234620cca22630c7bf575c6491c4a
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2019-01-29 19:04:51 +08:00
wu jingchen
05702a1e17 arm64: dts: rockchip: px30-evb-ddr3-v10: Separate android firmware
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>
2019-01-29 16:42:53 +08:00
Wenping Zhang
ed50fb143d drivers: cpufreq_interactive: enable the boost function of mouse device.
Change-Id: I33bb569cb4abc2a5f0602a6fccfa29bc3d8de274
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2019-01-29 14:27:00 +08:00
William Wu
e192640666 arm64: dts: rockchip: increase atomic coherent pool size for rk3399/rk3328
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>
2019-01-29 10:34:12 +08:00
Finley Xiao
06165d2e65 arm64: dts: rockchip: rk3308: Set suspend frequency to 408MHz for rk3308k
Change-Id: Idfc2ed6c3c1be8579caae144835904a41b0b03f7
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-01-28 14:39:30 +08:00
Finley Xiao
7175d2320b cpufreq: dt: Implement rockchip_cpufreq_suspend()
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>
2019-01-28 14:39:07 +08:00
Finley Xiao
596651a047 soc: rockchip: opp_select: Add rockchip_cpu_suspend_low_temp_adjust()
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>
2019-01-28 14:33:33 +08:00
Jianhui Wang
27f039b43a arm64: dts: rockchip: rk3399-sapphire-excavator-edp: modify sound adapter
HDMI sound use i2s2 & dp sound use spdif

Change-Id: Id4ee15d3eb67dad1372f733ecf16182cc6488835
Signed-off-by: Jianhui Wang <wjh@rock-chips.com>
2019-01-25 15:35:13 +08:00
Jianhui Wang
8ea4ee1c3e ASoC: rockchip: cdndp: use spdif for dp output
Change-Id: I23b3e58ad361ad026e836dc19e1f727c350046f1
Signed-off-by: Jianhui Wang <wjh@rock-chips.com>
2019-01-25 15:32:32 +08:00
Jianhui Wang
b104ddfbbe ASoC: rockchip: cdndp: add support for 176.4k & 192k
Change-Id: I5881829fe29729784d1f16d918f932062664b961
Signed-off-by: Jianhui Wang <wjh@rock-chips.com>
2019-01-25 15:31:50 +08:00
Wenlong Zhuang
5fb2a5cdd2 media/cif: ignore CSI error interrupt when CSI HOST work on DSI RX mode
Only remain PHY error and crc error interrupt.

Change-Id: I8b2690e25c76728c7d3356d9ae69719b56754b55
Signed-off-by: Wenlong Zhuang <daisen.zhuang@rock-chips.com>
2019-01-25 14:21:21 +08:00
Elaine Zhang
aa34d0fe71 clk: rockchip: Modify uart frac divider rule
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>
2019-01-25 14:12:36 +08:00
Elaine Zhang
49c8309d05 clk: fractional-divider: Improve fractional divider jitter
Numerator is greater than 4,the clk jitter is better.

Change-Id: I9fda9ddeb7b26c6b8559b4126e2ad1d29bb850d1
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-01-25 14:12:26 +08:00
Jianqun Xu
07e28b187d drm/rockchip: select DEBUG_FS for ROCKCHIP_DRM_DEBUG
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>
2019-01-24 15:40:25 +08:00
David Wu
b24c62307b iio: adc: rockchip_saradc: Just get referenced voltage once at probe
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>
2019-01-24 15:40:04 +08:00
Yiqing Zeng
5c9731114e media: soc_camera: add camera sensor sc2232
Change-Id: I26e8291d5fd779d7c8cda80921d21aa57d000aac
Signed-off-by: Yiqing Zeng <zack.zeng@rock-chips.com>
2019-01-24 15:39:37 +08:00
Cai YiWei
d899b036e2 media: rockchip: isp1: del nonsupport yuv format
from isp specification, only semi-planar with
uv swap.

Change-Id: I3fc713cd6cbab1e12a94d7b8144d7d43a6de5530
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2019-01-24 14:49:26 +08:00
Cai YiWei
2c61995140 media: rockchip: isp1: fix sp rgb output format
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>
2019-01-24 14:49:15 +08:00
Cai YiWei
ac0c5d3dc3 media: i2c: gc2145 add mipi interface
Change-Id: Ie7ee430c6d34b935f1e9e270d50b2a42b726ef1a
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2019-01-24 14:49:02 +08:00
Cai YiWei
5c6258197f media: i2c: imx323 change to low 10bit output
Change-Id: I053b15f7dc0bd3ca393957d6d23f91752392cb7d
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2019-01-24 14:48:36 +08:00
Cai YiWei
89c354e3b7 media: rockchip: isp1: fix dvp data width config
Change-Id: If90968fbae78fadaf99d68766606143f1f4f2208
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2019-01-24 14:48:36 +08:00
zack.zeng
7b1fb3919b media: soc_camera: add mono sensor sc031gs
Change-Id: I6b3e376d905895ad9fef4364184b201da5f873cc
Signed-off-by: Yiqing Zeng <zack.zeng@rock-chips.com>
2019-01-24 14:47:38 +08:00
Hu Kejun
f944fd08f6 media: rk-isp10: add api mutex for multi-thread app
Change-Id: If2f8600a5f6cdf57bc3859b81a68539bb2d05a84
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-01-24 14:28:44 +08:00
Hu Kejun
60edcb0765 media: rk-isp10: add control for clear exposure list
Change-Id: I57aae7bfcf54d0055b63824fb608e6beb621e974
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-01-24 14:28:30 +08:00