linux.git
7 years agousb: dwc3: core: add current_dr_role member
Roger Quadros [Tue, 4 Apr 2017 08:25:27 +0000 (11:25 +0300)]
usb: dwc3: core: add current_dr_role member

We're going to use this member to track which role we're currently
playing, that way we can more easily implement dual-role swap in
upcoming patches.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
7 years agousb: udc: allow adding and removing the same gadget device
Roger Quadros [Mon, 3 Apr 2017 12:20:29 +0000 (15:20 +0300)]
usb: udc: allow adding and removing the same gadget device

allow usb_del_gadget_udc() and usb add_gadget_udc() to be called
repeatedly on the same gadget->dev structure.

We need to clear the gadget->dev structure so that kobject_init()
doesn't complain about already initialized object.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
7 years agoMLK-16283 regulator: pfuze100: add 500us wait time for switch enable
Robin Gong [Mon, 28 Aug 2017 09:24:41 +0000 (17:24 +0800)]
MLK-16283 regulator: pfuze100: add 500us wait time for switch enable

add 500us enable_time for switch to be stable while turned on.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
7 years agoMLK-16275-2: ARM64: dts: imx8qm/qxp: Sync ESAI0 and AMIX SAIs rates
Viorel Suman [Thu, 24 Aug 2017 11:52:03 +0000 (14:52 +0300)]
MLK-16275-2: ARM64: dts: imx8qm/qxp: Sync ESAI0 and AMIX SAIs rates

The ESAI0 and AMIX SAIs rates need to be the same for the
common and master clocks in the clock tree given the existing
clock rates store/restore functionality and the asynchronous
nature of the drivers "probe" method invocation.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
7 years agoMLK-16275-1: ASoC: fsl: amix: fix rates constraints
Viorel Suman [Fri, 25 Aug 2017 11:14:35 +0000 (14:14 +0300)]
MLK-16275-1: ASoC: fsl: amix: fix rates constraints

AMIX SAIs frequency was doubled in order to
support the [98k rate X 8 channels X 32 bit width].
As consequence the criteria to enforce the rates
constrainsts needs to be changed accordingly.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
7 years agoMLK-16255-6 video: fbdev: dcss: use aligned width to calc pitch for DPR
Fancy Fang [Fri, 25 Aug 2017 10:14:39 +0000 (18:14 +0800)]
MLK-16255-6 video: fbdev: dcss: use aligned width to calc pitch for DPR

After alignment handling for DPR, the aligned width
may be larger than the same as original width, so
use the aligned width to calculate the pitch for
DPR.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16266-02 ARM: imx: Enhance the code to support new TO for imx6qp
Bai Ping [Fri, 25 Aug 2017 05:22:32 +0000 (13:22 +0800)]
MLK-16266-02 ARM: imx: Enhance the code to support new TO for imx6qp

Previous code don't take care about the i.MX6QP revision update of
new TO. So improve the code to include future TO support for i.MX6QP.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16266-01 ARM: imx: improve the soc revision calculation flow
Bai Ping [Fri, 25 Aug 2017 05:07:27 +0000 (13:07 +0800)]
MLK-16266-01 ARM: imx: improve the soc revision calculation flow

On our i.MX6 SOC, the DIGPROG register is used for represent the
SOC ID and silicon revision. The revision has two part: MAJOR and
MINOR. each is represented in 8 bits in the register.

  bits [15:8]: reflect the MAJOR part of the revision;
  bits [7:0]: reflect the MINOR part of the revision;

In our linux kernel, the soc revision is represented in 8 bits. MAJOR
part and MINOR each occupy 4 bits.

previous method does NOT take care about the MAJOR part in DIGPROG register.
So reformat the revision read from the HW to compatible the revision format
used in kernel.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16255-5 video: fbdev: dcss: init default video layer buffer to black
Fancy Fang [Fri, 25 Aug 2017 09:30:53 +0000 (17:30 +0800)]
MLK-16255-5 video: fbdev: dcss: init default video layer buffer to black

For video layer, the black pixel value is not 0x0,
but (Y: 0x0, U: 128, V: 128). So init the video
layer frame buffer contents to the black pixel
value by default.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16255-4 video: fbdev: dcss: add alignment handling for SCALER
Fancy Fang [Fri, 25 Aug 2017 06:32:08 +0000 (14:32 +0800)]
MLK-16255-4 video: fbdev: dcss: add alignment handling for SCALER

According to the DCSS spec, the SCALER has alignment
limitations for the input source image on both 'x'
and 'y' directions of Luma and Chroma planes. And
the 'x' and 'y' should be divisable by 4.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16255-3 video: fbdev: dcss: add alignment handling for DPR
Fancy Fang [Thu, 24 Aug 2017 09:49:18 +0000 (17:49 +0800)]
MLK-16255-3 video: fbdev: dcss: add alignment handling for DPR

According to the DCSS spec, the DPR has alignment
limitations for the input source image on both 'x'
and 'y' directions of Luma and Chroma planes. The
DPR has different alignment requirements for
different bpp, tile type, rtram buffer lines and
etc.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16255-2 video: fbdev: dcss: use 'db' of ctxld to config DTG
Fancy Fang [Wed, 23 Aug 2017 07:39:33 +0000 (15:39 +0800)]
MLK-16255-2 video: fbdev: dcss: use 'db' of ctxld to config DTG

DTG is a standard double buffer module which has
shadow registers. So use double buffer to config
its registers via Context Loader.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16255-1 video: fbdev: dcss: add 'db' support for ctxld
Fancy Fang [Wed, 23 Aug 2017 07:02:20 +0000 (15:02 +0800)]
MLK-16255-1 video: fbdev: dcss: add 'db' support for ctxld

Add double buffer Context Loader function support in
DCSS, since some of the submodules have shadow reigsters
which are more suitable to use double buffer context
loader to load the reigster values for them, and double
buffer loadding is earlier than single buffer loading.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16165-2 cpufreq: imx8mq: remove non-necessary opp table initialization
Anson Huang [Fri, 25 Aug 2017 05:06:24 +0000 (13:06 +0800)]
MLK-16165-2 cpufreq: imx8mq: remove non-necessary opp table initialization

For i.MX8MQ, suspend freq can use policy->max after cpu freq
table is validated, so no need to get OPP number and MAX
frequency for suspend freq now, also add necessary resource free
when probe failed.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-16165-1 cpufreq: imx8: remove non-necessary opp table initialization
Anson Huang [Fri, 25 Aug 2017 05:03:23 +0000 (13:03 +0800)]
MLK-16165-1 cpufreq: imx8: remove non-necessary opp table initialization

For i.MX8QM/8QXP, suspend freq can use policy->max after cpu
freq table is validated, so no need to get OPP number and MAX
frequency for suspend freq now, also add necessary resource free
when probe failed.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-16244-2 cpufreq: imx8: add SIP cpu-freq support
Anson Huang [Wed, 23 Aug 2017 05:00:47 +0000 (13:00 +0800)]
MLK-16244-2 cpufreq: imx8: add SIP cpu-freq support

Add SIP cpu-freq support, the CPU hardware frequency
scale will be performed by ARM Trusted Firmware,
and add cpu-freq suspend support, MAX frequency will
be used during suspend.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-16244-1 arm64: dts: freescale: imx8qxp: add cpu-freq set-point
Anson Huang [Wed, 23 Aug 2017 04:48:59 +0000 (12:48 +0800)]
MLK-16244-1 arm64: dts: freescale: imx8qxp: add cpu-freq set-point

Add i.MX8QXP cpu-freq setpoints, currently only
1.2GHz and 1GHz are supported.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-16262: Input: snvs_pwrkey - move devm_request_irq to the end of probe function
Shenwei Wang [Thu, 24 Aug 2017 15:13:41 +0000 (10:13 -0500)]
MLK-16262: Input: snvs_pwrkey - move devm_request_irq to the end of probe function

A pending interrupt may cause a kernel panic at system
startup. It is because the necessary data have not been
initialized completely before the interrupt handler is
called.

[    1.141547] Unable to handle kernel NULL pointer dereference at virtual address 00000048
[    1.149642] pgd = ffff000009275000
[    1.153048] [00000048] *pgd=00000000ffffe003[    1.157148] , *pud=00000000ffffd003
, *pmd=0000000000000000[    1.162660]
[    1.164164] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    1.169740] Modules linked in:
[    1.172818] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.11-03067-g40eb128-dirty #112
[    1.180738] Hardware name: Freescale i.MX8MQ EVK (DT)
[    1.185794] task: ffff8000ba0e0000 task.stack: ffff8000ba0e8000
[    1.191725] PC is at imx_snvs_pwrkey_interrupt+0x14/0x70
[    1.197046] LR is at __handle_irq_event_percpu+0x9c/0x128
[    1.202450] pc : [<ffff000008849524>] lr : [<ffff000008101d4c>] pstate: 000001c5
[    1.209848] sp : ffff8000bff79ed0
[    1.213166] x29: ffff8000bff79ed0 x28: ffff8000ba0e8000
[    1.218514] x27: 0000000000000001 x26: ffff000008e582b8
[    1.223862] x25: ffff000009113eaf x24: ffff8000ba480200
[    1.229210] x23: 0000000000000021 x22: ffff8000bff79f8c
[    1.234557] x21: 0000000000000000 x20: ffff8000ba480200
[    1.239906] x19: 0000000000000000 x18: 0000000000000000
[    1.245253] x17: 0000000000000000 x16: 0000000000000000
[    1.250600] x15: 0000000000000000 x14: 0000000000000000
[    1.255947] x13: 0000000000000000 x12: 0000000000000000
[    1.261293] x11: 0000000000000040 x10: ffff8000b8000028
[    1.266642] x9 : ffff8000b8000130 x8 : 0000000000000000
[    1.271989] x7 : ffff8000ba480200 x6 : ffff8000ba480200
[    1.277336] x5 : ffff8000b8000000 x4 : 00008000b6eca000
[    1.282684] x3 : 0000000000000000 x2 : ffff000008849510
[    1.288030] x1 : 0000000000000000 x0 : 0000000000000021
[    1.293378]
[    1.294875] Process swapper/0 (pid: 1, stack limit = 0xffff8000ba0e8020)
[    1.301581] Stack: (0xffff8000bff79ed0 to 0xffff8000ba0ec000)
[    1.307330] Call trace:
[    1.309782] Exception stack(0xffff8000bff79d00 to 0xffff8000bff79e30)
[    1.316229] 9d00: 0000000000000000 0001000000000000 ffff8000bff79ed0 ffff000008849524
[    1.324065] 9d20: ffff8000bff79d40 ffff0000080e0830 ffff8000bffaa980 0000000000000000
[    1.331901] 9d40: ffff8000bff79d60 ffff0000080e0898 ffff8000bff79d70 ffff0000080f83d8
[    1.339736] 9d60: 0000000000554179 ffff0000080e097c ffff8000bff79da0 ffff0000080e7ff0
[    1.347572] 9d80: ffff8000ba0e0000 0000000000554179 ffff8000bff79dc0 ffff0000080eb20c
[    1.355408] 9da0: 0000000000000021 0000000000000000 ffff000008849510 0000000000000000
[    1.363243] 9dc0: 00008000b6eca000 ffff8000b8000000 ffff8000ba480200 ffff8000ba480200
[    1.371079] 9de0: 0000000000000000 ffff8000b8000130 ffff8000b8000028 0000000000000040
[    1.378914] 9e00: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    1.386748] 9e20: 0000000000000000 0000000000000000
[    1.391633] [<ffff000008849524>] imx_snvs_pwrkey_interrupt+0x14/0x70
[    1.397994] [<ffff000008101d4c>] __handle_irq_event_percpu+0x9c/0x128
[    1.404440] [<ffff000008101df4>] handle_irq_event_percpu+0x1c/0x58
[    1.410626] [<ffff000008101e78>] handle_irq_event+0x48/0x78
[    1.416206] [<ffff0000081057c0>] handle_fasteoi_irq+0xb8/0x1b0
[    1.422045] [<ffff000008100e4c>] generic_handle_irq+0x24/0x38
[    1.427797] [<ffff0000081014b4>] __handle_domain_irq+0x5c/0xb8
[    1.433637] [<ffff00000808163c>] gic_handle_irq+0xbc/0x168
[    1.439127] Exception stack(0xffff8000ba0eb9e0 to 0xffff8000ba0ebb10)
[    1.445574] b9e0: ffff8000ba48029c 0000000000000040 0000000000000005 0000000000000000
[    1.453409] ba00: 0000000000000004 000000000000000f ffff8000ba480220 0000000000000000
[    1.461244] ba20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    1.469080] ba40: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    1.476915] ba60: 0000000000000000 0000000000000000 0000000000000000 ffff8000ba837f00
[    1.484751] ba80: ffff8000ba480200 0000000000000021 ffff8000ba48029c ffff8000ba480268
[    1.492586] baa0: 0000000000000000 0000000000000040 ffff8000ba480220 ffff8000ba480220
[    1.500422] bac0: 0000000000000000 ffff8000ba0ebb10 ffff000008103cb8 ffff8000ba0ebb10
[    1.508258] bae0: ffff000008b2b868 0000000040000045 ffff8000ba837f00 ffff8000ba480200
[    1.516092] bb00: ffffffffffffffff ffff000008103e18
[    1.520975] [<ffff0000080827b0>] el1_irq+0xb0/0x124
[    1.525863] [<ffff000008b2b868>] _raw_spin_unlock_irqrestore+0x10/0x48
[    1.532397] [<ffff000008104124>] request_threaded_irq+0xec/0x1c0
[    1.538410] [<ffff00000810689c>] devm_request_threaded_irq+0x74/0xe0
[    1.544770] [<ffff0000088497a8>] imx_snvs_pwrkey_probe+0x178/0x2a8
[    1.550958] [<ffff0000085ccaa0>] platform_drv_probe+0x58/0xc0
[    1.556713] [<ffff0000085caf54>] driver_probe_device+0x1fc/0x2a8
[    1.562727] [<ffff0000085cb0ac>] __driver_attach+0xac/0xb0
[    1.568220] [<ffff0000085c8fa4>] bus_for_each_dev+0x64/0xa0
[    1.573800] [<ffff0000085ca740>] driver_attach+0x20/0x28
[    1.579119] [<ffff0000085ca290>] bus_add_driver+0x110/0x230
[    1.584698] [<ffff0000085cb880>] driver_register+0x60/0xf8
[    1.590190] [<ffff0000085cc9d8>] __platform_driver_register+0x40/0x48
[    1.596640] [<ffff000009027a24>] imx_snvs_pwrkey_driver_init+0x18/0x20
[    1.603174] [<ffff0000080830b8>] do_one_initcall+0x38/0x128
[    1.608754] [<ffff000008fe0cec>] kernel_init_freeable+0x1a4/0x248
[    1.614853] [<ffff000008b26230>] kernel_init+0x10/0x100
[    1.620084] [<ffff000008082e80>] ret_from_fork+0x10/0x50
[    1.625403] Code: 910003fd f9000bf3 f9405833 52800001 (f9402660)
[    1.631518] ---[ end trace 7bb9749c5dc6e8f9 ]---
[    1.636148] Kernel panic - not syncing: Fatal exception in interrupt

Review-by: Frank Li <frank.li@nxp.com>
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
7 years agoMGS-3800 drm,imx: drop drm_of_component_probe() in favor of imx specifics.
Marius Vlad [Tue, 22 Aug 2017 16:19:20 +0000 (19:19 +0300)]
MGS-3800 drm,imx: drop drm_of_component_probe() in favor of imx specifics.

In order to be able to specify a comparison based on driver name.
This is due to the fact that we don't have a dts/dtb entry for the
blit engine and we rely only on the driver name.

Not present in previous patches.

Signed-off-by: Adrian Negreanu <adrian.negreanu@nxp.com>
Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
7 years agoMLK-15321 drm,imx: Add DRM support for dpu-blit
Meng Mingming [Mon, 14 Aug 2017 05:46:21 +0000 (13:46 +0800)]
MLK-15321 drm,imx: Add DRM support for dpu-blit

This patch adds DRM support for the blit engine, allowing
DRM_RENDER_ALLOW ioctls() to be registered dynamically.

Signed-off-by: Adrian Negreanu <adrian.negreanu@nxp.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
---
Changes since v3:

Added support for registering DRM_RENDER ioctls dynamically, by replacing fops
ioctl to a routed one (provided by drm core), where we get the chance to verify
in the list of previously registered ioctls for a blit ioctls.

7 years agoMLK-15321 dpu: Register the blit engine(s).
Marius Vlad [Tue, 22 Aug 2017 15:38:20 +0000 (18:38 +0300)]
MLK-15321 dpu: Register the blit engine(s).

Signed-off-by: Marius-Adrian Negreanu <adrian.negreanu@nxp.com>
Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
---
Changes since v3:

Use a features array for bliteng driver name, as not to polute
dpu_add_client_devices() and simply the register process in the same time.

7 years agoMLK-15321 dpu-blit: Add dpu blit engine driver
Meng Mingming [Mon, 14 Aug 2017 05:38:49 +0000 (13:38 +0800)]
MLK-15321 dpu-blit: Add dpu blit engine driver

Initial support for the iMX8 DPU Blitter engine.

Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
7 years agoMGS-3224: arm64: dts: fsl-imx8qxp-mek: enable gpu
Xianzhong [Thu, 24 Aug 2017 05:44:50 +0000 (13:44 +0800)]
MGS-3224: arm64: dts: fsl-imx8qxp-mek: enable gpu

this patch enable gpu feature for i.mx8qxp mek board

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
7 years agoMLK-16227: arm64: dts: fsl-imx8qm-lpddr4-arm2: Introduce it6263 dual chan dts
Oliver Brown [Mon, 21 Aug 2017 01:09:18 +0000 (20:09 -0500)]
MLK-16227: arm64: dts: fsl-imx8qm-lpddr4-arm2: Introduce it6263 dual chan dts

This patch adds support for dual lvds channels for the it6263 LVDS to HDMI
bridge for fsl-imx8qm-lpddr4-arm2 board. LVDS Dual channel mode is supported on the
the MCIMX8-HDMIDC board. LVDS Dual channel mode is not supported on the mini SAS LVDS
to HDMI daughter card.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
7 years agoMLK-16243: mtd: gpmi: enable the EDO mode for i.MX8
Han Xu [Tue, 22 Aug 2017 14:45:50 +0000 (09:45 -0500)]
MLK-16243: mtd: gpmi: enable the EDO mode for i.MX8

Enable the EDO mode on i.MX8 platforms for better performance.

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-16242-7 video: fbdev: dcss: add non-blocking mode in pan display
Fancy Fang [Tue, 22 Aug 2017 08:56:24 +0000 (16:56 +0800)]
MLK-16242-7 video: fbdev: dcss: add non-blocking mode in pan display

Add non-blocking mode for pan display interface to
support very special cases to focus on the maximum
FPS display.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16242-6 video: fbdev: dcss: refine cfifo synchronization logic
Fancy Fang [Tue, 22 Aug 2017 08:51:00 +0000 (16:51 +0800)]
MLK-16242-6 video: fbdev: dcss: refine cfifo synchronization logic

Remove the synchronization workaround in 'commit_to_fifo()'
and add ctxld wq flush calls in pan display, since the pan
display usually requires blocking mode behavior. But other
functions can also work in non-blocking mode, so perform
synchronization handling in 'commit_to_fifo' is not good
for the interfaces which doesn't require blocking mode.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16242-5 video: fbdev: dcss: add 'FBIO_WAITFORVSYNC' support
Fancy Fang [Tue, 22 Aug 2017 08:43:50 +0000 (16:43 +0800)]
MLK-16242-5 video: fbdev: dcss: add 'FBIO_WAITFORVSYNC' support

Implement 'FBIO_WAITFORVSYNC' ioctl which is a non-standard
command to provide vsyc active wait function for user space
applications.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16242-4 video: fbdev: dcss: realize 'fb_ioctl' interface
Fancy Fang [Tue, 22 Aug 2017 03:32:55 +0000 (11:32 +0800)]
MLK-16242-4 video: fbdev: dcss: realize 'fb_ioctl' interface

Realize the 'fb_ioctl' hook interface with a blank
function. Non-standard ioctl commands implementations
can be added later.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16242-3 video: fbdev: dcss: add dtg irq handling
Fancy Fang [Mon, 21 Aug 2017 11:22:44 +0000 (19:22 +0800)]
MLK-16242-3 video: fbdev: dcss: add dtg irq handling

Add the 8th interrupt of DCSS handling for DTG
which is used to trigger the signal when the VSYNC
start point reaches. By default, this irq is masked
to avoid too many unnecessary interrupt handles.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16242-2 video: fbdev: dcss: correct some irq indexes
Fancy Fang [Mon, 21 Aug 2017 11:07:57 +0000 (19:07 +0800)]
MLK-16242-2 video: fbdev: dcss: correct some irq indexes

The hw irq index for DEC400D, DTRC2 and DTRC3 should
be '15', '16' and '17'. So correct the corresponding
macro definitions in DCSS driver.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16242-1 ARM64: dts: imx8mq: add the 8th irq for DCSS
Fancy Fang [Mon, 21 Aug 2017 10:02:04 +0000 (18:02 +0800)]
MLK-16242-1 ARM64: dts: imx8mq: add the 8th irq for DCSS

The 8th interrupt of DCSS comes from DTG module
and it is used as a general purpose timings
interrupt which can generate an interrupt at a
programmable X/Y corordinate. There are total
four such interrupts in DTG. And this one will
be used for a VSYNC Active interrupt.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16240 drm/bridge: it6263: Don't use freed edid structure in ->get_modes()
Liu Ying [Tue, 22 Aug 2017 07:54:57 +0000 (15:54 +0800)]
MLK-16240 drm/bridge: it6263: Don't use freed edid structure in ->get_modes()

We call the helper drm_detect_hdmi_monitor() to check if the EDID blob read
from a monitor indicates the monitor is connected via HDMI or not.  We pass
an edid structure to the helper.  However, the structure has been freed
before we use it.  This patch moves the helper up before the structure is
freed to fix the issue.

Fixes: a5c01aa91842 ("MLK-15001-25 drm/bridge: Add ITE IT6263 LVDS to HDMI transmitter support")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-12606 ARM64: defconfig: Enable USB host CDC ACM
Li Jun [Thu, 17 Aug 2017 13:34:08 +0000 (21:34 +0800)]
MLK-12606 ARM64: defconfig: Enable USB host CDC ACM

Build USB host cdc acm driver as module.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16013-41 ARM64: imx8mq: remove dis_u2_susphy_quirk for usb
Li Jun [Tue, 8 Aug 2017 13:34:19 +0000 (21:34 +0800)]
MLK-16013-41 ARM64: imx8mq: remove dis_u2_susphy_quirk for usb

As the USB3 hotplug issue identified by IC team, the recommended
solution is to use FREECLK by clear COMMMONONN, so remove this
quick temp workaround.

Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16013-40 phy: phy-fsl-imx8mq-usb: clear COMMONONN to keep FREECLK running
Li Jun [Tue, 8 Aug 2017 13:24:21 +0000 (21:24 +0800)]
MLK-16013-40 phy: phy-fsl-imx8mq-usb: clear COMMONONN to keep FREECLK running

COMMONONN: This signal controls whether the high-speed Bias and PLL
blocks remain powered—consuming additional current during Suspend and
Sleep modes. As imx8mq USB3 ITP&SOF have to use FREECLK, so clear
COMMONONN to be 0(valid) to make FREECLK always running, this is the
recommended setting from design team.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16013-39 ARM64: defconfig: enable typec and power delivery
Li Jun [Fri, 4 Aug 2017 16:19:56 +0000 (00:19 +0800)]
MLK-16013-39 ARM64: defconfig: enable typec and power delivery

Build-in typec, power delivery port manager and tcpci driver.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoASoC: codecs: fsl_mqs: Add PM support
Daniel Baluta [Mon, 21 Aug 2017 12:48:45 +0000 (15:48 +0300)]
ASoC: codecs: fsl_mqs: Add PM support

Save the values of registers at suspend and restore
it at resume.

We don't need to implement runtime PM support because
MQS is already enabled in startup() and disabled in
shutdown().

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-16239 clk: imx: imx8qm/qxp: Adding the missing sentinel value of match table
Jason Liu [Mon, 21 Aug 2017 21:00:02 +0000 (05:00 +0800)]
MLK-16239 clk: imx: imx8qm/qxp: Adding the missing sentinel value of match table

Need to put the sentinel value to the end of the of_device_id array.
This patch also fixes the following KASAN complains when KASAN is enabled:

[    0.671315] ==================================================================
[    0.678400] BUG: KASAN: global-out-of-bounds in __of_match_node+0x70/0xb8 at addr ffff2000092958a8
[    0.687321] Read of size 1 by task swapper/0/1
[    0.691760] Address belongs to variable imx8qm_match+0xc8/0x260
[    0.697666] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.11-03033-ge2e5fb2 #44
[    0.704955] Hardware name: Freescale i.MX8QM ARM2 (DT)
[    0.710081] Call trace:
[    0.712528] [<ffff20000808b438>] dump_backtrace+0x0/0x278
[    0.717907] [<ffff20000808b6c4>] show_stack+0x14/0x20
[    0.722949] [<ffff2000085311ec>] dump_stack+0xa4/0xc8
[    0.727990] [<ffff200008256cbc>] kasan_report_error+0x4c4/0x4d8
[    0.733892] [<ffff2000082570f8>] kasan_report+0x40/0x48
[    0.739103] [<ffff2000082552cc>] __asan_load1+0x4c/0x58
[    0.744318] [<ffff200008d7ac28>] __of_match_node+0x70/0xb8
[    0.749791] [<ffff200008d7aca8>] of_match_node+0x38/0x60
[    0.755088] [<ffff200008d7d870>] of_match_device+0x30/0x50
[    0.760565] [<ffff200008858dbc>] platform_match+0x6c/0x130
[    0.766040] [<ffff200008855dec>] __device_attach_driver+0x5c/0x138
[    0.772205] [<ffff200008852d18>] bus_for_each_drv+0xd0/0x130
[    0.777852] [<ffff2000088557fc>] __device_attach+0x13c/0x1a0
[    0.783499] [<ffff200008855f30>] device_initial_probe+0x10/0x18
[    0.789406] [<ffff200008854608>] bus_probe_device+0xe0/0xf0
[    0.794965] [<ffff200008851310>] device_add+0x5c8/0x818
[    0.800176] [<ffff200008d7dc3c>] of_device_add+0x5c/0x88
[    0.805477] [<ffff200008d7e854>] of_platform_device_create_pdata+0xb4/0x118
[    0.812426] [<ffff200008d7e8cc>] of_platform_device_create+0x14/0x20
[    0.818771] [<ffff200009913374>] arm_smmu_of_init+0x38/0x50
[    0.824332] [<ffff200009913298>] of_iommu_init+0xa4/0x100
[    0.829715] [<ffff200008083990>] do_one_initcall+0x90/0x1c8
[    0.835278] [<ffff2000098c1034>] kernel_init_freeable+0x290/0x330
[    0.841361] [<ffff20000905be28>] kernel_init+0x10/0x110
[    0.846567] [<ffff200008083680>] ret_from_fork+0x10/0x50
[    0.851860] Memory state around the buggy address:
[    0.856648]  ffff200009295780: fa fa fa fa 00 03 fa fa fa fa fa fa 00 00 00 00
[    0.863854]  ffff200009295800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    0.871065] >ffff200009295880: 00 00 00 00 00 fa fa fa fa fa fa fa 00 00 00 00
[    0.878270]                                   ^
[    0.882792]  ffff200009295900: 02 fa fa fa fa fa fa fa 00 00 07 fa fa fa fa fa
[    0.890003]  ffff200009295980: 00 00 00 00 01 fa fa fa fa fa fa fa 00 00 00 00
[    0.897208] ==================================================================

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
7 years agoMLK-16196-2: [i.MX8MQ/Hantro]: enhance power management for suspend/resume
Zhou Peng-B04994 [Mon, 21 Aug 2017 03:02:55 +0000 (11:02 +0800)]
MLK-16196-2: [i.MX8MQ/Hantro]: enhance power management for suspend/resume

in resume functions, vpu clock maybe not enabled at all,
so clk enable/disable are required by hw related operations in resume context

Signed-off-by: Zhou Peng-B04994 <eagle.zhou@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16222-2 video: fbdev: dcss: use new coeffs from tables
Fancy Fang [Fri, 18 Aug 2017 11:11:25 +0000 (19:11 +0800)]
MLK-16222-2 video: fbdev: dcss: use new coeffs from tables

The new coeff tables defined in 'imx_dcss_table.h' can
make common alpha blending operations to be correct.
So config the corresponding registers with these new
coeffs in the probe stage with only once and remove
the previous duplicate configurations. Besides, one
dtg config needs to be adjusted accordingly.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16222-1 video: fbdev: dcss: define some tables in a header file
Fancy Fang [Fri, 18 Aug 2017 10:55:23 +0000 (18:55 +0800)]
MLK-16222-1 video: fbdev: dcss: define some tables in a header file

Define some data tables to list all the coefficients config
which only requires to be configured once. The tables include:

    1. Scaler Coeffs
    2. HDR10 Input Pipe LUT and CSC Coeffs
    3. HDR10 Output Pipe Linear to Non_Linear Conversion
       and CSC Coeffs.

Each table entry includes the register offset addr and the
value needs to be written to this register.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16215 PCI: imx: refine pcie codes
Richard Zhu [Thu, 17 Aug 2017 05:27:06 +0000 (13:27 +0800)]
MLK-16215 PCI: imx: refine pcie codes

- correct the msi address
- only do shutdown reset for imx6q pcie, since only
imx6qdl pcie doesn't have the reset mechanism.
- don't limit the max link speed of imx pcie to gen2

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
7 years agoMLK-16226: arm64: dts: disable the NAND node in i.MX8QXP default device tree
Han Xu [Fri, 18 Aug 2017 16:32:33 +0000 (11:32 -0500)]
MLK-16226: arm64: dts: disable the NAND node in i.MX8QXP default device tree

NAND node was disabled in default device tree, the patch 4ad48e3cf
wrongly inserted usb node in the middle caused NAND enabled.

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-16203 enable runtime pm of i2c temporary when do system suspend
Gao Pan [Fri, 18 Aug 2017 10:35:11 +0000 (18:35 +0800)]
MLK-16203 enable runtime pm of i2c temporary when do system suspend

When we do system suspend, the runtime pm will be disabled, but we need
to control the PMIC to power on/off the regulator, if the runtime pm is
disabled, if will failed to request runtime wakeup. So data transfer will
failed.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
7 years agoMLK-13975-2: ASoC: fsl: qxp: Make AMIX working for 8 channels and 96kHz rate
Viorel Suman [Fri, 18 Aug 2017 09:13:38 +0000 (12:13 +0300)]
MLK-13975-2: ASoC: fsl: qxp: Make AMIX working for 8 channels and 96kHz rate

The patch mirrors commit 7c953daaf599 ("MLK-13975: ASoC: fsl: Make
AMIX working for 8 channels and 96kHz rate") for QXP.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
7 years agoMLK-13975-1: ASoC: fsl: qxp: Assign audio clocks within it's own power domain
Viorel Suman [Fri, 18 Aug 2017 09:09:14 +0000 (12:09 +0300)]
MLK-13975-1: ASoC: fsl: qxp: Assign audio clocks within it's own power domain

The patch mirrors commit f154ceffe411 ("MLK-13975: ASoC: fsl: Assign audio
clocks within it's own power domain") for QXP.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
7 years agoMLK-16220 lpi2c: imx8: improve i2c driver probe priority
Gao Pan [Thu, 10 Aug 2017 09:32:39 +0000 (17:32 +0800)]
MLK-16220 lpi2c: imx8: improve i2c driver probe priority

use subsys_initcall for i2c driver to improve i2c driver probe priority

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
7 years agoMLK-16217: PXP: fix pxp rotate yuv formate video issue
Guoniu.Zhou [Fri, 18 Aug 2017 02:09:08 +0000 (10:09 +0800)]
MLK-16217: PXP: fix pxp rotate yuv formate video issue

Because of IC limitation, pxp only can use rotation0 engine to
do rotation operation.

Correct coordinate settings of ps and out buffer.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-13975: ASoC: fsl: Make AMIX working for 8 channels and 96kHz rate
Viorel Suman [Fri, 18 Aug 2017 08:39:07 +0000 (11:39 +0300)]
MLK-13975: ASoC: fsl: Make AMIX working for 8 channels and 96kHz rate

Double the master and related clocks frequencies for AMIX SAIs in order to
make AMIX working for 8 channels and 96k Hz rate.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-16065-16 usb: cdns3: gadget: fix no one handled interrupt issue
Peter Chen [Wed, 2 Aug 2017 07:04:02 +0000 (15:04 +0800)]
MLK-16065-16 usb: cdns3: gadget: fix no one handled interrupt issue

If there are too many interrupts for non-control ep, the
no-one handled interrupt issue will occur due to without
return IRQ_HANDLED for them.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-15 usb: cdns3: gadget: refine the enable endpoint operation
Peter Chen [Wed, 2 Aug 2017 05:45:14 +0000 (13:45 +0800)]
MLK-16065-15 usb: cdns3: gadget: refine the enable endpoint operation

Move non-ep enable operation from set_configuration to ep_enable

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-14 ARM64: dts: fsl-imx8qm-lpddr4-arm2.dts: add USB Type-C port support
Peter Chen [Wed, 16 Aug 2017 06:59:44 +0000 (14:59 +0800)]
MLK-16065-14 ARM64: dts: fsl-imx8qm-lpddr4-arm2.dts: add USB Type-C port support

Due to pin conflict with other modules, we can only enable
host mode for Type-C port. If the user wants to use both
host and device mode for Type-C port, please use
fsl-imx8qm-lpddr4-arm2-usb3.dts instead.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-13 ARM64: defconfig: add USB testing driver and USB2 comliance client driver
Peter Chen [Tue, 25 Jul 2017 01:50:32 +0000 (09:50 +0800)]
MLK-16065-13 ARM64: defconfig: add USB testing driver and USB2 comliance client driver

Add USB testing driver and USB2 comliance client driver (used for
USB2 test in USB3 IP).

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-12 ARM64: defconfig: add EXTCON_PTN5150 support
Peter Chen [Tue, 11 Jul 2017 01:34:54 +0000 (09:34 +0800)]
MLK-16065-12 ARM64: defconfig: add EXTCON_PTN5150 support

It is a Type-C CC logic chip, the USB driver will get external events
for detach and attach for kinds of Type-C cables.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-11 ARM64: defconfig: enable cadence USB3
Peter Chen [Fri, 9 Jun 2017 06:09:20 +0000 (14:09 +0800)]
MLK-16065-11 ARM64: defconfig: enable cadence USB3

Enable both USB host and device function for Cadence USB3 IP.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-10 usb: host: xhci-dbg: do not print reseverd registers for imx cdns host
Peter Chen [Fri, 21 Jul 2017 03:15:45 +0000 (11:15 +0800)]
MLK-16065-10 usb: host: xhci-dbg: do not print reseverd registers for imx cdns host

When access reserved registers, the cdns host will trigger
an exception, and the synchronous external abort will occur
at ARM64 platforms.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-9 usb: cdns3: host: add quirk for avoid access reverved registers
Peter Chen [Wed, 19 Jul 2017 08:30:58 +0000 (16:30 +0800)]
MLK-16065-9 usb: cdns3: host: add quirk for avoid access reverved registers

Add quirk for CDNS USB3 host.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-8 usb: host: xhci: add XHCI_SKIP_ACCESS_RESERVED_REG quirk
Peter Chen [Wed, 19 Jul 2017 08:27:02 +0000 (16:27 +0800)]
MLK-16065-8 usb: host: xhci: add XHCI_SKIP_ACCESS_RESERVED_REG quirk

The IMX XHCI host which uses cadence USB3 IP is not compatible with
xHCI spec, the controller will trigger an exception if
visiting reserved registers, but the xHCI spec does not forbid it,
so add one quirk for skipping access reserved registers.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-7 usb: cdns3: add Cadence USB3 controller driver
Peter Chen [Tue, 25 Jul 2017 01:39:40 +0000 (09:39 +0800)]
MLK-16065-7 usb: cdns3: add Cadence USB3 controller driver

Add Cadence USB3 IP driver, this is the 1st version for this driver,
so wrapper layer and PHY layer are still IP core file (core.c).
Below functions are supported:

- Basic host function
- Limited gadget function, only ACM (old g_seiral) are supported, and
mass_storage support is not very well.
- Role switch between host and device through extcon design
(Eg, Type-C application NXP PTN5150).

Below functions are missing:
- Multi-queue support at gadget function, without this feature, many
gadget function are missing.
- Low power mode support, including system PM and runtime PM
- Wakeup support

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-6 doc: binding: cdns-usb3: add binding-doc for Cadence USB3
Peter Chen [Tue, 25 Jul 2017 01:38:25 +0000 (09:38 +0800)]
MLK-16065-6 doc: binding: cdns-usb3: add binding-doc for Cadence USB3

Add binding-doc for Cadence USB3

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-5 extcon: ptn5150: add PTN5150 Type-C CC logic chip
Peter Chen [Mon, 24 Jul 2017 09:30:23 +0000 (17:30 +0800)]
MLK-16065-5 extcon: ptn5150: add PTN5150 Type-C CC logic chip

Add NXP PTN5150 Type-C CC logic chip, this chip supplies CC flip
function automatically, and the driver will notify extcon
consumer (USB controller driver) attach and detach events.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-4 ARM64: dts: fsl-imx8qm: add fsl-imx8qm-lpddr4-arm2-usb3.dts
Peter Chen [Mon, 24 Jul 2017 09:16:54 +0000 (17:16 +0800)]
MLK-16065-4 ARM64: dts: fsl-imx8qm: add fsl-imx8qm-lpddr4-arm2-usb3.dts

This dts is dedicated for USB3 Type-C port, the Type-C CC logic
chip PTN5150 is conflict with other peripherals which use
i2c1 pins (I2C1_SDA/I2C1_SCL) from GTP blocks.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-3 ARM64: dts: fsl-imx8qxp-lpddr4-arm2.dts: enable USB3 Type-C port
Peter Chen [Mon, 24 Jul 2017 07:21:25 +0000 (15:21 +0800)]
MLK-16065-3 ARM64: dts: fsl-imx8qxp-lpddr4-arm2.dts: enable USB3 Type-C port

At imx8qxp arm2 board, the USB3 controller is at one Type-C port, and
the CC logic at this Type-C port is controlled by PTN5150. Enable
USB3 Type-C port at this commit.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-2 ARM64: dts: fsl-imx8qxp.dtsi: add Cadence USB3 support
Peter Chen [Mon, 24 Jul 2017 07:14:21 +0000 (15:14 +0800)]
MLK-16065-2 ARM64: dts: fsl-imx8qxp.dtsi: add Cadence USB3 support

Add Cadence USB3 controller and phy, the phy uses generic USB PHY
driver.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16065-1 ARM64: dts: fsl-imx8qm.dtsi: add Cadence USB3 support
Peter Chen [Mon, 24 Jul 2017 07:11:49 +0000 (15:11 +0800)]
MLK-16065-1 ARM64: dts: fsl-imx8qm.dtsi: add Cadence USB3 support

Add Cadence USB3 controller and phy, the phy uses generic USB PHY
driver.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16202-03 ARM64: dts: add separate node for each domain on imx8mq
Bai Ping [Fri, 11 Aug 2017 05:50:56 +0000 (13:50 +0800)]
MLK-16202-03 ARM64: dts: add separate node for each domain on imx8mq

Use separate node for each domain, so we can easily handle the clock
and supply specific to each domain.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16202-02 driver: soc: refact the gpc power domain driver for imx8mq
Bai Ping [Fri, 11 Aug 2017 05:50:08 +0000 (13:50 +0800)]
MLK-16202-02 driver: soc: refact the gpc power domain driver for imx8mq

Enhance the power domain driver for i.mx8mq. We may need to make sure
clock is enabled for some power domain. And also when a power domain
is down, the external supply for this power domain need to be turn off
to save power.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16202-01 driver: regulator: add enable/disable for switch for pfuze100
Robin Gong [Thu, 10 Aug 2017 09:03:45 +0000 (17:03 +0800)]
MLK-16202-01 driver: regulator: add enable/disable for switch for pfuze100

Add enable/disable support for switch regulator on pfuze100.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16209 ARM: dts: imx: add 'regulator-always-on' property for pmic sw4
Bai Ping [Thu, 17 Aug 2017 07:54:06 +0000 (15:54 +0800)]
MLK-16209 ARM: dts: imx: add 'regulator-always-on' property for pmic sw4

Add 'regulator-always-on' for PMIC SW4 switch regulator.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16204-5: arm64: defconfig: build nvmem and ocotp
Peng Fan [Thu, 17 Aug 2017 08:09:25 +0000 (16:09 +0800)]
MLK-16204-5: arm64: defconfig: build nvmem and ocotp

Build NVMEM and OCOTP driver

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16204-4: nvmem: imx-ocotp: add i.mx8mq support and fix read
Peng Fan [Fri, 18 Aug 2017 03:19:08 +0000 (11:19 +0800)]
MLK-16204-4: nvmem: imx-ocotp: add i.mx8mq support and fix read

Add i.MX8MQ support and Fix read.

When offset is not 4 bytes aligned, directly shift righty by 2 bits
will cause reading out wrong data. Since imx ocotp only supports
4 bytes reading once, we need handle offset is not 4 bytes aligned
and enlarge the bytes to 4 bytes aligned. After finished reading,
copy the needed data from buffer to caller and free buffer.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16204-3: clk: imx8mq: add ocotp clock
Peng Fan [Thu, 17 Aug 2017 07:59:00 +0000 (15:59 +0800)]
MLK-16204-3: clk: imx8mq: add ocotp clock

Add OCOTP clock support.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16204-2 arm64: dts: add ocotp node
Peng Fan [Thu, 17 Aug 2017 00:47:49 +0000 (08:47 +0800)]
MLK-16204-2 arm64: dts: add ocotp node

Add ocotp node.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16204-1 nvmem: add imx-scu-ocotp driver
Peng Fan [Thu, 17 Aug 2017 09:06:21 +0000 (17:06 +0800)]
MLK-16204-1 nvmem: add imx-scu-ocotp driver

Add imx-scu-ocotp driver to support i.MX8QM/QXP.

The usage, add an entry in ocotp node, such as the test_1 entry:
ocotp: ocotp {
               #address-cells = <1>;
               #size-cells = <1>;
               compatible = "fsl,imx8qm-ocotp", "syscon";

               test_1: test_1@40 {
                       reg = <0x41 0x8>;
                       bits = <4 40>;
               };
       };

Then in your device node, add this:
       node: node {
        .....
                nvmem-cells = <&test_1>;
                nvmem-cell-names = "test_1";
       };

Then in your driver, using the following piece code:

       +#include <linux/nvmem-consumer.h>

       struct nvmem_cell *cell;
       u8 *val;
       size_t len;
       int i;
       cell = devm_nvmem_cell_get(&pdev->dev, "test_1");
       if (IS_ERR(cell)) {
               if (PTR_ERR(cell) == -EPROBE_DEFER)
                       return -EPROBE_DEFER;
       }
       val = nvmem_cell_read(cell, &len);

The val points the contents that you need.

After shutdown or driver remove, use this:
       devm_nvmem_cell_put(&pdev->dev, cell);

Note: we not reuse the imx-ocotp driver, because mix scu api with
legacy code will cost many maintenance efforts. When we have common
api support, we could merge the two.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16123 video: fbdev: dcss: change a print level to be debug
Fancy Fang [Fri, 18 Aug 2017 01:49:36 +0000 (09:49 +0800)]
MLK-16123 video: fbdev: dcss: change a print level to be debug

Change a 'dev_info' call to 'dev_dbg' call to avoid
possible too many kernel messages printed out.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16205 video: fbdev: dcss: handle cfifo wrapping case
Fancy Fang [Thu, 17 Aug 2017 08:08:04 +0000 (16:08 +0800)]
MLK-16205 video: fbdev: dcss: handle cfifo wrapping case

As time goes on, the cfifo buffer is close to be
exausted. And since the cfifo is a ring buffer,
so at this moment, the cfifo needs to be wrapped
to the buffer beginning. In this driver, the fifo
wrapping condition is that the free size to buffer
end is less than the commit size. And before the
buffer wrapping, the 'ctxld_wq' workqueue needs to
be flushed to make sure all the previous commited
jobs to be finished. Besides, this commit uses the
spinlock in the 'cqueue' workqueue to replace the
'wlock'.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16207-4 arm64: dts: fsl-imx8qxp-mek: Add LVDS2HDMI it6263 bridge(s) support
Liu Ying [Thu, 17 Aug 2017 06:09:08 +0000 (14:09 +0800)]
MLK-16207-4 arm64: dts: fsl-imx8qxp-mek: Add LVDS2HDMI it6263 bridge(s) support

This patch adds LVDS to HDMI it6263 bridge(s) support on the i.MX8qxp MEK
platform.  Since the platform supports up to two it6263 bridge(s) via
daughter cards plugged into mini-SAS connectors, this patch introduces
several DT sources so that users may choose relevant DT blob to use
single or dual it6263 display.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-16207-3 arm64: dts: fsl-imx8qxp-mek: Enable dpu1
Liu Ying [Thu, 17 Aug 2017 06:13:45 +0000 (14:13 +0800)]
MLK-16207-3 arm64: dts: fsl-imx8qxp-mek: Enable dpu1

This patch enables dpu1 DT node.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-16207-2 drm/bridge: it6263: 2nd time to workaround cable detection failure
Liu Ying [Thu, 17 Aug 2017 05:55:53 +0000 (13:55 +0800)]
MLK-16207-2 drm/bridge: it6263: 2nd time to workaround cable detection failure

There is cable detection failure issue on i.MX8qxp MEK platform at boot
time when we use single LVDS to HDMI display.  The workaround is to read
the cable detection status for even more times.  Based on experiments, it
looks reading for 90 times works.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-16207-1 drm/bridge: it6263: Add gpio reset support
Liu Ying [Tue, 15 Aug 2017 07:59:44 +0000 (15:59 +0800)]
MLK-16207-1 drm/bridge: it6263: Add gpio reset support

A low pulse whose width is at least 40ms on pin SYSRSTN
may reset the bridge, according to the chip maker.
This patch adds gpio reset support for the bridge.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMGS-3093 [#imx-701] Fix power-off random failure when GPU become idle
Yuchou Gan [Thu, 17 Aug 2017 16:35:50 +0000 (00:35 +0800)]
MGS-3093 [#imx-701] Fix power-off random failure when GPU become idle

Workaround to fix this issue, gpu failed to power off because chip is not idle when tried to cut the power, tried and wait until gpu is idle and then tried to power off will help.

Date: Aug 15, 2017
Signed-off-by: Yuchou Gan <yuchou.gan@nxp.com>
7 years agoMLK-16197-13 video: fbdev: dcss: workaround to make fifo commit to be synchronous
Fancy Fang [Wed, 16 Aug 2017 11:36:28 +0000 (19:36 +0800)]
MLK-16197-13 video: fbdev: dcss: workaround to make fifo commit to be synchronous

Add a workaround to make the fifo commit operation to be
synchronous, since for now, there is no interface which
can be called by user space to do synchronization.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16197-12 video: fbdev: dcss: refine 'dtg_channel_timing_config'
Fancy Fang [Wed, 16 Aug 2017 10:58:08 +0000 (18:58 +0800)]
MLK-16197-12 video: fbdev: dcss: refine 'dtg_channel_timing_config'

Add 'blank' parameter to 'dtg_channel_timing_config' interface
to set or clear the channel display window according to the
blank state.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16197-11 video: fbdev: dcss: remove (un)blank calls in 'dcss_set_par'
Fancy Fang [Wed, 16 Aug 2017 10:28:15 +0000 (18:28 +0800)]
MLK-16197-11 video: fbdev: dcss: remove (un)blank calls in 'dcss_set_par'

Remove the possible 'dcss_blank' calls in 'dcss_set_par',
since the context loader can change the DCSS sub-modules
configuration on the fly.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16197-10 video: fbdev: dcss: improve 'dcss_blank' logic
Fancy Fang [Wed, 16 Aug 2017 10:10:01 +0000 (18:10 +0800)]
MLK-16197-10 video: fbdev: dcss: improve 'dcss_blank' logic

Do the following improvements about 'dcss_blank':

    1. move DPR trigger on config from 'dcss_blank' to
       'dcss_dpr_config'.
    2. move SCALER trigger on config from 'dcss_blank'
       to 'dcss_scaler_config'.
    3. remove duplicate code in 'dcss_blank'.
    4. save the blank state for each channel in 'dcss_blank'.

All the above improvements focus on making fb blank/unblank
logic more simple and more clear.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16197-9 video: fbdev: dcss: improve dtg config logic
Fancy Fang [Wed, 16 Aug 2017 09:36:21 +0000 (17:36 +0800)]
MLK-16197-9 video: fbdev: dcss: improve dtg config logic

Do the following improvements about DTG config:

    1. move db and sb loading position config from
       'dcss_dtg_config' to 'dcss_dtg_start'.
    2. Only one DTG trigger config is required which
       is put in 'dcss_dtg_start'.
    3. move 'dcss_dtg_config' call from 'dcss_blank'
       to 'dcss_set_par'.
    4. add default background color configs for both
       graph and video layers in 'dcss_dtg_start'.
    5. remove channel enable and disable function in
       'dcss_channel_blank'.

All the above improvements focus on making dtg config
logic more simple and more clear.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16197-8 video: fbdev: dcss: move subsam config to probe
Fancy Fang [Wed, 16 Aug 2017 08:38:20 +0000 (16:38 +0800)]
MLK-16197-8 video: fbdev: dcss: move subsam config to probe

Move the SUBSAM config to probe stage to generate
display timings as soon as the graphic layer unblank.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16197-7 video: fbdev: dcss: use display mode for subsam config
Fancy Fang [Wed, 16 Aug 2017 08:26:35 +0000 (16:26 +0800)]
MLK-16197-7 video: fbdev: dcss: use display mode for subsam config

The SUBSAM module is used to generate the output timings
to display monitor. So use display mode to config SUBSAM
is more suitable and can reduce coupling degree between
SUBSAM config and graphic layer initialization.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16197-6 video: fbdev: dcss: move 'dcss_dtg_start' call to probe
Fancy Fang [Wed, 16 Aug 2017 07:59:03 +0000 (15:59 +0800)]
MLK-16197-6 video: fbdev: dcss: move 'dcss_dtg_start' call to probe

Move the 'dcss_dtg_start' calling to probe stage which
can service the fifo commits generated in probe stage
in time.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16197-5 video: fbdev: dcss: use display mode for 1st frame dtg config
Fancy Fang [Wed, 16 Aug 2017 07:44:55 +0000 (15:44 +0800)]
MLK-16197-5 video: fbdev: dcss: use display mode for 1st frame dtg config

For the first frame timings generated by DTG, the display mode
is better to be used to configure this timings which can reduce
the coupling degree between first frame dtg config and the graphic
layer initialization process.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16197-4 video: fbdev: dcss: improve hp/lp data count settings
Fancy Fang [Fri, 11 Aug 2017 10:54:59 +0000 (18:54 +0800)]
MLK-16197-4 video: fbdev: dcss: improve hp/lp data count settings

For now, all the DCSS register configuration should be put
in the high priority single buffer by default in context
loader. So improve the high and low priority data counts
calculation and setting.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16197-3 video: fbdev: dcss: add fifo commit in dcss_set_par().
Fancy Fang [Wed, 9 Aug 2017 11:11:01 +0000 (19:11 +0800)]
MLK-16197-3 video: fbdev: dcss: add fifo commit in dcss_set_par().

In dcss_set_par(), it will config the parameters related
with DEC400D/DTRC, DPR, SCALER, HDR10 and etc. So commit
all the registers configuration at the end of this function
to avoid mixing with later configurations which may cause
duplicating settings in one commit.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16197-2 video: fbdev: dcss: init dcss irqs earlier
Fancy Fang [Fri, 11 Aug 2017 10:44:03 +0000 (18:44 +0800)]
MLK-16197-2 video: fbdev: dcss: init dcss irqs earlier

Initialize the DCSS interrupt system earlier to make
it enabled before any cfifo commit.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16197-1 video: fbdev: dcss: use non-cacheable mapping for cfifo buffer.
Fancy Fang [Wed, 9 Aug 2017 10:51:53 +0000 (18:51 +0800)]
MLK-16197-1 video: fbdev: dcss: use non-cacheable mapping for cfifo buffer.

The kernel direct mapping for cfifo buffer is cacheable which
requires cache flush and is easier to bring in strange issue.
So use coherent dma mapping for cfifo buffer access. But the
kfifo dma sgl interface using the direct mapping to get the
phyiscal page via dma mapping virtual addr. So record fifo 'in'
for each commit which is used for context loader sb and db addr
configurations.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-14720 epdc: correct WFE setting when bypass legacy process
Robby Cai [Thu, 20 Apr 2017 09:17:42 +0000 (17:17 +0800)]
MLK-14720 epdc: correct WFE setting when bypass legacy process

set WFE (WFE_A on imx7d, and WFE_B on imx6ull/imx6sll) input address to
framebuffer start address, and set left/top coordinate since the framebuffer is
the original source of WFE (i.e., not from PXP output) when bypass legacy mode.
The patch also limits the condition to bypass legacy mode when not use
EPDC_FLAG_USE_ALT_BUFFER.

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

7 years agoMLK-16176-2 PCI: imx: get the bus clock regulator correctly
Richard Zhu [Tue, 15 Aug 2017 09:18:17 +0000 (17:18 +0800)]
MLK-16176-2 PCI: imx: get the bus clock regulator correctly

In order to make sure that get the regulator correctly.
Check the return value of devm_regulator_get().
Return value directly if it is '-EPROBE_DEFER'

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
7 years agoMLK-16176-1 ARM: dts: imx6qp: remove the duplicated node
Richard Zhu [Tue, 15 Aug 2017 09:15:50 +0000 (17:15 +0800)]
MLK-16176-1 ARM: dts: imx6qp: remove the duplicated node

The pcie dts node is dulicated, remove none-used one.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
7 years agoMLK-16200 arm64: dts: imx8qxp-mek: enable UART port for Bluetooth 1FD and 1CQ
Fugang Duan [Mon, 14 Aug 2017 12:58:13 +0000 (20:58 +0800)]
MLK-16200 arm64: dts: imx8qxp-mek: enable UART port for Bluetooth 1FD and 1CQ

Enable lpuart port1 for Bluetooth HCI interface, tested pass on
Murata module 1FD and 1CQ on imx8qxp MEK board.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Pandy Gao <pandy.gao@nxp.com>
7 years agoMLK-16199 tty: serial: lpuart: don't clear idle flag in eeop mode
Fugang Duan [Mon, 14 Aug 2017 09:46:11 +0000 (17:46 +0800)]
MLK-16199 tty: serial: lpuart: don't clear idle flag in eeop mode

In DMA EEOP mode idle flag can trigger DMA major loop stop. The idle
flag should be cleared by HW. So others cannot clear idle flag in the
mode enabled.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Pandy Gao <pandy.gao@nxp.com>