Commit Graph

622201 Commits

Author SHA1 Message Date
Jon Lin
9ead5f3cbd drivers: rkflash: Support new devices
1.FSNS8B004G
2.W25N01JWZEIG, W25N01KWZPIG, F35SQB004G, F35SQB002G, DS35M4GB-IB, DS35Q4GB-IB,
DS35M12C-IB, DS35Q12C-IB, DS35Q2GBS, XT26Q04DWSIGT-B, XT26Q01DWSIGA, FM25S02BI3,
FM25G02D, UM19A9LISW, UM19A9HISW, UM19A0HISW, UM19A0LISW, GSS01GSAM0, GSS02GSAX1,
GSS01GSAX1, F50L1G41LC, ZB35Q01BYIG, ZB35Q04BYIG, HSESYHDSW2G.
3.W25Q12PWSSIM, W25Q01JVIM, DS25M64E, DS25Q4AA, BY25FQ32EL, BY25FQ64EL, BY25FQ128EL

Change-Id: Iabcd0145742de6ac0875ba6cfb1d557d37a1a8a0
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2024-12-31 14:32:07 +08:00
Jon Lin
8ac112c93c drivers: rkflash: Add ecc_strength value
SPI Nand support these flowing ECC status:
1.ECC OK.
2.ECC bits flip is correctable and not reach it's ecc_strength.
3.ECC bits flip is correctable and reach it's ecc_strength.
4.ECC failed.

Case2/3 rely on ecc_strength value, or will be set as ECC ok although
it's accept.

Change-Id: Ia39b0b17ca8f1b3a94b43a49a607a37d35fd185f
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2024-12-30 18:16:13 +08:00
Binyuan Lan
8058d68cef ASoC: rk817: fix no sound when capture by tinycap or arecord
Because I2STX_CKE has been set to disable in rk817_codec_shutdown,
then I2STX_CKE_EN should be set when recording.

Signed-off-by: Binyuan Lan <lby@rock-chips.com>
Change-Id: If1201ad12e33dca21eb443bd32750a73c1fa9f67
2024-10-22 16:51:12 +08:00
Binyuan Lan
8ddec9d851 ASoC: rk817: Resolve POP noise when starting recording during playback
During the playback, if PLL_PW_DOWN and PLL_PW_UP is performed,
a POP sound is generated.
When the sample rate does not change, do not restart the pll.

Signed-off-by: Binyuan Lan <lby@rock-chips.com>
Change-Id: I83de976e6e2752a85c57fbc4d4eb6bd5f1b21fbf
2024-09-30 11:50:09 +08:00
XiaoTan Luo
e661a47242 ASoC: rk817: Fix no sound issue on first switch from 48K to 16K/8K
When switching sample rates, the clock settings are as follows:
- For 48K, MCLK = 256fs = 256 * 48K = 12288K
- For 16K, MCLK = 256fs = 256 * 16K = 4096K
- For 8K, MCLK = 256fs = 256 * 8K = 2048K

The `set_sysclk` function in the soc i2s_tdm controller does not
actually perform `clk_set_rate`; it merely passes the parameters.
The actual `clk_set_rate` is called during `i2s_tdm_hw_params`.
However, `rk817_hw_params` performs `restart_clk_apll` inside,
which sets the PLL parameters that do not match the MCLK,
resulting in silence. To resolve this, clk_set_rate for the MCLK
frequency should be called within the set_sysclk function.

Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: I3ad233542a5e8b16ae72f829e086a25f5be4a095
2024-08-09 17:03:46 +08:00
XiaoTan Luo
e8e4654243 ASoC: rk817: Fix L/R channel order
The I2S part of RK817 work as slave mode require BCLK on
first, otherwise, there will make the L/R invert.

On the stage hw_params, the BCLK maybe off. so, let's move
it into mute stage to fix this.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I3b9a7030342281a596e16c025f42c49a79c3a5df
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
2024-08-07 18:11:38 +08:00
Huibin Hong
b3877ccd38 fiq_debugger: set uart irq no balancing
When IRQ BALANCING is enable, the log below is show:

fiq_debugger:cpu 0 not responding,reverting to cpu 6

Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Change-Id: Ic5a1786ecb72dc4b28e9b9fa8428065e111e55ee
2024-07-26 11:23:42 +08:00
Algea Cao
fa644f9077 ARM: dts: rockchip: rk3036s-evb: Add hdmi phy cfg table
Change-Id: I8d69b98e3cb65ac475e5cecd3a753df0a491d8eb
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-06-06 14:38:51 +08:00
Algea Cao
186c235f8b drm: rockchip: inno_hdmi: Support get phy cfg from dts
Change-Id: Ibe408164be6314e489a140ceeeea6d5305f8d0aa
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-06-06 14:38:44 +08:00
Algea Cao
1f4c3c5654 drm: rockchip: inno_hdmi: Support mode valid
Filters unsupported resolutions.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ib79bfc7f8d8602ddea17445e1324202028380386
2024-06-06 11:16:37 +08:00
Sugar Zhang
3585f57b87 ASoC: rockchip: i2s: Fix FIFO clear error on SLAVE mode
Workaround for FIFO clear on SLAVE mode:

A Suggest to do reset hclk domain and then do mclk
  domain, especially for SLAVE mode without CLK in.
  at last, recovery regmap config.

B Suggest to switch to MASTER, and then do FIFO clr,
  at last, bring back to SLAVE.

Now we choose plan B here.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I1884659df7fa9052477652b7b0315da21e3165c2
2024-05-21 10:53:15 +08:00
Sugar Zhang
3350436838 ASoC: rockchip: i2s: Simplify FIFO clear routine
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I4ecfe4978d7646a99b205772515ae1c4f2d4607f
2024-05-21 10:53:04 +08:00
William Wu
954f58057e usb: gadget: f_hid: fix zero length packet transfer for ep0
If the hid transfer with size divisible to EP0 max packet
size, it needs to set the req->zero to true, then the usb
controller can transfer a zero length packet at the end
according to the USB 2.0 spec.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Iae8c06966efe49c3a33213f9c36dd752633e8bd1
2024-04-29 11:38:33 +08:00
Qiqi Zhang
8782cb475e ARM: configs: rockchip_linux_defconfig: enable CONFIG_SND_SOC_ES8311 for rk3036-evb1
Change-Id: I8a7cbcc02e0bd38aa27bc9271aeb743e85f1c69a
Signed-off-by: Qiqi Zhang <eddy.zhang@rock-chips.com>
2024-04-16 20:47:39 +08:00
Xing Zheng
9646ce8459 ASoC: es8311: add support es8311 codec driver
Change-Id: Iae35145535664754f3babf4245c9682077c1fc00
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Qiqi Zhang <eddy.zhang@rock-chips.com>
2024-04-16 20:40:18 +08:00
Qiqi Zhang
3e79ac75db ASoC: codec: add rk3036 codec
Change-Id: I622bc79ee084a6e861d31e6772ec69b8aad843e8
Signed-off-by: Qiqi Zhang <eddy.zhang@rock-chips.com>
2024-04-16 20:34:30 +08:00
Qiqi Zhang
c44f6589e8 ARM: configs: rockchip_linux_defconfig: enable rk3036 codec config
Change-Id: Ia916b6a80b14fd18e1a5539f10ce75578a4b9fb3
Signed-off-by: Qiqi Zhang <eddy.zhang@rock-chips.com>
2024-04-16 20:27:01 +08:00
Finley Xiao
eae6b939b0 ARM: dts: rockchip: rk3036: Add eFuse device node
Change-Id: I3d09d61d26844dbda9f8175db608e47950eb2135
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2024-04-16 15:06:16 +08:00
Finley Xiao
561dae93e1 nvmem: rockchip-efuse: add support for rk3036-efuse
This adds the necessary data for handling eFuse on the rk3036.

Change-Id: Ifef7bcdb8ddb1dc04546e4d7dad0c0a24ab974f3
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2024-04-16 15:06:15 +08:00
Finley Xiao
a1d19023a7 clk: rockchip: rk3036: Add clock id for pclk_efuse
Change-Id: Iefd7a812bebbcd9c0f222468381865cf92fb1f41
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2024-04-16 15:06:15 +08:00
Qiqi Zhang
aee91c55c1 ARM: dts: rockchip: rk3036: fix pinctrl error for pwm
Change-Id: I5ff558304ab080468aa2c562955d9d96d5b2329a
Signed-off-by: Qiqi Zhang <eddy.zhang@rock-chips.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
2024-04-15 17:58:21 +08:00
ZiHan Huang
400d2332ab ARM: configs: rockchip_linux_defconfig: add remotectl pwm
Change-Id: I62ec4985381e16b19d8dc00a16bdefa7258f2ff3
Signed-off-by: ZiHan Huang <zack.huang@rock-chips.com>
2024-04-12 09:49:35 +08:00
ZiHan Huang
85416b4435 ARM: dts: rockchip: rk3036 adaptive pwm3 Infrared function
Change-Id: Idb6251f109900c4c2956688a849aced0e9872a10
Signed-off-by: ZiHan Huang <zack.huang@rock-chips.com>
2024-04-12 09:47:26 +08:00
Lin Jianhua
b3115c260f ARM: dts: rockchip: add rk3036s evb1/evb2 dts
Change-Id: Ic48e6aebaf0f814d3da4a3c03a1be94fe92bcd77
Signed-off-by: Lin Jianhua <linjh@rock-chips.com>
2024-04-12 09:35:38 +08:00
ZiHan Huang
b24ac52c25 ARM: dts: rockchip: rk3036: fix compatible of pwm nodes
PWM in rk3036 is the same as rk3288

Change-Id: I078e068c8e6fe64fd2f53b0fde1b1fb9984c76bc
Signed-off-by: ZiHan Huang <zack.huang@rock-chips.com>
2024-04-12 09:28:08 +08:00
Jon Lin
b822a55277 ARM: dts: rockchip: rk312x: Add SPI0 clock
Change-Id: I4337420caae3be2f2c20393463d0475542f3d8a2
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2024-03-04 15:26:35 +08:00
Binyuan Lan
72e266d865 ASoC: rockchip: rk817-codec: fix pop from DAC_DIG_CLK_DIS and DAC_DIG_CLK_EN
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
Change-Id: Idfa31a4f3484f1641ebcf46d237244e98e378e93
2024-02-07 09:44:47 +00:00
Jon Lin
e32bd50138 drivers: rkflash: Support new devices
PP Nand IS34ML08G088;
SPI Nand GD5F1GM7REYIGR, GD5F4GM8UEYIGR, HYF2GQ4IAACAE, HYF1GQ4IDACAE
F35UQA002G-WWT, F35UQA001G-WWT, DS35Q1GD-IB, XT26Q02DWSIGA,
XT26Q01DWSIGA, XT26Q04DWSIGA, XT26G01DWSIGA, XT26G02DWSIGA,
XT26G04DWSIGA, FM25S01BI3, FM25G02BI3, F50L2G41KA, UM19A1HISW,
UM19A0HCSW, UM19A0LCSW, UM19A1LISW, S35ML01G3, ANV1GCP0CLG,
HYF1GQ4UTXCAE, YX25G1E, HYF2GQ4UTXCAE, YX25G2E, GSS01GSAK1, GSS02GSAK1,
XCSP2AAPK, XCSP1AAPK;
SPI Nor GD55LB01GEFIRR, GD55LT01GEFIRT, GD25LB256EYIGR, EN25QX128A,
PY25Q128LA, BY25Q128AS, FM25Q256I3, GT25Q40D.

Change-Id: I4c32eac2249ff5b11d637bd5f9a8ba5fa006f67c
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-12-22 16:05:49 +08:00
Sandy Huang
6babefa2e2 arm64: dts: rockchip: px30: fix vopb register length error
Change-Id: Id3972d03297542ca1738f0b13fe6fb1075f1af42
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2023-12-19 14:23:22 +08:00
Chaoyi Chen
d3edb3da35 drm/rockchip: vop: correct RK3288/RK3399 VOP WIN register fields
In RK3288/RK3399, there is a problem with the definition of the
`fmt_10` field in the VOP WIN register. The original `fmt_10`
definition conflicts with the `lb_mode` definition.

This will cause the `lb_mode` function to be affected, there may be
problems with incorrect colors displayed, incorrect window sizes,
image flickering, etc.

This patch correct `fmt_10` field to the expected value in TRM.

Change-Id: I0f9f23c459dc5870532e28b74053a9b4dc606de0
Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
2023-12-14 10:50:33 +08:00
Shawn Lin
050b1d0769 arm64: dts: rockchip: Covert ciu-drv to ciu-drive for matching the driver
The driver is using ciu-drive instead of ciu-drv.

They were converted by:
sed -i "s/ciu-drv/ciu-drive/g" `grep ciu-drv -rl arch/arm64/boot/dts/rockchip/*`

Change-Id: I7e5be98a46d7eb5d29b5b0fe0280ea8b91c60406
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2023-12-12 09:38:32 +08:00
Jianlong Wang
5fa8783dee arm64: dts: rockchip: rk3328: correct dmc_opp_table frequencies
Change-Id: Ic680a2e73d84ed4e2604b1228b2d743b91601af1
Signed-off-by: Jianlong Wang <jianlong.wang@rock-chips.com>
2023-11-21 17:34:59 +08:00
XiaoTan Luo
f33449f8c6 ASoC: rockchip: rk817-codec: always enable mclk
Change-Id: Id2a87aaf665c8f1030b425e7e7fa4727401ac70b
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
2023-11-15 15:19:33 +08:00
Damon Ding
101587befd drm/rockchip: vop: init mcu_frame_st as 0 in vop_mcu_mode()
If mcu_hold_mode is 1, set 1 to mcu_frame_st will
refresh one frame from ddr. So mcu_frame_st is needed
to be initialized as 0.

Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I75d755826dbbdd229da3c3db15d4682dc2bd13a0
2023-11-14 10:51:03 +08:00
Neal Liu
1b826e92e7 UPSTREAM: usb: gadget: f_mass_storage: Make CD-ROM emulation works with Windows OS
Add read TOC with format 1 to support CD-ROM emulation with
Windows OS.
This patch is tested on Windows OS Server 2019.

Bug: 254441685
Fixes: 89ada0fe66 ("usb: gadget: f_mass_storage: Make CD-ROM emulation work with Mac OS-X")
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
Link: https://lore.kernel.org/r/20220628021436.3252262-1-neal_liu@aspeedtech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3b91edd624)
Signed-off-by: Lee Jones <joneslee@google.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Iaff2f9a4e8698f0f744150169a4bc78409885bec
2023-09-07 15:08:22 +08:00
Roger Quadros
cedcb1e8df UPSTREAM: usb: gadget: f_mass_storage: Make CD-ROM emulation work with Mac OS-X
Mac OS-X expects CD-ROM TOC in raw format (i.e. format:2). It also
sends the READ_TOC CDB in old style SFF8020i format. i.e. 2 format bits
are encoded in MSBs of CDB byte 9.

This patch will enable CD-ROM emulation to work with Mac OS-X. Tested on
Mac OS X v10.6.3.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Roger Quadros <roger.quadros@nokia.com>
Signed-off-by: Jack Pham <quic_jackp@quicinc.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Link: https://lore.kernel.org/r/20220124160150.19499-1-quic_jackp@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 235304500
(cherry picked from commit 89ada0fe66)
Change-Id: Ibc4b89260f3ca788edae401d60e1392322e785a0
2023-09-07 15:06:35 +08:00
William Wu
863c30d55b usb: ehci: Re-enable port polling during resume
This patch re-enable port polling if ehci maintained
power in suspend as well as ehci lost power in suspend.

Change-Id: If970d33323582a8c4bd4158a4b4fcc3f08366ceb
Signed-off-by: William Wu <william.wu@rock-chips.com>
2023-08-30 12:04:31 +08:00
William Wu
aca78f3cd7 usb: ehci: fix hs reset work for abnormal linestate
This patch two issues for ehci host hs reset work.
1. If the port owner has been set to ohci, the port
   status reg of ehci is invalid, in this case, it
   needs to schedule ehci hs reset work if ohci root
   hub has no configured child.

2. Avoid triggering hs reset work for normal linestate
   in hotplug quickly test.

Change-Id: I4d5f70f83332abc42e8a8b2c875f9da9f76e55d0
Signed-off-by: William Wu <william.wu@rock-chips.com>
2023-08-18 17:06:16 +08:00
William Wu
1b6ad982ad usb: dwc2: hcd: fix hs reset work for abnormal linestate
This patch fix two issues for dwc2 host hs reset work.
1. Avoid triggering hs reset work for normal linestate
   in hotplug quickly test.

2. If the usb linestate is in abnormal status, the dwc2
   controller may stay in low speed, it needs to clear
   the HPRT0_PWR to recovery the dwc2 controller before
   do high speed handshake.

Change-Id: I7789afb209957646a9537fd775a0ed43dd400aa5
Signed-off-by: William Wu <william.wu@rock-chips.com>
2023-08-18 17:05:24 +08:00
Huibin Hong
ac19893b29 serial: 8250 dw: support rs485
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Change-Id: I3be8ac4b08e482136cf7a26f33dce1c9177368a4
2023-08-04 02:08:27 +00:00
Huibin Hong
ad6dd44650 fiq_debugger: fix cpu not responding issue
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Change-Id: Id984f9d9077e80210445f4ae32a028ed2e90a230
2023-08-04 02:07:51 +00:00
Huibin Hong
37bb83cd14 soc: rockchip: rk_fiq_debugger: fix interrupt fires forever
Fix bug that RX TIMEOUT interrupt fires forever.

Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Change-Id: I98062debaf549ccbd8e3bda84a396e59588c8309
2023-08-04 01:08:51 +00:00
Zhihuan He
86f3a47825 arm64: dts: rockchip: px30: delete dmc 528MHz and en 666MHz ODT
For a more stable system, delete the 528MHz frequency and open
the 666MHz frequency ODT.

Signed-off-by: Zhihuan He <huan.he@rock-chips.com>
Change-Id: I0354c6dde8f39a9b41878446475ee3acbe1be729
2023-07-28 17:52:43 +08:00
Jon Lin
41bbd47455 drivers: rkflash: Add sleep for spinand
Program/Erase/Read Speed
– Page Program time : 450us typical
– BLOCK ERASE time : 4ms typical
– PAGE READ time : 120us maximum (without ECC)

Change-Id: I0c5bc9827788938df028e525e331c0db8d041676
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-07-27 16:53:32 +08:00
Jon Lin
cea915a87b dt-bindings: spi: spi-rockchip: Support rockchip,autosuspend-delay-ms
Change-Id: Ib5a7344b4732ce525a3ac54c90868e89e82ca819
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-07-27 14:15:00 +08:00
Jon Lin
f0fb2f659d spi: rockchip: Support pm_runtime_use_autosuspend
Change-Id: I12103f0d1fbe3c168c5fa304d4bfb181d2a4ab5f
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-07-26 15:21:36 +08:00
Jon Lin
6850021d69 spi: rockchip: Set DMA state as actomic one
Change-Id: I300ce14cdac63d8b7ee0103ec5a25b7763f111b7
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-07-26 15:21:28 +08:00
Binyuan Lan
1790845a60 ASoC: rockchip: rk817-codec: Solve pop problems cause by re-configure APLL
SMIC TudorAG and previous versions:
During playback, a POP sound occurs when the recording is opened.
This patch is intended to fix this issue.

Signed-off-by: Binyuan Lan <lby@rock-chips.com>
Change-Id: I86f79cd531738113092723e1ef198b093ae472b9
2023-07-24 01:40:24 +00:00
William Wu
922103a96a usb: gadget: u_audio: improve uac compatibility
Some PC USB Hosts (e.g Dell laptop) fail to send
SetInterface(AltSet=0) to stop capture/playback
when PC enter suspend or play YouTube Video.

To be compatible with these PC, add this patch to
stop capture/playback prior to start again if the
stream_state is true.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Iced57de39b6b88a7c987897dcb123cf8d7cf6473
2023-07-21 15:53:48 +08:00
Jerome Brunet
d27b910f6c UPSTREAM: usb: gadget: u_audio: fix race condition on endpoint stop
If the endpoint completion callback is call right after the ep_enabled flag
is cleared and before usb_ep_dequeue() is call, we could do a double free
on the request and the associated buffer.

Fix this by clearing ep_enabled after all the endpoint requests have been
dequeued.

Fixes: 7de8681be2 ("usb: gadget: u_audio: Free requests only after callback")
Cc: stable <stable@vger.kernel.org>
Reported-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210827092927.366482-1-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I27ee980deef79ddf22b848b3a4b039845d02f562
(cherry picked from commit 068fdad204)
2023-07-21 15:51:49 +08:00