linux.git
6 years agoMLK-16819-1: CEC: Add HDMI CEC driver
Sandor Yu [Wed, 15 Nov 2017 07:55:30 +0000 (15:55 +0800)]
MLK-16819-1: CEC: Add HDMI CEC driver

Add iMX8 HDMI CEC function.
Support CEC MSG TX and RX function.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16748-02: HDMI: Support iMX8MQ HDMI in HDMI DRM driver
Sandor Yu [Fri, 13 Oct 2017 07:37:19 +0000 (15:37 +0800)]
MLK-16748-02: HDMI: Support iMX8MQ HDMI in HDMI DRM driver

-Add iMX8MQ HDMI function support in iMX8 HDMI DRM driver.
-EDID read function supported for iMX8MQ.
-Move iMX8QM clock management functions and pixel link
setting functions to iMX8QM SOC specific struct.
-replace printk with pr_info, dev_warn and dev_err.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Changes made during rebase to 4.19:
 * removed drm_edid_to_eld call as it's redundant;
 * replaced drm_mode_connector_update_edid_property with
   drm_connector_update_edid_property;

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16748-01: HDMI: Add iMX8MQ HDMI PHY config function
Sandor Yu [Fri, 13 Oct 2017 04:33:10 +0000 (12:33 +0800)]
MLK-16748-01: HDMI: Add iMX8MQ HDMI PHY config function

Add iMX8MQ HDMI PHY configuration source code
to iMX8 HDMI DRM driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16675-5: drm: imx: dcss: fix BLKCTL for B0 silicon
Laurentiu Palcu [Wed, 8 Nov 2017 08:23:28 +0000 (10:23 +0200)]
MLK-16675-5: drm: imx: dcss: fix BLKCTL for B0 silicon

B0 silicon brings some changes in the BLKCTL registers that need to be
properly used for B0 to work. This patch adds support for that.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16675-4: arm64: defconfig: compile DRM DCSS driver
Laurentiu Palcu [Thu, 19 Oct 2017 13:23:15 +0000 (16:23 +0300)]
MLK-16675-4: arm64: defconfig: compile DRM DCSS driver

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16597: hdmi: Fix kernel dump issue
Sandor Yu [Tue, 17 Oct 2017 11:13:23 +0000 (19:13 +0800)]
MLK-16597: hdmi: Fix kernel dump issue

Kernel will dump when CONFIG_CC_STACKPROTECTOR_STRONG is enable.

[    2.675537] CDN_API_HDMITX_Set_Mode_blocking ret = 0
[    2.675550] Kernel panic - not syncing: stack-protector: Kernel stack
is corrupted in: ffff000008ad5a50
[    2.675550]
[    2.675557] CPU: 2 PID: 1553 Comm: kworker/2:2 Not tainted
4.9.56-641868-gead64f8 #12
[    2.675559] Hardware name: Freescale i.MX8MQ EVK (DT)
[    2.675576] Workqueue: events deferred_probe_work_func
[    2.675578] Call trace:
[    2.675587] [<ffff00000808974c>] dump_backtrace+0x0/0x1d0
[    2.675594] [<ffff000008089930>] show_stack+0x14/0x1c
[    2.675602] [<ffff000008401650>] dump_stack+0x8c/0xac
[    2.675609] [<ffff0000081b0b24>] panic+0x13c/0x2a8
[    2.675617] [<ffff0000080c5ec4>] print_tainted+0x0/0xa4
[    2.675624] [<ffff000008ad5a50>] Afe_write+0x0/0x50
[    2.675632] [<ffff00000849aff0>] hdmi_init.constprop.3+0x188/0x1d0
[    2.675638] [<ffff00000849b264>] imx_hdmi_probe+0x22c/0x2ac
[    2.675645] [<ffff0000086d543c>] platform_drv_probe+0x50/0xc8
[    2.675650] [<ffff0000086d3530>] driver_probe_device+0x218/0x2b8
[    2.675655] [<ffff0000086d3710>] __device_attach_driver+0x98/0xe8
[    2.675660] [<ffff0000086d126c>] bus_for_each_drv+0x60/0xb0
[    2.675665] [<ffff0000086d31bc>] __device_attach+0xd4/0x128
[    2.675669] [<ffff0000086d38f8>] device_initial_probe+0x10/0x18
[    2.675674] [<ffff0000086d275c>] bus_probe_device+0x90/0x98
[    2.675679] [<ffff0000086d2bf0>] deferred_probe_work_func+0x7c/0xb0
[    2.675685] [<ffff0000080e1580>] process_one_work+0x144/0x434
[    2.675690] [<ffff0000080e1ec4>] worker_thread+0x200/0x4a4
[    2.675696] [<ffff0000080e81f0>] kthread+0xf0/0x104
[    2.675701] [<ffff000008082e80>] ret_from_fork+0x10/0x50

It is cause by array variable access exceed.
Fixed it with correct array size.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-13946-2: hdp: add i2s clock for imx8qm hdmi audio
Shengjiu Wang [Thu, 12 Oct 2017 05:58:51 +0000 (13:58 +0800)]
MLK-13946-2: hdp: add i2s clock for imx8qm hdmi audio

hdmi audio need to enable the i2s clock and i2s_bypass clock

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-16538-4: defconfig: Add hdmi/dp driver to default kernel build
Sandor Yu [Fri, 29 Sep 2017 06:05:32 +0000 (14:05 +0800)]
MLK-16538-4: defconfig: Add hdmi/dp driver to default kernel build

Default enable hdmi/dp drm dirver.

Acked-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16570-2: hdmi audio: Add hdmi audio config function
Sandor Yu [Wed, 11 Oct 2017 11:05:13 +0000 (19:05 +0800)]
MLK-16570-2: hdmi audio: Add hdmi audio config function

Add hdmi audio config function to hdmi driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16570-1: hdp: Add hdp audio config function
Sandor Yu [Wed, 11 Oct 2017 11:00:58 +0000 (19:00 +0800)]
MLK-16570-1: hdp: Add hdp audio config function

Add hdp audio config function to hdp driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16538-3: hdmi/dp: Add imx8qm hdmi/dp driver
Sandor Yu [Fri, 29 Sep 2017 06:22:36 +0000 (14:22 +0800)]
MLK-16538-3: hdmi/dp: Add imx8qm hdmi/dp driver

Add hdmi/dp drm architecture driver.
HDMI and DP driver can work in imx8qm ARM2 board.
The driver support basic hotplug function.
Default working mode is 1080p60.

Acked-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
Changes made during 4.19 rebase:
 * replaced drm_mode_connector_attach_encoder with drm_connector_attach_encoder;

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16538-2: hdmi api: Relocate hdmi api soure code
Sandor Yu [Fri, 29 Sep 2017 06:16:27 +0000 (14:16 +0800)]
MLK-16538-2: hdmi api: Relocate hdmi api soure code

-Relocate hdmi api source code from drivers/video/fbdev/mxc/cdn_hdp
to drivers/mxc/hdp.
-Add displayport and hdcp api function.
-Move t28hpc_hdmitx function from api source code folder
to hdmi fb driver folder.
-Update imx8 hdmi fb driver according api source code change.
-Sync api source code with CDN_API_1_0_33 release.

Acked-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16184: hdmi: Add timeout check to hdmi initialize
Sandor Yu [Thu, 10 Aug 2017 10:51:10 +0000 (18:51 +0800)]
MLK-16184: hdmi: Add timeout check to hdmi initialize

Add timeout check for hdmi FW alive function to avoid
kernel booting hang for that board without HDMI FW.

CDN_API_General_Test_Echo_Ext_blocking is the first
function that calling mailbox.
Add timeout to the function to avoid kernel booting hang
for that board without HDMI ROM patch.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16119-01: fbdev: Add mx8 hdmi driver
Sandor Yu [Tue, 1 Aug 2017 09:41:01 +0000 (17:41 +0800)]
MLK-16119-01: fbdev: Add mx8 hdmi driver

Add hdmi api code from cadence.
Add mx8 hdmi driver.
Basic hdmi function:
no hotplug and no video mode dynamic change.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16675-3: drm: imx: register mscale DCSS driver with IMX DRM core
Laurentiu Palcu [Thu, 19 Oct 2017 09:30:51 +0000 (12:30 +0300)]
MLK-16675-3: drm: imx: register mscale DCSS driver with IMX DRM core

To be used, the iMX8M DCSS driver has to be "registered" with the IMX
DRM core.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16675-2: drm: imx: add mscale DCSS drm driver
Laurentiu Palcu [Thu, 19 Oct 2017 09:29:54 +0000 (12:29 +0300)]
MLK-16675-2: drm: imx: add mscale DCSS drm driver

This patch adds DRM KMS support for i.MX8M's DCSS.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16675-1: drm: imx: add mscale DCSS core driver
Laurentiu Palcu [Thu, 19 Oct 2017 09:27:23 +0000 (12:27 +0300)]
MLK-16675-1: drm: imx: add mscale DCSS core driver

This patch adds base suport for i.MX8M's Display Controller
subsystem(DCSS). It has built-in DPR, Scaler and HDR10 modules. Also, it
features a video Decompression and Tile to Raster Conversion (DTRC) unit,
as well as a graphics pixel decompression infrastracture (DEC400D).

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMGS-4653 upgrade 6.2.4.p4 gpu driver for L4.19
Xianzhong [Fri, 29 Mar 2019 07:28:13 +0000 (15:28 +0800)]
MGS-4653 upgrade 6.2.4.p4 gpu driver for L4.19

source branch: gpu-viv6/fsl_6.2.4.p4
commit: 5d4888f3d031ced5923839345f82973cb3e74663

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
6 years agoMLK-21274-3 drm/bridge: sec-dsim: add defer probe support
Fancy Fang [Thu, 28 Mar 2019 14:54:12 +0000 (22:54 +0800)]
MLK-21274-3 drm/bridge: sec-dsim: add defer probe support

Since the dsi panel device is not a component, so its driver
loading can be before or after the other display components
binding randomly. So add defer probing for sec dsim bridge
attach to support the case that the panel driver is loaded
after sec dsim binding.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-21274-2 drm/bridge: sec-dsim: remove bridge assign for encoder
Fancy Fang [Thu, 28 Mar 2019 14:56:29 +0000 (22:56 +0800)]
MLK-21274-2 drm/bridge: sec-dsim: remove bridge assign for encoder

Remove the bridge assignment for encoder before the bridge
attach during the sec dsim bind stage, since if the bridge
attach succeeds, the assignment will be done in the attach,
or if attach fails, the encoder's bridge field should be
set to NULL, otherwise below warning message printed:

[    1.034614] WARNING: CPU: 1 PID: 1 at drivers/gpu/drm/drm_bridge.c:150 drm_bridge_detach+0x4c/0x54
[    1.043570] Modules linked in:
[    1.046630] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.19.30-03537-g02a6fac0da96 #338
[    1.054544] Hardware name: FSL i.MX8MM EVK board (DT)
[    1.059595] pstate: 60000005 (nZCv daif -PAN -UAO)
[    1.064386] pc : drm_bridge_detach+0x4c/0x54
[    1.068657] lr : drm_encoder_cleanup+0x28/0xa4
[    1.073099] sp : ffff00000807b9d0
[    1.076412] x29: ffff00000807b9d0 x28: ffff80007ab3ba80
[    1.081725] x27: 0000000000000039 x26: ffff80007a8a3080
[    1.087039] x25: ffff80007ab3ba88 x24: ffff80007ab6c800
[    1.092352] x23: 00000000ffffffed x22: ffff000008f1c518
[    1.097665] x21: ffff80007ab6c800 x20: ffff80007ab3ba88
[    1.102978] x19: 0000000000000000 x18: 0000000000000000
[    1.108291] x17: 0000000000000001 x16: 00000000000000fc
[    1.113604] x15: 0000000000000000 x14: 64697262206d6973
[    1.118917] x13: 642063657320646e x12: 6962206f74206465
[    1.124230] x11: ffffffffffffffff x10: 0000000000000006
[    1.129543] x9 : 0000000000000005 x8 : 000000000000068e
[    1.134856] x7 : 7320646e6962206f x6 : ffff000008668de4
[    1.140169] x5 : 0000000000000000 x4 : 0000000000000000
[    1.145481] x3 : ffffffffffffffff x2 : 0000000000000000
[    1.150794] x1 : 31cae07dd51c2b00 x0 : ffff80007a7bd580
[    1.156107] Call trace:
[    1.158555]  drm_bridge_detach+0x4c/0x54
[    1.162478]  drm_encoder_cleanup+0x28/0xa4
[    1.166574]  imx_sec_dsim_bind+0x1c4/0x1f8
[    1.170673]  component_bind_all+0xfc/0x24c
[    1.174770]  imx_drm_bind+0xa0/0x134
[    1.178346]  try_to_bring_up_master+0x148/0x1a8
[    1.182877]  component_add+0x9c/0x174
[    1.186539]  lcdif_crtc_probe+0x20/0x3c
[    1.190376]  platform_drv_probe+0x4c/0xb0
[    1.194385]  really_probe+0x21c/0x2b4
[    1.198047]  driver_probe_device+0xa8/0xfc
[    1.202143]  __driver_attach+0xd4/0xd8
[    1.205892]  bus_for_each_dev+0x64/0xc0
[    1.209728]  driver_attach+0x20/0x28
[    1.213303]  bus_add_driver+0x1c0/0x224
[    1.217140]  driver_register+0x68/0x120
[    1.220976]  __platform_driver_register+0x4c/0x54
[    1.225682]  lcdif_crtc_driver_init+0x18/0x20
[    1.230040]  do_one_initcall+0x58/0x168
[    1.233877]  kernel_init_freeable+0x1b4/0x274
[    1.238235]  kernel_init+0x10/0x104
[    1.241724]  ret_from_fork+0x10/0x18
[    1.245300] ---[ end trace a1ee52d990264440 ]---

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-21274-1 gpu/imx: lcdif: set 'dma_mask' for client devices
Fancy Fang [Wed, 27 Mar 2019 11:28:41 +0000 (19:28 +0800)]
MLK-21274-1 gpu/imx: lcdif: set 'dma_mask' for client devices

Since the client devices are allocated manually in this driver,
its 'dma_mask' will not be initialized before its probe start,
and this will cause the dma configure for the client devices to
give a warning message "DMA mask not set". So make 'dma_mask' to
point to its 'coherent_dma_mask' by default to avoid this warnning.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-21150-4 drm/bridge: sec-dsim: a general way to compute PLL PMS
Fancy Fang [Sun, 17 Mar 2019 04:16:26 +0000 (12:16 +0800)]
MLK-21150-4 drm/bridge: sec-dsim: a general way to compute PLL PMS

A fixed PLL PMS setting for attached panel is obviously not
enough for any other mipi panel which needs a different PLL
output clock frequency, and besides, for the CEA-861 standard
display modes, the 'pll_pms' table also can not cover all the
modes requirements. So a general way is created to solve this
problem which can provide an optimum solution to output a PLL
bit clock to match the request frequency in a maximum degree
and also satisfy the input clock and intermediate clocks limit
according to the PLL specification.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit a73fdd5e48fe0df47685cfc197fe66edc1e28405)

6 years agoMLK-21150-3 drm/bridge: sec-dsim: add a new property 'pref-rate'
Fancy Fang [Fri, 15 Mar 2019 04:09:58 +0000 (12:09 +0800)]
MLK-21150-3 drm/bridge: sec-dsim: add a new property 'pref-rate'

Add a new property 'pref-rate' support which can be used to
assign a different clock frequency for the DPHY PLL reference
clock in the dtb file. And if this property does not exist,
the default clock frequency for the reference clock will be
used. And according to the spec, the DPHY PLL reference clk
frequency should be in [6MHz, 300MHz] range.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit a9fafe8108505f8a1580af898ff5fa9c26d03680)

6 years agoMLK-21150-2 drm/bridge: sec-dsim: refine hblank word count compute
Fancy Fang [Fri, 15 Mar 2019 03:23:46 +0000 (11:23 +0800)]
MLK-21150-2 drm/bridge: sec-dsim: refine hblank word count compute

When there is no existing horizontal blanking word counts in
'dsim_hblank_par' tables, these data requires to be computed
according to the 'hfp', 'hbp' and 'hsa' timings which are in
pixel unit. So the pixel unit data requires to be converted
to word count unit data correctly to match the PLL output clk
frequency.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit af9ab0d4362d9298978e2ac62033f65ea1cc09ed)

6 years agoMLK-21150-1 drm/bridge: sec-dsim: change uint64_t clk fields to uint32_t
Fancy Fang [Fri, 15 Mar 2019 02:33:35 +0000 (10:33 +0800)]
MLK-21150-1 drm/bridge: sec-dsim: change uint64_t clk fields to uint32_t

Change the 'bit_clk' and 'pix_clk' fields of struct sec_mipi_dsim
and the 'bit_clk' field of struct dsim_pll_pms from 'uint64_t' type
to 'uint32_t' type, since first, these two fields are in KHz unit,
and so 32 bit unsigned integer is enough to hold the data values,
and second, use 32 bit integer can simplify related clocks compute.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 3e62c748a531ca5eacbf6a616d3a979be5222b9c)

6 years agoMLK-20687 drm/bridge: sec-dsim: correct LPM config for Long Packet
Fancy Fang [Mon, 7 Jan 2019 02:29:42 +0000 (10:29 +0800)]
MLK-20687 drm/bridge: sec-dsim: correct LPM config for Long Packet

According to the test, the Low Power Mode config should be
done before the Long Packet payload is written to SFR FIFO.
Otherwise, the packet send out by DSIM is not correct. This
should be the DSIM implementation behaviour.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit c7833c3920264c32934870bc49006348be9ad397)

6 years agoMLK-20438 drm/bridge: sec-dsim: remove 'FORCEBTA' for packet send
Fancy Fang [Sat, 1 Dec 2018 09:08:20 +0000 (17:08 +0800)]
MLK-20438 drm/bridge: sec-dsim: remove 'FORCEBTA' for packet send

Configure 'FORCEBTA' mandatorily for every packet send may
cause some packet send timeout in a low possibility. And
until now, this timeout issue only happens during panel
disable callback with the below error log:

"
imx_sec_dsim_drv 32e10000.mipi_dsi: wait pkthdr tx done time out
panel-raydium-rm67191 32e10000.mipi_dsi.0: [drm:rad_panel_disable] *ERROR* Failed to enter sleep mode (-16)
imx_sec_dsim_drv 32e10000.mipi_dsi: panel disable failed: -16
panel-raydium-rm67191 32e10000.mipi_dsi.0: [drm:rad_panel_unprepare] *ERROR* Panel still enabled!
imx_sec_dsim_drv 32e10000.mipi_dsi: panel unprepare failed: -1
"

The root cause for this error is not clear, but remove
'FORCEBTA' can avoid it and won't cause any side effect.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 811696087681cd45a8150afff7a8da3a2a6eb113)

6 years agoMLK-20337 drm/imx: lcdif: block 'active CRTC with no plane' commit
Fancy Fang [Mon, 26 Nov 2018 11:17:51 +0000 (19:17 +0800)]
MLK-20337 drm/imx: lcdif: block 'active CRTC with no plane' commit

When an atomic commit contains an active CRTC with no plane,
it may cause two potential issues:

First, this CRTC will fetch its last attached plane data
or has no data can be fetched depending on the plane
driver's atomic_disable() implementation.

Second, this CRTC's 'plane_changed' will be false during
the whole commit tail stage, and this will make vblank
wait to be bypassed which directly causes the later wait
flip done timeout.

So add this commit case check to the LCDIF CRTC's atomic
check to block this kind of commits.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit e4b792704c1ed48296f135fdab47070c4987881b)

6 years agoMLK-20416-2 video: fbdev: mxc: add RM68191 MIPI panel support
Fancy Fang [Tue, 20 Nov 2018 05:00:54 +0000 (13:00 +0800)]
MLK-20416-2 video: fbdev: mxc: add RM68191 MIPI panel support

The Driver IC 'RM68191' is used in the MIPI panel
'RK055IQH042' whose default mode is '540x960@60Hz'.
So this commit adds a new FBDEV driver for 'RM68191'
and enables the 'RK055IQH042' panel on IMX7ULP1-EVKB
platform with Northwest MIPI DSI controller.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 8d529576c51cf38e32d48dbc88834d688e06fc8b)

6 years agoMLK-20416-1 video: fbdev: mxc: add RM68200 MIPI panel support
Fancy Fang [Mon, 12 Nov 2018 14:25:24 +0000 (22:25 +0800)]
MLK-20416-1 video: fbdev: mxc: add RM68200 MIPI panel support

The Driver IC 'RM68200' is used in the MIPI panel
'RK055AHD042' whose default mode is '720x1280@60Hz'.
So this commit adds a new FBDEV driver for 'RM68200'
and enables the 'RK055AHD042' panel on IMX7ULP1-EVKB
platform with Northwest MIPI DSI controller.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 277bc948aa17a43285c340399bdaf7f099926677)

6 years agoMLK-19819-2 Revert "MLK-19318 drm/imx: lcdif: avoid log print when no device attached"
Fancy Fang [Tue, 9 Oct 2018 09:26:43 +0000 (17:26 +0800)]
MLK-19819-2 Revert "MLK-19318 drm/imx: lcdif: avoid log print when no device attached"

This reverts commit 05d335b07bab856b34317acbe3e3b9d9f58946ce, since the
commit e07309cfdc567623a3f0cde6b79b972910248152 (MLK-19819-1 drm/imx:
lcdif: bypass atomic check when CRTC is disabled) can cover the function
that commit 05d335b07bab856b34317acbe3e3b9d9f58946ce can provide.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 1201a0e8194da559703d64a26aa346a8de387baa)

6 years agoMLK-19819-1 drm/imx: lcdif: bypass atomic check when CRTC will be disabled
Fancy Fang [Tue, 9 Oct 2018 07:33:04 +0000 (15:33 +0800)]
MLK-19819-1 drm/imx: lcdif: bypass atomic check when CRTC will be disabled

On 4.14.y kernel branch, the DRM framework has been modified that
when no CONNECTOR attach to CRTC, the fb creation wil be deferred
until some CONNECTOR has been detected via hotplug. And the system
suspend workflow is also affected accordingly, if the CRTC atomic
check fails, the display-subsystem suspend also will be caused to
fail. So bypass the 'bus_format' check when CRTC is going to be
disabled.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6d54c414c2226bebe7201c69a67891eb4fcc5449)

6 years agoMLK-19318 drm/imx: lcdif: avoid log print when no device attached
Fancy Fang [Fri, 31 Aug 2018 03:27:29 +0000 (11:27 +0800)]
MLK-19318 drm/imx: lcdif: avoid log print when no device attached

In the 'lcdif_crtc_atomic_check()', when the 'bus_format' is
zero which means that there is no valid display peripherals
attached to LCDIF, return directly to avoid below error log
to make noises, since the error log is not cared in this case.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 25d2b80f637af06094f56c60d46404af3b7ff381)
(cherry picked from commit 535a7256a3eae059398acaa040f42a4aa650bbea)

6 years agoMLK-19400-2 drm/imx: sec-dsim_imx: alter 'rpm_suspended' to a counter
Fancy Fang [Wed, 29 Aug 2018 02:58:19 +0000 (10:58 +0800)]
MLK-19400-2 drm/imx: sec-dsim_imx: alter 'rpm_suspended' to a counter

Since the DSIM's runtime PM suspend() and resume() callbacks
are also called during system PM suspend() and resume(), it
is necessary to use a counter to record the suspended depth,
and 'rpm_suspended' field can be used as this purpose which
can help to detect and avoid runtime suspend and resume calls
mismatch caused problems, by changing the 'rpm_suspended' to
be an atomic integer from a boolean type.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 91a8e6c8f63db328fbc752b1659bdaa67ee5c8d5)
(cherry picked from commit 09f6ef5494d5fec7e3949bd80e4b51200b60dee3)

6 years agoMLK-19400-1 drm/bridge: sec-dsim: correct one fail branching
Fancy Fang [Thu, 30 Aug 2018 07:13:57 +0000 (15:13 +0800)]
MLK-19400-1 drm/bridge: sec-dsim: correct one fail branching

Obviously, DRM panel prepare is done after the DSIM PLL config,
so when PLL config failed, the 'sec_mipi_dsim_bridge_enable()'
should return directly instead of goto DRM panel unprepare.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 9c77865d6ec98ff60a82f03743fd797d082634cc)
(cherry picked from commit a9de06cdd2d8c2a677d687791eb31ad965951ece)

6 years agoMLK-19317-2 drm/bridge: sec-dsim: fine tune for '720p@60Hz' mode on 2 lanes
Fancy Fang [Thu, 30 Aug 2018 13:23:23 +0000 (21:23 +0800)]
MLK-19317-2 drm/bridge: sec-dsim: fine tune for '720p@60Hz' mode on 2 lanes

There is an issue that run several times of modetest 720p@60 test,
display turns to be abnormal or no display. So fine tunning the
DPHY TIMING config to use the same timing config of '720p@60Hz'
mode on 4 data lanes for the same display mode no 2 data lanes.
Until now, it works fine with this config.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6ca115f778cf61691ef4c20d8473e5818f96ad31)
(cherry picked from commit 12740608ad7a6e94b6d1a9bdcffbc96087bb3a3e)

6 years agoMLK-19317-1 drm/bridge: sec-dsim: add missing 'ctrail' assignment
Fancy Fang [Thu, 30 Aug 2018 09:45:47 +0000 (17:45 +0800)]
MLK-19317-1 drm/bridge: sec-dsim: add missing 'ctrail' assignment

In the macro 'DSIM_DPHY_TIMING' definition, the field
'clk_trail' assignment to 'ctrail' is missing which
certainly needs to be added.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit f2818410d3d8d3b09002a85b593cee192d60bb06)
(cherry picked from commit 4cda22c138913af72f4eddf9ce53c98d96c69379)

6 years agoMLK-19252-7 drm/bridge: sec-dsim: workaround for 720p@60Hz on 4 lanes
Fancy Fang [Fri, 24 Aug 2018 02:29:53 +0000 (10:29 +0800)]
MLK-19252-7 drm/bridge: sec-dsim: workaround for 720p@60Hz on 4 lanes

For the CEA standard mode '1280x720@60Hz', the standard HFP value
is not suitable for the DSI peripheral which works with Non-burst
with Sync Pulse mode with 4 data lanes enabled. And this commit is
a workaround to plus 2 to the original HFP value to make this case
can display correctly.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 8b39ff24f89c5a9d21459ab5af47259060185b0a)
(cherry picked from commit 56c91a7ee40f866ae770b2f20b3ea623c6c2f0cc)
(cherry picked from commit cff6ad221228f69728c689a8ca7359eaa642573c)

6 years agoMLK-19252-6 drm/bridge: sec-dsim: improve DPHY TIMING configs
Fancy Fang [Tue, 21 Aug 2018 14:09:35 +0000 (22:09 +0800)]
MLK-19252-6 drm/bridge: sec-dsim: improve DPHY TIMING configs

The SEC provides a table to guide the DPHY TIMINGS config based
on the PLL output bit clock frequency for DSIM. So create the
table which is used by SEC LN14LPP DPHY with HS Timing v1.2 and
this table will be used by the SEC DSIM Bridge driver to help to
config the corresponding DPHY Timings correctly for each display
mode. Along with the table, a DPHY TIMING table entry 'compare'
method is implemented for the binary search when lookup the
suitable DPHY TIMING entry.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit eb899b434be6127db26c370bf200d8072eaf01c4)
(cherry picked from commit 3b23233dafd65d6ea8c1fa12e8992c58ebc412bc)
(cherry picked from commit f83d7cac521cb4d20ac2f9093354f55055189ff7)

6 years agoMLK-19252-5 drm/bridge: sec-dsim: improve PLL PMS configs
Fancy Fang [Thu, 16 Aug 2018 11:12:46 +0000 (19:12 +0800)]
MLK-19252-5 drm/bridge: sec-dsim: improve PLL PMS configs

Generally, different modes request different frequency bit clock,
so create a table to contain the PLL PMS config for each display
mode. This commit first contains several PLL PMS config entry for
several most popular CEA standard display modes.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 016ebc631e592e16848cd6426dd5b262a401746f)
(cherry picked from commit 5cddc84ba36c8107ec24f44a59351886181acdf1)
(cherry picked from commit c423258e23b9c6e7c3d777a856b370fc0715baff)

6 years agoMLK-19252-4 drm/bridge: sec-dsim: improve HT configs
Fancy Fang [Thu, 16 Aug 2018 06:00:26 +0000 (14:00 +0800)]
MLK-19252-4 drm/bridge: sec-dsim: improve HT configs

To make some DSI peripheral which can work only with 'Non-burst
with Sync Pulse mode' to display CEA standard timings, and there
is no common way to get the horizontal blanking timings for all
the display modes according to the test, and this is also related
with the data lanes used for data transfer, so create an horizontal
blanking parameters table for 2 and 4 data lanes mode respectively
for several popular CEA standard display modes.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 8fe1e3d77af5d380da4642c9f99c2dc59f5c5484)
(cherry picked from commit dbd661c160530e94e8c92c3272b77d74a72f48af)
(cherry picked from commit 31bf411cfeee65f9a15a9cf70ea9a9cda5203e2c)

6 years agoMLK-19252-3 drm/bridge: sec-dsim: workaround 3 data lanes case
Fancy Fang [Wed, 15 Aug 2018 06:14:21 +0000 (14:14 +0800)]
MLK-19252-3 drm/bridge: sec-dsim: workaround 3 data lanes case

According to a lot of tests and debug, for the Non-Burst with
Sync Pulse mode with 3 data lanes enable, the DSI peripheral
ADV7535 cannot display correctly, but the output timings seems
to be correct. Until now, the root cause for this issue still
cannot be found. So make this workaround to force to use 2 data
lanes when meeting the 3 lanes requests.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6e7bc3bfd5b03da698a4024199bb696b792cc14e)
(cherry picked from commit 14f43f0aef26418e10f7840db726e990e557a2d1)
(cherry picked from commit 28dfae13bc259a99b8ee15f95e65b48cc7dbb2f8)

6 years agoMLK-19252-2 drm/bridge: adv7511: realize mode_fixup for lanes fixup
Fancy Fang [Wed, 15 Aug 2018 02:45:27 +0000 (10:45 +0800)]
MLK-19252-2 drm/bridge: adv7511: realize mode_fixup for lanes fixup

In the current implementation, the data lanes fixup is done in
the Bridge's mode_set() function which is too late to give the
upper layer Bridge a chance to check this change to be supported
or not and a chance to refuse this commit if it does not support
the requested data lanes number.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit c97f9febd7e42d7865921e2bb56648ebb13c0761)
(cherry picked from commit 36f25495a5c30e66e033cfd3d46d4693f50fc8f7)
(cherry picked from commit de7e9c83c7503255c512b5c78165ba7924c7269e)

6 years agoMLK-19252-1 drm/bridge: sec-dsim: move PLL check to DSIM Encoder
Fancy Fang [Wed, 15 Aug 2018 01:28:09 +0000 (09:28 +0800)]
MLK-19252-1 drm/bridge: sec-dsim: move PLL check to DSIM Encoder

Defer the PLL output check to the SEC DSIM Encoder's atomic check
from SEC DSIM Bridge's mode_fixup(), since in the attached DSI
device Bridge's mode_fixup(), it may change the data lanes number,
and this change is done after the SEC DSIM Bridge's mode_fixup().
And the DSIM Encoder's atomic check is the ideal place to do this
PLL check, since it happens after all the Bridges' mode_fixup()
done.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit c9bce66fed982383dde189c428d4c2ee2c2fc623)
(cherry picked from commit ead3666313e552296da7e7b5094579b47dbdc364)
(cherry picked from commit 6a8fa239b31eca24f32b350e3c7e3118684b7323)

6 years agoMLK-19537-3 drm/imx: sec-dsim_imx: remove dphy slave reset
Fancy Fang [Tue, 11 Sep 2018 07:26:39 +0000 (15:26 +0800)]
MLK-19537-3 drm/imx: sec-dsim_imx: remove dphy slave reset

Remove dphy slave reset and only keep master reset for mipi dsi

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit 83f4a5a95262184759f1c99be46e8906dd24543b)
(cherry picked from commit f099988bd36482cf3aea465377339413fd338761)

6 years agoMLK-19158-5 drm/imx: lcdif: add bus format check to CRTC's check
Fancy Fang [Sun, 12 Aug 2018 08:10:01 +0000 (16:10 +0800)]
MLK-19158-5 drm/imx: lcdif: add bus format check to CRTC's check

Add the check to LCDIF CRTC atomic check for the requested bus
format by encoder with the bus format which can be supported by
LCDIF CRTC to refuse unsupported case.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit e98afe9b6b20c2494c8570427b7811ed9ce202e8)
(cherry picked from commit 9f1bb920916492fba4b6c82f4c25203ce8090298)

6 years agoMLK-19158-4 drm/imx: lcdif: remove bus format check from PLANE's check
Fancy Fang [Sun, 12 Aug 2018 07:47:41 +0000 (15:47 +0800)]
MLK-19158-4 drm/imx: lcdif: remove bus format check from PLANE's check

Since the LCDIF output data width can be different from the data
width of input pixel data, so the bus format check in the plane's
atomic check is not correct anymore, and need to be removed.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 2245702e7905fa7b75aec92fdbb9ffeb33bdb6de)
(cherry picked from commit facd1962b0f89cf80435e458194189e55ef00fac)

6 years agoMLK-19158-3 gpu: imx: lcdif: fix output order for 16bpp BGR formats
Fancy Fang [Sun, 12 Aug 2018 04:02:43 +0000 (12:02 +0800)]
MLK-19158-3 gpu: imx: lcdif: fix output order for 16bpp BGR formats

The 16bpp BGR order pixel formats 'DRM_FORMAT_ABGR1555' and
'DRM_FORMAT_XBGR1555' also require to be re-ordered to RGB
order for display, just like the format 'DRM_FORMAT_BGR565'
does.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit f5cc4f4699570fe697d21cb47c54aa91b82c8458)
(cherry picked from commit f16eac4a32b333b8ccdadaebf540f2d2a522d240)

6 years agoMLK-19158-2 drm/imx: lcdif: improve output bus format config
Fancy Fang [Sun, 12 Aug 2018 00:58:43 +0000 (08:58 +0800)]
MLK-19158-2 drm/imx: lcdif: improve output bus format config

According to LCDIF specification, the input pixel data
width and the output pixel data width can be different,
and this conversion is done by LCDIF automatically. So
config the output data width according to the requested
bus format from the encoder, instead to be same with the
input pixel data width.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit bfd27f6d71d86a7f2fc8314f082565db3682b925)
(cherry picked from commit a5940ee5db21adc76721d33c2171aa593d9a8ea8)

6 years agoMLK-19158-1 drm/imx: sec-dsim_imx: add bus format check for ENCODER
Fancy Fang [Fri, 10 Aug 2018 14:40:18 +0000 (22:40 +0800)]
MLK-19158-1 drm/imx: sec-dsim_imx: add bus format check for ENCODER

The connector's 'display_info' usually includes all the bus
formats the display peripheral device can be accepted. And
the DRM adjusted display mode's 'private_flags' includes
bus format the DSIM bridge requested according to the DSI
device display format. Add the bus format check to the DSIM
encoder's atomic check to make sure these two bus formats
have intersection.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6d804db82b95411ebad9fcfb43b3acecee5941d9)
(cherry picked from commit db574fd09da97c5f5c2f12b0aa47519969edd06f)

6 years agoMLK-19199 drm/imx: lcdif: replace FB width usage for cropping
Fancy Fang [Fri, 10 Aug 2018 04:22:18 +0000 (12:22 +0800)]
MLK-19199 drm/imx: lcdif: replace FB width usage for cropping

According to the comments of 'struct drm_framebuffer', its
'width' field refers to the logical width of the visible
area of the framebuffer. This may be unequal to the total
pixels number of a line. So use the 'pitches' field to
replace 'width' for the horizontal cropping feature.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 9a2bbbf971ed79b32ae1c7da2d62b8a72f3ccffd)
(cherry picked from commit 0649fa3e27916edf43dcb9f1edc965e2cf1175e1)

6 years agoMLK-19152-3 drm/imx: lcdif: add horizontal crop support to plane update
Fancy Fang [Tue, 7 Aug 2018 10:37:06 +0000 (18:37 +0800)]
MLK-19152-3 drm/imx: lcdif: add horizontal crop support to plane update

Add horizontal cropping support when atomic plane update is
running, and if the attached CRTC needs modeset. And if the
width of visible portion of plane is equal to the fb surface
width, the Pigeon Mode will be disabled, so cropping will be
disabled.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 30672b2b18a07a2926979cc533cbb84ea4a642dd)
(cherry picked from commit 3bdf9efa9f1ebb995c79a60da4d579d21310670d)

6 years agoMLK-19152-2 drm/imx: lcdif: force 'mode_changed' when fb width changed
Fancy Fang [Tue, 7 Aug 2018 09:41:39 +0000 (17:41 +0800)]
MLK-19152-2 drm/imx: lcdif: force 'mode_changed' when fb width changed

In DRM atomic modeset check, it will not check the fb's width
change, so in later atomic commit, it will not disable the CRTC
which has no mode changed. But for LCDIF, the fb width related
registers configuration can not be done when LCDIF is running.
So force 'mode_changed' to be true when fb width changed.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 518ff82756a39ff2d2f750596295baa4f5fca4c5)
(cherry picked from commit c399d83491cb80ca9d6b040cdf3e9d1e709785b2)

6 years agoMLK-19152-1 gpu: imx: lcdif: realize fb horizontal crop via Pigeon Mode
Fancy Fang [Tue, 7 Aug 2018 10:04:54 +0000 (18:04 +0800)]
MLK-19152-1 gpu: imx: lcdif: realize fb horizontal crop via Pigeon Mode

According to the LCDIF specification, the Legacy Mode does not
support cropping function in the horizontal direction, so add
Pigeon Mode which can support this kind of function. And when
enable this mode, the legacy horizontal timings configuration
should use stride value but not the active width, and related
pigeon configuration should use the active width but not the
stride value.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit e6da9542693dd585972897f62748a101f5726a74)
(cherry picked from commit 55a2e07dd598d996cb3fbb35e3a61058962f20a5)

6 years agoMLK-19112 gpu: imx: lcdif: change 'rpm_suspended' to be atomic counter
Fancy Fang [Thu, 2 Aug 2018 06:08:56 +0000 (14:08 +0800)]
MLK-19112 gpu: imx: lcdif: change 'rpm_suspended' to be atomic counter

Change the 'rpm_suspended' field to be an atomic type from
boolean type to make it have the counting ability which can
help to detect and avoid runtime suspend and resume calls
mismatch caused problems.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit dece6fbe51f9c0ea3cd42c52e1c174bd26ae70f1)
(cherry picked from commit 909a7d18608224861ef7a0aca6ba1e736a7570fa)

6 years agoMLK-19083 drm/imx: lcdif: remove untrue condition for pixel format set
Fancy Fang [Sun, 29 Jul 2018 11:09:31 +0000 (19:09 +0800)]
MLK-19083 drm/imx: lcdif: remove untrue condition for pixel format set

After supporting DISPMIX power domain, the LCDIF runtime
resume callback always write '0' to 'LCDIF_CTRL' register
which will clear previous pixel format related setting.
So the previous condition by comparing format change for
setting pixel format during plane atomic update is not
true anymore.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 5f84c69799456f28fd8182fd156e9067921e9a4e)
(cherry picked from commit 364fd1879c587fbdb80aa290df54609c30de7ef8)

6 years agoMLK-19082 drm/bridge: sec-dsim: wait 'ph_tx_done' for long packet send
Fancy Fang [Fri, 27 Jul 2018 14:50:17 +0000 (22:50 +0800)]
MLK-19082 drm/bridge: sec-dsim: wait 'ph_tx_done' for long packet send

According to a lot of tests, for long packet send, the packet
payload transfer done interrupt will be triggered no later than
the packet header transfer done interrupt. So, to make sure the
long packet has been send to the peripheral completely, wait
'ph_tx_done' interrupt instead of 'pl_tx_done' for long packet
transfer. Otherwise it may cause subsequent packet transfer
failed sometimes.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 69a5f44025c6ecb2fee16c1650a81198b501f284)
(cherry picked from commit 9f89a46266ecd905c701cc88e15d2303ac319acd)

6 years agoMLK-19017-7 drm/imx: sec-dsim_imx: add rpm status check for suspend/resume
Fancy Fang [Wed, 25 Jul 2018 07:42:51 +0000 (15:42 +0800)]
MLK-19017-7 drm/imx: sec-dsim_imx: add rpm status check for suspend/resume

Add runtime PM status check during runtime suspend and resume
to avoid unnecessary jobs if it is already in that state which
can avoid possible kernel warnings of clock disable/unprepare
mismatch during system suspend if it is alreay in runtime
suspended state.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6f95c6fdc0de2fd4fe1d835c164f5e3cfb23e17d)
(cherry picked from commit b6f7433f5b795fa16c15ef9cb3551a371f42f25e)

6 years agoMLK-19017-6 drm/imx: add system pm support for SEC DSIM
Fancy Fang [Mon, 2 Jul 2018 10:41:16 +0000 (18:41 +0800)]
MLK-19017-6 drm/imx: add system pm support for SEC DSIM

Implement the suspend()/resume() callbacks to support system
power management functions for SEC DSIM.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit db3e9faa0278af6de5aaac008478123d0ebecb73)
(cherry picked from commit 549fb9fb7d4e29e72f4a5da707b3a378ee81081d)

6 years agoMLK-19017-5 drm/imx: add DISPMIX power domain support for SEC DSIM
Fancy Fang [Mon, 2 Jul 2018 10:33:28 +0000 (18:33 +0800)]
MLK-19017-5 drm/imx: add DISPMIX power domain support for SEC DSIM

After the DISPMIX power domain enabled, all the related registers
will drop their values once runtime pm suspend called. So in the
pm runtime resume process, the SEC DSIM de-reset and some init jobs
need to be done, and these jobs are no longer necessary to be done
during probe bind anymore.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 7a7f17f5fb66135629ef20a2b4780dfef2f0f0ce)
(cherry picked from commit 1f80017f237264f2c84579d8291de210b0ac746c)

6 years agoMLK-19017-4 gpu: imx: lcdif: add rpm status check for suspend/resume
Fancy Fang [Wed, 25 Jul 2018 07:25:37 +0000 (15:25 +0800)]
MLK-19017-4 gpu: imx: lcdif: add rpm status check for suspend/resume

Add runtime PM status check during runtime suspend and resume
to avoid unnecessary jobs if it is already in that state which
can avoid below kernel warnings during system suspend if it is
alreay in runtime suspended state:

[   21.772969] ------------[ cut here ]------------
[   21.772982] WARNING: CPU: 3 PID: 3328 at drivers/clk/clk.c:594 clk_core_disable+0x80/0x88
[   21.772986] Modules linked in:
[   21.772988]
[   21.772993] CPU: 3 PID: 3328 Comm: rtcwakeup.out Not tainted 4.9.88-05410-g9fa23e9ada2a #135
[   21.772995] Hardware name: FSL i.MX8MM EVK board (DT)
[   21.772997] task: ffff800074358c80 task.stack: ffff80007b40c000
[   21.773000] PC is at clk_core_disable+0x80/0x88
[   21.773003] LR is at clk_core_disable_lock+0x20/0x34
[   21.773005] pc : [<ffff0000084e1430>] lr : [<ffff0000084e1a5c>] pstate: 800001c5
[   21.773007] sp : ffff80007b40fa90
[   21.773010] x29: ffff80007b40fa90 x28: 0000000000000000
[   21.773014] x27: 0000000000000002 x26: ffff000009395000
[   21.773017] x25: ffff00000863473c x24: ffff0000092de3d0
[   21.773021] x23: ffff80007a53f870 x22: 0000000000000000
[   21.773024] x21: ffff00000862877c x20: ffff80007a049400
[   21.773027] x19: 0000000000000140 x18: 0000000000000002
[   21.773031] x17: 0000ffff93824858 x16: ffff00000822a200
[   21.773034] x15: 0000463fe3000000 x14: 0000000000000000
[   21.773037] x13: 0000000000000000 x12: 0000000000000000
[   21.773040] x11: 0000000000000000 x10: 0000000000000000
[   21.773044] x9 : 0000000040000000 x8 : 0000000000210d00
[   21.773047] x7 : 0000000000000000 x6 : 0010ed7f00000000
[   21.773051] x5 : ffff80007a53f9a8 x4 : 0000000000000000
[   21.773054] x3 : 0000000010c110c0 x2 : 0000000000000000
[   21.773057] x1 : 0000000000000000 x0 : ffff80007a049400
[   21.773058]
[   21.773060] ---[ end trace 4a8e187491f145ed ]---
[   21.773062] Call trace:
[   21.773065] Exception stack(0xffff80007b40f8b0 to 0xffff80007b40f9e0)
[   21.773068] f8a0:                                   0000000000000140 0000ffffffffffff
[   21.773071] f8c0: ffff80007b40fa90 ffff0000084e1430 00000000800001c5 000000000000003d
[   21.773074] f8e0: ffff80007b475c00 ffff80007b40c000 ffff80007b40c000 000000018020001e
[   21.773077] f900: ffff000008c53cec ffff80007b40c000 ffff80007b40f950 ffff0000085d3b9c
[   21.773081] f920: ffff80007b40f9b0 ffff0000085f3728 ffff80007b475c00 ffff80007b475c00
[   21.773084] f940: ffff80007b40f990 ffff0000085f2430 ffff80007b475c00 ffff80007abf8800
[   21.773087] f960: ffff80007a049400 0000000000000000 0000000000000000 0000000010c110c0
[   21.773090] f980: 0000000000000000 ffff80007a53f9a8 0010ed7f00000000 0000000000000000
[   21.773092] f9a0: 0000000000210d00 0000000040000000 0000000000000000 0000000000000000
[   21.773095] f9c0: 0000000000000000 0000000000000000 0000000000000000 0000463fe3000000
[   21.773098] [<ffff0000084e1430>] clk_core_disable+0x80/0x88
[   21.773101] [<ffff0000084e1a5c>] clk_core_disable_lock+0x20/0x34
[   21.773104] [<ffff0000084e1a8c>] clk_disable+0x1c/0x24
[   21.773110] [<ffff0000085c73a0>] lcdif_disable_clocks+0x1c/0x60
[   21.773113] [<ffff0000085c7718>] imx_lcdif_suspend+0x10/0x24
[   21.773118] [<ffff0000086287a0>] platform_pm_suspend+0x24/0x50
[   21.773123] [<ffff000008633b58>] dpm_run_callback.isra.12+0x30/0x8c
[   21.773126] [<ffff0000086345d4>] __device_suspend+0x110/0x278
[   21.773129] [<ffff000008635800>] dpm_suspend+0x114/0x240
[   21.773132] [<ffff000008635bfc>] dpm_suspend_start+0x6c/0x78
[   21.773137] [<ffff000008104e28>] suspend_devices_and_enter+0xbc/0x534
[   21.773139] [<ffff0000081054f8>] pm_suspend+0x258/0x2f4
[   21.773142] [<ffff000008104030>] state_store+0x80/0xf4
[   21.773147] [<ffff0000083e7ce8>] kobj_attr_store+0x14/0x24
[   21.773153] [<ffff00000825d974>] sysfs_kf_write+0x40/0x48
[   21.773156] [<ffff00000825cd48>] kernfs_fop_write+0xb8/0x1cc
[   21.773160] [<ffff0000081e2d00>] __vfs_write+0x28/0x110
[   21.773163] [<ffff0000081e3ae4>] vfs_write+0xa8/0x1a8
[   21.773166] [<ffff0000081e4ea0>] SyS_write+0x44/0xa0
[   21.773170] [<ffff0000080838d8>] __sys_trace_return+0x0/0x4
[   21.773184] ------------[ cut here ]------------
[   21.773188] WARNING: CPU: 3 PID: 3328 at drivers/clk/clk.c:476 clk_core_unprepare+0x88/0x98
[   21.773190] Modules linked in:
[   21.773192]
[   21.773195] CPU: 3 PID: 3328 Comm: rtcwakeup.out Tainted: G        W       4.9.88-05410-g9fa23e9ada2a #135
[   21.773196] Hardware name: FSL i.MX8MM EVK board (DT)
[   21.773198] task: ffff800074358c80 task.stack: ffff80007b40c000
[   21.773201] PC is at clk_core_unprepare+0x88/0x98
[   21.773204] LR is at clk_unprepare+0x28/0x34
[   21.773206] pc : [<ffff0000084e1320>] lr : [<ffff0000084e3130>] pstate: 60000145
[   21.773208] sp : ffff80007b40faa0
[   21.773211] x29: ffff80007b40faa0 x28: 0000000000000000
[   21.773215] x27: 0000000000000002 x26: ffff000009395000
[   21.773218] x25: ffff00000863473c x24: ffff0000092de3d0
[   21.773221] x23: ffff80007a53f870 x22: 0000000000000000
[   21.773225] x21: ffff00000862877c x20: ffff80007aafbf80
[   21.773228] x19: ffff80007aafb298 x18: 0000000000000002
[   21.773232] x17: 0000ffff93824858 x16: ffff00000822a200
[   21.773235] x15: 0000463fe3000000 x14: 0000000000000000
[   21.773238] x13: 0000000000000000 x12: 0000000000000000
[   21.773241] x11: 0000000000000000 x10: 0000000000000000
[   21.773245] x9 : 0000000040000000 x8 : 0000000000210d00
[   21.773248] x7 : 0000000000000000 x6 : 0010ed7f00000000
[   21.773251] x5 : ffff80007a53f9a8 x4 : ffff00000944b000
[   21.773255] x3 : 0000000000000000 x2 : ffff800074358c80
[   21.773258] x1 : 0000000000000000 x0 : ffff80007a049400
[   21.773259]
[   21.773260] ---[ end trace 4a8e187491f145ee ]---
[   21.773262] Call trace:
[   21.773264] Exception stack(0xffff80007b40f8c0 to 0xffff80007b40f9f0)
[   21.773267] f8c0: ffff80007aafb298 0000ffffffffffff ffff80007b40faa0 ffff0000084e1320
[   21.773270] f8e0: 0000000060000145 000000000000003d ffff80007b40c000 000000018020001e
[   21.773273] f900: ffff000008c53cec ffff80007b40c000 ffff80007b40f950 ffff0000085d3b9c
[   21.773276] f920: ffff80007b40f9b0 ffff0000085f3728 ffff80007b475c00 ffff80007b475c00
[   21.773279] f940: ffff80007b40f990 ffff0000085f2430 ffff80007b475c00 ffff80007abf8800
[   21.773282] f960: ffff80007a049400 0000000000000000 ffff80007a049400 0000000000000000
[   21.773285] f980: ffff800074358c80 0000000000000000 ffff00000944b000 ffff80007a53f9a8
[   21.773288] f9a0: 0010ed7f00000000 0000000000000000 0000000000210d00 0000000040000000
[   21.773291] f9c0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[   21.773293] f9e0: 0000000000000000 0000463fe3000000
[   21.773296] [<ffff0000084e1320>] clk_core_unprepare+0x88/0x98
[   21.773299] [<ffff0000084e3130>] clk_unprepare+0x28/0x34
[   21.773303] [<ffff0000085c73a8>] lcdif_disable_clocks+0x24/0x60
[   21.773306] [<ffff0000085c7718>] imx_lcdif_suspend+0x10/0x24
[   21.773309] [<ffff0000086287a0>] platform_pm_suspend+0x24/0x50
[   21.773312] [<ffff000008633b58>] dpm_run_callback.isra.12+0x30/0x8c
[   21.773315] [<ffff0000086345d4>] __device_suspend+0x110/0x278
[   21.773318] [<ffff000008635800>] dpm_suspend+0x114/0x240
[   21.773321] [<ffff000008635bfc>] dpm_suspend_start+0x6c/0x78
[   21.773324] [<ffff000008104e28>] suspend_devices_and_enter+0xbc/0x534
[   21.773327] [<ffff0000081054f8>] pm_suspend+0x258/0x2f4
[   21.773329] [<ffff000008104030>] state_store+0x80/0xf4
[   21.773332] [<ffff0000083e7ce8>] kobj_attr_store+0x14/0x24
[   21.773336] [<ffff00000825d974>] sysfs_kf_write+0x40/0x48
[   21.773339] [<ffff00000825cd48>] kernfs_fop_write+0xb8/0x1cc
[   21.773342] [<ffff0000081e2d00>] __vfs_write+0x28/0x110
[   21.773345] [<ffff0000081e3ae4>] vfs_write+0xa8/0x1a8
[   21.773347] [<ffff0000081e4ea0>] SyS_write+0x44/0xa0
[   21.773350] [<ffff0000080838d8>] __sys_trace_return+0x0/0x4

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit a6bac9bdebbdecf56575f6e361ad8f54e5263b95)
(cherry picked from commit defd91c3c0e6d237391027fc3e89c52f656357a1)

6 years agoMLK-19017-3 gpu: imx: add system pm support for LCDIF
Fancy Fang [Mon, 2 Jul 2018 09:37:37 +0000 (17:37 +0800)]
MLK-19017-3 gpu: imx: add system pm support for LCDIF

Implement the suspend()/resume() callbacks to support system
power management functions for LCDIF.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 7e00487012753cb370eab4ff5c05f76f7361297f)
(cherry picked from commit ad367beb841a15dc99ef2773f7843d2e83d18edd)

6 years agoMLK-19017-2 gpu: imx: add DISPMIX power domain support for LCDIF
Fancy Fang [Sun, 1 Jul 2018 06:22:50 +0000 (14:22 +0800)]
MLK-19017-2 gpu: imx: add DISPMIX power domain support for LCDIF

After the DISPMIX power domain enabled, all the related registers
will drop their values once runtime pm suspend called. So in the
pm runtime resume process, the LCDIF de-reset and some init jobs
need to be done, and these jobs are no longer necessary to be done
during probe stage anymore.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit f83aaaecaeb54d8b1231be2cb7175ce58682dae7)
(cherry picked from commit aa6a8be1f5e5107d02e58e4091e666a2d8fbfcc6)

6 years agoMLK-18605-15 dt-bindings: display: panel: add 'video-mode' prop for rm67191
Fancy Fang [Mon, 16 Jul 2018 12:52:14 +0000 (20:52 +0800)]
MLK-18605-15 dt-bindings: display: panel: add 'video-mode' prop for rm67191

Add a new property 'video-mode' binding for panel rm67191
which is used to specify a video data transfer mode.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 9dba8643d7b9c73a2b20ef517c79bb799f5ade3d)
(cherry picked from commit 6a427c8e9c4ae06cb84a7d8c70b7a95cf92b4206)

6 years agoMLK-18605-14 drm/imx: lcdif: adjust 'max_height' for '1080x1920' mode
Fancy Fang [Tue, 17 Jul 2018 00:26:53 +0000 (08:26 +0800)]
MLK-18605-14 drm/imx: lcdif: adjust 'max_height' for '1080x1920' mode

Change the maximum height limitation to 1920 to support
'1080x1920' resolution mode. It is a temporary work
around and will be improved later.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 44d0209e97e0c574af30dd7a7d7e059d4ddf996d)
(cherry picked from commit 884680d1decf63f5a9cb3ed4ef1b6452ad6d088a)

6 years agoMLK-18605-10 drm/bridge: sec-dsim: complete mipi panel support
Fancy Fang [Thu, 5 Jul 2018 07:14:26 +0000 (15:14 +0800)]
MLK-18605-10 drm/bridge: sec-dsim: complete mipi panel support

This patch adds mipi panel enable/disable during the dsim
bridge enable/disable procedure and implements required
callbacks and helper functions for dsi panel peripheral
support.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 4ef0a4e4ba0faca91e5b556fd13483aafdb64519)
(cherry picked from commit b43c58d9e04b331aa7468dd4ddf100ef40b766ab)

6 years agoMLK-18605-9 drm/bridge: sec-dsim: increase timeout values for BTA and LPRX
Fancy Fang [Mon, 16 Jul 2018 05:52:11 +0000 (13:52 +0800)]
MLK-18605-9 drm/bridge: sec-dsim: increase timeout values for BTA and LPRX

The current timeout values for 'BTA' and 'LPRX' in register
'DSIM_TIMEOUT' is not long enough for some dsi peripherals,
so increase them long enough for all current peripherals to
avoid timeout errors generation in some cases.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 8e2b86b317382635e74002a5b2a466804247e61a)
(cherry picked from commit cf7e6fc89b939684cb5ee66ff501db540981e222)

6 years agoMLK-18605-8 drm/bridge: sec-dsim: add non-continuous clock support
Fancy Fang [Fri, 13 Jul 2018 10:32:35 +0000 (18:32 +0800)]
MLK-18605-8 drm/bridge: sec-dsim: add non-continuous clock support

Complete the non-continuous clock mode support.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit cd216df51f322434e45d12b6721637f1d8159fe4)
(cherry picked from commit 4b907a32838bf45768a1f687539a09ed96cf53a6)

6 years agoMLK-18605-7 drm/bridge: sec-dsim: correct a register macro misspelt
Fancy Fang [Fri, 13 Jul 2018 02:39:21 +0000 (10:39 +0800)]
MLK-18605-7 drm/bridge: sec-dsim: correct a register macro misspelt

The macro 'CONFIG_NON_CONTINUOUS_CLOCK_LANE' has been misspelt
to 'CONFIG_NON_CONTINOUS_CLOCK_LANE'. So correct it.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 24a05825b7299fc2f60768468fafbbc9a33804ad)
(cherry picked from commit 3f20acbee9329e8a453879f06eaa34f336a43ea2)

6 years agoMLK-18605-6 drm/bridge: sec-dsim: add fifo pointers initialization
Fancy Fang [Fri, 6 Jul 2018 09:43:22 +0000 (17:43 +0800)]
MLK-18605-6 drm/bridge: sec-dsim: add fifo pointers initialization

All the DSIM fifo pointers should be better to be put into the
initialized state before enabling DSIM to transfer commands or
data.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 1c1624e48c83623a538f4af862367e6b3cbf8d67)
(cherry picked from commit 1c9d8b1cce6e173be29141fcf868529204e2c9a8)

6 years agoMLK-18605-5 drm/bridge: sec-dsim: correct 'DSIM_FIFOCTRL' offset
Fancy Fang [Fri, 6 Jul 2018 09:11:55 +0000 (17:11 +0800)]
MLK-18605-5 drm/bridge: sec-dsim: correct 'DSIM_FIFOCTRL' offset

According to the DSIM specification, the 'DSIM_FIFOCTRL'
register addr offset should be '0x4c' instead of '0x48'.
So correct it.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 31850816f3aea109aff6c4bbcb44221e7d74afb5)
(cherry picked from commit 0d6537496801653f4aad63fce9a30f94453c6c10)

6 years agoMLK-18605-4 drm/bridge: sec-dsim: refine data lanes stop state check
Fancy Fang [Wed, 13 Jun 2018 11:45:58 +0000 (19:45 +0800)]
MLK-18605-4 drm/bridge: sec-dsim: refine data lanes stop state check

When the attached dsi device does not use all the data lanes
to transfer data, data lanes stop state check should only
check the lanes used precisely, since unused lanes state is
not guaranteed to be in some stable state.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6787ee8505ab16bf7bba38c721da0bfa87e9de0e)
(cherry picked from commit 6281e4f4b6e0d4f8a0f714fe2112f70f2865c540)

6 years agoMLK-18605-3 drm/bridge: sec-dsim: refuse unknown dsi device attach
Fancy Fang [Wed, 13 Jun 2018 11:01:39 +0000 (19:01 +0800)]
MLK-18605-3 drm/bridge: sec-dsim: refuse unknown dsi device attach

When a dsi device who is neither a bridge nor a panel requests
to be attached to the host, refuse this request directly.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 2e80acc8a611327fcc77d2e73515bc062cdc4233)
(cherry picked from commit 9ef87498c5406b44cd41b9592bdec9c948c962d2)

6 years agoMLK-18605-2 drm/bridge: sec-dsim: allow same panel can be re-attached
Fancy Fang [Wed, 13 Jun 2018 10:22:58 +0000 (18:22 +0800)]
MLK-18605-2 drm/bridge: sec-dsim: allow same panel can be re-attached

During the mode set procedure, some dsi client device may detach
itself first and then attach it again according to the target
display mode parameters. In this case, the dsi client device
should be allowed to be re-attached again. So this is also true
for panel device.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit f586625dd1a665c58b976405c7980b7414554481)
(cherry picked from commit 75f65aebfd661151811339d652e3704f5a7e3936)

6 years agoMLK-18605-1 drm/bridge: sec-dsim: add cleanup when detach dsi client
Fancy Fang [Wed, 13 Jun 2018 09:32:58 +0000 (17:32 +0800)]
MLK-18605-1 drm/bridge: sec-dsim: add cleanup when detach dsi client

When the dsi device is detached, the dsi parameters saved when
the dsi device is attached should be cleaned to avoid to be
misused. And besides, add some sanity check along with this
cleanup.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit a02c30a0ed8acc4a136d2281431fa4b07d66b933)
(cherry picked from commit 0b78ed9b7c61d2b703c1065850bd5f25ea30482f)

6 years agoMLK-19081 drm/bridge: sec-dsim: correct args of 'drm_bridge_attach' call
Fancy Fang [Sat, 28 Jul 2018 11:03:57 +0000 (19:03 +0800)]
MLK-19081 drm/bridge: sec-dsim: correct args of 'drm_bridge_attach' call

Obviously, according to the drm_bridge_attach()'s definition,
the passing arguments of its function call should be corrected
here.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit e04e4d286abf204b5db058018112026ad5d08271)

6 years agoMLK-18560 drm/imx: lcdif: refine bus format sanity check for plane
Fancy Fang [Mon, 11 Jun 2018 07:57:48 +0000 (15:57 +0800)]
MLK-18560 drm/imx: lcdif: refine bus format sanity check for plane

Add an function to get the LCDIF controller supported bus
formats according to the pixel format bpp. And change the
bus format sanity check in the plane's atomic check to see
if the bus format required by the peripheral attached to
LCDIF can be supported by LCDIF.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit f1d0c89ec48e6b76ddde9c55744ebb341f74ab3a)

6 years agoMLK-18535-12 dt-bindings: display: imx: add eLCDIF device node
Fancy Fang [Thu, 7 Jun 2018 06:09:34 +0000 (14:09 +0800)]
MLK-18535-12 dt-bindings: display: imx: add eLCDIF device node

Add the device-tree bindings for the display node eLCDIF
on i.MX platforms.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit b5bbc0b7aac35101edfa9bfe6079d97a2c847175)

6 years agoMLK-18535-10 drm/imx: lcdif: limit the maximum resolution to '1920x1080'
Fancy Fang [Wed, 6 Jun 2018 16:10:12 +0000 (00:10 +0800)]
MLK-18535-10 drm/imx: lcdif: limit the maximum resolution to '1920x1080'

For now, the higher resolution than '1920x1080' is not supported
yet. So limit the 'max_width' and 'max_height' of mode_config
to be 1920 and 1080.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 0ad9839e59978e2c425f6d7ffa9b4561598625b5)

6 years agoMLK-18535-9 ARM64: defconfig: enable 'IMX_SEC_DSIM' config
Fancy Fang [Sun, 3 Jun 2018 16:04:13 +0000 (00:04 +0800)]
MLK-18535-9 ARM64: defconfig: enable 'IMX_SEC_DSIM' config

Enable the 'IMX_SEC_DSIM' config by default in ARM64
defconfig.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 3a1bb280c4b5338dfb9c8a8b24929e02b7803aee)

6 years agoMLK-18535-8 drm/imx: sec_mipi_dsim-imx: add DSIM host driver
Fancy Fang [Wed, 6 Jun 2018 15:46:37 +0000 (23:46 +0800)]
MLK-18535-8 drm/imx: sec_mipi_dsim-imx: add DSIM host driver

The Samsung DSIM host driver mainly focuses on the config
related with soc platforms. And the controller itself config
has been moved to the sec-dsim bridge driver.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 941ef8c5fc870b72d18c1ec5abc69c5523647cba)

6 years agoMLK-18535-7 drm/bridge: sec-dsim: add bridge driver support
Fancy Fang [Wed, 6 Jun 2018 15:32:56 +0000 (23:32 +0800)]
MLK-18535-7 drm/bridge: sec-dsim: add bridge driver support

This is the abstracted bridge driver for Samsung MIPI DSIM
controller. This driver only foucses on the DSIM controller
itself configurations and never care about any config about
the platforms. So it can be shared by different platforms
without any modifications.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit beb9d163c755fe7ae960b79d85c0c1436a8dc057)

6 years agoMLK-18535-6 drm/imx: core: add LCDIF support
Fancy Fang [Wed, 6 Jun 2018 15:20:43 +0000 (23:20 +0800)]
MLK-18535-6 drm/imx: core: add LCDIF support

Allows the LCDIF to be one of the supported client
components. And set the 'legacyfb_depth' of LCDIF
to be 32.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit dae914b351853add6d506925cc0c9742ee698bc4)

6 years agoMLK-18535-5 drm/imx: add LCDIF DRM/KMS driver
Fancy Fang [Wed, 6 Jun 2018 14:52:35 +0000 (22:52 +0800)]
MLK-18535-5 drm/imx: add LCDIF DRM/KMS driver

This is a new DRM/KMS driver for LCDIF which conforms
to the IMX DRM Core framework. It provides support for
CRTCs, Planes and mode config of KMS.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit a104e928da7281a3089ff31afb2df979f35716b8)

6 years agoMLK-18535-4 ARM64: defconfig: enable 'IMX_LCDIF_CORE' config
Fancy Fang [Sun, 27 May 2018 08:40:13 +0000 (16:40 +0800)]
MLK-18535-4 ARM64: defconfig: enable 'IMX_LCDIF_CORE' config

Enable the 'IMX_LCDIF_CORE' config by default in ARM64
defconfig.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 09f1d5639676712f813cec99254abe29175ff9b3)

6 years agoMLK-18535-3 gpu: imx: add LCDIF core driver
Fancy Fang [Wed, 6 Jun 2018 14:26:28 +0000 (22:26 +0800)]
MLK-18535-3 gpu: imx: add LCDIF core driver

The LCDIF core driver is responsible to provide controller
registers configuration and create the platform devices for
the child port nodes. And the platform devices later will
attach to the corresponding DRM/KMS drivers via name match.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit ca168846dcfe6d498d33f4a977b21b25ca5c6c41)

6 years agoMLK-21257-5: arm64: dts: fix warnning when complie dts
Guoniu.Zhou [Wed, 27 Mar 2019 06:33:59 +0000 (14:33 +0800)]
MLK-21257-5: arm64: dts: fix warnning when complie dts

Because ov5640 device node has been in fsl-imx8qxp-mek-ov5640-rpmsg.dts,
so there is no need to another one.

In 4.19 kernel dts, local endpoint need to match one remote endpoint,
not for two or more, so delete redundant node.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-21257-4: arm64: dts: change compatible string for i2c node of mipi csi
Guoniu.Zhou [Wed, 27 Mar 2019 03:15:50 +0000 (11:15 +0800)]
MLK-21257-4: arm64: dts: change compatible string for i2c node of mipi csi

Because "fsl,imx8qm-lpi2c" was remove from of_device_id structure in
i2c-imx-lpi2c.c driver, so add "fsl,imx7ulp-lpi2c" in compatible string
of i2c node.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-21257-3: media: isi: fix some conflicts when do upgrade
Guoniu.Zhou [Wed, 27 Mar 2019 03:10:51 +0000 (11:10 +0800)]
MLK-21257-3: media: isi: fix some conflicts when do upgrade

Fix some conflicts when do kernel 4.19 upgrade

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-20923: ISI: improve ISI memory to memory performance
Guoniu.Zhou [Wed, 13 Feb 2019 10:50:39 +0000 (18:50 +0800)]
MLK-20923: ISI: improve ISI memory to memory performance

Refer to ISI validataion code, there is no need to enable ISI
mem2mem read done interrupt and driver can handle buffers in
frame received interrupt service

Remove 50ms delay when enable ISI AXI read, it will improve
performance obviously

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit bdabe035cd5c57d713f824e61f120213ed9357ba)
(cherry picked from commit 7dd4c6affaaceefd80e6b4a033c21f6b26303902)

6 years agoMLK-20595-2: camera: check camera's running state before suspend
Guoniu.Zhou [Mon, 17 Dec 2018 02:16:55 +0000 (10:16 +0800)]
MLK-20595-2: camera: check camera's running state before suspend

Check camera's running state before suspend for imx8qm/qxp
and don't support suspend when camera's running

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-19957-1: ISI: clean isi status before enable interrupt
Guoniu.Zhou [Wed, 17 Oct 2018 02:16:08 +0000 (10:16 +0800)]
MLK-19957-1: ISI: clean isi status before enable interrupt

Because ISI can't restore to default state after software
reset, the status value of exit will be maintained. If not
cleared, ISI will triggle fake interrupt after enableing irq,
but there is not ready for data.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 932af3df1745f5afb0b9433d3355b2e24b177f4e)

6 years agoMLK-19901: ISI: manually clean isi status register
Guoniu.Zhou [Fri, 12 Oct 2018 02:55:41 +0000 (10:55 +0800)]
MLK-19901: ISI: manually clean isi status register

When QM run two linux and divide ISI resource into two
parts, channel 0-3 for one linux and channel 4-7 for the
other. If dom0 destroy domU which camera is running, then
restart domU. ISI will trigger interrupt immediately after
register irq handler when driver probe. The reason for this
is that status register of ISI isn't cleared. ISI have no
ablility to reset its register to defautl value expcept power
off all resource of ISI, but it can't be done in two os. So
manually clean status before registering irq when driver probe.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit b84601aaef15870c80f684b1881b22e9dd2ba9a3)

6 years agoMLK-19514-2: ISI: use ping-pong buffer of ISI
Guoniu.Zhou [Tue, 4 Sep 2018 10:05:38 +0000 (18:05 +0800)]
MLK-19514-2: ISI: use ping-pong buffer of ISI

1. Use ping-pong buffer of isi.
2. Add multi-plane support for m2m out queue. When
V4L2 m2m device support multi-plane, it should be
applied for both input and output, so add it.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-19343: ISI: add memory to memory support for qm and qxp
Guoniu.Zhou [Mon, 27 Aug 2018 10:28:23 +0000 (18:28 +0800)]
MLK-19343: ISI: add memory to memory support for qm and qxp

Add memory to memory support for qm and qxp. Because only
ISI channel0 can support memory to memory feature so this
feature only support one channel. User can use channel 0
as other function when it isn't used for m2m.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
6 years agoMLK-19111: ISI: fix module installation fail issue
Guoniu.Zhou [Tue, 31 Jul 2018 09:41:20 +0000 (17:41 +0800)]
MLK-19111: ISI: fix module installation fail issue

If build ISI driver as module and insmod it after system
boot up, it will fail. Because lack of MODULE_LICENSE("GPL")
,insmod isi driver will print many unknown symbol messages

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
6 years agoMLK-19108: ISI: fix isi hang issue when open it many times
Guoniu.Zhou [Tue, 31 Jul 2018 07:58:41 +0000 (15:58 +0800)]
MLK-19108: ISI: fix isi hang issue when open it many times

When one ISI channel is receiving data, if an other process
just open it at the same time and then close, it will lead
to this channel hang. The reason is soft reset in release
callback, so it make the channel stop work. Add an counter
for open isi channel and really soft reset the channel when
the counter equal to zero.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
6 years agoMLK-18517-1: ISI: fix system reboot stress test from nfs fail
Guoniu.Zhou [Thu, 28 Jun 2018 01:47:54 +0000 (09:47 +0800)]
MLK-18517-1: ISI: fix system reboot stress test from nfs fail

1. System will dump painc message and hang when do system
reboot stress test. It caused by ISI HW reset function. When
user open the video device, it will get the device and driver
will turn on ISI power domain, but after that, ISI HW reset
will first turn off and then turn on it's power. During this
time, the process which open ISI channel 0 maybe sleep and
the other process which open other ISI channel will active but
the other channel power domain depend on channel 0. It leads to
system panic. So change msleep to udelay and move HW reset to
other place.

2. Refine ISI system and runtime suspend/resume.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-18482: ISI: fix isi resume fail issue
Guoniu.Zhou [Tue, 12 Jun 2018 08:56:14 +0000 (16:56 +0800)]
MLK-18482: ISI: fix isi resume fail issue

Driver enable clock will fail in isi system power resume
callback because isi power domain is power off after system
power suspend so driver need to get device before disable
clock in system power suspend/resume callback and then put
device after disable clock.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 668fdea95ff9b4588f02a5c4285d56b90e05ccb4)

6 years agoMLK-17230-8: camera: add CI_PI in camera device framework
Guoniu.Zhou [Mon, 5 Feb 2018 08:26:38 +0000 (16:26 +0800)]
MLK-17230-8: camera: add CI_PI in camera device framework

Add CI_PI and ov5640 camera sensor support in camera device
framework. The data flow is "ov5640->ci_pi->isi_ch0". Disable
the other channels of ISI.

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 37bc5d225e8a3eeb21fef5d94335d1edb2036988)