linux.git
6 years agoMLK-21525 drm/imx: dpu: kms: Disallow primary plane on-the-fly disablement
Liu Ying [Tue, 23 Apr 2019 11:25:24 +0000 (19:25 +0800)]
MLK-21525 drm/imx: dpu: kms: Disallow primary plane on-the-fly disablement

The below commit introduced in v4.16 reveals the fact that the DPU KMS
driver doesn't support primary plane on-the-fly disablement.  This may
cause display issue when we restart weston with 4kp60 display for i.MX8QM.
To support this, we need considerable driver change, but doesn't make
too much sense, because disabling primary plane on an active CRTC doesn't
often happen for real graphics update.  In order not to run into this problem,
we can explicitly disallow this use case in ->atomic_check().  This rejection
makes us fall back to disable CRTC when removing the primary plane's
framebuffer according to the below commit's rationale, which is the original
behavior of atomic_remove_fb().

commit 846c7dfc1193 ("drm/atomic: Try to preserve the crtc enabled state in drm_atomic_remove_fb, v2.")

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-21524: VPU Decoder: tsm ignore invalid timestamp in some case
ming_qian [Tue, 23 Apr 2019 09:24:36 +0000 (17:24 +0800)]
MLK-21524: VPU Decoder: tsm ignore invalid timestamp in some case

If one frame is split into several buffers.
The timestamp of the first buffer is valid, others are invalid.
TSManagerGetLastTimeStamp() will try to get the last timestamp of frame.
it may get a invalid timestamp. and this will output some wrong timestamp.
so ignore these invalid timestamp

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21522: VPU Decoder: fix the api of tsm is not thread safe
ming_qian [Tue, 23 Apr 2019 07:42:07 +0000 (15:42 +0800)]
MLK-21522: VPU Decoder: fix the api of tsm is not thread safe

the api of tsm is not thread safe.
but in driver context, it's multithread.
add a lock to protect the api

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years ago[i.MX845/VPU]:MLK-21235: multi instance encode process fail to resume encoding during...
Zhou Peng [Tue, 23 Apr 2019 05:32:35 +0000 (13:32 +0800)]
[i.MX845/VPU]:MLK-21235: multi instance encode process fail to resume encoding during suspend resume test.100%

Add mirror registers to store HW registers before power off
Replace 'wait_event_interruptible' with 'wait_event_timeout' to avoid interrupted

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit 789a419a5d4c0fed3eb0cbe83999bf8a65a980b4)

6 years agoMLK-21521 VPU Decoder: add new v4l2_s_contrl for contrl decode frame disable reorder
Shijie Qin [Tue, 23 Apr 2019 07:21:14 +0000 (15:21 +0800)]
MLK-21521 VPU Decoder: add new v4l2_s_contrl for contrl decode frame disable reorder

    #define V4L2_CID_USER_FRAME_DIS_REORDER (V4L2_CID_USER_BASE + 0x1300)

    cfg.ops = &vpu_custom_ctrl_ops;
    cfg.id = V4L2_CID_USER_FRAME_DIS_REORDER;
    cfg.name = "frame disable reoder ctrl";
    cfg.min = 0;
    cfg.max = 1;
    cfg.step = 1;
    cfg.def = 0;
    cfg.type = V4L2_CTRL_TYPE_BOOLEAN;

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
6 years agoMLK-21520-3 spi: lpspi: remove fsl_lpspi->chipselect
Clark Wang [Tue, 23 Apr 2019 07:43:29 +0000 (15:43 +0800)]
MLK-21520-3 spi: lpspi: remove fsl_lpspi->chipselect

Replace fsl_lpspi->chipselect by controller->cs_gpios. Clean up the
code.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21520-2 spi: lpspi: add multi SS support in PIO mode
Clark Wang [Tue, 23 Apr 2019 07:16:35 +0000 (15:16 +0800)]
MLK-21520-2 spi: lpspi: add multi SS support in PIO mode

Add "fsl,spi-num-chipselects" check to support multi SS function in PIO
mode.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21520-1 spi: lpspi: add NULL check when probe device
Clark Wang [Tue, 23 Apr 2019 07:11:58 +0000 (15:11 +0800)]
MLK-21520-1 spi: lpspi: add NULL check when probe device

Add a NULL check for device node and lpspi_platform_info when lpspi
device probe.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21503 rpmsg: imx: refine imx rpmsg codes
Richard Zhu [Fri, 19 Apr 2019 09:01:50 +0000 (17:01 +0800)]
MLK-21503 rpmsg: imx: refine imx rpmsg codes

No functions changes.
- Use the dynamic allocation, and remove the pre-defined static
  structure.
- Remove the vdev layer notify block codes.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
6 years agoMLK-21247 rpmsg: imx: do not check the remote ready flag in suspend mode
Richard Zhu [Mon, 25 Mar 2019 09:22:00 +0000 (17:22 +0800)]
MLK-21247 rpmsg: imx: do not check the remote ready flag in suspend mode

Since, the partition reset irq would be triggered anytime.
Do not read the status of the MU if master side is in suspend mode.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
(cherry picked from commit 117dbcb1ce258587f8d162c0b3219f32d6de6fbc)

6 years agoMLK-21244 rpmsg: imx: move pm ops to noirq phrase
Anson Huang [Sat, 23 Mar 2019 03:56:47 +0000 (11:56 +0800)]
MLK-21244 rpmsg: imx: move pm ops to noirq phrase

Some rpmsg user may require rpmsg resume before the user start
handle its irq, e.g the typec controller use a GPIO as irq and
use rpmsg to get event status, so move imx rpmsg power management
ops to noirq phrase.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Tested-by: Clark Wang <xiaoning.wang@nxp.com>
Signed-off-by: Anson Huang <anson.huang@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21087-6:[i.MX8QXP/VPU]: Integrate timestamp manager into driver
ming_qian [Mon, 22 Apr 2019 09:28:29 +0000 (17:28 +0800)]
MLK-21087-6:[i.MX8QXP/VPU]: Integrate timestamp manager into driver

Some frames are not for display,
so the timestamp of these frames should be skipped.

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21458: mxc-jpeg: Implement V4L2_ENC_CMD_STOP
Mirela Rabulea [Thu, 18 Apr 2019 17:02:24 +0000 (20:02 +0300)]
MLK-21458: mxc-jpeg: Implement V4L2_ENC_CMD_STOP

Implementation is similar with V4L2_DEC_CMD_STOP, but cannot unify them,
due to different structures.
Also added the other V4L2_*_CMD_* commands to the switch,
but as "not implemented" for now.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-21507 VPU Decoder: kernel panic if seek when video playing
Shijie Qin [Sat, 20 Apr 2019 07:17:57 +0000 (15:17 +0800)]
MLK-21507 VPU Decoder: kernel panic if seek when video playing

    The same buffer prepend to the list twice at
    'VID_API_EVENT_REL_FRAME_BUFF'event and vpu_buf_queue()
    cause list form a dead cycle.
    Add an verification before prepend to list at vpu_buf_queue().

Unable to handle kernel paging request at virtual address dead000000000100
[<ffff000008bce7f4>] wait_right_buffer+0x60/0xac
[<ffff000008bd28f0>] vpu_api_event_handler+0xc64/0x1990
[<ffff000008bd3704>] vpu_msg_instance_work+0xe8/0x12c
[<ffff0000080f8518>] process_one_work+0x140/0x3f8
[<ffff0000080f8908>] worker_thread+0x138/0x3e4
[<ffff0000080fed70>] kthread+0x104/0x130
[<ffff000008085064>] ret_from_fork+0x10/0x18

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
6 years agoMLK-21437-2 VPU Decoder: add new v4l2_s_ctrl for adjust vpu_frm_depth
Shijie Qin [Thu, 18 Apr 2019 06:29:49 +0000 (14:29 +0800)]
MLK-21437-2 VPU Decoder: add new v4l2_s_ctrl for adjust vpu_frm_depth
    the default value should be vpu_frm_depth when init

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
6 years agoMLK-21087-5:[i.MX8QXP/VPU]: Integrate timestamp manager into driver
ming_qian [Fri, 19 Apr 2019 05:31:52 +0000 (13:31 +0800)]
MLK-21087-5:[i.MX8QXP/VPU]: Integrate timestamp manager into driver

For some format, scode is need to insert before or after frame data.
It may cause that the input frame length is not match with
the consumed frame length.

The scode can be calculated as part of input frame.

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21087-4:[i.MX8QXP/VPU]: Integrate timestamp manager into driver
ming_qian [Thu, 18 Apr 2019 09:00:54 +0000 (17:00 +0800)]
MLK-21087-4:[i.MX8QXP/VPU]: Integrate timestamp manager into driver

set tsm_use_consumed_length default to 1

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21442: VPU Decoder: could not handle timestamp with start offset
ming_qian [Thu, 18 Apr 2019 06:38:43 +0000 (14:38 +0800)]
MLK-21442: VPU Decoder: could not handle timestamp with start offset

add some nxp buf flags: CODECCONFIG and TIMESTAMP_INVALID
if TIMESTAMP_INVALID is enabled, drop the timestamp.

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21087-3:[i.MX8QXP/VPU]: Integrate timestamp manager into driver
ming_qian [Thu, 18 Apr 2019 02:16:20 +0000 (10:16 +0800)]
MLK-21087-3:[i.MX8QXP/VPU]: Integrate timestamp manager into driver

Lower the level of the log indicating invalid frame rate

Signed-off-by: ming_qian <ming.qian@nxp.com>
6 years agoMLK-21484-3: ASoC: fsl_sai: ensure clk is unprepared before reparent
Viorel Suman [Thu, 18 Apr 2019 12:28:04 +0000 (15:28 +0300)]
MLK-21484-3: ASoC: fsl_sai: ensure clk is unprepared before reparent

On recent kernels clks which are marked with CLK_SET_RATE_GATE are
"protected" against further changes at clk_prepare time, including clk
reparent. Wrap clk set_parent and set_rate operations with
disable_unprepare and prepare_enable.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
6 years agoMLK-21484-2: ASoC: fsl_spdif: ensure clk is unprepared before reparent
Viorel Suman [Thu, 18 Apr 2019 12:25:44 +0000 (15:25 +0300)]
MLK-21484-2: ASoC: fsl_spdif: ensure clk is unprepared before reparent

On recent kernels clks which are marked with CLK_SET_RATE_GATE are
"protected" against further changes at clk_prepare time, including clk
reparent. Wrap clk set_parent and set_rate operations with
disable_unprepare and prepare_enable.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
6 years agoMLK-21484-1: ASoC: fsl_micfil: unprepare the clk before reparent
Viorel Suman [Thu, 18 Apr 2019 12:14:17 +0000 (15:14 +0300)]
MLK-21484-1: ASoC: fsl_micfil: unprepare the clk before reparent

On recent kernels clks which are marked with CLK_SET_RATE_GATE are
"protected" against further changes at clk_prepare time, including clk
reparent. Fix this by moving clk_disable_unprepare before clk_set_parent.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
6 years agoMLK-21506-2: mtd: nand: raw: gpmi-nand: use runtime pm not en/disable clock
Han Xu [Fri, 19 Apr 2019 20:00:56 +0000 (15:00 -0500)]
MLK-21506-2: mtd: nand: raw: gpmi-nand: use runtime pm not en/disable clock

use the run-time pm rather than en/disable clock in chip select function.

Signed-off-by: Han Xu <han.xu@nxp.com>
6 years agoMLK-21506-1: mtd: nand: raw: gpmi-nand: enable the macros for MX8
Han Xu [Fri, 19 Apr 2019 14:51:06 +0000 (09:51 -0500)]
MLK-21506-1: mtd: nand: raw: gpmi-nand: enable the macros for MX8

enable the macros for mx8 platforms

Signed-off-by: Han Xu <han.xu@nxp.com>
6 years agoMLK-20917-2: mtd: flexspi: Improve the i.MX8MM fspi performance
Han Xu [Fri, 19 Apr 2019 18:39:55 +0000 (13:39 -0500)]
MLK-20917-2: mtd: flexspi: Improve the i.MX8MM fspi performance

- Implemented the SFDP lut to get the correct chip information
- Changed the default read mode from normal read to Quad DDR
- Enabled the AHB prefetch after chip probed
- Limited the highest clock rate for iMX8MM

Signed-off-by: Han Xu <han.xu@nxp.com>
6 years agoMLK-18396-2: mtd: fsl-flexspi: enable FSPI on i.MX8MM
Han Xu [Fri, 19 Apr 2019 16:53:24 +0000 (11:53 -0500)]
MLK-18396-2: mtd: fsl-flexspi: enable FSPI on i.MX8MM

Enable FlexSPI driver on i.MX8MM EVK.

Signed-off-by: Han Xu <han.xu@nxp.com>
6 years agoMLK-21496 usb: typec: tcpm: remove qos request when unregister port
Peter Chen [Fri, 19 Apr 2019 08:34:37 +0000 (16:34 +0800)]
MLK-21496 usb: typec: tcpm: remove qos request when unregister port

As the counter part of pm_qos_add_request(), we should do
pm_qos_remove_request() and release high bus when unregister tcpm
port, otherwise we will have below crash if tcpm register again.

[    4.229417] tcpm_register_port(5021): trace
[    4.233631] pm_qos_update_target(280): c=ffff000009685998
node=ffff80083a084fb0
[    4.240960] pm_qos_update_target(301): trace
[    4.245228] pm_qos_update_target(303): trace
[    4.249512] Unable to handle kernel NULL pointer dereference at
virtual address 0000000000000000
[    4.258302] Mem abort info:
[    4.261089]   ESR = 0x96000044
[    4.264142]   Exception class = DABT (current EL), IL = 32 bits
[    4.270063]   SET = 0, FnV = 0
[    4.273115]   EA = 0, S1PTW = 0
[    4.276258] Data abort info:
[    4.279135]   ISV = 0, ISS = 0x00000044
[    4.282973]   CM = 0, WnR = 1
[    4.285938] [0000000000000000] user address but active_mm is swapper
[    4.292300] Internal error: Oops: 96000044 [#1] PREEMPT SMP
[    4.297876] Modules linked in:
[    4.300934] Process kworker/0:2 (pid: 860, stack limit =
0x(____ptrval____))
[    4.307992] CPU: 0 PID: 860 Comm: kworker/0:2 Not tainted
4.19.35-04375-gedbbcdc07bf1-dirty #3
[    4.316604] Hardware name: Freescale i.MX8QXP MEK (DT)
[    4.321761] Workqueue: events deferred_probe_work_func
[    4.326901] pstate: 80000085 (Nzcv daIf -PAN -UAO)
[    4.331700] pc : plist_add+0x98/0xd8
[    4.335279] lr : pm_qos_update_target+0x310/0x330
[    4.339982] sp : ffff00000d603a00
[    4.343290] x29: ffff00000d603a00 x28: 0000000000000000
[    4.348607] x27: ffff00000936b538 x26: 0000000000000000
[    4.353924] x25: ffff000008f425b0 x24: 0000000000000000
[    4.359241] x23: ffff0000098d0000 x22: 0000000000000000
[    4.364557] x21: 000000003af84fa8 x20: ffff80083a084fb0
[    4.369874] x19: ffff000009685998 x18: ffffffffffffffff
[    4.375191] x17: 0000000000000000 x16: 0000000000000000
[    4.380508] x15: ffff0000096686c8 x14: ffff0000898d0fef
[    4.385824] x13: ffff0000098d0ffd x12: ffff000009685000
[    4.391141] x11: 0000000005f5e0ff x10: ffff000009668940
[    4.396458] x9 : ffff000008681658 x8 : ffff80083a084fb8
[    4.401775] x7 : ffff80083a084fc8 x6 : ffff80083af84fc8
[    4.407091] x5 : 0000000000000000 x4 : 0000000000000000
[    4.412408] x3 : ffff80083af84fb0 x2 : 0000000000000000
[    4.417725] x1 : ffff80083af84fb8 x0 : ffff80083a084fb0
[    4.423044] Call trace:
[    4.425497]  plist_add+0x98/0xd8
[    4.428728]  pm_qos_add_request+0x88/0x170
[    4.432831]  tcpm_register_port+0x5ec/0x898
[    4.437017]  tcpci_register_port+0x154/0x1e0
[    4.441291]  tcpci_probe+0xa8/0x218
[    4.444784]  i2c_device_probe+0x2e4/0x2f8
[    4.448796]  really_probe+0x248/0x3b8
[    4.452461]  driver_probe_device+0x12c/0x148
[    4.456735]  __device_attach_driver+0xac/0x160
[    4.461184]  bus_for_each_drv+0x68/0xd0
[    4.465022]  __device_attach+0xd8/0x160
[    4.468864]  device_initial_probe+0x10/0x18
[    4.473049]  bus_probe_device+0x94/0xa0
[    4.476890]  deferred_probe_work_func+0x84/0xd8
[    4.481427]  process_one_work+0x1ec/0x460
[    4.485438]  worker_thread+0x224/0x448
[    4.489194]  kthread+0x12c/0x130
[    4.492427]  ret_from_fork+0x10/0x18
[    4.496006] Code: f9400822 91002021 f9000428 a9008801 (f9000048)
[    4.502103] ---[ end trace 910526b6d64dab64 ]---
[    4.506754] note: kworker/0:2[860] exited with preempt_count 1

Reported-by: Leonard Crestez <leonard.crestez@nxp.com>
Suggested-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
6 years agoMLK-21504 arm: dts: imx6qdl: fix mipi csi compatible string typo
Robby Cai [Fri, 19 Apr 2019 09:26:01 +0000 (17:26 +0800)]
MLK-21504 arm: dts: imx6qdl: fix mipi csi compatible string typo

should be "fsl,imx6q-mipi-csi2" rather than "fsl,imx6-mipi-csi2"

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-21501 ARM: dts: imx7d-sdb: remove cd-post property to enable wlan
Fugang Duan [Fri, 19 Apr 2019 09:02:57 +0000 (17:02 +0800)]
MLK-21501 ARM: dts: imx7d-sdb: remove cd-post property to enable wlan

brcmfmac driver designe doesn't support the "cd-post", so remove
it to support cyw4339, and here also remove the dummy property
"wifi-host" for brcmfmac.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21502 brcmfmac: fix the load issue for bcm4339
Fugang Duan [Fri, 19 Apr 2019 08:56:08 +0000 (16:56 +0800)]
MLK-21502 brcmfmac: fix the load issue for bcm4339

Current brcmfmac driver cannot load cyw4339 module and always report
bus timeout as below log.

brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4339-sdio for chip BCM4339/2
brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4339-sdio for chip BCM4339/2
brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-11), device may have limited channels available
brcmfmac: brcmf_sdio_bus_rxctl: resumed on timeout
brcmfmac: brcmf_bus_started: failed: -110
brcmfmac: brcmf_attach: dongle is not responding: err=-110
brcmfmac: brcmf_sdio_bus_rxctl: resumed on timeout
brcmfmac: brcmf_bus_started: failed: -110
brcmfmac: brcmf_attach: dongle is not responding: err=-110
brcmfmac: brcmf_sdio_firmware_callback: brcmf_attach failed
brcmfmac: brcmf_sdio_bus_rxctl: resumed on timeout
brcmfmac: brcmf_c_preinit_dcmds: Retreiving version information failed, -110
brcmfmac: brcmf_bus_started: failed: -110
Unable to handle kernel NULL pointer dereference at virtual address 00000004
pgd = 50d469b0
[00000004] *pgd=00000000
Internal error: Oops: 817 [#1] PREEMPT SMP ARM
Modules linked in: mxc_vadc mxc_dcic mx6s_capture ov5640_camera_v2 brcmfmac brcmutil
CPU: 0 PID: 91 Comm: kworker/0:3 Not tainted 4.19.35-04384-g50ca4a9 #1147
Hardware name: Freescale i.MX6 SoloX (Device Tree)
Workqueue: events request_firmware_work_func
PC is at brcmf_attach+0x234/0x3d8 [brcmfmac]
LR is at __slab_free+0x1a4/0x308
pc : [<7f022500>]    lr : [<8020d7a8>]    psr: 20010013
sp : a8679e78  ip : a8679de8  fp : 00000000
r10: 00000000  r9 : a8ef0c00  r8 : a9ffa1a0
r7 : a868b808  r6 : a9ff8460  r5 : ffffff92  r4 : a9ff81a0
r3 : 00000000  r2 : 588fd8f8  r1 : 00000000  r0 : 00000000
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c53c7d  Table: a901c04a  DAC: 00000051
Process kworker/0:3 (pid: 91, stack limit = 0xbe6d797a)
Stack: (0xa8679e78 to 0xa867a000)
9e60:                                                       7f03540c 00000000
9e80: a97cecc0 00000008 00000001 a8ecf800 81004d08 a8ecfc00 a868b808 7f0328b8
9ea0: 00000002 00000008 00000001 7f02adfc 00000840 00010000 00000840 bc3ef180
9ec0: a92abcc0 00000000 00000000 588fd8f8 ab731d80 a92ab454 a8398340 00000014
9ee0: 81004d08 00000000 a92ab440 a9461140 ab731d80 7f023620 a9eec980 588fd8f8
9f00: a9461480 81004d08 ab731d80 ab734f00 00000000 a9461484 00000000 8054c058
9f20: 00000000 00000003 a9461140 588fd8f8 ab731d80 a9461480 a865a280 80146690
9f40: 81003d00 ab731d98 a865a280 a865a294 ab731d80 81003d00 ab731d98 a8678000
9f60: 00000008 8014697c 00000000 a8643e00 a8643dc0 00000000 a865a280 80146950
9f80: a8643e1c a8075ebc 00000000 8014bfc8 a8643dc0 8014bea4 00000000 00000000
9fa0: 00000000 00000000 00000000 801010e8 00000000 00000000 00000000 00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[<7f022500>] (brcmf_attach [brcmfmac]) from [<7f02adfc>] (brcmf_sdio_firmware_callback+0x4c4/0x74c [brcmfmac])
[<7f02adfc>] (brcmf_sdio_firmware_callback [brcmfmac]) from [<7f023620>] (brcmf_fw_request_done+0x188/0x214 [brcmfmac])
[<7f023620>] (brcmf_fw_request_done [brcmfmac]) from [<8054c058>] (request_firmware_work_func+0x4c/0x88)
[<8054c058>] (request_firmware_work_func) from [<80146690>] (process_one_work+0x138/0x3f8)
[<80146690>] (process_one_work) from [<8014697c>] (worker_thread+0x2c/0x554)
[<8014697c>] (worker_thread) from [<8014bfc8>] (kthread+0x124/0x154)
[<8014bfc8>] (kthread) from [<801010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xa8679fb0 to 0xa8679ff8)
9fa0:                                     00000000 00000000 00000000 00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
Code: e3530000 0a000011 e59432cc e3a00000 (e5839004)
---[ end trace 8b8e3996f6f715bf ]---

cyw4339 doesn't support ulp_sdioctrl iovar and ulp mode, the current logic make
sdio bus down/up, and trigger firmware load twice. So remove the ulp status
check for cyw4339.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21495 can: flexcan: replace ARCH_MXC_ARM64 with HAVE_IMX_SC
Joakim Zhang [Thu, 18 Apr 2019 10:59:55 +0000 (18:59 +0800)]
MLK-21495 can: flexcan: replace ARCH_MXC_ARM64 with HAVE_IMX_SC

Upstream rejected ARCH_MXC_ARM64 in favor of defining ARCH_MXC for
arm64.

Update the CAN driver to check for CONFIG_HAVE_IMX_SC around
SCFW-dependent code.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21494 can: flexcan: add branch for "fd-non-iso on"
Joakim Zhang [Thu, 18 Apr 2019 10:26:33 +0000 (18:26 +0800)]
MLK-21494 can: flexcan: add branch for "fd-non-iso on"

CAN driver will keep ISOFD state after setting "fd on" or "fd on
fd-non-iso off", you can't switch to NONISOFD mode, this patch intends
to add branch for "fd-non-iso on".

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMGS-4715 [#imx-1413] disable gpu probe options log
Xianzhong [Fri, 19 Apr 2019 16:40:11 +0000 (00:40 +0800)]
MGS-4715 [#imx-1413] disable gpu probe options log

do not show galcore parameters in default setting

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
6 years agoMGS-4716 [#imx-1412] redirect cma limit request with dma32
Xianzhong [Thu, 18 Apr 2019 15:38:43 +0000 (23:38 +0800)]
MGS-4716 [#imx-1412] redirect cma limit request with dma32

L4.19 kernel support CONFIG_ZONE_DMA32 feature, which is
better to allocate 4G memory than CMA limit feature.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
6 years agoMLK-21489 drm/imx: dpu: kms: Return properly in case we fail to get plane state to...
Liu Ying [Thu, 18 Apr 2019 08:34:05 +0000 (16:34 +0800)]
MLK-21489 drm/imx: dpu: kms: Return properly in case we fail to get plane state to check

We should return properly in case we fail to get plane state to check.
For example, a race condition on the plane state would happen when one
thread does page flip and another thread updates CRTC properties on
that CRTC simultaneously.  '-EDEADLK' should be returned when the
condition occurs.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 2ab36051b74c49f66bb12d8d8086e6e6b3dc069b)

6 years agoMLK-21380 video: fbdev: mxsfb: fix resume timing for overlay fb
Fancy Fang [Fri, 12 Apr 2019 07:42:50 +0000 (15:42 +0800)]
MLK-21380 video: fbdev: mxsfb: fix resume timing for overlay fb

The overlay fb can only be enabled when the LCDIF is not in
running, otherwise overlay display may look like image shift.
So during the system resume procedure, the overlay fb should
be resumed before mxsfb unblank.

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

6 years agoMLK-21500 rpmsg: imx: CONFIG_ARCH_MXC_ARM64 should be replaced
Richard Zhu [Fri, 19 Apr 2019 06:12:55 +0000 (14:12 +0800)]
MLK-21500 rpmsg: imx: CONFIG_ARCH_MXC_ARM64 should be replaced

Since CONFIG_ARCH_MXC_ARM64 does not exist on imx_4.19.y, this should
be replaced by CONFIG_HAVE_IMX_SC.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
6 years agoMLK-18355-2: hdp: Resolve hdp sink/source HDMI CAR headfile conflict
Sandor Yu [Fri, 18 May 2018 07:15:27 +0000 (15:15 +0800)]
MLK-18355-2: hdp: Resolve hdp sink/source HDMI CAR headfile conflict

Add head file sink_car.h.
Rename HDMI CAR bit definition.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-20209 hdmi rx: fixed unsigned compare against less than zero
Oliver Brown [Fri, 22 Mar 2019 18:44:37 +0000 (13:44 -0500)]
MLK-20209 hdmi rx: fixed unsigned compare against less than zero

Fixed CID 3411368, Unsigned compared against 0. Removed comparison with
no effect.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-20451-3: hdmi rx: Add hdmi rx cec running status
Sandor Yu [Fri, 23 Nov 2018 07:01:08 +0000 (15:01 +0800)]
MLK-20451-3: hdmi rx: Add hdmi rx cec running status

Add hdmi rx cec running status.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-20451-2: hdmi rx: Fix incorrect type of function return variable
Sandor Yu [Fri, 23 Nov 2018 06:40:16 +0000 (14:40 +0800)]
MLK-20451-2: hdmi rx: Fix incorrect type of function return variable

Fix incorrect function return variable type.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-20451-1: hdmt rx: use dev_xxx instead of pr_xxx
Sandor Yu [Fri, 2 Nov 2018 08:03:55 +0000 (16:03 +0800)]
MLK-20451-1: hdmt rx: use dev_xxx instead of pr_xxx

Print hdmi rx video mode info.
use dev_xxx instead of pr_xxx in mxc-hdmi-hw.c.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-20391: v4l2: hdmi rx: Add hdmi cable plugin status check
Sandor Yu [Fri, 16 Nov 2018 08:26:44 +0000 (16:26 +0800)]
MLK-20391: v4l2: hdmi rx: Add hdmi cable plugin status check

Added hdmi cable plugin status check in v4l2 api function.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19990-3: hdmi rx: Fix hdmi rx reset bit error
Sandor Yu [Fri, 19 Oct 2018 09:07:14 +0000 (17:07 +0800)]
MLK-19990-3: hdmi rx: Fix hdmi rx reset bit error

Fix hdmi rx reset bit error.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19990-2: hdmi rx: Remove ddc clock setting function
Sandor Yu [Fri, 19 Oct 2018 07:42:03 +0000 (15:42 +0800)]
MLK-19990-2: hdmi rx: Remove ddc clock setting function

HDMI RX DDC clock is configurated in HDMI RX FW(V1.0.52).
Remove code in driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19990-1: hdmi rx: enable low power mode for cable plugout
Sandor Yu [Fri, 19 Oct 2018 07:22:31 +0000 (15:22 +0800)]
MLK-19990-1: hdmi rx: enable low power mode for cable plugout

-HDMI RX controller enter low power mode when cable plug out.
-Replace CDN_API_HDMIRX_ReadEvent with
CDN_API_General_GetHpdState_blocking, hdmi rx could enter low power
mode.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19610: hdmi rx: Enable hdmi rx edid function
Sandor Yu [Tue, 18 Sep 2018 07:00:52 +0000 (15:00 +0800)]
MLK-19610: hdmi rx: Enable hdmi rx edid function

Update edid block0&1 for imx8qm hdmi rx.
Remove unsupported video modes.
Added edid clock setting.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19583-1: hdmi rx: Add HPD support
Sandor Yu [Fri, 14 Sep 2018 05:26:15 +0000 (13:26 +0800)]
MLK-19583-1: hdmi rx: Add HPD support

Add HPD support.
Add s_param function that may needed by user application.
Add mutex protect for hdp register access.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18578: hdmi_rx: wait longer time for audio info frame
Shengjiu Wang [Fri, 8 Jun 2018 10:36:03 +0000 (18:36 +0800)]
MLK-18578: hdmi_rx: wait longer time for audio info frame

The wait time is short that cause recording failed sometimes

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
6 years agoMLK-18578: hdmi_rx: fix issue that ARC can't work in 4k.
Shengjiu Wang [Fri, 8 Jun 2018 09:59:53 +0000 (17:59 +0800)]
MLK-18578: hdmi_rx: fix issue that ARC can't work in 4k.

After changing the deemphasis to 0dB in TX_DIG_CTRL_REG_1
the issue that ARC can't work with 4k resolution is fixed

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
6 years agoMLK-18397-1: hdmi_rx: turn on aux_ana for rx arc
Shengjiu Wang [Fri, 25 May 2018 02:37:51 +0000 (10:37 +0800)]
MLK-18397-1: hdmi_rx: turn on aux_ana for rx arc

turn on aux_ana for rx arc

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-18368-6: hdmi_rx: avoid blocking in audio config
Shengjiu Wang [Tue, 22 May 2018 07:43:41 +0000 (15:43 +0800)]
MLK-18368-6: hdmi_rx: avoid blocking in audio config

add delay count in audio auto config to avoid blocking
change the justify to right

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-18368-5: hdmi_rx: add hdmi rx audio clock
Shengjiu Wang [Tue, 22 May 2018 07:31:49 +0000 (15:31 +0800)]
MLK-18368-5: hdmi_rx: add hdmi rx audio clock

add clock for hdmi audio rx

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-18368-4: hdmi_rx: add generic hdmi audio rx driver
Shengjiu Wang [Tue, 22 May 2018 07:32:51 +0000 (15:32 +0800)]
MLK-18368-4: hdmi_rx: add generic hdmi audio rx driver

Register generic hdmi audio rx driver.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-18366: hdmi_rx: return error when HDMI PHY failed initialized
Sandor Yu [Tue, 22 May 2018 03:28:38 +0000 (11:28 +0800)]
MLK-18366: hdmi_rx: return error when HDMI PHY failed initialized

return error state when HDMI PHY failed initialized.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18355-8: hdmi rx: Add HDMI RX CEC function
Sandor Yu [Mon, 21 May 2018 02:58:46 +0000 (10:58 +0800)]
MLK-18355-8: hdmi rx: Add HDMI RX CEC function

Add HDMI RX CEC function in hdmi rx driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18355-7: hdmi_rx: Enable HDMI RX CEC clock
Sandor Yu [Mon, 21 May 2018 02:48:03 +0000 (10:48 +0800)]
MLK-18355-7: hdmi_rx: Enable HDMI RX CEC clock

Enable HDMI RX CEC clock when hdmi rx driver initialized.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18355-6: hdmi_rx: move startup function to probe function
Sandor Yu [Mon, 21 May 2018 02:45:00 +0000 (10:45 +0800)]
MLK-18355-6: hdmi_rx: move startup function to probe function

Move startup function from s_power to probe function,
HDMI RX controller keep in running state after driver probe.
The startup function should move to cable plugin handle.
When iMX8QM B0 silicon HDMI RX hot plug function is ready.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18355-5: hdmi_rx: Add timeout for check HDMI 5V
Sandor Yu [Mon, 21 May 2018 02:41:08 +0000 (10:41 +0800)]
MLK-18355-5: hdmi_rx: Add timeout for check HDMI 5V

Add timeout for HDMI 5V check.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18267-4: hdmi rx: hdmi rx driver for imx8qm
Sandor Yu [Thu, 10 May 2018 03:25:40 +0000 (11:25 +0800)]
MLK-18267-4: hdmi rx: hdmi rx driver for imx8qm

Enable hdmi rx driver for imx8qm.
Driver implement with V4L2 architecture.
RGB32 and YUV444 are verified.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18267-3: hdp api: Add HDMI RX API function
Sandor Yu [Thu, 12 Apr 2018 02:59:21 +0000 (10:59 +0800)]
MLK-18267-3: hdp api: Add HDMI RX API function

Add HDMI RX video and audio API function and head files.
This API base on CDN_API_1_0_36.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-21478-25 Revert "MLK-16013-9 usb: typec: add interface to get port type and role"
Li Jun [Thu, 18 Apr 2019 09:21:41 +0000 (17:21 +0800)]
MLK-21478-25 Revert "MLK-16013-9 usb: typec: add interface to get port type and role"

This reverts commit ccbf06406704c52d5146c9f28cbc8907429b92ce.

As we will use fwnode API to get typec properties, those APIs to be
reverted are not required, this will also fix below build warnings:

drivers/usb/typec/class.c: In function â€˜typec_register_port’:
drivers/usb/typec/class.c:1591:2: warning: enumeration value
‘TYPEC_PORT_TYPE_UNKNOWN’ not handled
in switch [-Wswitch]
  switch (cap->type) {
  ^~~~~~

Reported-by: Fugang Duan <fugang.duan@nxp.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-24 usb: typec: support source only port with dual data
Li Jun [Wed, 17 Apr 2019 09:44:32 +0000 (17:44 +0800)]
MLK-21478-24 usb: typec: support source only port with dual data

In case source only for power, but dual data role on USB, we
enable drp toggling for detect source(host), this is mainly for
get orientation, then keep it at SNK_ATTACHED state.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agonvmem: imx-ocotp: add i.MX7ULP support
Anson Huang [Mon, 28 Jan 2019 15:54:57 +0000 (15:54 +0000)]
nvmem: imx-ocotp: add i.MX7ULP support

i.MX7ULP is a new SoC of i.MX family which has 8 kbit eFuse OTP,
enable ocotp driver support for this SoC.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c8b63ddc91190d4022d456bf6abbc2085b4f56b5)

6 years agoMLK-20718-4: arm64: dts: imx8qm: Use DSI PHY_REF clk
Robert Chiras [Fri, 1 Mar 2019 08:39:19 +0000 (10:39 +0200)]
MLK-20718-4: arm64: dts: imx8qm: Use DSI PHY_REF clk

Until now, the DSI PHY_REF clock was by default ON in SCFW, which made
this clock unusable in kernel, therefore, this clock was set as
CLK_DUMMY in DSI device nodes.
Sinnce this clock was set to OFF in SCFW, now it can be used from
kernel, so add it to device nodes so that the driver can use it
properly.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-20718-3: arm64: dts: imx8dx: Use DSI PHY_REF clk
Robert Chiras [Fri, 1 Mar 2019 08:35:32 +0000 (10:35 +0200)]
MLK-20718-3: arm64: dts: imx8dx: Use DSI PHY_REF clk

Until now, the DSI PHY_REF clock was by default ON in SCFW, which made
this clock unusable in kernel, therefore, this clock was set as
CLK_DUMMY in DSI device nodes.
Sinnce this clock was set to OFF in SCFW, now it can be used from
kernel, so add it to device nodes so that the driver can use it
properly.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-20718-2: clk: imx8qxp: Add DSI phy_ref clk for second instance
Robert Chiras [Fri, 1 Mar 2019 08:30:02 +0000 (10:30 +0200)]
MLK-20718-2: clk: imx8qxp: Add DSI phy_ref clk for second instance

The DSI PHY_REF clock for the second DSI instance was missing from the
clock driver, so add it now.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-20718-1: clk: imx8qm: Add DSI phy_ref clock
Robert Chiras [Fri, 1 Mar 2019 08:27:25 +0000 (10:27 +0200)]
MLK-20718-1: clk: imx8qm: Add DSI phy_ref clock

Add the missing clocks for the DSI PHY_REF:
IMX8QM_MIPI0_DSI_PHY_CLK and IMX8QM_MIPI1_DSI_PHY_CLK.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-20558 media: camera: add QVGA 30fps support for ov5640
Robby Cai [Thu, 6 Dec 2018 10:17:35 +0000 (18:17 +0800)]
MLK-20558 media: camera: add QVGA 30fps support for ov5640

Add QVGA @30fps support for ov5640

Signed-off-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit c2dd4525e766355076e8fb8f0ae40fe98c27130a)

6 years agoMLK-19362: media: csi: Fix "Hresponse" and "Rx fifo overflow" camera errors
Mirela Rabulea [Wed, 12 Sep 2018 08:50:54 +0000 (11:50 +0300)]
MLK-19362: media: csi: Fix "Hresponse" and "Rx fifo overflow" camera errors

When the register setting for fifo_send_level is set to high, some residual
data of a frame which cannot fill up to the send_level, will be sent with
the next frame data. In this case, for CSI receive dma, sometimes,
the vertical blanking is too short to finish the storage of the previous
frame before the next frame start, depending on the system bandwidth.

Tested on imx8mq-evk rev B4 and B3, with OV5640 camera.

This patch was proposed by Tom Zheng <haidong.zheng@nxp.com>

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit 12f811f934b53008a445c3af67f1f22baea98a86)

6 years agoMLK-19537-2 media: mipi_csi: use PHY slave reset for MIPI CSI
Robby Cai [Tue, 11 Sep 2018 07:01:10 +0000 (15:01 +0800)]
MLK-19537-2 media: mipi_csi: use PHY slave reset for MIPI CSI

Remove PHY master reset and only need to use PHY slave reset for MIPI CSI.
Use regmap framework for cleanup.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6968f84ad8ee1613ff90d90e19e7434d5dd95126)
(cherry picked from commit 8a93a78c9bee1b456961a6d611f31d7708089798)

6 years agoMLK-18552-2 media: mipi_csi: enable disp_axi and disp_apb before the access
Robby Cai [Mon, 11 Jun 2018 02:38:43 +0000 (10:38 +0800)]
MLK-18552-2 media: mipi_csi: enable disp_axi and disp_apb before the access

On i.MX8MM, IC design uses registers from CSI to do MIPI PHY reset. Need enable
disp_axi and disp_apb before the access, otherwise meet hang issue.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 86ff2008b5a33d4233c33c2e662f8391cc474db2)

6 years agoMLK-18362-2 midea: mipi_csi: add mipi phy reset on imx8mm
Robby Cai [Wed, 23 May 2018 13:03:27 +0000 (21:03 +0800)]
MLK-18362-2 midea: mipi_csi: add mipi phy reset on imx8mm

on imx8mm, use different way rather than via SRC. so use different
device id to distinguish different MIPI-PHY reset method.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit 59e5fa6d4e8ad5c3d4fcd54aa8fa0a0d98e148b6)

6 years agoMLK-18485 emvsim: enable CWT for ATR
Gao Pan [Mon, 4 Jun 2018 07:47:21 +0000 (15:47 +0800)]
MLK-18485 emvsim: enable CWT for ATR

Enable CWT for ATR, and switch to RX_DATA_IM to detect receiving data
in fifo.

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
(cherry pick from: d6807ed26c531ef50c23fb8575ff07dd778de2df)
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-17416 imx8: sim: add usleep_range() before reading SPDP Bit
Gao Pan [Fri, 19 Jan 2018 03:12:15 +0000 (11:12 +0800)]
MLK-17416 imx8: sim: add usleep_range() before reading SPDP Bit

Card Presence Detect Status Bit SPDP in EMV_SIM_PCSR is
synchronized by two posedge of low_ref_clk which is 32KHz.

So there should be 1.5 low_ref_clk cycles(about 90us) before
reading SPDP Bit.

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
(cherry pick from: 42a733a62525725d145ce6b55dfc94f1f5ff0a9d)
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-17319-3 defconfig: enable EMVSIM in defconfig
Gao Pan [Thu, 18 Apr 2019 05:38:57 +0000 (13:38 +0800)]
MLK-17319-3 defconfig: enable EMVSIM in defconfig

enable EMVSIM in defconfig

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Reviewed-by: Andy Duan <fugang.duan@nxp.com>
(cherry pick from: 497b081ed407c592ea68f7b988629c10fafa1734)
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-17319-1 imx8: sim: add driver to support EMVSIM module
Gao Pan [Mon, 8 Jan 2018 09:10:31 +0000 (17:10 +0800)]
MLK-17319-1 imx8: sim: add driver to support EMVSIM module

The EMVSIM module is designed to facilitate communication to
Smart Cards compatible to the EMV ver4.3 standard and compatible
with ISO/IEC 7816-3 Standard.

This patch adds driver to support EMVSIM module for imx8.

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Reviewed-by: Andy Duan <fugang.duan@nxp.com>
(cherry pick from: 2cac9c1e36676af7e3964d93b2aaea4991bc3c53)
(Fixed conflicts and added "#include <linux/pinctrl/consumer.h>")
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21415 can: flexcan: add Tx support for variable payload size
Joakim Zhang [Thu, 18 Apr 2019 08:54:34 +0000 (16:54 +0800)]
MLK-21415 can: flexcan: add Tx support for variable payload size

Now the FlexCAN driver always use last mailbox for TX, it will work well when
MB payload size is 8/16 bytes. TX mailbox would change to 13 when MB payload
size is 64 bytes to support CANFD. So we may need to set iflag register to add
support for variable payload size.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21414 can: flexcan: use callback for mailbox read/write function
Joakim Zhang [Mon, 8 Apr 2019 06:55:19 +0000 (14:55 +0800)]
MLK-21414 can: flexcan: use callback for mailbox read/write function

Add callback for mailbox read/write function and clean up the code.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21413 can: flexcan: use CBT register to set bitrate for normal mode on i.MX8
Joakim Zhang [Mon, 8 Apr 2019 05:04:32 +0000 (13:04 +0800)]
MLK-21413 can: flexcan: use CBT register to set bitrate for normal mode on i.MX8

We need to add property in DTS node before when we want to use normal
mode on i.MX8 platform. Check in RM, we also can use CBT register not
must CTRL1 register to set bitrate for normal mode.

This patch intends to use CBT register to set bitrate for normal mode on
i.MX8. After this, we don't need to modify the DTS node to support
normal mode.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21412 can: flexcan: add ISO CAN FD feature support
Joakim Zhang [Mon, 8 Apr 2019 04:56:35 +0000 (12:56 +0800)]
MLK-21412 can: flexcan: add ISO CAN FD feature support

ISO CAN FD is introduced to increase the failture detection capability
than non-ISO CAN FD. The non-ISO CAN FD is still supported by FlexCAN so
that it can be used mainly during an intermediate phase, for evaluation
and development purposes.

Therefore, it is strongly recommended to configure FlexCAN to the ISO
CAN FD protocol by setting the ISOCANFDEN field in the CTRL2 register.

Test Command:
ISO FD MODE:
ip link set can0 type can bitrate 1000000 dbitrate 4000000 fd on
fd-non-iso off

non-ISO FD MODE:
ip link set can0 type can bitrate 1000000 dbitrate 4000000 fd on
fd-non-iso on

NOTE: if you only set fd on, driver will use ISO FD MODE by default.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21411 can: flexcan: fix CAN can't suspend/resume when CAN is only capable of...
Joakim Zhang [Mon, 8 Apr 2019 05:32:28 +0000 (13:32 +0800)]
MLK-21411 can: flexcan: fix CAN can't suspend/resume when CAN is only capable of wakeup

When dev->power.can_wakeup set to true, device_prepare() may runtime resume the device:
    dpm_suspend_start()
            dpm_prepare(state);
                    dev->driver->pm->prepare()
                            pm_genpd_prepare()
                                    if (resume_needed(dev, genpd))
                                        pm_runtime_resume(dev);

And imx8qm/qxp power domain driver don't implement the active_wakeup() callback, then
resume_needed() always return "true" when dev->power.can_wakeup is true.

Once CAN device is runtime active status, then CAN's clock's count is 1 during system
suspend. And CAN0/CAN1/CAN2 share the same module clock, so we can say all CAN's module
clock is enabled during system suspended.

    flexcan_runtime_resume()
            flexcan_clks_enable(priv);

i.MX8QM/QXP SCU code clock logic requires linux kernel clocks should be disabled during
suspend, otherwise SCU don't enable them after system resume back.

There are two ways to fix the issue:
1. CAN driver should check the runtime status to ensure all clocks are disabled  during
system suspend.
2. Don't set CAN wakeup capability during probe, move it into flexcan_open().

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21410 can: flexcan: add CAN wakeup function for MX8
Joakim Zhang [Mon, 8 Apr 2019 04:50:28 +0000 (12:50 +0800)]
MLK-21410 can: flexcan: add CAN wakeup function for MX8

This patch is to add CAN wakeup function on MX8 platforms and update the
binding file fsl-flexcan.txt.

For MX8, the function "flexcan_irq()" should not call "flexcan_exit_stop_mode()"
due to firmware(SCU) cannot make SC IPC calls from an interrupt context.
If not exit stop mode in ISR, it will continuously enter wakeup ISR for the reason
that system will respond IRQ before call CAN system resume.
To fix the issue, we can exit stop mode during noirq resume stage.

For wakeup case, it should not set pinctrl to sleep state by
pinctrl_pm_select_sleep_state.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21409 can: flexcan: enable flexcan driver for i.MX8
Joakim Zhang [Mon, 8 Apr 2019 04:31:53 +0000 (12:31 +0800)]
MLK-21409 can: flexcan: enable flexcan driver for i.MX8

Add support flexcan on imx8 platforms, mailbox as default

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21408-2 can: flexcan: enable flexcan defconfig
Joakim Zhang [Mon, 8 Apr 2019 05:55:12 +0000 (13:55 +0800)]
MLK-21408-2 can: flexcan: enable flexcan defconfig

Add support in defconfig file to enable flexcan module on imx8qm/qxp boards

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21408-1 can: flexcan: enable flexcan support for arm64
Joakim Zhang [Mon, 8 Apr 2019 05:53:48 +0000 (13:53 +0800)]
MLK-21408-1 can: flexcan: enable flexcan support for arm64

Modify Kconfig file to enable flexcan support for arm64

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
6 years agoMLK-21493 brcmfmac: move .brcmf_bus_preinit() after changing bus state
Fugang Duan [Thu, 18 Apr 2019 08:21:20 +0000 (16:21 +0800)]
MLK-21493 brcmfmac: move .brcmf_bus_preinit() after changing bus state

Moving the brcmf_bus_preinit() call allows the bus code to do some
required initialization before handling firmware control messages.

.brcmf_bus_preinit() already is called in .brcmf_bus_started() when
bus is ready. So remove it from .brcmf_c_preinit_dcmds().

Fixes: 383c26d2ea2f(MLK-18675-20 brcmfmac: Support wake on ping packet)
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21492 brcmfmac: remove func0 that is not provied by mmc stack
Fugang Duan [Thu, 18 Apr 2019 06:50:34 +0000 (14:50 +0800)]
MLK-21492 brcmfmac: remove func0 that is not provied by mmc stack

func0 is not provided by the mmc stack as a function when probing.
commit 99d7b6fdfc8c(brcmfmac: Remove func0 from function array)
already remove the func0.

But commit c37fa19e0128(brcmfmac: Remove array of functions) add
fun0 again. That cause NULL pointer issue.

Fixes: c37fa19e0128(brcmfmac: Remove array of functions)
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21491 serial: imx: add pm_qos to interact with cpu idle
Fugang Duan [Wed, 17 Apr 2019 12:44:44 +0000 (20:44 +0800)]
MLK-21491 serial: imx: add pm_qos to interact with cpu idle

Add pm_qos to prevent cpuidle from entering low level idles
for uart DMA mode when the uart port is active.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21490 arm64: dts: imx8qxp: use power-on-gpio to power on EP device
Fugang Duan [Wed, 17 Apr 2019 07:12:20 +0000 (15:12 +0800)]
MLK-21490 arm64: dts: imx8qxp: use power-on-gpio to power on EP device

Pcie driver power-on-gpio pin to control EP device's power,
firstly power down, then power up when it registers pcie port.
So using the pin for PCIe wlan EP device is better.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21357 arm64: dts: imx8qm/imx8qxp: remove the 32KHz pin config
Fugang Duan [Tue, 16 Apr 2019 06:58:32 +0000 (14:58 +0800)]
MLK-21357 arm64: dts: imx8qm/imx8qxp: remove the 32KHz pin config

No need to set the 32KHz PIN except pcie brcmfmac driver
is loaded that requires to reserve these pin groups for
pin->init_state and pin->idle_state to support multiple
differents wlan cards.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21460: ASoC: imx-audmix: fix dummy device DMA ops
Viorel Suman [Tue, 16 Apr 2019 11:25:55 +0000 (14:25 +0300)]
MLK-21460: ASoC: imx-audmix: fix dummy device DMA ops

The device is not created from a device tree node, so arch_setup_dma_ops
is not called, thus leaving the device with dummy DMA ops. Fix this by
calling of_dma_configure() with a NULL node to set default DMA ops.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
6 years agoMLK-21473-3 Documentation: fsl-imx-esdhc: Add new compatible string for imx8mm
Haibo Chen [Tue, 16 Apr 2019 11:03:09 +0000 (19:03 +0800)]
MLK-21473-3 Documentation: fsl-imx-esdhc: Add new compatible string for imx8mm

Add "fsl, imx8mm-usdhc" for imx8mm

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
6 years agoMLK-21473-2 ARM64: dts: fsl-imx8mm: change to use new compatible for usdhc
Haibo Chen [Tue, 16 Apr 2019 10:54:43 +0000 (18:54 +0800)]
MLK-21473-2 ARM64: dts: fsl-imx8mm: change to use new compatible for usdhc

Use the new compatible "fsl, imx8mm-usdhc" for imx8mm SoC.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
6 years agoMLK-21473-1 mmc: sdhci-esdhc-imx: add esdhc_soc_data for i.MX8MM
Haibo Chen [Tue, 16 Apr 2019 10:48:50 +0000 (18:48 +0800)]
MLK-21473-1 mmc: sdhci-esdhc-imx: add esdhc_soc_data for i.MX8MM

i.MX8MM contains USDHC which support eMMC V5.1 (including CMDQ and
HS400ES), besides i.MX8MM also support bus frequency, so add a new
esdhc_soc_data for i.MX8MM.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
6 years agoMLK-21461: ASoC: fsl_rpmsg_i2s: clear buffer pointer in i2s_send_message
Shengjiu Wang [Tue, 16 Apr 2019 07:17:06 +0000 (15:17 +0800)]
MLK-21461: ASoC: fsl_rpmsg_i2s: clear buffer pointer in i2s_send_message

Reset the buffer pointer to be zero in i2s_send_message, actully we have
set the buffer pointer to be zero in imx_rpmsg_terminate_all.
But if there is timer task (I2S_TX_POINTER) queued in queue, after it is
executed the buffer pointer will be changed, this is timing issue that
the task in the queue is delayed. so need to reset it with TERMINATE
command.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 0a07dd454cbf85744677812e53fc5e86a48706bf)

6 years agoMLK-21459: mxc-jpeg: Jpeg encoder/decoder multi-instance crash
Mirela Rabulea [Tue, 16 Apr 2019 14:36:28 +0000 (17:36 +0300)]
MLK-21459: mxc-jpeg: Jpeg encoder/decoder multi-instance crash

Reserve a slot for each context and allocate the slot data at open,
deallocate slot data at release and free that slot.
The device was already holding the array of slots.
The maximum number of slots allowed per device is currently limited to 1
for encoder and 1 for decoder, but the hardware supports 4+4.
Use GFP_ATOMIC for dma_zalloc_coherent, as we are holding a lock.

Also fix potential decoder bug when stm_ctrl is not properly cleared before
setting a new image format. This could be observed when decoding an
yuv420 image (img_fmt=0000b) after an yuv444 image (0011b), but only if
the descriptor is being reused.

Removed some debug logs and updated a comment.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
6 years agoMLK-20684 PCI: Disable MSI on CYW4356 and CYW4359 chips
Andy Duan [Wed, 2 Jan 2019 09:55:44 +0000 (17:55 +0800)]
MLK-20684 PCI: Disable MSI on CYW4356 and CYW4359 chips

MSI is broken on CYW4356/4359 chips. This causes CYW4356 1CX not
work on i.MX8x platforms with bandwidth test. It is known issue
that i.MX8x PCIe host driver MSI interrupt lost.

Disable MSI completely for this chipset to let wifi can stable work
until PCIe RC driver fix the issue.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit d99766187fb99d4a6655a1e0fdf5dc9451a8e4a0)

6 years agobrcmfmac: Fix access point mode
Stefan Wahren [Wed, 12 Dec 2018 19:20:06 +0000 (20:20 +0100)]
brcmfmac: Fix access point mode

commit 861cb5eb467f ("brcmfmac: Fix access point mode") upstream.

Since commit 1204aa17f3b4 ("brcmfmac: set WIPHY_FLAG_HAVE_AP_SME flag")
the Raspberry Pi 3 A+ (BCM43455) isn't able to operate in AP mode with
hostapd (device_ap_sme=1 use_monitor=0):

brcmfmac: brcmf_cfg80211_stop_ap: setting AP mode failed -52

So add the missing mgmt_stypes for AP mode to fix this.

Fixes: 1204aa17f3b4 ("brcmfmac: set WIPHY_FLAG_HAVE_AP_SME flag")
Suggested-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoMLK-21161-04 brcmfmac: fix 43455 CRC error under SDIO 3.0 SDR104 mode
Wright Feng [Mon, 18 Mar 2019 05:09:44 +0000 (13:09 +0800)]
MLK-21161-04 brcmfmac: fix 43455 CRC error under SDIO 3.0 SDR104 mode

This patch fixes 43455 CRC error while running throughput test with
suspend/resume stress test.

The continuous failure messages before system crash:
brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84
brcmfmac: brcmf_sdio_rxglom: glom read of 25600 bytes failed: -5
brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame
brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84
brcmfmac: brcmf_sdio_rxglom: glom read of 24576 bytes failed: -5
brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit d6e37c2eb0f6fc2b50172321a464337073038228)