Commit Graph

1059167 Commits

Author SHA1 Message Date
Sandy Huang
641da0dc82 drm/rockchip: vop2: get correct plane state for dmc
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I2cdc7394ccddcd0a0a10b2b7fc3d8f5b033fa643
2021-07-28 15:02:55 +08:00
Sandy Huang
4713955fb8 drm/rockchip: fb: implement rockchip_drm_atomic_helper_commit_tail_rpm
implement rockchip_drm_atomic_helper_commit_tail_rpm() to instead of
drm_atomic_helper_commit_tail_rpm(), this is prepare to add some rockchip
private implement, just like calculate bandwidth and make sure commit
planes is mutually-exclusive.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I2ac87f672a3ef06611b5047781f7cf53aa4b3700
2021-07-28 14:59:48 +08:00
Tao Huang
66af96482f arm64: rockchip_gki.config: Enable CONFIG_ARM_ROCKCHIP_DMC_DEVFREQ
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I70d61f5e57371174b1d9f74287c3826d38a99be6
2021-07-28 14:50:03 +08:00
Finley Xiao
990b7b2229 PM / devfreq: rk3399_dmc: rename driver to 'rockchip_dmc'
In future it will be modified to support more rockchip platforms.

Change-Id: I5cd7ce555eefe08b12fbfcda8ef445c4b169e8c6
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-28 14:38:18 +08:00
YouMin Chen
c50f99f2f3 PM / devfreq: rockchip_dmc: use rockchip_drm_get_sub_dev_type to get lcdc_type
Change-Id: Ic1eb21c6b6b45a2c8c36d3666a987a32f3b50f05
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-28 14:20:43 +08:00
Liang Chen
14a667d18f arm64: dts: rockchip: rk3568: adjust opp-table
Change-Id: Icbae16ac2c077555326c1d44b0df87161e929ea6
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-07-28 14:19:37 +08:00
Tao Huang
4a03eb898f arm64: rockchip_gki.config: Enable IEP/MPP/RGA2
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ib03d3a5a52251648fbb3766898e22f8b81b1b611
2021-07-27 19:21:27 +08:00
Tao Huang
6a9e8e123f video: Add rockchip video drivers
Change-Id: Ice3ea34c4ea3862c29f5e9b561d19a390f2965c7
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-07-27 19:05:33 +08:00
Tao Huang
eb6f2eff4e video/rockchip: rga: Fix gcc-10 warning
drivers/video/rockchip/rga/rga_drv.c: In function 'rga_get_rotate_mode_str':
drivers/video/rockchip/rga/rga_drv.c:199:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
  199 |   else if (req_rga->sina == -65536 && req_rga->cosa == 0)
      |           ^
drivers/video/rockchip/rga/rga_drv.c:202:2: note: here
  202 |  case 0x2:
      |  ^~~~

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I2416a20f4acb5345ee130e6e93ea923205b4e395
2021-07-27 19:05:33 +08:00
Tao Huang
53bbaaab0f rk: clang-wrapper.py ignore atags_to_fdt.c:129
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Icbfa48cfd16e9eacd6780032954d5f7e3f016aad
2021-07-27 19:04:30 +08:00
YouMin Chen
8a169769bb arm64: dts: rockchip: rk3568: modify dmc clk
ddr clk using SCMI, replace <&cru SCLK_DDRCLK> with <&scmi_clk 3>

Change-Id: Ibce1779718c6800d3ce3e334ce0ed5151b9a6eec
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-27 18:48:07 +08:00
YouMin Chen
a02f4a7f2e PM / devfreq: rockchip_dmc: rk3568: add rockchip_ddr_set_rate
Add rockchip_ddr_set_rate to support ddr frequency switching.
This function wraps the SMC call and frequency switching is
implemented in ATF. Afterwards it will call clk_get_rate to
update the rate in clock framework.
Set dmcfreq->is_set_rate_in_dmc=true to enable this process.

Change-Id: I9349a2e8413751360bf105a70e46d1453791194c
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-27 18:48:07 +08:00
YouMin Chen
d1e5d1a895 arm64: dts: rockchip: rk356x: dmc: Replace system-status-freq by system-status-level
"system-status-level" property define only frequency level, not the
actual frequency. In dmc driver, it will switch from frequency level
to actual frequency base on available frequencies table which get
from ATF.

Change-Id: I489b671da5e56912d4f970d32174bdc8b1f86a08
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-27 18:48:07 +08:00
YouMin Chen
55821a0836 PM / devfreq: rockchip_dmc: rk3568: get available frequencies from ATF
Add the function of rockchip_get_freq_info to get available ddr
frequencies info via SMC call. The frequency info include available
frequencies count and frequencies table(sort by rate from low to high).
Afterwards it will update the dmc_opp_table base on frequencies info.

If have "system-status-level" property in dmc, the function of
rockchip_get_system_status_level will get the frequency for
system-status base on frequency level and available frequencies table.

Change-Id: I73d0f999e718ba9426ad75e48ac2a4ec3fe5f496
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-27 18:48:07 +08:00
YouMin Chen
f2b003043c dt-bindings: soc: rockchip: add dram frequency level support
Change-Id: I57b14a8682f9987327ff83f6c98708abd3ec8d8b
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-27 18:48:07 +08:00
Steven Liu
307b69d178 serial: 8250_port: reset LSR DLAB before set MCR
When setting the 16550 serial port baud rate, you need
to configure the UART to loopback mode. After setting
the DLL and DLH, you need to reset the LSR first,
and then configure the MCR to make the UART return
to the normal mode. If you do not reset the LSR
first, an error will occur when the UART RX is still
receiving data.

Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: Ia940b278554ef1d4e7a6c4550fe4a4600407a57e
2021-07-27 17:47:21 +08:00
Tao Huang
5083bf6d03 serial: 8250: Call serial8250_init() early when CONFIG_ROCKCHIP_THUNDER_BOOT=y
Before dw8250_platform_driver probe.

Change-Id: I46382f1d563ed75897e964c625b91b6f8be0481a
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-07-27 17:47:21 +08:00
Huibin Hong
44b8b0f5f2 serial: 8250: enable programmable transmit interrupt mode
Enable programmable transmit interrupt mode in order to increase
system performance.

Change-Id: Ic1ef9ecae0c6feb00170ad97ee3c6245ca3bf068
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-07-27 17:47:21 +08:00
Mark Yao
2a083e031d drm/rockchip: hdmi: support yuv420 mode on rk3288w
Change-Id: Ie7c68dad11a98a1142388deadb7d3034443f9658
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2021-07-27 17:42:15 +08:00
Nickey Yang
3db372714e drm/rockchip: dw_hdmi: add default 594Mhz clk for 4K@60hz
add 594Mhz configuration parameters in rockchip_phy_config

Change-Id: Iaa335cdd90059817fd9892877e574f8b84f2b5dc
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2021-07-27 17:42:15 +08:00
Algea Cao
7b29b5f295 drm/rockchip: dw_hdmi: Support HDMI 2.0 YCbCr 4:2:0
Some old code has too many conflicts with the upstream code,
so recombine and commit these changes.

Including these changes:
1.Support yuv420.
2.Limit rk3229/rk3328 max output resolution.
3.Support dynamically get input/out color info.
4.Introduce mpll_cfg_420.
5.use drm_mode_is_420 instead of DRM_MODE_FLAG_420_MASK.

Change-Id: I42462284b16f26b7adef0e9455903ee5fc71e432
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-07-27 17:42:15 +08:00
Zheng Yang
23cdfcc164 drm/rockchip: hdmi: Use Synopsys HDMI TX Controller YUV420 bus format
Change-Id: Ib787054dc1b6d81090a6aa94c3dabce91219e335
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2021-07-27 17:42:15 +08:00
Zheng Yang
300a685623 drm/rockchip: dw_hdmi: support ROCKCHIP_OUT_MODE_YUV420
VOP output mode and bus_format must be ROCKCHIP_OUT_MODE_YUV420
and MEDIA_BUS_FMT_YUV8_1X24 when display mode has a YCbCr420
flag.

Change-Id: Ib2d51c119f5a8f1b8a9285c47ab228b22a293d56
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2021-07-27 17:42:15 +08:00
Algea Cao
e63c116c2e drm: rockchip: hdmi: check sink max_tmds_clock in mode_valid
If sink max TMDS clock < 340MHz, we think the mode pixel clock
greater than 340MHz should support YCbCr420, or it is a bad mode.

Change-Id: I3930e943f5bdf7ca86b3e719c55e6aa57e8eff53
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-07-27 17:42:15 +08:00
Algea Cao
ae93137500 drm/rockchip: dw_hdmi: get rid of clock slop
Clock slop is a solution for rk3288, not suitable for rk3399,
after use crtc mode_valid, we can remove the clock slop.

Change-Id: I68121505dfb7e65bf09c26d51c23edc909bdb517
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-07-27 17:42:15 +08:00
Algea Cao
0a52ff8181 drm/rockchip: dw_hdmi: check display mode with crtc mode valid
Change-Id: I23470e46b97169da0b59153dfc0835833f1aa549
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-07-27 17:42:15 +08:00
Algea Cao
157918bc84 CHROMIUM: drm: rockchip/dw_hdmi: introduce werid audio tmds_n table
There are some rates that would be ranged for better clock jitter at
Chrome OS tree, like 25.175Mhz would range to 25.170732Mhz.

But due to the clock is aglined to KHz in struct drm_display_mode,
this would bring some inaccurate error if we still run the compute_n
math, so let's just code an const table for it until we can actually
get the right clock rate.

Change-Id: Ief14b7c9bffa95ff3b173925f3e1bd795625320d
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/316280
Commit-Ready: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-07-27 17:42:15 +08:00
Yakir Yang
9dd3cb3411 CHROMIUM: drm: bridge/dw_hdmi: improved the hdmi audio N/CTS cacluate math
The original math would bring some inaccurate to N/CTS that would
caused those magic number won't fit the HDMI 1.4 Spec request:
	128 * SampleRate = Tmds * N / CTS;

So this time we try to improved to math of N that would find the
minimal inaccurate with the HDMI 1.4 Spec.

Change-Id: Ied3cde3c352d955ae6f15d5e7fb172e92316c2a5
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/315424
Reviewed-by: Douglas Anderson <dianders@chromium.org>
2021-07-27 17:42:15 +08:00
Algea Cao
19b0683460 CHROMIUM: drm: rockchip/dw_hdmi-rockchip: Protect against > 2GHz pixel clocks
Add a check just to make sure that someone doesn't try to give us a
pixel clock that is > 2GHz.  If they did that, some of our math might
overflow, so it's good to make sure we don't do it.

Change-Id: I451602f0d771bb16b399b43e376e1054b7ee060f
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/284642
Reviewed-by: Alexandru Stan <amstan@chromium.org>
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-07-27 17:42:15 +08:00
Douglas Anderson
52e7b391aa FROMLIST: drm/rockchip: dw_hdmi: Use auto-generated tables
The previous tables for mpll_cfg and curr_ctrl were created using the
20-pages of example settings provided by the PHY vendor.  Those
example settings weren't particularly dense, so there were places
where we were guessing what the settings would be for 10-bit and
12-bit (not that we use those anyway).  It was also always a lot of
extra work every time we wanted to add a new clock rate since we had
to cross-reference several tables.

In <http://crosreview.com/285855> I've gone through the work to figure
out how to generate this table automatically.  Let's now use the
automatically generated table and then we'll never need to look at it
again.

We only support 8-bit mode right now and only support a small number
of clock rates and and I've verified that the only 8-bit rate that was
affected was 148.5.  That mode appears to have been wrong in the old
table.

Change-Id: I42b260300880f2bab6732c5ee3b11bc78e87500c
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
(am from https://patchwork.kernel.org/patch/9223325)
2021-07-27 17:42:15 +08:00
Yakir Yang
043d4c43e2 FROMLIST: drm/rockchip: dw_hdmi: adjust cklvl & txlvl for RF/EMI
Dut to the high HDMI signal voltage driver, Mickey have meet
a serious RF/EMI problem, so we decided to reduce HDMI signal
voltage to a proper value.

The default params for phy is cklvl = 20 & txlvl = 13 (RF/EMI failed)
  ck: lvl = 13, term=100, vlo = 2.71, vhi=3.14, vswing = 0.43
  tx: lvl = 20, term=100, vlo = 2.81, vhi=3.16, vswing = 0.35

1. We decided to reduce voltage value to lower, but VSwing still
keep high, RF/EMI have been improved but still failed.
   ck: lvl =  6, term=100, vlo = 2.61, vhi=3.11, vswing = 0.50
   tx: lvl =  6, term=100, vlo = 2.61, vhi=3.11, vswing = 0.50

2. We try to keep voltage value and vswing both lower, then RF/EMI
test all passed  ;)
   ck: lvl = 11, term= 66, vlo = 2.68, vhi=3.09, vswing = 0.40
   tx: lvl = 11, term= 66, vlo = 2.68, vhi=3.09, vswing = 0.40
When we back to run HDMI different test and single-end test, we see
different test passed, but signle-end test failed. The oscilloscope
show that simgle-end clock's VL value is 1.78v (which remind LowLimit
should not lower then 2.6v).

3. That's to say there are some different between PHY document and
measure value. And according to experiment 2 results, we need to
higher clock voltage and lower data voltage, then we can keep RF/EMI
satisfied and single-end & differen test passed.
  ck: lvl =  9, term=100, vlo = 2.65, vhi=3.12, vswing = 0.47
  tx: lvl = 16, term=100, vlo = 2.75, vhi=3.15, vswing = 0.39

Change-Id: I766df9ad519ddddb9be76f95fbbdb36c5a2d6e51
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
(am from https://patchwork.kernel.org/patch/9223303/)
2021-07-27 17:42:15 +08:00
Douglas Anderson
be630e69b1 FROMLIST: drm/rockchip: dw_hdmi: Set cur_ctr to 0 always
Jitter was improved by lowering the MPLL bandwidth to account for high
frequency noise in the rk3288 PLL.  In each case MPLL bandwidth was
lowered only enough to get us a comfortable margin.  We believe that
lowering the bandwidth like this is safe given sufficient testing.

Change-Id: Ife266747f0e6ed46f914f4868362fefc481440f9
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9223301/)
2021-07-27 17:42:15 +08:00
Algea Cao
cabb9735d1 drm/rockchip: dw_hdmi: Compatible with two inno hdmi phy names
4.4 kernel inno hdmi phy name is "hdmi_phy".
4.19 kernel inno hdmi phy name is "hdmi".

Change-Id: Ie87aa205c89154b417887a84703ce7bd9ffb2c7f
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-07-27 17:42:15 +08:00
Yu Qiaowei
f9d1b18dda video/rockchip: rga: adapt to kernel 5.10
1. Use dma_sync_single_for_device to flush cache.
2. Refer to RGA2 adaptation kernel 5.10.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Iebd7f092b8dd070661cde12fd8669d2bdf4001c3
2021-07-27 17:02:07 +08:00
Yifeng Zhao
df25c9db87 drivers: rk_nand: fix complie error
complie error messege:
drivers/rk_nand/rk_ftlv5_arm32.S:5405:2: error: invalid instruction, did you mean: strb?
 strlsb r4, [r5, #-2712] ^
drivers/rk_nand/rk_ftlv5_arm32.S:5406:2: error: invalid instruction, did you mean: strb, strh?
 strhib r4, [r5, #-2720] ^
drivers/rk_nand/rk_zftl_arm32.S:4792:2: error: invalid instruction, did you mean: ldrexh, ldrh?
ldrneh r3, [r2, #124] ^

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I3059d565b4fa8f32bb2e488bd1e39ccbcfc8a6da
2021-07-27 17:01:50 +08:00
Tao Huang
3d11013d8b MALI: midgard: Kbuild: Fix src path
Make $(src) as absolute path if it isn't already, by prefixing $(srctree).
Fix build module with "O=dir".

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I50a809faee21afd66d8f2025d05602a8a85293df
2021-07-27 15:04:15 +08:00
Tao Huang
d94eb2767e MALI: utgard: Kbuild: Fix src path
Make $(src) as absolute path if it isn't already, by prefixing $(srctree).
Fix build module with "O=dir".

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I4e6d1f252e51956dc264e544ebbf7cf774a39c5d
2021-07-27 14:58:35 +08:00
YouMin Chen
b1ea54223a clk: rockchip: clk-ddr: fix return value in rockchip_ddrclk_sip_set_rate
Returns success (0) or negative errno in rockchip_ddrclk_sip_set_rate call.

Change-Id: I9c424d8625a465c235ac5f6b0795f51848e65283
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-26 19:05:25 +08:00
Jacob Chen
c042adc2a6 clk: rockchip: do not register ddrclk if PSCI is not enabled on arm32
ARM32 system can run without trustos,
we should prevent arm_smccc_smc being called in such system.

Change-Id: Ic87b78107b464e3ab8dc72a3ca1fa9a64e358580
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-07-26 19:05:07 +08:00
Tao Huang
0bad88f3ef ARM: psci: Export psci_smp_available()
Allow some rockchip drivers call this API.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I56965dda83f5f5400230615283875990a85929d8
2021-07-26 19:04:55 +08:00
YouMin Chen
ff3405ff4c clk: rockchip: remove spin_lock in the rockchip_ddrclk_sip_set_rate
Change-Id: Ia3d04aef8fbf8093c2a3a89a845f948f69c8611f
Signed-off-by: YouMin Chen <cym@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-07-26 19:04:41 +08:00
Finley Xiao
d2b92a90ea clk: rockchip: support setting ddr clock via SCPI and SIP Version 2 APIs
On rk3368, let a mcu scaling ddr clock via SCPI (System Control and
Power Interface) APIs.

Change-Id: I95342b876caad991e6d1319c5e4ec793365c7981
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-26 19:01:46 +08:00
Steven Liu
c945c9dcda pwm: sysfs: Add PWM oneshot mode support
Allow a user to write pwm oneshot_count value. If oneshot_count == 0,
the pwm works in continuous mode. If 0 < oneshot_count < 256, the
pwm works in oneshot mode.

Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: Icbcea85dc1d625a4ac24fee4ab07f1e2421bde77
2021-07-26 18:29:57 +08:00
Steven Liu
ea419b14d6 pwm: rockchip: Support pwm oneshot mode for specified number of cycles.
The oneshot_count value should be less than PWM_ONESHOT_COUNT_MAX.
If oneshot_count == 0, this pwm channel works in continuous mode.

Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: I45857fb5762e0365cce5278502479c580638e40c
2021-07-26 18:29:57 +08:00
Tao Huang
c83c32522f video: rockchip: mpp: Fix compilation warning on ARM
In file included from drivers/video/rockchip/mpp/mpp_iommu.c:12:
./arch/arm/include/asm/dma-iommu.h:27:33: warning: declaration of
'struct bus_type' will not be visible outside of this function [-Wvisibility]
arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, u64 size);

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ieac6a2ab326a62fbb6831643519d55ab532ec3e9
2021-07-26 18:15:59 +08:00
Yu Qiaowei
865b1e840f video/rockchip/rga: Fix the error of dst R2Y color space abnormality.
This commit must be updated when using im2d api.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I0cd8e53323f45c3410703f149587ea884cdbe624
2021-07-26 17:43:17 +08:00
Huibin Hong
5760581699 serial: 8250: support rx dma mode only
Most SOCS have only 8 or 6 channels, but have more than 16
peripherals. If those peripherals work together, some
fails to request dma channel, because there are no enough
channels. And maybe it's unnecessary to use dma for uart
tx. It is necessary for uart rx when hardware auto flow
control is not used.

&uart0 {
	dma-names = "!tx", "rx";  // disable uart tx with dma
	status = "okay";
};

Change-Id: Ia74477514ba57300a4d19a5c2565ae7b5b8ab521
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-07-26 14:31:51 +08:00
Huibin Hong
ec403a4036 serial: 8250_dma: support rockchip dma transfer
Change-Id: I0735c41c7d55770eb24c6dede62d623ae8285bdd
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-07-26 10:09:14 +08:00
Huibin Hong
fc7855d6f2 serial: 8250_dw: lost one byte sometime when receive
To avoid "too much work for irq" issue, cherry pick the patch.
It reads the RBR to clear the time out interrupt, but sometime the
rx fifo may be not empty while cpu reads the RBR. Which would cause
the data lost.

patch for "too much work":06451e93ab59e5b1843c29cbb468a274f4919563

By the way, current patch can't get rid of the risk entirely, so I
try a lot to solve it. Unfortunately, I only got the phenomenon that
lower pclk can reduce the probability. And I check the dw data sheet,
it has pclk and sclk, so there is synchronization problem. But it
only requires (slck < 4*pclk).

Change-Id: I01a36c689b43310294c45294abcf4982f5ddf2af
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-07-26 10:09:14 +08:00
Huibin Hong
b03cab30e2 serial: 8250_dw: clear time out interrupt when in dma mode
Change-Id: Iebeacce7cea7be8a71ae0dad17db5bcdeb26d52a
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2021-07-26 10:09:14 +08:00