Commit Graph

615555 Commits

Author SHA1 Message Date
Hu Kejun
fbdc9e72ee media: spi: rk1608: add enum_frame_size function
Change-Id: Ia27c7f36609d686f724a4d004c54d3c3a4278bac
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-03-27 15:06:30 +08:00
David Wu
73cf9b5fe8 arm64: dts: rockchip: Add spi5 power-domain for rk3399
Change-Id: Id67c805457f4930cea20d8c507700fc21d04d6b0
Signed-off-by: David Wu <david.wu@rock-chips.com>
2019-03-27 11:20:54 +08:00
Nickey Yang
a8b799e15b ARM: dts: rockchip: enable rockchip_suspend for rk3288-linux
Change-Id: I8904510cae68283ba37a1f374c55883f454142d6
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2019-03-27 08:53:09 +08:00
Nickey Yang
fcea069cd4 ARM: rockchip_linux_defconfig: enable ROCKCHIP_SUSPEND_MODE
Change-Id: I4051fc0282b4febbb5b0537e0e34826ace8cf9d8
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2019-03-27 08:52:34 +08:00
Shixiang Zheng
bb9a509def video/rockchip: rga2 add YUV packet format support
Change-Id: I4f096bd1b1edfc90094124ddde25a95862730676
Signed-off-by: Shixiang Zheng <shixiang.zheng@rock-chips.com>
2019-03-26 19:33:08 +08:00
Zefa Chen
9a090b04da dt-bindings: Document add imx258
Change-Id: I486552192ef43213a673db495b9da2f7e444b16c
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
2019-03-26 19:29:54 +08:00
Hu Kejun
84e3920065 media: rockchip: isp1: fix reset on too high isp_clk rate will result in bus dead
Change-Id: I4e99c011a599901dbc1aaba147dcc77df9692fd1
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-03-26 19:05:59 +08:00
Ziyuan Xu
3091608226 arm64: dts: rockchip: fixup vccio3-supply for ai-va-v10
Power **vccio3** was fixed to VCC_IO that is always supply 3.3v, and
it's used as functions pins for sfc/nandc.

Change-Id: I0f5a60ab944a773c1dd254adf1dbc6af16b35403
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2019-03-26 16:32:16 +08:00
Ziyuan Xu
8e4a05cc07 arm64: dts: rockchip: fixup vccio3-supply for evb-v11
Power **vccio3** was fixed to VCC_IO that is always supply 3.3v, and
it's used as functions pins for sfc/nandc.

Change-Id: I928770f34ea30fe5bc6569219385d3dbf59c3db1
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2019-03-26 16:32:02 +08:00
Hu Kejun
13652aa11a ARM64: dts: rockchip: new rk3326-evb-lp3-v10-rk1608-linux
Change-Id: I9509d19ce06026252e216a7b839684b1ea16d975
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Signed-off-by: Wenlong Zhuang <daisen.zhuang@rock-chips.com>
2019-03-26 11:44:14 +08:00
Wenlong Zhuang
e95c343dd1 media: spi: add misc device for rk1608
Change-Id: I2aaf703792b0a37aae03fb4fbe875dddfc06cbd6
Signed-off-by: Wenlong Zhuang <daisen.zhuang@rock-chips.com>
2019-03-26 11:42:55 +08:00
Liang Chen
194cc5db8c arm64: dts: rockchip: fix include search path for rk3326-863-cif-sensor.dtsi
This is because of the commit form upstream: commit 5ffa2aed38
("of: remove arch/$(SRCARCH)/boot/dts from include search path for CPP")

Change-Id: I87d332caf5b3aaf3848b709c276ddb00db1327e0
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-03-26 10:49:00 +08:00
Shawn Lin
c976543254 BACKPORT: UPSTREAM: mmc: sd: Fix signal voltage when there is no power cycle
Some boards have SD card connectors where the power rail cannot be switched
off by the driver. However there are various circumstances when a card
might be re-initialized, such as after system resume, warm re-boot, or
error handling. However, a UHS card will continue to use 1.8V signaling
unless it is power cycled.

If the card has not been power cycled, it may still be using 1.8V
signaling. According to the SD spec., the Bus Speed Mode (function group 1)
bits 2 to 4 are zero if the card is initialized at 3.3V signal level. Thus
they can be used to determine if the card has already switched to 1.8V
signaling. Detect that situation and try to initialize a UHS-I (1.8V)
transfer mode.

Tested with the following cards:
  Transcend 4GB High Speed
  Kingston 64GB SDR104
  Lexar by Micron HIGH-PERFORMANCE 300x 16GB DDR50
  SanDisk Ultra 8GB DDR50
  Transcend Ultimate 600x 16GB SDR104
  Transcend Premium 300x 64GB SDR104
  Lexar by Micron Professional 1000x 32GB UHS-II SDR104
  SanDisk Extreme Pro 16GB SDR104

Change-Id: Iab33b1020f857ff754f3d00494ecee44c96e02b6
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Zhoujie Wu <zjwu@marvell.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Bin Yang <yangbin@rock-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from 6a11fc47f1)
2019-03-26 10:35:15 +08:00
Zefa Chen
44ab3ae0f6 media: i2c: add imx258 driver
Change-Id: I97a6744c8009a2af56dad5c69cb162450101eaa8
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
2019-03-26 09:58:19 +08:00
Shixiang Zheng
f881c99144 arm64: dst: rockchip: rk3308: change default lcdc pin output to 4ma
Change-Id: If7c2b693c45b7b6f3b78284db309f440a4301468
Signed-off-by: Shixiang Zheng <shixiang.zheng@rock-chips.com>
2019-03-25 17:53:39 +08:00
Wang Panzhenzhuan
13c179992d media: i2c: ov5648 match vts and fps strictly
fix cts  CaptureRequestTest#testEdgeModeControl failed
failed log:
Frame duration must be in the range of [33333333, 33333333],
value 33903000 is out of range [32833332, 33833332])

Change-Id: I054e3546736edcdba041c4a37cb9975ed3fa0870
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2019-03-25 15:03:15 +08:00
Hu Kejun
cdf7fa3eac media: rk-isp10: fix ISP can not get tx1rx1 mipi data in rk3288
Change-Id: Ia509734a0aff0941d3a8dedb44e9ed2eb78eea4f
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-03-25 08:26:26 +08:00
Shawn Lin
6c49045c29 PCI: rockchip: limit PCIe accessors within 1MB cfg space
PCIe spec requires max cfg space size is 4KB, and the hierarchy
of PCIe tree only support up to 256 devices. So the reserved
cfg space for RC is 1MB per spec.

If any callers access the cfg space out of range, the spec asks
PCIe RC kick back 0xffffffff. However, Rockchip RC will crash
if this happens. So the software should manually check the ECAM
size in PCIe accessors to workaround it.

Change-Id: If4d40add229f9c315eab6d99b290766695208daf
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-03-22 17:31:40 +08:00
Shawn Lin
a4ccde21f5 mmc: core: Add mmc_sd_shutdown support for SD as main disk
The ROM code for Rockchip platform never support detecting
SD 3.0 mode, so if the SD card contains system image running
into SD 3.0 mode in kernel, it will fails to reboot.

The problem is SD 3.0 mode is using 1.8V signal and could only
be switched back into 2.0 mode by power cycle. If the customed
board could not switch off its power rail, the ROM code can't
soft reset the SD.

Add mmc_sd_shutdown to workaround this special case and don't
bother normal SD cards used as external disk by checking the
RESTRICT_CARD_TYPE_MMC flag.

Change-Id: I4c3d3111c0bce0ad3cd4f0c6592ff595d7015afe
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-03-22 17:26:59 +08:00
Ziyuan Xu
e6ce68b4ee arm64: dts: rockchip: replace cpuinfo device node to rk3399.dtsi
Change-Id: I5776fb36be90bd67b2f2efee17d06f037b7a1665
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2019-03-22 11:49:44 +08:00
Ziyuan Xu
d50c0fdafe arm64: rk3326_linux_defconfig: enable pstore feature
Change-Id: I37af5cbdf442280111ab87b4d513450c77d5b350
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2019-03-22 09:33:34 +08:00
Ziyuan Xu
06a5e12598 arm64: dts: rockchip: support ramoops device node for rk3326-linux
Change-Id: Idc7f0696cd6ce12b4ad9ff1547b60acc32a4a006
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2019-03-22 09:32:48 +08:00
Ziyuan Xu
ee597d107d drivers: rkflash: sfc: use dev_pm_ops instead of legacy callback
Change-Id: Ic9694d9ca0cb94f8b6fab3115f64dfc83dde2ee8
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2019-03-21 18:41:01 +08:00
Ziyuan Xu
fa43242189 drivers: rkflash: nandc: use dev_pm_ops instead of legacy callback
If the device has a 'power-domains' property that the power framework
prefer to use dev_pm_ops for suspend&resume. The legacy suspend & resume
callback for nandc driver would not be used.

Anyway, it's better use dev_pm_ops whether 'power-domains' is existent.

Change-Id: I0e2822a44f3f0d458b778636cd84c5ae54505cf5
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2019-03-21 18:41:01 +08:00
Algea Cao
f23edc8aff drm/rockchip: dw_hdmi: Support switch hdmi quantization range
Add property hdmi_quant_range to switch hdmi quantization range.

Change-Id: I084cd2e1ccb46ed9757fe39802b90eedfbe466b4
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-03-21 10:54:04 +08:00
Algea Cao
54656aa5b3 drm/bridge: synopsys: dw-hdmi: Support set RGB quantization range
1.Filling the HDMI AVI infoframe quantization range information.
2.If output is limited enable color space conversion to convert.

Change-Id: I75f666424f00f3f6ec695047f7851824e89cd1a5
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-03-21 10:54:04 +08:00
Wang Panzhenzhuan
d8c65325a2 media: i2c: ov8858 fix otp null pointer crash
Change-Id: Ic80e74fa3198a6f877b69d38a225a187dc53769e
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2019-03-20 18:52:43 +08:00
Shawn Lin
5b44e6b88e phy: rockchip-inno-combphy: change pre-emphasis value
New Inno combphy improve its pre-emphasis settings, so we
need to use new recommended value instead.

Change-Id: I5b4b2e8819c4b44d908156bb8ad99bd8c62c8bdf
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2019-03-20 18:52:01 +08:00
Jon Lin
0f2800842e drivers: rkflash: use physical continuous memory for flash stress test
otherwise cache flush will cause test fail

Change-Id: I6d4a4be405998bfe68eac0004b5fee407ed62a70
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-03-20 18:48:57 +08:00
Hu Kejun
6c10c70bb9 media: rk-isp10: update to v0.2.3
Change-Id: I815d41ce0f0d7e35d7b8bd133a3f203e24e69943
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-03-20 18:45:22 +08:00
Hu Kejun
43634de342 media: rk-isp10: add control exposure of long and short frame for hdr
modify head file to match the change of camera engine

Change-Id: Ia139e733f766cf9cbb02e80ceda81a1817b3acbf
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-03-20 18:45:22 +08:00
David Wu
df29350c9c arm64: dts: rockchip: rk1808: Correct the drive strength for rgmii/rmii
According to the hardware test, change the tx pin drive strength
to 4ma, and mdc/mdio 2ma.

Change-Id: Ia5ab1728c9e9ecbfa7207217649588f600070ae4
Signed-off-by: David Wu <david.wu@rock-chips.com>
2019-03-20 18:41:38 +08:00
Ziyuan Xu
4aac5d2e7c power: rk817-battery: fix compile error whitout CONFIG_SUSPEND
drivers/power/rk817_battery.c:3254:12: warning: 'rk817_bat_pm_resume' defined but not used [-Wunused-function]
error, forbidden warning:rk817_battery.c:3254
 static int rk817_bat_pm_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~
drivers/power/rk817_battery.c:3037:13: warning: 'rk817_bat_pm_suspend' defined but not used [-Wunused-function]
error, forbidden warning:rk817_battery.c:3037
 static int  rk817_bat_pm_suspend(struct device *dev)

Change-Id: I8cb39c95688e16027257c09a20eaeb100bd1024b
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2019-03-20 18:38:38 +08:00
Lin Huang
8b8d1e98f5 arm64: dts: rockchip: rk1808-evb-x4: assigned-clock-parents for clk_32k_ioe
we replace cru assigned clock node in rk1808-evb-x4 dts, and now clk_32k_ioe
is setted in this node, so we need to add this back in rk1808-evb-x4.dts,
otherwise the SOC can not boot normally.

Change-Id: I06a55bea97e0ef260f2549349b3211a311a913ae
Signed-off-by: Lin Huang <hl@rock-chips.com>
2019-03-20 18:15:57 +08:00
Felipe Balbi
ad5d0418d3 UPSTREAM: usb: dwc3: debug: fix ep name on trace output
There was a typo when generating endpoint name which
would be very confusing when debugging. Fix it.

Change-Id: If29433f427499674b7604b399cbc3ac6e6bf7b1f
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 696fe69d7e)
2019-03-20 11:31:37 +08:00
Jon Lin
e27dfc2ce4 drivers: rkflash: support 8KB page size slc nand
comfirm in MT29F16G08ABABA

Change-Id: I6b1179e7e835b77176aaa0292b162ab08bb38fb7
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-03-19 22:12:27 +08:00
Xiaotan Luo
8a0cdc7283 arm64: dts: rockchip: add dummy i2s sound for rk3399 sapphire excavator
Change-Id: Ic7a9437eee6d9d12d25ce7fb1171faf1624d3681
Signed-off-by: Xiaotan Luo <lxt@rock-chips.com>
2019-03-19 14:49:23 +08:00
Xiaotan Luo
2b120ce738 ASoC: codec: dummy-codec: add setting mclk
Many devices require MCLK to work, So add mclk

Change-Id: I666e46c8968330afd81506d0c64769b59ad0837d
Signed-off-by: Xiaotan Luo <lxt@rock-chips.com>
2019-03-19 14:49:16 +08:00
Hu Kejun
f3ef7216c2 media: spi: RK1608: support no sensor connect to preisp
To support preisp post-processing and camera hal1,
let driver probe ok when no sensor device is connected.

Change-Id: I1830420f448b47a0bd327ee3950da0eb7af8d3fb
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-03-19 14:32:07 +08:00
Sandy Huang
ebc86551e6 dt-bindings: display: media-bus-format: Sync with include/uapi/linux/media-bus-format.h
Change-Id: I1da14bc81a8652dcac5f0b85035f8f1bf6e71bfe
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-03-19 14:09:33 +08:00
Sandy Huang
9528ba24f1 drm/rockchip: rgb: Add support srgb and srgb dummy mode
Change-Id: Ie5942b90dccec5cec74d1f1f2cbef835d95bdfd9
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-03-19 14:09:33 +08:00
Sandy Huang
e3655c6616 drm/rockchip: vop: Add support srgb and srgb dummy mode
Change-Id: I31892fe22db329deaca8d9e1eb4085d530b65d6f
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-03-19 14:09:33 +08:00
Sandy Huang
1dfe019d6a media-bus: Add SRGB888 media bus format
The output timing described at [1], focus at s888 mode and
s888 dummy mode:

[1] https://patchwork.kernel.org/patch/9992241/

Change-Id: I1bcc6d64ede243d89807acc7e842bcc7fd120c26
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-03-19 14:09:33 +08:00
Liao Huaping
ecccc04d21 init: support init ramfs async
If enable ramfs function, init ramfs async,
can reduce kernel init time.

Change-Id: I95d8ca6d8b9c4e9c738c635c5ee56391cbbe7c16
Signed-off-by: Liao Huaping <huaping.liao@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-19 14:06:04 +08:00
Hu Kejun
5c64ed8c2a media: i2c: fix compile error
fix the following error on RK1808.
error: implicit declaration of function 'kzalloc' [-Werror=implicit-function-declaration]
inf = kzalloc(sizeof(*inf), GFP_KERNEL);
error: implicit declaration of function 'kfree' [-Werror=implicit-function-declaration]
kfree(inf);

Change-Id: Ie46828b03a45cc523b8503fb62caeccee165142f
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-03-18 19:37:11 +08:00
Wang Panzhenzhuan
ae7a2bbf69 media: i2c: add sensor ov5648
Change-Id: Ia6f19841a86983dd3b8896cf4f598180076ecc7b
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2019-03-18 18:10:14 +08:00
Shixiang Zheng
b2a750b7c6 video/rockchip: rga2 fix the issue of yuv422p format conversion
Change-Id: I5213a7be831e7a5166231f4e7179ce4a564a14fb
Signed-off-by: Shixiang Zheng <shixiang.zheng@rock-chips.com>
2019-03-18 11:15:26 +08:00
Longjian Lin
d787c5f0e0 arm64: dts: rockchip: pulldown BT irq gpio for rk3399pro evb v10
Change-Id: I8c4ac43cd2ff560f2f94a01570ec82b143a7966a
Signed-off-by: Longjian Lin <llj@rock-chips.com>
2019-03-15 19:12:20 +08:00
William Wu
ef409c6d47 usb: dwc3: rockchip: fix connect fail when force host mode
The DWC3 rockchip driver provides a sysfs interface "dwc3_mode"
to force Peripheral mode or Host mode. It has a problem to force
to Host mode when the DWC3 works as Peripheral mode and connects
to Host (e.g. PC USB Port).

This issue can be reproduced on RK1808 EVB follow these steps:

1. Set dr_mode = "otg" in DTS dwc3 node;
2. Start the system, and connect the RK1808 USB 3.0 to PC USB.
3. Make sure that PC has recognized the USB device, and then
   force DWC3 to Host mode via "dwc3_mode".

   echo "host" > /sys/devices/platform/usb/dwc3_mode

   And plug in an USB 2.0 Device to RK1808 USB 3.0 Port, then
   we can see the following error log:

   rockchip-dwc3 usb: Peripheral disconnect timeout
   rockchip-dwc3 usb: USB unconnectedxhci-hcd
   xhci-hcd.3.auto: xHCI Host Controller
   xhci-hcd xhci-hcd.3.auto: new USB bus registered, assigned bus number 3
   xhci-hcd xhci-hcd.3.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x04010010
   ...
   hub 4-0:1.0: USB hub found
   hub 4-0:1.0: 1 port detected
   rockchip-dwc3 usb: USB HOST connected
   rockchip-dwc3 usb: set new mode successfully
   usb 3-1: new high-speed USB device number 2 using xhci-hcd
   usb 3-1: new high-speed USB device number 3 using xhci-hcd
   usb usb3-port1: attempt power cycle
   usb 3-1: new full-speed USB device number 4 using xhci-hcd
   usb 3-1: Device not responding to setup address
   usb 3-1: Device not responding to setup address
   usb 3-1: device not accepting address 4, error -71

It's because that in this test case, the dr_mode is original otg
mode, and the current code only call phy_set_mode() to disconnect
the peripheral from PC host if the dr_mode is peripheral mode.
This cause dwc3_rockchip_otg_extcon_evt_work() wait peripheral
disconnect timeout, and DWC3 fail to do runtime suspend and resume
to initialized the DWC3 core register again.

This patch call phy_set_mode() to disconnect the peripheral if
the current dr_mode is peripheral or otg when force to host mode.

Change-Id: I733d364046abcb616cf3d99ed57ab8604a87eef6
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-03-15 18:34:28 +08:00
William Wu
afd36f1250 usb: dwc3: rockchip: fix NULL pointer dereference in async probe
In dwc3_rockchip_async_probe(), if it tries to get hcd in
peripheral only mode (dr_mode = "peripheral"), a NULL pointer
deference will happen. Because hcd only be allocated and
initialized in host mode or otg mode.

We can reproduce this issue when set dr_mode to peripheral
in DTS, like rk3399pro-npu.dtsi, and get the following panic
log on RK1808 EVB:

Unable to handle kernel NULL pointer dereference at virtual address 000000b0
pgd = ffffff8008b0b000
[000000b0] *pgd=000000007fffe003, *pud=000000007fffe003, *pmd=0000000000000000
Internal error: Oops: 96000005 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 29 Comm: kworker/u4:1 Not tainted 4.4.167 #493
Hardware name: Rockchip RK1808 EVB V10 Board (DT)
Workqueue: events_unbound async_run_entry_fn
task: ffffffc07cd29580 task.stack: ffffffc07cd40000
PC is at dwc3_rockchip_async_probe+0x28/0x1c8
LR is at async_run_entry_fn+0x48/0x100
pc : [<ffffff80083adf5c>] lr : [<ffffff80080b445c>] pstate: 60000045
sp : ffffffc07cd43d10
...
[<ffffff80083adf5c>] dwc3_rockchip_async_probe+0x28/0x1c8
[<ffffff80080b445c>] async_run_entry_fn+0x48/0x100
[<ffffff80080acca8>] process_one_work+0x1b8/0x2b8
[<ffffff80080ad94c>] worker_thread+0x304/0x418
[<ffffff80080b206c>] kthread+0xd0/0xd8
[<ffffff8008082e80>] ret_from_fork+0x10/0x50

Fixes: f2a2b34e45 ("usb: dwc3: rockchip: use async_schedule for initial dwc3")
Change-Id: I740936e43bc4ea2b5a056d6d9dcaf18466006f0c
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-03-15 18:33:43 +08:00