Commit Graph

1073029 Commits

Author SHA1 Message Date
Frank Wang
bcb9689220 ARM: dts: rockchip: rk3288: Add utmi clock for ehci and ohci
This change adds USB-PHY output clock reference for EHCI and OHCI.

Change-Id: I39e91fed99756a86c83fe9332587c6630a5e5853
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 11:24:44 +08:00
Jianqun Xu
043ddfca3f ARM: dts: rockchip: rk3288: add operating-points-v2 for cpu nodes
Merge the pvtm patch to this patch.

Change-Id: I3cb938fbfaf0ae5957d4832f4ad5671ab9631409
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 11:22:54 +08:00
buluess.li
3ad628c268 ARM: dts: rockchip: rk3288: add iep node
Change-Id: Ie7fe0bbc91a5fedb0617d9b6c6056bdb4aed610d
Signed-off-by: buluess.li <buluess.li@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 11:19:24 +08:00
Rocky Hao
212d266625 ARM: dts: rockchip: rk3288: Assign tsadc clock to 5 KHz
Add tsadc's working clock rate for rk3288. if not set, tsadc
will work at the default rate of 1k hz.

Change-Id: I1b26351c3fb97f5ceb4657c2356c2f5649ad140c
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 11:16:23 +08:00
XiaoTan Luo
5c12a1263c ARM: dts: rockchip: rk3288: add spdif_2ch node
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: Id0abf6748053cbf0666f20c28fd68bbf9c3f2086
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 11:11:17 +08:00
Jianqun Xu
a6202ba721 ARM: dts: rockchip: rk3288: fix to timer0 for broadcast timer
Change-Id: I0dd9a367c2587391b17ab9bb3a4610abdee14816
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 11:09:57 +08:00
Finley Xiao
9ee437dc1d ARM: dts: rockchip: rk3288: Change 400MHz to 420Mhz for gpu
It doesn't support 400MHz, but support 420MHz.

Change-Id: Ife31469307912f83919b02b532acde91cc0f19ce
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 11:04:04 +08:00
Jason Song
dff006bcf0 ARM: dts: rockchip: rk3288: fix uart pinctrl to pullup
Change-Id: Ia1d5af0a3fadf9f8649df664aef2e6f3d862d778
Signed-off-by: Jason Song <sxj@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 10:58:49 +08:00
Allon Huang
853742ebfe ARM: dts: rockchip: rk3288: Add csi_host and cif_pin
Change-Id: I43f289d3de897ef16098639a57b140c9554de3cd
Signed-off-by: Allon Huang <allon.huang@rock-chips.com
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 10:58:02 +08:00
xcq
0b16181d0a ARM: dts: rockchip: rk3288: Add isp config
Change-Id: I00883343c8addff1adc71bef5001d3064b829d97
Signed-off-by: xcq <shawn.xu@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 10:55:34 +08:00
William Wu
0fce242c01 ARM: dts: rockchip: rk3288: Fix reg size for ehci
According to rk3288 TRM, the size of usb ehci is 128K,
so let's fix it in dts.

Change-Id: I1adf02080033906a88b34cae877bb84ad0f63059
Signed-off-by: William Wu <william.wu@rock-chips.com>
2022-11-18 10:52:23 +08:00
Elon Zhang
e5611037e8 ARM: dts: rockchip: rk3288: Add firmware and optee node
Add optee node to supply OP-TEE required properties.
/optee node is supposed to be below /firmware node.

Signed-off-by: Elon Zhang <zhangzj@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I067f12319a2ec3252655669b199ced6ab451cbd9
2022-11-18 10:51:57 +08:00
Jianqun Xu
e7be6c1a29 ARM: dts: rockchip: rk3288: add rockchip-suspend node
Change-Id: Id5700548a6034248ed5ad3226dd652d0833eec13
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 10:51:27 +08:00
Jianqun Xu
d906b21832 ARM: dts: rockchip: rk3288: Add SCLK_HDMI_CEC to PD_VIO
Change-Id: I6de8283516f01093213ea16f0792bcd10fb1af2b
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 10:49:06 +08:00
Jianqun Xu
a4a177f736 ARM: dts: rockchip: rk3288-evb enable sound with rt5640
Change-Id: Ibe3f218f9b3283c82329500486fd73298fc3b0d6
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-17 18:07:13 +08:00
Jianqun Xu
9903fc2377 ARM: dts: rockchip: rk3288-evb-rk808-linux add wifi_enable_h pinctrl
DTC     arch/arm/boot/dts/rk3288-evb-rk808-linux.dtb
arch/arm/boot/dts/rk3288-evb-rk808-linux.dts:87.27-101.4: ERROR (phandle_references): /sdio-pwrseq: Reference to non-existent node or label "wifi_enable_h"

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I14eb634ed8823e4caef581b8974a5dded63f5d8e
2022-11-17 18:07:13 +08:00
Jianqun Xu
f1d80296b4 ARM: dts: rockchip: rk3288-evb-rk808-linux fix to hdmi_cec_c0
DTC     arch/arm/boot/dts/rk3288-evb-rk808-linux.dtb
arch/arm/boot/dts/rk3288.dtsi:1433.22-1463.4: ERROR (phandle_references): /hdmi@ff980000: Reference to non-existent node or label "hdmi_cec"

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I976f1ea4d9ee796ce1c179f5dfead625c257f8af
2022-11-17 18:07:13 +08:00
Jianqun Xu
1f38917aeb ARM: dts: rockchip: rk3288: fix base address for i2s to 0xff8b0000
This patch fixes the error base address for the i2s controller from
0xff88b0000 to 0xff8b0000.

Also order the i2s node by mapping address.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I613eaf64ee010c41208f1c8169e55efbf39fd34c
2022-11-17 18:07:13 +08:00
Yifeng Zhao
4ba9bb2228 drivers: rk_nand: fix compile warning
warning: drivers/rk_nand/rk_ftlv5_arm32.o uses 4-byte wchar_t yet
the output is to use 2-byte wchar_t;

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I9ea1cdb05be5e4edb297517a9ae8c5e5377538be
2022-11-17 16:46:48 +08:00
Jianwei Fan
3f98f91c6f arm64: dts: rockchip: rk3326-evb-lp3: remove pinctrl dvp_d0d1_m0
In rk3326-evb-lp3-avb, gpio2_b6 is used for CAM_PDN0 instead of cif_data1.

Change-Id: I926474f2b06cc39052997750eb1894a8b0fe04d7
Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
2022-11-17 16:42:47 +08:00
Ziyuan Xu
f91fc90bbe media: i2c: sc3338: pm_runtime_put device until stream_off for thunderboot
The camera device should keep *power on* until stream off, that make
sure the mclk is enable.

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: I2db0070793d755d8d1fe2cda3f87aaa498e052d3
2022-11-17 16:17:58 +08:00
Lin Jianhua
334791b0d3 input: touchscreen: gt1x: ignore pin of reset and support power invert
Signed-off-by: Lin Jianhua <linjh@rock-chips.com>
Change-Id: I3f0da33eef197d78bfb72c620bfe2c25dd87d02a
2022-11-17 14:41:50 +08:00
David Wu
54f657fcdb configs: rockchip: Enable CONFIG_MOTORCOMM_PHY for RK631
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Id19b664d3688908f3f758bb26eab8e0b7c7d4201
2022-11-17 14:30:02 +08:00
David Wu
5b7a85aa3e net: phy: Add motorcomm driver for RK631 PHY
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Iad8fd02e5f3dd2397dbdb7eb150325fc76e9c422
2022-11-17 14:28:50 +08:00
Peter Geis
4de4ec6c66 UPSTREAM: net: phy: abort loading yt8511 driver in unsupported modes
While investigating the clang `ge` uninitialized variable report, it was
discovered the default switch would have unintended consequences. Due to
the switch to __phy_modify, the driver would modify the ID values in the
default scenario.

Fix this by promoting the interface mode switch and aborting when the
mode is not a supported RGMII mode.

This prevents the `ge` and `fe` variables from ever being used
uninitialized.

Fixes: 48e8c6f161 ("net: phy: add driver for Motorcomm yt8511 phy")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David Wu <david.wu@rock-chips.com>
(cherry-pick from commit 0cc8bddb5b)
Change-Id: I610c03a4f032a8a8dde8ef58d105b721c0541bf5
2022-11-17 14:28:29 +08:00
Peter Geis
14adf98ff1 UPSTREAM: net: phy: fix yt8511 clang uninitialized variable warning
clang doesn't preinitialize variables. If phy_select_page failed and
returned an error, phy_restore_page would be called with `ret` being
uninitialized.
Even though phy_restore_page won't use `ret` in this scenario,
initialize `ret` to silence the warning.

Fixes: 48e8c6f161 ("net: phy: add driver for Motorcomm yt8511 phy")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David Wu <david.wu@rock-chips.com>
(cherry-pick from commit 546d6bad18)
Change-Id: I0467ca4b5846e71ddca8a6818e5c021010a72d98
2022-11-17 14:28:03 +08:00
Peter Geis
9ec339342e UPSTREAM: net: phy: add driver for Motorcomm yt8511 phy
Add a driver for the Motorcomm yt8511 phy that will be used in the
production Pine64 rk3566-quartz64 development board.
It supports gigabit transfer speeds, rgmii, and 125mhz clk output.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: David Wu <david.wu@rock-chips.com>
(cherry-pick from commit 48e8c6f161)
Change-Id: If0af67cda0ad607e4a31f126804547e9d8b3df50
2022-11-17 14:27:47 +08:00
Ding Wei
d5519c9605 ARM: dts: rockchip: rk3288: hevc_service: add default val setting
Change-Id: I3f71fe50e8b51e21728afae850f0aca21b8b160c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2022-11-17 14:26:53 +08:00
Ding Wei
fee9944154 ARM: dts: rockchip: rk3288 add clk-rates setting for vdpu and rkvdec
Change-Id: Ibd695ef470c40829a348c660dd94de3f6a2b320c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2022-11-17 14:26:53 +08:00
Chen Jinsen
2e18f6fc32 ARM: dts: rockchip: vdpu support automatic frequency for rk3288
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
Change-Id: I0378d57524d1b7146dbebec3d4fa9c125430b0d0
2022-11-17 14:26:53 +08:00
Ding Wei
a9175d765e video: rockchip: mpp: deal with the case for iommu share
In platform arm32, iommu is shared in different device,
it must attach to ensure hardware working in current device.

Change-Id: I854a362adf6145dcfd796885922683f8a6b7e131
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2022-11-17 14:26:53 +08:00
Su Yuefu
d55a25476c media: i2c: gc3003: pm_runtime_put device until stream_off for thunderboot
Signed-off-by: Su Yuefu <yuefu.su@rock-chips.com>
Change-Id: I041b9cdb4a3416951e5d3855e2d4400db84e3c94
2022-11-17 14:19:33 +08:00
Su Yuefu
927e0f59f7 media: i2c: sc200ai: pm_runtime_put device until stream_off for thunderboot
Signed-off-by: Su Yuefu <yuefu.su@rock-chips.com>
Change-Id: I5754491e2d5344efcfe41897a241435b21804593
2022-11-17 14:19:17 +08:00
Su Yuefu
660f1d040d media: i2c: sc230ai: pm_runtime_put device until stream_off for thunderboot
Signed-off-by: Su Yuefu <yuefu.su@rock-chips.com>
Change-Id: If328b3af33d14fdc5309c35d6e3a222abbcb47ec
2022-11-17 14:18:51 +08:00
Cai YiWei
797a0b4b11 media: rockchip: isp: fix stats buf update for multi sensor
Change-Id: Ic1a8b62ab73b0076a83033c350759be71df53793
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-11-17 14:16:41 +08:00
Jon Lin
b7cf98650b mtd: spi-nor: core: Support misc devices
Calling ioctl PCIE_DMA_GET_FLASH_INFO to get spi nor id.

Change-Id: I1ecfdd527f18c0c323fba9673546c167032d1726
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-11-17 12:06:59 +08:00
Shawn Lin
5083234249 mmc: dw_mmc: Remove useless SDMMC_INT_TXDR and SDMMC_INT_RXDR
These two interrupts are managed by data routine and not need to
enable it via runtime_resume each time.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I9ef2ae0acabefeba4a69ff6b4c7edc3c0318fdeb
2022-11-17 11:53:30 +08:00
Jon Lin
416f4a15a4 PCI: rockchip: dw: Add cache clean for dma read test
Add cache clean for coherent when DMA is running.

Change-Id: Ic5df0588009367de6716db9c6cc418b05e8a43f6
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-11-16 21:07:01 +08:00
Sugar Zhang
89764514b7 ASoC: rockchip: pdm: Shift rate back to 0 ppm when restart
Change-Id: Ibb867e8b1a9a553a3077a7c91d415eea82cc76ba
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
2022-11-16 19:20:31 +08:00
Sugar Zhang
28567ec23e ASoC: rockchip: pdm: Add support for clk compensation
This patch introduces a method to handle clk drift and compensation.

e.g:

/# amixer contents
numid=1,iface=PCM,name='PCM Clk Compensation In PPM'
; type=INTEGER,access=rw------,values=1,min=-1000,max=1000,step=1
: values=0

/# arecord -D hw:0,0 --period-size=1024 --buffer-size=4096 -r
16000 -c 2 -f s16_le /dev/zero &

/# amixer -- cset numid=1 -10
numid=1,iface=PCM,name='PCM Clk Compensation In PPM'
; type=INTEGER,access=rw------,values=1,min=-1000,max=1000,step=1
: values=-10

/# amixer -- cset numid=1 10
numid=1,iface=PCM,name='PCM Clk Compensation In PPM'
; type=INTEGER,access=rw------,values=1,min=-1000,max=1000,step=1
: values=10

Change-Id: Ibc70ce8ccec6dddb082161fa544d066c706c37bc
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
2022-11-16 19:20:23 +08:00
Andy Yan
72fafe97a1 drm/rockchip: Add dynamic debug
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I441245ec77122dae766c9e175d182ee6d15e217f
2022-11-16 17:18:44 +08:00
Caesar Wang
fb22b123d6 arm64: dts: rockchip: use new type-c framework on rk3399pro evb boards
Amends to support the new type-c framework.

Change-Id: I060da4667e6a5da9477841f80995c459021ef345
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2022-11-16 16:46:48 +08:00
William Wu
a9a4f474d7 usb: dwc3: gadget: fix deadlock in kick transfer
If kick transfer command fail and the return value isn't
EAGAIN, the current code will issue end transfer command
to stop the active transfer, and only set dep->flags with
DWC3_EP_END_TRANSFER_PENDING if the end transfer command
is done successfully. If the DWC3_EP_END_TRANSFER_PENDING
isn't set, it cleanup the cancelled requests and give the
request back to the gadget layer immediately.

For uvc gadget, the uvc gadget driver hold spinlock and
then call usb_ep_queue() to submit uvc usb request to dwc3
controller. The dwc3 controller may kick transfer for the
request sequentially, if the kick transfer command and
the end transfer command all failed, the dwc3 will give
the request back to the uvc gadget driver via the request
complete function uvc_video_complete(), in this function,
it try to get the spinlock again that lead to deadlock.

This case always happens with the following warning log:

WARNING: CPU: 0 PID: 14450 at drivers/usb/dwc3/gadget.c:1839 __dwc3_gadget_kick_transfer+0x3a0/0x3b0
...
Workqueue: events uvcg_video_pump
...
Call trace:
 __dwc3_gadget_kick_transfer+0x3a0/0x3b0
 __dwc3_gadget_ep_queue+0x128/0x1f0
 dwc3_gadget_ep_queue+0x40/0x6c
 usb_ep_queue+0x44/0x100
 uvcg_video_pump+0xd0/0x1d4
 process_one_work+0x1f4/0x490
 worker_thread+0x278/0x4dc
 kthread+0x13c/0x344
 ret_from_fork+0x10/0x30

Fixes: 0ec00e864a ("UPSTREAM: usb: dwc3: gadget: move cmd_endtransfer to extra function")
Change-Id: I43d455a45d542efcaa9234de60e37277611b3c47
Signed-off-by: William Wu <william.wu@rock-chips.com>
2022-11-16 16:09:26 +08:00
Jianwei Fan
9086c42501 media: i2c: imx577: fix configuration of HDR2 30fps
Change-Id: Iea82c79fd52a30f06fcbd6d0782958ebead9ee96
Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
2022-11-16 16:05:11 +08:00
Jianwei Fan
933af6b20c media: i2c: sensors: fix pm_runtime_put issue in HDR mode
Change-Id: I11189e30eeb5ac2b7073888329e819a9a7f6b074
Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
2022-11-16 07:39:24 +00:00
Jon Lin
62d3af47b8 PCI: rockchip: dw: Fix error in calling dw_pcie_prog_inbound_atu function
drivers/pci/controller/dwc/pcie-dw-ep-rockchip.c:533:70: error: too few arguments to function call, expected 6, have 5
        ret = dw_pcie_prog_inbound_atu(pci, free_win, bar, cpu_addr, as_type);

Change-Id: Iaa3083f6cfe4edbba422fff5a245515f40c70db4
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-11-16 11:56:22 +08:00
Jacob Chen
4e8fc0099d MALI: utgard: fix mali_mmap failed
Validate vmf_insert_pfn return value with VM_FAULT_NOPAGE

Signed-off-by: Jacob Chen <cc@rock-chips.com>
Change-Id: I53b1eabd20ab76f08f5edf571ead1ffaccd19ec1
2022-11-16 10:48:04 +08:00
Jianqun Xu
b199fc40bf ARM: dts: rockchip: rk3288-evb hdmi use i2c-hdmi instead of i2c5
Fix the error from pinctrl
[    5.112827] rockchip-pinctrl pinctrl: could not request pin 235 (gpio7-19) from group i2c5-xfer  on device rockchip-pinctrl
[    5.123951] rk3x-i2c ff170000.i2c: Error applying setting, reverse things back
[    5.131207] rk3x-i2c: probe of ff170000.i2c failed with error -22

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I7bdf76832fb2805ced05f0a5bb52612f528d8ebf
2022-11-16 10:39:31 +08:00
Wyon Bi
672b2060ed drm/bridge: analogix_dp: Compatible for EXTCON_DISP_EDP cable
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I042d3f855fdb09f971d9d533951c267686a57245
2022-11-16 10:24:24 +08:00
William Wu
b37ab4ccd0 usb: gadget: uvc: wait for req complete before free req
when uvc calls uvcg_video_enable() to disable the video
stream, it dequeues all requests from the usb endpoint,
and it expects the usb controller to giveback the requests
immediately, and then it can free the requests safely.
But for usb dwc3 controller, it doesn't giveback the
started requests in dequeue ops. Instead, it issues the
end transfer command and  wait for the command completion
IRQ, then giveback the requests to uvc. If the uvc driver
free req before the command completion IRQ, it will led
to null pointer dereference problem. So need to wait
for the req complete before free it.

Example call stack on RK3588 platform:

Thread#1:
uvcg_video_enable()
 -> usb_ep_dequeue()
  -> dwc3_gadget_ep_dequeue()
   -> dwc3_stop_active_transfer()
      issue end transfer command
    -> dwc3_gadget_move_cancelled_request()
     ...
      -> uvc_video_free_requests()
       -> Thread#2 executes

Thread#2:
dwc3 end transfer command completion IRQ occurs
dwc3_gadget_endpoint_command_complete()
 -> dwc3_gadget_ep_cleanup_cancelled_requests()
  -> dwc3_gadget_giveback()
   -> usb_gadget_giveback_request()
    -> uvc_video_complete()

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I0bcb8d18e851448fc973f901d74afa19ab1e2406
2022-11-16 10:13:37 +08:00