linux.git
5 years agoMA-13475 usb: cdns3: gadget: fix NULL pointer issue when switch functions
Peter Chen [Wed, 6 Mar 2019 09:12:29 +0000 (17:12 +0800)]
MA-13475 usb: cdns3: gadget: fix NULL pointer issue when switch functions

Below oops is reproduced when switch between mtp and ptp function
at Android, the interrupt occurs when the usb_ss->gadget_driver
is already NULL. In this commit, we add NULL pointer check for
it as well as protecting for clear usb_ss->gadget_driver.

init: Sending signal 9 to service 'adbd' (pid 4644) process group...
Mem abort info:
  Exception class = DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
Data abort info:
  ISV = 0, ISS = 0x00000004
  CM = 0, WnR = 0
user pgtable: 4k pages, 48-bit VAs, pgd = ffff800830e49000
[0000000000000020] *pgd=0000000000000000
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Modules linked in: wlan
CPU: 0 PID: 3226 Comm: surfaceflinger Not tainted 4.14.98 #1
init: Successfully killed process cgroup uid 0 pid 4644 in 11ms
Hardware name: Freescale i.MX8QXP MEK (DT)
task: ffff80083bf55400 task.stack: ffff00000ffe8000
PC is at cdns_get_setup_ret+0x38/0x64
LR is at cdns_get_setup_ret+0x24/0x64
pc : [<ffff0000089b0e88>] lr : [<ffff0000089b0e74>] pstate: 000001c5
sp : ffff000008003d10
x29: ffff000008003d10 x28: ffff80083bf55400
x27: ffff000009873018 x26: ffff000008004000
x25: ffff000009873018 x24: ffff000009c6a288
x23: ffff000008003f24 x22: ffff00000a85e000
x21: 0000000000000001 x20: ffff8008361c97b8
x19: ffff8008361c9000 x18: 0000000000000001
x17: 0000fe6e544aee34 x16: ffff0000082b54f0
x15: 0000ffffccae15f0 x14: 0000000000000000
x13: 0000000000000000 x12: 0000000000010000
x11: 0000000000000040 x10: 0000000000000040
x9 : ffff8008380ae238 x8 : ffff800838000248
x7 : 0000000000000000 x6 : ffff800838000248
init: Service 'adbd' (pid 4644) killed by signal 9
x5 : ffff80083ae40600 x4 : 0000000000000000
x3 : 00000000000001c0 x2 : 0000000000000000
x1 : ffff00000a85e000 x0 : ffff8008361c9300

X0: 0xffff8008361c9280:
9280  00000000 00000000 00000000 00000000 000f000f
init: processing action (init.svc.adbd=stopped) from (/init.usb.configfs.rc:15)
 00000000 3bf6ce00 ffff8008
92a0  3acd9a00 ffff8008 00000000 00000000 00000000 00000000 00000000 00000000
92c0  00000000 00000000 00000000 00000000 00000000 00000000 089b0e3c ffff0000
92e0  00000000
init: processing action (sys.usb.config=mtp,adb && sys.usb.configfs=1) from (/init.usb.configfs.rc:33)
 00000000 00000000 00000000
read descriptors
read strings
init: starting service 'adbd'...
 00000000
init: property_set("ro.boottime.adbd", "97804848500") failed: property already set
init: Created socket '/dev/socket/adbd', mode 660, user 1000, group 1000
 00000000 0e0f0000 ffff0000
9300  3ff21105 ffff8008 3ff1d120 ffff8008 2e15d4e0 ffff8008 089f9558 ffff0000
9320  3618ac00 ffff8008 091b7860 ffff0000 3bf6ce18 ffff8008 3bf6cd30
read descriptors
read strings
 ffff8008
9340  3acd9a30 ffff8008 00000000 00000005 00000000 00000000 095c4e58 ffff0000
9360  361c9000 ffff8008 3acd9700 ffff8008 095be4c8 ffff0000 3618ac28 ffff8008

X5: 0xffff80083ae40580:
0580  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
05a0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
05c0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
05e0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0600  03440204 ffffffff 00000000 00000000 00000000 00000000 0000000f 00000000
0620  00000001 00000000 00000000 00000030 0000010f 00000000 3ae40600 ffff8008
0640  09d7aae0 ffff0000 3a088000 ffff8008 3aa22c80 ffff8008 00000000 00000000
0660  09886e24 ffff0000 081496ec ffff0000 3b444080 ffff8008 00000000 00000000

X6: 0xffff8008380001c8:
01c8  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
01e8  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0208  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0228  fffffc00 ffffffff 00000000 00000000 00000000 00000000 38000248 ffff8008
0248  003f0000 00000000 380af6c0 ffff8008 09c937f0 ffff0000 38000260 ffff8008
0268  38000260 ffff8008 00000000 00000000 3a007400 ffff8008 3a007600 ffff8008
0288  3a007800 ffff8008 3a007a00 ffff8008 3a007c00 ffff8008 3a6be600 ffff8008
02a8  3ab1da00 ffff8008 3ab1dc00 ffff8008 3ab1de00 ffff8008 3ac52000 ffff8008

X8: 0xffff8008380001c8:
01c8  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
01e8  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0208  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
0228  fffffc00 ffffffff 00000000 00000000 00000000 00000000 38000248 ffff8008
0248  003f0000 00000000 380af6c0 ffff8008 09c937f0 ffff0000 38000260 ffff8008
0268  38000260 ffff8008 00000000 00000000 3a007400 ffff8008 3a007600 ffff8008
0288  3a007800 ffff8008 3a007a00 ffff8008 3a007c00 ffff8008 3a6be600 ffff8008
02a8  3ab1da00 ffff8008 3ab1dc00 ffff8008 3ab1de00 ffff8008 3ac52000 ffff8008

X9: 0xffff8008380ae1b8:
e1b8  3ae1ddd0 ffff8008 3ae1de58 ffff8008 3ae1dee0 ffff8008 3ae1df68 ffff8008
e1d8  3aad9000 ffff8008 3aad9088 ffff8008 3aad9110 ffff8008 3aad9198 ffff8008
e1f8  3aad9220 ffff8008 3aad92a8 ffff8008 3aad9330 ffff8008 3aad93b8 ffff8008
e218  00000000 00000000 00000000 00000000 00000000 00000000 380ae238 ffff8008
e238  000b0400 00000000 3802c490 ffff8008 3a081060 ffff8008 380ae250 ffff8008
e258  380ae250 ffff8008 00000000 00000000 00000000 00000000 00000000 00000000
e278  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
e298  00000000 00000000 3aea2c28 ffff8008 3aea2e28 ffff8008 00000000 00000000

X19: 0xffff8008361c8f80:
8f80  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
8fa0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
8fc0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
8fe0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9000  3ab9f410 ffff8008 3bf6b000 ffff8008 095c4e48 ffff0000 361c9378 ffff8008
9020  360ed558 ffff8008 3ab9f420 ffff8008 3a7d5800 ffff8008 09d9fa00 ffff0000
9040  361b94c8 ffff8008 00000006 00000003 00000000 00000000 00000000 00000000
9060  00000000 00000000 00000000 00000000 361c9070 ffff8008 361c9070 ffff8008

X20: 0xffff8008361c9738:
9738  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9758  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9778  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9798  0000000e 00000000 71a71600 ffff8000 00000000 00000000 00000000 00000000
97b8  044c044c 00000002 00000000 00000000 00000001 00000000 3ab9f410 ffff8008
97d8  00000001 00000000 3bf6cc70 ffff8008 3bf6c170 ffff8008 00000000 00000000
97f8  00000000 00000000 361c9800 ffff8008 361c9800 ffff8008 089b1dc8 ffff0000
9818  71a71600 ffff8000 00000000 00000000 00000000 00000000 00000000 00000000

X28: 0xffff80083bf55380:
5380  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
53a0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
53c0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
53e0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
5400  00000022 00000000 ffffffff ffffffff 00010001 00000000 00000000 00000000
5420  0ffe8000 ffff0000 00000006 00404100 00000000 00000000 00000000 00000000
5440  00000001 00000000 000000e6 00000000 ffff3a2d 00000000 30c10000 ffff8008
5460  00000000 00000001 00000062 00000070 00000062 00000001 09023e38 ffff0000

Process surfaceflinger (pid: 3226, stack limit = 0xffff00000ffe8000)
Call trace:
Exception stack(0xffff000008003bd0 to 0xffff000008003d10)
3bc0:                                   ffff8008361c9300 ffff00000a85e000
3be0: 0000000000000000 00000000000001c0 0000000000000000 ffff80083ae40600
3c00: ffff800838000248 0000000000000000 ffff800838000248 ffff8008380ae238
3c20: 0000000000000040 0000000000000040 0000000000010000 0000000000000000
3c40: 0000000000000000 0000ffffccae15f0 ffff0000082b54f0 0000fe6e544aee34
3c60: 0000000000000001 ffff8008361c9000 ffff8008361c97b8 0000000000000001
3c80: ffff00000a85e000 ffff000008003f24 ffff000009c6a288 ffff000009873018
3ca0: ffff000008004000 ffff000009873018 ffff80083bf55400 ffff000008003d10
3cc0: ffff0000089b0e74 ffff000008003d10 ffff0000089b0e88 00000000000001c5
3ce0: 00000000000001c0 1a8824534cfb2000 0000ffffffffffff ffff0000080f87c8
3d00: ffff000008003d10 ffff0000089b0e88
[<ffff0000089b0e88>] cdns_get_setup_ret+0x38/0x64
[<ffff0000089b2a48>] cdns_check_ep0_interrupt_proceed+0xc0/0x8dc
[<ffff0000089b3508>] cdns_irq_handler_thread+0x2a4/0x4e8
[<ffff0000089afd98>] cdns3_irq+0x44/0x94
[<ffff000008145994>] __handle_irq_event_percpu+0x60/0x24c
[<ffff000008145c54>] handle_irq_event+0x58/0xc0
[<ffff000008149784>] handle_fasteoi_irq+0x98/0x180
[<ffff000008144a58>] generic_handle_irq+0x24/0x38
[<ffff0000081451b8>] __handle_domain_irq+0x60/0xac
[<ffff0000080819c4>] gic_handle_irq+0xd4/0x17c

Signed-off-by: Peter Chen <peter.chen@nxp.com>
(cherry picked from commit 6ee6e32b0c3fcbea70117eaea3c315f0e220144c)

5 years agoMLK-22526: VPU: synchronize sending message to MU
ming_qian [Fri, 30 Aug 2019 02:47:47 +0000 (10:47 +0800)]
MLK-22526: VPU: synchronize sending message to MU

use a spinlock to synchronize sending message to MU

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22484: ARM64: dts: Fix mem clock for asrc
Shengjiu Wang [Fri, 30 Aug 2019 03:24:54 +0000 (11:24 +0800)]
MLK-22484: ARM64: dts: Fix mem clock for asrc

The mem clock is used to access the register, if there is no
mem clock defined, we should use the ipg clock instead,
otherwise there will be kernel dump after system reboot.

[    3.010962] Kernel panic - not syncing: Asynchronous SError Interrupt
[    3.010964] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.19.35-05057-g2134d856e6b2 #2889
[    3.010966] Hardware name: Freescale i.MX8QXP MEK (DT)
[    3.010968] Call trace:
[    3.010969]  dump_backtrace+0x0/0x178
[    3.010971]  show_stack+0x14/0x20
[    3.010972]  dump_stack+0x8c/0xac
[    3.010974]  panic+0x120/0x28c
[    3.010975]  __stack_chk_fail+0x0/0x18
[    3.010977]  arm64_serror_panic+0x74/0x80
[    3.010979]  do_serror+0x68/0x130
[    3.010980]  el1_error+0x7c/0xdc
[    3.010982]  _raw_spin_unlock_irqrestore+0xc/0x48
[    3.010984]  clk_core_disable_lock+0x28/0x38
[    3.010985]  clk_disable+0x1c/0x30
[    3.010987]  regmap_mmio_write+0x54/0x68
[    3.010989]  _regmap_bus_reg_write+0x14/0x20
[    3.010990]  _regmap_write+0x60/0xa8
[    3.010992]  regmap_write+0x48/0x70
[    3.010994]  fsl_asrc_probe+0x258/0x660
[    3.010995]  platform_drv_probe+0x50/0xb0

Why this issue only happen at kernel reboot, it is because the ipg
clock is enabled in default after system reset, after used once, the
ipg clock is disabled, then reboot system, the issue happen.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
5 years agoMLK-22519-2 VPU Decoder: remove *ctrls[V4L2_MAX_CTRLS] from vpu_ctx
Shijie Qin [Wed, 28 Aug 2019 12:34:44 +0000 (20:34 +0800)]
MLK-22519-2 VPU Decoder: remove *ctrls[V4L2_MAX_CTRLS] from vpu_ctx

*ctrls[V4L2_MAX_CTRLS] is not actually used, and it is easy to cause
out-of-bound when add v4l2_ctrl. Hence remove it.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22519-1 VPU Decoder: separate setting start_code_bypass and stream_input_mode
Shijie Qin [Wed, 28 Aug 2019 12:18:28 +0000 (20:18 +0800)]
MLK-22519-1 VPU Decoder: separate setting start_code_bypass and stream_input_mode

There is no dependency between start_code_bypass and stream_input_mode,
should be set separately.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-22522: ASoC: fsl_sai: fix stack-out-of-bounds KASAN complain
Viorel Suman [Thu, 29 Aug 2019 10:17:33 +0000 (13:17 +0300)]
MLK-22522: ASoC: fsl_sai: fix stack-out-of-bounds KASAN complain

Fix the following KASAN reported issue:
==================================================================
[   11.580278] BUG: KASAN: stack-out-of-bounds in find_next_bit+0x3c/0xc0
[   11.586815] Read of size 8 at addr ffffffc8c8d4f760 by task swapper/0/1
[   11.593440]
[   11.594943] CPU: 4 PID: 1 Comm: swapper/0 Tainted: G W 4.19.35-05042-g. #157
[   11.604259] Hardware name: Freescale i.MX8QM MEK (DT)
[   11.609323] Call trace:
[   11.611785]  dump_backtrace+0x0/0x230
[   11.615458]  show_stack+0x14/0x20
[   11.618787]  dump_stack+0xbc/0xf4
[   11.622118]  print_address_description+0x60/0x270
[   11.626830]  kasan_report+0x230/0x360
[   11.630505]  __asan_load8+0x84/0xa8
[   11.634005]  find_next_bit+0x3c/0xc0
[   11.637595]  fsl_sai_calc_dl_off+0x1c/0x50
[   11.641703]  fsl_sai_read_dlcfg+0x184/0x368
[   11.645898]  fsl_sai_probe+0x3ec/0xb48
[   11.649663]  platform_drv_probe+0x70/0xd8
[   11.653683]  really_probe+0x24c/0x370
[   11.657358]  driver_probe_device+0x70/0x138
[   11.661554]  __driver_attach+0x124/0x128
[   11.665489]  bus_for_each_dev+0xe8/0x158
[   11.669425]  driver_attach+0x30/0x40
[   11.673012]  bus_add_driver+0x290/0x308
[   11.676861]  driver_register+0xbc/0x1d0
[   11.680711]  __platform_driver_register+0x7c/0x88
[   11.685431]  fsl_sai_driver_init+0x18/0x20
[   11.689537]  do_one_initcall+0xe8/0x5a8
[   11.693387]  kernel_init_freeable+0x6b0/0x760
[   11.697759]  kernel_init+0x10/0x120
[   11.701255]  ret_from_fork+0x10/0x18
....
==================================================================
[   11.800186] Disabling lock debugging due to kernel taint

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
5 years agoMLK-22521-3: ASoC: fsl_easrc: Add multi context for bps_iec958
Shengjiu Wang [Thu, 29 Aug 2019 08:31:06 +0000 (16:31 +0800)]
MLK-22521-3: ASoC: fsl_easrc: Add multi context for bps_iec958

Add multi context support for bps_iec958

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 131408cc5b9f7957502c01bf3bff18c9c4b4fca0)

5 years agoMLK-22521-2: ASoC: fsl_easrc: support configuration of channel status
Shengjiu Wang [Thu, 29 Aug 2019 05:56:22 +0000 (13:56 +0800)]
MLK-22521-2: ASoC: fsl_easrc: support configuration of channel status

support configuration of channel status for IEC958

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 92aee54f844098080c878ae59878dadab28d8ea3)

5 years agoMLK-22521-1: ASoC: fsl_easrc:IEC958 is only supported for output
Shengjiu Wang [Thu, 29 Aug 2019 06:07:18 +0000 (14:07 +0800)]
MLK-22521-1: ASoC: fsl_easrc:IEC958 is only supported for output

IEC958 is only supported for output according to the RM

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit bf36888526c420776c18ca06548b9d3798200beb)

5 years agoMLK-22514 arm64: dts: imx8mm: Fix GPU axi/ahb rates
Leonard Crestez [Tue, 27 Aug 2019 11:34:40 +0000 (14:34 +0300)]
MLK-22514 arm64: dts: imx8mm: Fix GPU axi/ahb rates

On imx8mm gpu AXI should be 800m and AHB 400m but assigned-clock-rates
incorrectly assigned 400m to AXI and left AHB at 800m.

Fixes: e744bde4148b ("MLK-21700-4 arm64: dts: imx8mm: Consolidate composite assigned-clocks")

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
5 years agoMLK-22502: arm64: dts: fsl-imx8mq: Use SYNC_PULSE for Raydium panel
Robert Chiras [Mon, 26 Aug 2019 08:38:08 +0000 (11:38 +0300)]
MLK-22502: arm64: dts: fsl-imx8mq: Use SYNC_PULSE for Raydium panel

On 8MQ, it seems that the panel has issues when video-mode used is with
SYNC_EVENTS (default). So, use the video-mode to <2> (SYNC_PULSE), since
the video signal is much stable with this mode.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
5 years agoMLK-22360 soc: imx8qm/imx8qxp: Fix power state of parent power domains
Ranjani Vaidyanathan [Thu, 15 Aug 2019 19:54:49 +0000 (14:54 -0500)]
MLK-22360 soc: imx8qm/imx8qxp: Fix power state of parent power domains

Handle the case when powering down a pd with no active slave domains.

Signed-off-by: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>
5 years agoMLK-22506: VPU Decoder: fix mutex may not unlock if v4l2_open fail
ming_qian [Tue, 27 Aug 2019 01:46:39 +0000 (09:46 +0800)]
MLK-22506: VPU Decoder: fix mutex may not unlock if v4l2_open fail

there is an bug in v4l2_open,
that the dev_mutex may be not unlock in some flow,
it'll cause dead lock.

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22463-2: ASoC: imx-sii902x: Fix constant variable guards dead code
Shengjiu Wang [Mon, 26 Aug 2019 07:55:14 +0000 (15:55 +0800)]
MLK-22463-2: ASoC: imx-sii902x: Fix constant variable guards dead code

Fix constant variable guards dead code which is reported by coverity.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
5 years agoMLK-22463-1: ASoC: fsl_easrc: Fix logically dead code
Shengjiu Wang [Mon, 26 Aug 2019 07:52:13 +0000 (15:52 +0800)]
MLK-22463-1: ASoC: fsl_easrc: Fix logically dead code

Fix logically dead code which is reported by coverity

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
5 years agoMLK-22487-2 clk: imx: imx8mm/n: fix pll mux bit
Peng Fan [Thu, 22 Aug 2019 03:23:42 +0000 (11:23 +0800)]
MLK-22487-2 clk: imx: imx8mm/n: fix pll mux bit

pll BYPASS bit should be kept inside pll driver for glitchless freq
setting following spec. If exposing the bit, that means pll driver and
clk driver has two paths to touch this bit, which is wrong.

So use EXT_BYPASS bit here.

And drop uneeded set parent, because EXT_BYPASS default is 0.

Suggested-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoMLK-22487-1 clk: imx: clk-pll14xx: unbypass PLL by default
Peng Fan [Thu, 22 Aug 2019 03:18:13 +0000 (11:18 +0800)]
MLK-22487-1 clk: imx: clk-pll14xx: unbypass PLL by default

When registering the PLL, unbypass the PLL.
The PLL has two bypass control bit, BYPASS and EXT_BYPASS.
we will expose EXT_BYPASS to clk driver for mux usage, and keep
BYPASS inside pll14xx usage. The PLL has a restriction that
when M/P change, need to RESET/BYPASS pll to avoid glitch, so
we could not expose BYPASS.

To make it easy for clk driver usage, unbypass PLL which does
not hurt current function.

Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoMLK-22489 clk: imx: pll14xx: avoid glitch when set rate
Peng Fan [Tue, 20 Aug 2019 02:27:04 +0000 (10:27 +0800)]
MLK-22489 clk: imx: pll14xx: avoid glitch when set rate

According to PLL1443XA and PLL1416X spec,
"When BYPASS is 0 and RESETB is changed from 0 to 1, FOUT starts to
output unstable clock until lock time passes. PLL1416X/PLL1443XA may
generate a glitch at FOUT."

So set BYPASS when RESETB is changed from 0 to 1 to avoid glitch.
In the end of set rate, BYPASS will be cleared.

When prepare clock, also need to take care to avoid glitch. So
we also follow Spec to set BYPASS before RESETB changed from 0 to 1.
And add a check if the RESETB is already 0, directly return 0;

Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoMLK-22464 VPU Decoder: [MX8QM] vpu issue in coverity kernel scan
Shijie Qin [Fri, 23 Aug 2019 07:27:21 +0000 (15:27 +0800)]
MLK-22464 VPU Decoder: [MX8QM] vpu issue in coverity kernel scan

1. CID 6371811: Dereference before null check (REVERSE_INULL)
2. CID 6371006: Unchecked return value (CHECKED_RETURN)

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-22314-3 VPU Decoder: modify show performance measure
Shijie Qin [Fri, 23 Aug 2019 05:59:10 +0000 (13:59 +0800)]
MLK-22314-3 VPU Decoder: modify show performance measure

1. start timer from open device;
2. add the interval from open device to feed first data and to
   send start cmd;
3. In order to reduce the time deviation of print log, use
   device_attribute file to show performance info.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-21499 arm: imx: put pads into OFF state before entering VLLS
Shenwei Wang [Tue, 20 Aug 2019 20:07:36 +0000 (15:07 -0500)]
MLK-21499 arm: imx: put pads into OFF state before entering VLLS

Due to the hardware limitation, the power supply for the PADs could not
be off during VLLS mode. To reduce the power consumption under VLLS
state, put all the PADs on iomuxc1 into OFF state before the
system enters into VLLS mode.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
5 years agoMLK-22466 ARM64: dts: fsl-imx8dxl-phantom-mek.dtsi: add sd cd and wp support
Haibo Chen [Tue, 20 Aug 2019 12:32:11 +0000 (20:32 +0800)]
MLK-22466 ARM64: dts: fsl-imx8dxl-phantom-mek.dtsi: add sd cd and wp support

Add card detect and write protect support for the sd slot on imx8dxl-phantom-mek
board.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
5 years agoMLK-22460: VPU Decoder: export buffer info to help analysis some hang
ming_qian [Tue, 20 Aug 2019 08:24:57 +0000 (16:24 +0800)]
MLK-22460: VPU Decoder: export buffer info to help analysis some hang
case

Some hang case is caused by the frame count in the stream buffer
is not reach the threshold,
export these infomations, can help us  locate the problem quickly

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22206-2 VPU Decoder: modify vpu log print method
Shijie Qin [Mon, 19 Aug 2019 02:27:29 +0000 (10:27 +0800)]
MLK-22206-2 VPU Decoder: modify vpu log print method

Move LVL_WARN/LVL_EVENT/LVL_INFO one bit to the left to convenient for
adjust log level, and leave 4th position to reserved.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-22451: VPU Decoder: don't append scode after sequence header in
ming_qian [Mon, 19 Aug 2019 02:38:40 +0000 (10:38 +0800)]
MLK-22451: VPU Decoder: don't append scode after sequence header in
dis_reorder mode

in dis_reorder mode, scode need to be inserted after every frame.
but if it's inserted after sequence header, it may cause stream hang,
or cause mosaics.

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22429 imx8mn: fix audio pll setting
Peng Fan [Tue, 13 Aug 2019 03:28:33 +0000 (11:28 +0800)]
MLK-22429 imx8mn: fix audio pll setting

The AUDIO PLL max support 650M, so the original clk settings violate
spec. In order not to impact audio functionality, let's div the
clk by 2.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
5 years agoMLK-22448-2 arch64: dts: imx8m: Set qspi parent to pll1_400m
Leonard Crestez [Fri, 16 Aug 2019 16:54:41 +0000 (19:54 +0300)]
MLK-22448-2 arch64: dts: imx8m: Set qspi parent to pll1_400m

On imx8mm and imx8mn pll1_800m is not a parents of qspi, that mux
position connects to pll2_333m instead.

Set the assigned-clock-parent to pll1_400m instead so that we can get
80m as expected.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Han Xu <han.xu@nxp.com>
5 years agoMLK-22448-1 clk: imx8m: Correct qspi parent
Leonard Crestez [Fri, 16 Aug 2019 16:53:46 +0000 (19:53 +0300)]
MLK-22448-1 clk: imx8m: Correct qspi parent

On imx8mm and imx8mn sys_pll1_800m is not a parent of qspi, that mux
position connects to sys_pll2_333m instead.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Han Xu <han.xu@nxp.com>
5 years agoMLK-22400-2: ARM64: dts: imx8mn: support rpmsg audio in imx8mn
Shengjiu Wang [Wed, 7 Aug 2019 03:00:13 +0000 (11:00 +0800)]
MLK-22400-2: ARM64: dts: imx8mn: support rpmsg audio in imx8mn

Support rpmsg audio in imx8mn

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 02f10fd736edbf4c9d144241ec45656f607262c3)

5 years agoMLK-22400-1: ASoC: fsl_rpmsg_i2s: Add rpmsg i2s for imx8mn
Shengjiu Wang [Wed, 7 Aug 2019 02:56:52 +0000 (10:56 +0800)]
MLK-22400-1: ASoC: fsl_rpmsg_i2s: Add rpmsg i2s for imx8mn

The rpmsg i2s audio is supported with codec wm8524 in imx8mn

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

5 years agoMLK-22340-5: ASoC: imx-pcm-rpmsg: enable ignore_suspend for LPA
Shengjiu Wang [Mon, 29 Jul 2019 07:02:46 +0000 (15:02 +0800)]
MLK-22340-5: ASoC: imx-pcm-rpmsg: enable ignore_suspend for LPA

In LPA drain state, if runtime->status->state is SUSPEND, after resume,
ALSA would exit drain mode directly, that cause some data in end
of song is missed.

This patch is to enable ignore_suspend flags that
the runtime->status->state will be not in SUSPEND always.

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

5 years agoMLK-22340-4: ASoC: fsl_rpmsg_i2s: add lock to protect the resource
Shengjiu Wang [Mon, 29 Jul 2019 06:50:20 +0000 (14:50 +0800)]
MLK-22340-4: ASoC: fsl_rpmsg_i2s: add lock to protect the resource

Use the spin lock to protect the work_write_index and work_read_index,
Use the spin lock to protect the period_done_msg_enabled flag
That is to avoid the read and write flag confliction.

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

5 years agoMLK-22340-3: ASoC: imx-pcm-rpmsg: refine the timer
Shengjiu Wang [Mon, 29 Jul 2019 06:48:09 +0000 (14:48 +0800)]
MLK-22340-3: ASoC: imx-pcm-rpmsg: refine the timer

For we have dropped the cmd I2S_TX_POINTER, and M4 will send
notification every period, so we don't need to enable timer
every period to get the position of TX pointer.

But we need a timer to send the notification to M4 that is
to reduce the notificaition message number.

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

5 years agoMLK-22340-2: ASoC: imx-pcm-rpmsg: drop the cmd I2S_TX_POINTER
Shengjiu Wang [Mon, 29 Jul 2019 06:33:08 +0000 (14:33 +0800)]
MLK-22340-2: ASoC: imx-pcm-rpmsg: drop the cmd I2S_TX_POINTER

There is error log for short period size:

[ 6977.102062] i2s_rpmsg virtio0.rpmsg-audio-channel.-1.1: rpmsg_send cmd 22 timeout!

We use the I2S_TX_POINTER(cmd 22) to get the consumed period
index from M4 every period time, and m4 should send feedback
to A53. When the period time is small, there will too much
cmd send to m4, m4 may not handle it quickly that cause
timeout.

This patch is to remove the I2S_TX_POINTER cmd, m4 should
send notification to A53 every period time to be compatible
with this change. with the patch the loading of this rpmsg
channel is reduced.

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

5 years agoMLK-22340-1: Revert "MLK-20277-4: ARM64: fsl-imx8mm-evk-m4: enable sai3 with wm8524"
Shengjiu Wang [Mon, 29 Jul 2019 06:26:02 +0000 (14:26 +0800)]
MLK-22340-1: Revert "MLK-20277-4: ARM64: fsl-imx8mm-evk-m4: enable sai3 with wm8524"

This reverts commit b49dff663e17302230556745e45eb51b94dc1f0c.

M4 request to control the SAI3 for some customer want to use
the SAI3 + WM8524 for rpmsg playback, so remove the WM8524
sound card in this dts

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

5 years agoMLK-22420 VPU Decoder: change AVS eos padding data, correct chroma size
Shijie Qin [Mon, 12 Aug 2019 01:59:42 +0000 (09:59 +0800)]
MLK-22420 VPU Decoder: change AVS eos padding data, correct chroma size

1. Change AVS format EOS_PADDING_TYPE to EOS_GENERIC_MPEG to align with
firmware
2. chroma size shall also be 1/2 luma size for interlaced clips

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22440-3 clk: imx8mn: Fix incorrect parents
Leonard Crestez [Wed, 14 Aug 2019 11:50:13 +0000 (14:50 +0300)]
MLK-22440-3 clk: imx8mn: Fix incorrect parents

* Replace to audio_pll2_clk with audio_pll2_out
* Replace sys3_pll2_out with sys_pll3_out
* Replace sys1_pll_40m" with sys_pll1_40m
* Fix spelling qspi parents

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoMLK-22440-2 clk: imx8mm: Fix incorrect parents
Leonard Crestez [Tue, 13 Aug 2019 10:26:29 +0000 (13:26 +0300)]
MLK-22440-2 clk: imx8mm: Fix incorrect parents

* Replace reference to sys_pll3_clk with sys_pll3_out
* Replace reference to sys1_pll_40m with sys_pll1_40m
* Fix spelling qspi parents

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoMLK-22440-1 clk: imx8mq: Fix sys3 pll references
Leonard Crestez [Wed, 14 Aug 2019 11:47:40 +0000 (14:47 +0300)]
MLK-22440-1 clk: imx8mq: Fix sys3 pll references

The "sys3_pll2_out" CLK was removed in refactoring so all
references need to be updated to "sys3_pll_out"

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoMGS-4964-2 [#imx-1533] fix GPU kernel ctrl-C issue
Xianzhong [Tue, 13 Aug 2019 13:36:58 +0000 (21:36 +0800)]
MGS-4964-2 [#imx-1533] fix GPU kernel ctrl-C issue

fix 6Q GPU panic with ctrl-c during galcore load/unload

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
5 years agoMGS-4964-1 [#imx-1533] fix galcore load ctrl-C issue
Xianzhong [Fri, 14 Jun 2019 16:18:56 +0000 (00:18 +0800)]
MGS-4964-1 [#imx-1533] fix galcore load ctrl-C issue

fix 8QM GPU hang with ctrl-c during galcore load/unload

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
5 years agoMLK-22427 clk: imx8mn: fix int pll clk gate
Peng Fan [Tue, 13 Aug 2019 03:18:01 +0000 (11:18 +0800)]
MLK-22427 clk: imx8mn: fix int pll clk gate

To Frac pll, the gate shift is 13, however to Int PLL the gate shift
is 11.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
5 years agoMLK-22424 drm/imx: dpu: crc: Fix return value for dpu_crtc_set_crc_source()
Liu Ying [Mon, 12 Aug 2019 02:23:37 +0000 (10:23 +0800)]
MLK-22424 drm/imx: dpu: crc: Fix return value for dpu_crtc_set_crc_source()

In cases where error happens in dpu_crtc_set_crc_source(), we should
return proper error code from it.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
5 years agoarm64: dts: Fix imx8dxl-phantom-mek-rpmsg build
Leonard Crestez [Fri, 9 Aug 2019 12:29:42 +0000 (15:29 +0300)]
arm64: dts: Fix imx8dxl-phantom-mek-rpmsg build

There are two sets of CAN regulators that need to be disabled.

Fixes: d7e360899c59 ("MLK-22419 arm64: dts: enable partition reset for imx8dxl phantom board")

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
5 years agoMLK-22419 arm64: dts: enable partition reset for imx8dxl phantom board
Clark Wang [Fri, 9 Aug 2019 05:27:47 +0000 (13:27 +0800)]
MLK-22419 arm64: dts: enable partition reset for imx8dxl phantom board

Enable partition reset function for imx8dxl phantom board.
Use fsl-imx8dxl-phantom-mek-rpmsg.dtb to enable this function.

Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
5 years agoMLK-22406 usb: typec: tcpm: create parter for source only port
Li Jun [Wed, 7 Aug 2019 07:43:08 +0000 (15:43 +0800)]
MLK-22406 usb: typec: tcpm: create parter for source only port

After the hack of moving forward tcpm state machine for source
only port but with usb data device mode support, we need further
to create its partner, so app(like android) can use it to judge if
the connection exists or not.

Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
5 years agoarch: arm64: imx8dxl-phantom: enable Flexcan
Joakim Zhang [Fri, 9 Aug 2019 05:04:23 +0000 (13:04 +0800)]
arch: arm64: imx8dxl-phantom: enable Flexcan

Enable Flexcan on imx8dxl phantom mek.

Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
5 years agoMLK-22412-2 clk: imx8qm: Fix the wrong remove of IMX8QM_LVDS1_I2C0_CLK
Clark Wang [Thu, 8 Aug 2019 09:48:59 +0000 (17:48 +0800)]
MLK-22412-2 clk: imx8qm: Fix the wrong remove of IMX8QM_LVDS1_I2C0_CLK

The SC_R_LVDS_0/1_I2C_1 resources should be removed. So add
IMX8QM_LVDS1_I2C0_CLK back.

Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
5 years agoMLK-22412-1 Revert "MLK-22337 dts: clk: remove non-exist lvds1 recources for imx8qm"
Clark Wang [Thu, 8 Aug 2019 08:56:21 +0000 (16:56 +0800)]
MLK-22412-1 Revert "MLK-22337 dts: clk: remove non-exist lvds1 recources for imx8qm"

This reverts commit 9811210cb25a98b65be4e3ef35ccaf9c05e0ca83.

No need to remove PD_LVDS1_I2C0 and SC_R_LVDS_1_I2C_0.

Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
5 years agoMLK-22401: mxc-jpeg: No image shown on the screen if set resolution to 333x333
Mirela Rabulea [Tue, 6 Aug 2019 12:56:09 +0000 (15:56 +0300)]
MLK-22401: mxc-jpeg: No image shown on the screen if set resolution to 333x333

Negotiate the resolution during try_fmt/s_fmt ioctls by aligning down,
according to the format restrictions. For the height, loosen up the
restriction to multiple of 8, in order to support NV12 1080p, even if
normally the restriction for NV12 is multiple of 16.

Use v4l_bound_align_image instead of mxc_jpeg_bound_align_image, and
remove mxc_jpeg_bound_align_image, as not needed any more.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
5 years agoMLK-22288: mxc-jpeg: Jpeg decoding/encoding on slot other than 0
Mirela Rabulea [Thu, 18 Jul 2019 16:06:30 +0000 (19:06 +0300)]
MLK-22288: mxc-jpeg: Jpeg decoding/encoding on slot other than 0

Set-up the interrupts for all 4 slots to be handled in the same routine,
mxc_jpeg_dec_irq, which now is no longer hard-coded for slot 0.

Return initial code instead of EINVAL.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
5 years agoMLK-22288: mxc-jpeg: Jpeg decoding/encoding on slot != 0, dtb changes
Mirela Rabulea [Thu, 18 Jul 2019 16:05:00 +0000 (19:05 +0300)]
MLK-22288: mxc-jpeg: Jpeg decoding/encoding on slot != 0, dtb changes

There is an interrupt for each of the 4 slots, so add them
into the 8QXP & 8QM dtb.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
5 years agoMLK-22286: mxc-jpeg: Fix v4l2-compliance test for unlimited opens
Mirela Rabulea [Thu, 18 Jul 2019 15:48:38 +0000 (18:48 +0300)]
MLK-22286: mxc-jpeg: Fix v4l2-compliance test for unlimited opens

Postpone allocating slot data from open() until device_run(), this will
allow unlimited opens. This forces us to postpone some operations from
jpeg_parse and s_fmt, which depend on slot descriptor, until descriptors
configuration in mxc_jpeg_config_dec_desc/mxc_jpeg_config_enc_desc.

Remove hard-coding on slot 0, use COM_STATUS register to determine
the current executing slot in the interrupt handler.

Allocate slots as they become needed, mark unused when frame is done,
release data only on remove, to prevent frequent allocation.

Change order for the following functions:
mxc_jpeg_setup_cfg_stream (and mxc_jpeg_fixup_sos, mxc_jpeg_fixup_sof),
mxc_get_free_slot, mxc_jpeg_alloc_slot_data, mxc_jpeg_free_slot_data

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
5 years agoMLK-22408 ARM64: dts: imx8qm: update edma power domain
Peng Fan [Thu, 8 Aug 2019 02:28:18 +0000 (10:28 +0800)]
MLK-22408 ARM64: dts: imx8qm: update edma power domain

After commit
<1a0833a4b8db>("MLK-22284-1 dmaengine: fsl-edma-v3: add power domains for each channel")
xen dom0 is broken, need to update dom0 and domu dts for edma.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
5 years agoMLK-21819: drm/bridge: nwl-dsi: Use sync events instead of sync pulse
Robert Chiras [Wed, 31 Jul 2019 08:58:04 +0000 (11:58 +0300)]
MLK-21819: drm/bridge: nwl-dsi: Use sync events instead of sync pulse

For some reason, when sending HS DSI commands while also sending pixel
data, the display timing becomes messed up. Didn't find the reason for
which this is happening, but it seems that setting the video mode for
DPI to Non-Burst with Sync Events instead of Non-Burst with Sync Pulses
allows the insertion of HS DSI commands to be send without problems.
So, use Sync Pulses only if requested by mode_flags and use Sync Events
as default.
Also:
- added defines for this video mode, in order to explain those magic
numbers used
- removed write to ENABLE_MULT_PKTS register twice

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
5 years agoMLK-22261: media: mipi_csi: add MIPI PHY reset when csi runtime resume
Guoniu.Zhou [Thu, 11 Jul 2019 06:18:11 +0000 (14:18 +0800)]
MLK-22261: media: mipi_csi: add MIPI PHY reset when csi runtime resume

The reset signal of MIPI Slave PHY will drop when dispmix power down,
so driver need to release the signal again when csi resume.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22066: media: ISI: fix tearing issue for IMX8MN platform
Guoniu.Zhou [Wed, 10 Jul 2019 01:39:34 +0000 (09:39 +0800)]
MLK-22066: media: ISI: fix tearing issue for IMX8MN platform

ISI use ping-pong buffer to write image data to memory. Theoretically,
BUF1 will first work and then BUF2, but sometimes ISI of IMX8MN do not
follow this rule. But in our driver, we use list to manage buffers. It
means that we must follow 1-2-1... sequence. So just skip the frame for
this specail case.

Because we can not guarantee the interrupt sequence of BUF1 and BUF2,
and not sure which buffer is free, so change the buffer switching by
buffer status, not frame sequence.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22205-3: media: ov5640: Fix the first some black frames issue
Guoniu.Zhou [Tue, 9 Jul 2019 03:21:50 +0000 (11:21 +0800)]
MLK-22205-3: media: ov5640: Fix the first some black frames issue

The first some frames will be black or have transparent green
layer on the image. It caused by sensor not stable after releasing
power down. So driver need to delay some time for different resolution
to wait sensor stable.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22205-2: media: ov5640: Gate clock lane when no packet to transmit
Guoniu.Zhou [Thu, 4 Jul 2019 01:19:06 +0000 (09:19 +0800)]
MLK-22205-2: media: ov5640: Gate clock lane when no packet to transmit

If clock lane is free running, we met MIPI CSI clock lane will enter
stop state even though sensor is transmitting data to it. In MLK-22108,
We fix the issue by calling ov5640_stop() which can force sensor lane
to LP11. We can refine the solution by setting 0x4800[5] in initialization
stage.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22205-1: media: ov5640: remove HW reset for ov5640
Guoniu.Zhou [Tue, 9 Jul 2019 02:05:35 +0000 (10:05 +0800)]
MLK-22205-1: media: ov5640: remove HW reset for ov5640

Remove hardware reset pin for ov5640. Because the level of ov5640
reset pin will be low when system suspend and will be high when
system resume. The action will lead to reset ov5640 to default.
In order to fix the issue, driver load firmware before streaming
on every time, the expense is taking more time.

According to OV5640 datasheet, a reset can also be initiated through
the SCCB interface by setting register 0x3008[7] to high. So driver
can remove the hard reset and saving time of loading firmware.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22109-3: media: Replace dispmix gpr with gasket node for imx8mn
Guoniu.Zhou [Mon, 1 Jul 2019 03:16:48 +0000 (11:16 +0800)]
MLK-22109-3: media: Replace dispmix gpr with gasket node for imx8mn

Add gasket node for imx8mn and replace dispmix GPR with it. And remove
dispmix node since it's not needed any more.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22109-2: media: replace dispmix reset flow for ISI and MIPI CSI
Guoniu.Zhou [Wed, 19 Jun 2019 07:27:26 +0000 (15:27 +0800)]
MLK-22109-2: media: replace dispmix reset flow for ISI and MIPI CSI

After the dispmix reset driver development, the reset flow
is better to be replaced by using this driver to hide the
reset details for all the dispmix submodules, and whose
driver code for reset can become platform independent.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22109-1: arm64: dts: Define resets for ISI and CSI
Guoniu.Zhou [Wed, 26 Jun 2019 07:30:00 +0000 (15:30 +0800)]
MLK-22109-1: arm64: dts: Define resets for ISI and CSI

The dispmix-reset device can be used to control the ISI and
CSIS bus reset and clock enable. So define 'resets' property
for both ISI and CSIS for this purpose which will be used to
replace 'dispmix_gpr' usage.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22130: media: ISI: Return error when the output width more than 2048
Guoniu.Zhou [Fri, 28 Jun 2019 09:36:25 +0000 (17:36 +0800)]
MLK-22130: media: ISI: Return error when the output width more than 2048

Because ISI of imx815 only have one channel, so the line buffer
chain function can not be used. The maximum supported line width
is 2048.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22115: media: Fix system hang issue
Guoniu.Zhou [Thu, 27 Jun 2019 06:37:18 +0000 (14:37 +0800)]
MLK-22115: media: Fix system hang issue

System will hang when disable ISI and CSI clock in ATF by dispmix GPR.
The value of dispmix GPR will be cleared when its power domain off/on
although driver set it in probe. So driver need to reset its value in
runtime resume callback.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22113: arm64: dts: add power domain for MIPI CSI of imx815
Guoniu.Zhou [Thu, 27 Jun 2019 01:59:45 +0000 (09:59 +0800)]
MLK-22113: arm64: dts: add power domain for MIPI CSI of imx815

Add power domain for MIPI CSI of IMX8MN

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22110: arm64: dts: Remove redundant ISI node in dts for imx815
Guoniu.Zhou [Thu, 27 Jun 2019 01:29:49 +0000 (09:29 +0800)]
MLK-22110: arm64: dts: Remove redundant ISI node in dts for imx815

Because IMX8MN only support one ISI channel, so we need to remove
the others which planned to support before.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22108: media: sensor: Fix camera hang issue when do stress test
Guoniu.Zhou [Tue, 25 Jun 2019 09:49:40 +0000 (17:49 +0800)]
MLK-22108: media: sensor: Fix camera hang issue when do stress test

Camera will hang when do stress test. The state of MIPI DPHY
clock lane will enter stop state. Driver need to set clock
lane into LP11 mode when stream off.

Remove some unnecessary delay to improve performance.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-21886-4: media: ov5640: add sensor driver support for imx815
Guoniu.Zhou [Mon, 17 Jun 2019 09:16:03 +0000 (17:16 +0800)]
MLK-21886-4: media: ov5640: add sensor driver support for imx815

Add sensor driver support for imx815

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-21886-2: media: imx: Add imx815 platform support
Guoniu.Zhou [Wed, 29 May 2019 09:56:01 +0000 (17:56 +0800)]
MLK-21886-2: media: imx: Add imx815 platform support

Add imx815 platform support in camera media device framework
of imx8qxp/qm.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-21886-1: media: imx: add driver for mipi csi2 controller of SAMSUNG
Guoniu.Zhou [Wed, 29 May 2019 09:11:02 +0000 (17:11 +0800)]
MLK-21886-1: media: imx: add driver for mipi csi2 controller of SAMSUNG

Add driver for mipi csi2 controller of SAMSUNG

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22402 arm64: dts: imx8dxl-phantom-mek: enable M.2 WIFI/BT
Fugang Duan [Wed, 7 Aug 2019 03:07:28 +0000 (11:07 +0800)]
MLK-22402 arm64: dts: imx8dxl-phantom-mek: enable M.2 WIFI/BT

Enable M.2 interface on the phantom-mek board.
- Support WiFi with PCIe interface
- Support Bluetooth with HCI UART

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-22379: ARM64: dts: imx8dxl: Enable SAI/WM8960/ASRC
Shengjiu Wang [Tue, 6 Aug 2019 09:46:56 +0000 (17:46 +0800)]
MLK-22379: ARM64: dts: imx8dxl: Enable SAI/WM8960/ASRC

Correct the pinmux for SAI1
Remove AUDMIX/ESAI for they are not supported in imx8dxl
Configure fsl,sai-synchronous-rx for SAI1 according to pinmux
Enable ASRC p2p for SAI1

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
5 years agoMLK-22395 arm64: dts: imx8dxl-phantom-mek: correct the enet pin group
Fugang Duan [Tue, 6 Aug 2019 07:23:47 +0000 (15:23 +0800)]
MLK-22395 arm64: dts: imx8dxl-phantom-mek: correct the enet pin group

ENET1 pad ring register for compensation cell and voltage reference
is controlled by pin:
SC_P_COMP_CTL_GPIO_1V8_3V3_GPIORHB_PAD

- move the pin to enet pin group
- format the pin define as alignment
- move out below two pins to hoggrp
SC_P_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB0_PAD
SC_P_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB1_PAD

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Acked-by: Richard Zhu <hongxing.zhu@nxp.com>
5 years agoMLK-22364 brcmfmac: double check the D3 ACK state when wait event timeout
Fugang Duan [Tue, 6 Aug 2019 06:04:58 +0000 (14:04 +0800)]
MLK-22364 brcmfmac: double check the D3 ACK state when wait event timeout

When system suspend, pcie bus write BRCMF_H2D_HOST_D3_INFORM cmd
into tcm32 mem to let host enter D3 mode, and wait the D3 ACK
interrupt. But sometime, the interrupt is comming lately then
cause wait event timeout, so double check the D3 ACK state.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Acked-by: Richard Zhu <hongxing.zhu@nxp.com>
5 years agoMLK-22394 clk: imx: correct the earlycon port index check
Fugang Duan [Fri, 2 Aug 2019 06:25:30 +0000 (14:25 +0800)]
MLK-22394 clk: imx: correct the earlycon port index check

Correct the earlycon port index check.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Acked-by: Richard Zhu <hongxing.zhu@nxp.com>
5 years agoMLK-20716 PCI: add quirk for cyw4356 to disable D3 mode
Andy Duan [Mon, 7 Jan 2019 10:45:41 +0000 (18:45 +0800)]
MLK-20716 PCI: add quirk for cyw4356 to disable D3 mode

Add quirk for cyw4356 to disable D3 mode because current firmware
still doesn't support D3 mode.

After stress test, cyw4356 D3 mode still has timeout issue, so
cherry pick back the commit.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit 22212c60d7fb067e28a2fed16914515e3d6d3950)

5 years agoMLK-22025-3 usb: chipidea: enter lpm when imx7d host suspend
Li Jun [Wed, 31 Jul 2019 07:36:33 +0000 (15:36 +0800)]
MLK-22025-3 usb: chipidea: enter lpm when imx7d host suspend

This is the only platform we found has this remote wakeup issue,
so enable CI_HDRC_HOST_SUSP_PHY_LPM for it.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
5 years agoMLK-22025-2 doc: dt-binding: ci-hdrc-usb2: add compatible for imx8mm
Li Jun [Wed, 31 Jul 2019 08:51:40 +0000 (16:51 +0800)]
MLK-22025-2 doc: dt-binding: ci-hdrc-usb2: add compatible for imx8mm

imx8mm has 2 chipidea usb2 cores, add its compatible.

Signed-off-by: Li Jun <jun.li@nxp.com>
5 years agoMLK-22025-1 usb: chipidea: phy enter low power mode when host suspend
Li Jun [Wed, 31 Jul 2019 06:36:58 +0000 (14:36 +0800)]
MLK-22025-1 usb: chipidea: phy enter low power mode when host suspend

On some imx host, if USB PHY is active when bus suspended, host may
have problem on taking over resume signal of remote wakeup from usb
device, resolve this by making PHY enter low power mode right after
bus suspended.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
5 years agoMLK-22356 arm64: dts: imx8mn: Correct typec node
Li Jun [Tue, 30 Jul 2019 07:29:10 +0000 (15:29 +0800)]
MLK-22356 arm64: dts: imx8mn: Correct typec node

Use the correct typec node properties according to typec driver
update.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
5 years agoMLK-22383 arm64: dts: enable rpmsg on imx8dxl mek board
Richard Zhu [Tue, 6 Aug 2019 04:43:31 +0000 (12:43 +0800)]
MLK-22383 arm64: dts: enable rpmsg on imx8dxl mek board

Enable rpmsg on imx8dxl mek board.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-22360 soc: imx8qm/imx8qxp: Fix power state of parent power domains
Ranjani Vaidyanathan [Wed, 17 Jul 2019 16:33:46 +0000 (11:33 -0500)]
MLK-22360 soc: imx8qm/imx8qxp: Fix power state of parent power domains

Fix power state of parent power domains that have no device
associated with them.

Current power domain driver does not work well in two cases:
1. A device is controlled by multiple power domains
2. Multiple devices are controlled by a single power domain that
is dependent on another power domain(s).

This patch attempts to fix these two issues.

Signed-off-by: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>
5 years agoMLK-22355: mfd: si476x: Use system_freezable_wq instead of system_wq
Shengjiu Wang [Sat, 3 Aug 2019 07:54:45 +0000 (15:54 +0800)]
MLK-22355: mfd: si476x: Use system_freezable_wq instead of system_wq

There is issue that system can't enter suspend while the si476x is
working.

The reason is that with the workqueue thread is still working after
i2c enter suspend, then cause the cpu_suspend function failed.

This patch is to use the system_freezable_wq instead of the system_wq,
that the workqueue will be freeze before system enter suspend.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
5 years agoMLK-22377 VPU Decoder: move crc and input_data dump file directory to /data/
Shijie Qin [Mon, 5 Aug 2019 04:05:39 +0000 (12:05 +0800)]
MLK-22377 VPU Decoder: move crc and input_data dump file directory to /data/

In order to compatibility with Android system, move crc and input_data dump
file directory from /home/ and /tmp/ to /data/.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
5 years agoMLK-22294: arm64: dts: add imx8dxl phantom mek board
Teo Hall [Tue, 23 Jul 2019 04:16:05 +0000 (23:16 -0500)]
MLK-22294: arm64: dts: add imx8dxl phantom mek board

Add DTBs to support imx8dxl phantom mek board.

Signed-off-by: Teo Hall <teo.hall@nxp.com>
5 years agoMLK-22164-2 VPU Decoder: check input frame type before update to ring buffer
Shijie Qin [Thu, 1 Aug 2019 11:52:51 +0000 (19:52 +0800)]
MLK-22164-2 VPU Decoder: check input frame type before update to ring buffer

Previously, only process for RV format, other formats should also
be treated in the same way.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-22369-2 ARM: imx: Fix PMC module registers offset
Anson Huang [Mon, 5 Aug 2019 00:11:20 +0000 (08:11 +0800)]
MLK-22369-2 ARM: imx: Fix PMC module registers offset

The latest reference manual (Rev.0, 06/2019) shows PMC0
and PMC1 have different register offsets, clean them up.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
5 years agoMLK-22369-1 ARM: imx: Fix the offset for the PMC0 control register
Fabio Estevam [Fri, 2 Aug 2019 02:18:35 +0000 (23:18 -0300)]
MLK-22369-1 ARM: imx: Fix the offset for the PMC0 control register

The PMC0 control register is at offset 0x28, not 0x24.

Fix it accordingly.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
5 years agoMLK-22337 dts: clk: remove non-exist lvds1 recources for imx8qm
Clark Wang [Fri, 26 Jul 2019 02:55:04 +0000 (10:55 +0800)]
MLK-22337 dts: clk: remove non-exist lvds1 recources for imx8qm

The patch 4e995ba0a954980 removes the non-exist recources for LVDS1, so
remove the usage of SC_R_LVDS_1_I2C_0/SC_R_LVDS_1_I2C_1 in dts, and
replace pd_lvds1_i2c with pd_lvds1 which is the parent in lvds_i2c node.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
5 years agoMLK-22370: VPU Decoder: export firmware dbglog using raw data instead of
ming_qian [Fri, 2 Aug 2019 06:39:03 +0000 (14:39 +0800)]
MLK-22370: VPU Decoder: export firmware dbglog using raw data instead of
string

we can use the debug tool analyze the raw dbglog.

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22314-2 VPU Decoder: add driver param to show decode performance
Shijie Qin [Thu, 1 Aug 2019 11:35:15 +0000 (19:35 +0800)]
MLK-22314-2 VPU Decoder: add driver param to show decode performance

Show the interval from input first data to receive start_done
and seq_hdr_found event.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMGS-5061 GPU: Integrate 6.4.0.RC2 kernel driver
Xianzhong [Fri, 2 Aug 2019 13:47:59 +0000 (21:47 +0800)]
MGS-5061 GPU: Integrate 6.4.0.RC2 kernel driver

Include more bug-fixings for Vulkan and NN driver

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
5 years agoMLK-22347 VPU Decoder: add Xvid format supprot
Shijie Qin [Tue, 30 Jul 2019 09:28:03 +0000 (17:28 +0800)]
MLK-22347 VPU Decoder: add Xvid format supprot

add Xvid format support, and vpu treat it as MPEG4.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-22346 clk: imx: Fix the initialization of flag variable
Jacky Bai [Tue, 30 Jul 2019 09:13:12 +0000 (17:13 +0800)]
MLK-22346 clk: imx: Fix the initialization of flag variable

The flag variable must be initialized before used.
the 'OR' operation will cause unpredictable behavior.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
5 years agoMLK-22344 arm64: dts: mark ocotp as read-only
Peng Fan [Tue, 30 Jul 2019 07:02:58 +0000 (15:02 +0800)]
MLK-22344 arm64: dts: mark ocotp as read-only

It is easy to exploit system by allowing fuse program,
so let's mark as read-only. If pepole wanna fuse program,
just delete this property.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22303 gpu: imx: dpu: common: Fix build warning when CONFIG_PM_SLEEP=n
Liu Ying [Tue, 23 Jul 2019 07:36:49 +0000 (15:36 +0800)]
MLK-22303 gpu: imx: dpu: common: Fix build warning when CONFIG_PM_SLEEP=n

This patch fixes the below build warning when CONFIG_PM_SLEEP=n.

  CC      drivers/gpu/imx/dpu/dpu-common.o
drivers/gpu/imx/dpu/dpu-common.c:831:1: warning: ‘_dpu_submodules_init’ defined but not used [-Wunused-function]
 _dpu_submodules_init(struct dpu_soc *dpu, struct platform_device *pdev)
 ^~~~~~~~~~~~~~~~~~~~

Signed-off-by: Liu Ying <victor.liu@nxp.com>
5 years agoMLK-22333: ASoC: fsl_easrc: Support FLOAT_LE
Shengjiu Wang [Fri, 26 Jul 2019 08:08:17 +0000 (16:08 +0800)]
MLK-22333: ASoC: fsl_easrc: Support FLOAT_LE

The audio float point data range is (-1, 1), the asrc would output
all zero for float point input and integer output case, that is to
drop the fractional part of the data directly.

In order to support float to int conversion or int to float conversion
we need to do special operation on the coefficient to enlarge/reduce
the data to the expected range.

For float to int case:
Up sampling:
1. Create a 1 tap filter with center tap (only tap) of 2^31
   in 64 bits floating point.
   double value = (double)(((uint64_t)1) << 31);
2. Program 1 tap prefilter with center tap above.

Down sampling,
1. If the filter is single stage filter, add "shift" to the exponent of
   stage 1 coefficients.
2. If the filter is two stage filter , add "shift" to the exponent of
   stage 2 coefficients.

The "shift" is 31, same for int16, int24, int32 case.

For int to float case:
Up sampling:
1. Create a 1 tap filter with center tap (only tap) of 2^-31
   in 64 bits floating point.
2. Program 1 tap prefilter with center tap above.

Down sampling,
1. If the filter is single stage filter, subtract "shift" to the
   exponent of stage 1 coefficients.
2. If the filter is two stage filter , subtract "shift" to the
   exponent of stage 2 coefficients.

The "shift" is 15,23,31, different for int16, int24, int32 case.

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

5 years agoMLK-22315 VPU Decoder: add driver param to dump input frame data
Shijie Qin [Mon, 29 Jul 2019 01:42:19 +0000 (09:42 +0800)]
MLK-22315 VPU Decoder: add driver param to dump input frame data

module_param(vpu_datadump_ena, int, 0644);
MODULE_PARM_DESC(vpu_datadump_ena, "enable dump input frame data (0-1)");

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
5 years agoMLK-21976 nvmem: imx-scu-octop: implement program support
Peng Fan [Thu, 25 Jul 2019 10:41:51 +0000 (18:41 +0800)]
MLK-21976 nvmem: imx-scu-octop: implement program support

Implement program support.
Restruct code to check hole/ecc region.
Use ATF SIP to program fuse
Add mutex lock to protect access

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>