linux.git
7 years agoMLK-17158-1 drivers: clk: imx: Add RAWNAND root clock
Ye Li [Tue, 12 Dec 2017 09:02:21 +0000 (03:02 -0600)]
MLK-17158-1 drivers: clk: imx: Add RAWNAND root clock

i.MX8MQ CCGR has a clock enable signal for RAWNAND. Add this RAWNAND root
clock to clock tree.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17154 watchdog: imx8_wdt: align timeout value with imx2_wdt
Robin Gong [Tue, 12 Dec 2017 06:33:14 +0000 (14:33 +0800)]
MLK-17154 watchdog: imx8_wdt: align timeout value with imx2_wdt

Align timeout value with imx2_wdt.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
7 years agoMLK-17136 ath10k: clear fetch board fail log
Gao Pan [Tue, 12 Dec 2017 08:16:37 +0000 (16:16 +0800)]
MLK-17136 ath10k: clear fetch board fail log

Below fail log is caused by firmware version issue.
"ath10k_pci 0000:01:00.0: failed to fetch board data"

To clear the log, ath10k_dbg is used to replace ath10k_err.

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
7 years agoMLK-17119: Add ARM2 DDR4 DTB
Teo Hall [Tue, 5 Dec 2017 17:22:03 +0000 (11:22 -0600)]
MLK-17119: Add ARM2 DDR4 DTB

Add DTB to support DDR4 version of the ARM2
board

Signed-off-by: Teo Hall <teo.hall@nxp.com>
7 years agoMLK-17152: ASoC: fsl_hifi: support suspend and resume
Shengjiu Wang [Fri, 8 Dec 2017 07:50:35 +0000 (15:50 +0800)]
MLK-17152: ASoC: fsl_hifi: support suspend and resume

For hifi need to enter runtime suspend state in suspend,
then the power of HIFI can be down. In this case content
in internal RAM will be lost, and need to be recovered
in resume.

Move the loading firmware to runtime resume function, and
define ICM_SUSPEND and ICM_RESUME command, with ICM_SUSPEND
the hifi framework will store the data in RAM and with
ICM_RESUME the hifi framework will restore the data to RAM.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-16715-10 ARM64: dts: fsl-imx8qxp: change properties for USB2
Peter Chen [Tue, 12 Dec 2017 01:34:39 +0000 (09:34 +0800)]
MLK-16715-10 ARM64: dts: fsl-imx8qxp: change properties for USB2

The changes include: compatible, performance tuning parameters,
and delete the property which is dedicated to imx7d.

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16715-9 ARM64: dts: fsl-imx8qm-lpddr4-arm2-hsic: add HSIC board dts
Peter Chen [Mon, 11 Dec 2017 07:13:29 +0000 (15:13 +0800)]
MLK-16715-9 ARM64: dts: fsl-imx8qm-lpddr4-arm2-hsic: add HSIC board dts

Some special for HSIC usages:
- It needs imx8 debug board to test HSIC function.
- The USBOTG1 needs to be active when HSIC is in use.

BuildInfo:
- SCFW e0362348, IMX-MKIMAGE 9841373a, ATF e173337
- U-Boot 2017.03-imx_v2017.03+g3535868

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16715-8 ARM64: dts: fsl-imx8qm: add USB HSIC support
Peter Chen [Mon, 11 Dec 2017 07:12:04 +0000 (15:12 +0800)]
MLK-16715-8 ARM64: dts: fsl-imx8qm: add USB HSIC support

Add USB HSIC controller support.

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16715-7 usb: chipidea: imx: add "ci-disable-lpm" quirk
Peter Chen [Mon, 11 Dec 2017 03:29:07 +0000 (11:29 +0800)]
MLK-16715-7 usb: chipidea: imx: add "ci-disable-lpm" quirk

Some chipidea hardware needs to disable low power mode for controller
due to IC issue or hardware issue, add one quirk for it.

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16715-6 usb: chipidea: imx: add HSIC support for controllers from imx7d
Peter Chen [Thu, 16 Nov 2017 09:11:51 +0000 (17:11 +0800)]
MLK-16715-6 usb: chipidea: imx: add HSIC support for controllers from imx7d

From imx7d, there is a dedicate non-core register region for
each controller, and HSIC configurations are almost at non-core
register, this commit adds HSIC support for controllers from imx7d,
and the non-core confugrations are different with imx6's.

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16715-5 usb: chipidea: imx: using phy_mode to judge HSIC controller
Peter Chen [Fri, 27 Oct 2017 11:05:00 +0000 (19:05 +0800)]
MLK-16715-5 usb: chipidea: imx: using phy_mode to judge HSIC controller

HSIC controller must use HSIC phy mode, it is more suitable way
to judge HSIC controller.

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16715-4 usb: chipidea: imx: add imx8qm compatible
Peter Chen [Fri, 17 Nov 2017 02:48:34 +0000 (10:48 +0800)]
MLK-16715-4 usb: chipidea: imx: add imx8qm compatible

It is suitable for imx8qm and imx8qxp currently

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16715-3 ARM64: dts: fsl-imx8qm: change USB2 controller properties
Peter Chen [Fri, 17 Nov 2017 02:52:00 +0000 (10:52 +0800)]
MLK-16715-3 ARM64: dts: fsl-imx8qm: change USB2 controller properties

The imx8qm's non-core register controller is more like imx7ulp than
imx7d, since imx7d uses Samsung PHY, but imx7ulp and imx8qm use
freescale PHY, so imx8qm uses the same compatible for imx7ulp.

But imx8qm and imx7ulp's platform are so many differences, so the
compatible for driver are different.

Besides, we add performance tuning parameters and delete properties which
is dedicated for imx7d.

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16715-2 binding-doc: usb: ci-hdrc-usb2: add imx7ulp and imx8qm compatible
Peter Chen [Fri, 17 Nov 2017 02:50:51 +0000 (10:50 +0800)]
MLK-16715-2 binding-doc: usb: ci-hdrc-usb2: add imx7ulp and imx8qm compatible

Add imx7ulp and imx8qm compatible.

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16715-1 usb: chipidea: imx: replace &pdev->dev with local variable
Peter Chen [Fri, 27 Oct 2017 10:21:12 +0000 (18:21 +0800)]
MLK-16715-1 usb: chipidea: imx: replace &pdev->dev with local variable

There are tens of &pdev->dev, replace them with a local
variable

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-17149-2: arm64: dts: fsl-imx8mq.dtsi: Remove dummy clocks from lcdif
Robert Chiras [Mon, 11 Dec 2017 10:13:24 +0000 (12:13 +0200)]
MLK-17149-2: arm64: dts: fsl-imx8mq.dtsi: Remove dummy clocks from lcdif

Apparently, the CLK_DUMMY implementation is not so reliable, since this
can occur when doing a clk_disable_unprepare on a CLK_DUMMY clock:

[   51.197744] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W
4.9.51-03878-g6c48bec #415
[   51.206354] Hardware name: Freescale i.MX8MQ EVK (DT)
[   51.211405] Call trace:
[   51.213868] [<ffff0000080884c8>] dump_backtrace+0x0/0x1a0
[   51.219273] [<ffff00000808867c>] show_stack+0x14/0x20
[   51.224327] [<ffff0000083dd91c>] dump_stack+0x94/0xb8
[   51.229383] [<ffff0000080df898>] __schedule_bug+0x50/0x70
[   51.234786] [<ffff000008c24578>] __schedule+0x4c0/0x580
[   51.240013] [<ffff000008c24674>] schedule+0x3c/0xa8
[   51.244893] [<ffff000008c24a70>] schedule_preempt_disabled+0x20/0x38
[   51.251252] [<ffff0000080f966c>] mutex_optimistic_spin+0x194/0x1d8
[   51.257434] [<ffff000008c25f28>] __mutex_lock_slowpath+0x38/0x140
[   51.263529] [<ffff000008c26074>] mutex_lock+0x44/0x60
[   51.268589] [<ffff0000084d9914>] clk_prepare_lock+0x44/0xd8
[   51.274163] [<ffff0000084db378>] clk_unprepare+0x20/0x40
[   51.279478] [<ffff00000860827c>] mxsfb_disable_axi_clk+0x24/0x30
[   51.285485] [<ffff0000086082d8>] mxsfb_irq_handler+0x50/0x60
[   51.291144] [<ffff000008102c84>] __handle_irq_event_percpu+0x9c/0x128
[   51.297584] [<ffff000008102d2c>] handle_irq_event_percpu+0x1c/0x58
[   51.303762] [<ffff000008102db0>] handle_irq_event+0x48/0x78
[   51.309334] [<ffff0000081066f0>] handle_fasteoi_irq+0xb8/0x1b0
[   51.315165] [<ffff000008101d7c>] generic_handle_irq+0x24/0x38
[   51.320910] [<ffff0000081023ec>] __handle_domain_irq+0x5c/0xb8
[   51.326742] [<ffff00000808163c>] gic_handle_irq+0xbc/0x168
[   51.332226] Exception stack(0xffff000009253d90 to 0xffff000009253ec0)

Since AXI and DISP_AXI are optional clocks according to the driver,
there is no need for dummy clocks in DTS, so remove them.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17149-1: drm/mxsfb: Fix pipe enable
Robert Chiras [Mon, 11 Dec 2017 10:09:36 +0000 (12:09 +0200)]
MLK-17149-1: drm/mxsfb: Fix pipe enable

During enable function, the mxsfb driver is trying to associate with a
connector, when a drm_bridge is used. When accessing the connectors
list, mode_config->mutex might be locked, generating the below WARN.
Since we are not changing the mode_config, we can access the
connector_list directly.

[   16.876991] [<ffff0000086289d4>] mxsfb_pipe_enable+0xec/0xf8
[   16.882650] [<ffff0000085e4de0>] drm_simple_kms_crtc_enable+0x20/0x30
[   16.889090] [<ffff0000085e144c>]
drm_atomic_helper_commit_modeset_enables+0x17c/0x1a0
[   16.896918] [<ffff0000085e42dc>]
drm_atomic_helper_commit_tail+0x3c/0x68
[   16.903617] [<ffff0000085e436c>] commit_tail+0x64/0x80
[   16.908753] [<ffff0000085e4398>] commit_work+0x10/0x18
[   16.913893] [<ffff0000080d4928>] process_one_work+0x1c8/0x380
[   16.919638] [<ffff0000080d4b28>] worker_thread+0x48/0x498
[   16.925035] [<ffff0000080da8f8>] kthread+0xe0/0xf8
[   16.929828] [<ffff000008082e80>] ret_from_fork+0x10/0x50

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17111-3: crypto: caam: Correct Copyright
Aymen Sghaier [Fri, 8 Dec 2017 13:54:11 +0000 (14:54 +0100)]
MLK-17111-3: crypto: caam: Correct Copyright

 Correct Copyright for new files:
  - drivers/crypto/caam/inst_rng.c
  - drivers/crypto/caam/inst_rng.h

Reviewed-by: Silvano Di Ninno <silvano.dininno@nxp.com>
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
7 years agoMLK-17111-2: crypto: caam: Enable caam job ring 2 for i.MX8 mScale
Aymen Sghaier [Fri, 8 Dec 2017 13:49:31 +0000 (14:49 +0100)]
MLK-17111-2: crypto: caam: Enable caam job ring 2 for i.MX8 mScale

  As required by Test/Validation Team the third job ring is enabled
 here. This was not possible before modifying JR Master ID in ATF.
  ATF (arm-trusted-firmware) should be updated before using this JR.

Reviewed-by: Silvano Di Ninno <silvano.dininno@nxp.com>
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
7 years agoMLK-17111-1: crypto: caam: Fix RNG instantiation retry
Aymen Sghaier [Fri, 8 Dec 2017 13:36:46 +0000 (14:36 +0100)]
MLK-17111-1: crypto: caam: Fix RNG instantiation retry

  Seen on i.MX8MQ EVK board revision B0 that the RNG instantiation
 fail with default entropy delay. Retry process is fixed here to
 be able to instantiate RNG successfully.

Reviewed-by: Silvano Di Ninno <silvano.dininno@nxp.com>
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
7 years agoMLK-17144 driver: soc: use mutex for power domain of imx8mq
Bai Ping [Mon, 11 Dec 2017 04:51:23 +0000 (12:51 +0800)]
MLK-17144 driver: soc: use mutex for power domain of imx8mq

In current gpc-psci.c file, the irqchip driver and gpc power
domain driver use the same spinlock to prevent concurrent
access to the GPC module. But actually, the irq and power domain
are two seperated function and controlled by different registers.

when using the same spinlock for these two funcition, in some corner
case the system will be deadlock if the spinlock is already acquired
by the power domain, but the power domain on/off is interrupted by
timer IRQ. So adding a mutex for power domain driver.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMGS-2914 [#imx-587] [8QM/qxp] Disable depth compression only for 8QM
Yuchou Gan [Mon, 11 Dec 2017 16:24:13 +0000 (00:24 +0800)]
MGS-2914 [#imx-587] [8QM/qxp] Disable depth compression only for 8QM

Disable the depth compression on device tree for 8qm/8qxp/mscale
when the ddr4 is enabled.

Date: Dec 11, 2017
Signed-off-by Yuchou Gan yuchou.gan@nxp.com

7 years agoMLK-17147 arm64: dts: imx8mq: Add DDR3l and DDR4 ARM2 boards support
Ye Li [Mon, 4 Dec 2017 06:05:28 +0000 (00:05 -0600)]
MLK-17147 arm64: dts: imx8mq: Add DDR3l and DDR4 ARM2 boards support

Add two DTS files for supporting DDR3l and DDR4 ARM2 boards. Basic
nodes like UART, SD/eMMC, i2c, Ethernet are added.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-17142 arm64: dts: 8qxp: introduce dom0 dts
Peng Fan [Sat, 9 Dec 2017 10:44:37 +0000 (18:44 +0800)]
MLK-17142 arm64: dts: 8qxp: introduce dom0 dts

Introudce dom0 dts.
disable rtc, we do not have sip handler in xen, also need to modify the
driver to use hvc call.
remove gpu ss reg property to avoid overriding dom0 mapping.
Modify lpuart0 interrupt-parent to use gic, because xen could only
handle gic.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16549-2: ISI: fix suspend/resume error issue
Guoniu.Zhou [Fri, 8 Dec 2017 11:32:34 +0000 (19:32 +0800)]
MLK-16549-2: ISI: fix suspend/resume error issue

Because ISI runtime suspend has disable clock before system
suspend. If driver does not know that and disable clock again
in system suspend callback. It will lead to isi clk count mis-
match.

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
7 years agoMLK-16549-1: mipi_csi: fix camera sensor i2c R/W issue
Guoniu.Zhou [Fri, 8 Dec 2017 08:04:55 +0000 (16:04 +0800)]
MLK-16549-1: mipi_csi: fix camera sensor i2c R/W issue

Because there is a level shifter between mipi csi controller
and max9286 camera sensor bridge. We need configure RESET_B
and ENABLE pins as GPIO, otherwise the bridge will not work
normally.

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
7 years agoMLK-17122: arm64: dts: fix the flexspi power domain
Han Xu [Thu, 7 Dec 2017 22:18:57 +0000 (16:18 -0600)]
MLK-17122: arm64: dts: fix the flexspi power domain

fix the flexspi power domain in device tree

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-17121: mtd: fsl-flexspi: re-init the flexspi after suspend/resume
Han Xu [Thu, 7 Dec 2017 21:59:47 +0000 (15:59 -0600)]
MLK-17121: mtd: fsl-flexspi: re-init the flexspi after suspend/resume

re-init the flexspi controller after suspend/resume.

runtime resume will re-init the controller, Once the it was initialized
and need to be re-init(determined by read specific register bit).

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-17138: arm64: dts: sl-imx8qm.dtsi: Quad display support for 8QM
Robert Chiras [Fri, 8 Dec 2017 11:16:18 +0000 (13:16 +0200)]
MLK-17138: arm64: dts: sl-imx8qm.dtsi: Quad display support for 8QM

Add DTS files fo quad display on 8QM boards. Currently, there is only
one file for this: fsl-imx8qm-lpddr4-arm2-it6263-adv7535.dts, which is
the combination for 2 LVDS + 2 MIPI-HDMI on LPDDR4 board.
This patch adds the other possible use-cases:
- 2 LVDS + 2 MIPI-Panel on LPDDR4
- 2 LVDS + 2 MIPI-HDMI on MEK
- 2 LVDS + 2 MIPI-Panel on MEK

Also:
- fix the fsl-imx8qm-lpddr4-arm2-it6263-adv7535.dts, since it
contained the old mipi_dsi nodes.
- fix the order of mipi_dsi nodes in fsl-imx8qm.dtsi, since this order
  affects the suspend/resume routines.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17137-2: drm/bridge: Fix bridge_detach for nwl-dsi
Robert Chiras [Fri, 8 Dec 2017 13:15:35 +0000 (15:15 +0200)]
MLK-17137-2: drm/bridge: Fix bridge_detach for nwl-dsi

When the bridge is detached from it's parent, we also need to unregister
the dsi_host. Also, in enable, check if we have a panel or a bridge
connected, otherwise enable is not needed.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17137-1: drm/imx: Fix unbind for nwl_dsi-imx
Robert Chiras [Fri, 8 Dec 2017 13:13:10 +0000 (15:13 +0200)]
MLK-17137-1: drm/imx: Fix unbind for nwl_dsi-imx

In unbind function, first we need to detach the bridge, then do the
encoder cleanup, so that the bridge will do a proper detach.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17047-2: drm/imx: Fix suspend/resume for nwl_dsi-imx
Robert Chiras [Fri, 8 Dec 2017 14:21:33 +0000 (16:21 +0200)]
MLK-17047-2: drm/imx: Fix suspend/resume for nwl_dsi-imx

This patch addresses two issues:
1. Always request/release bus_freq, not just on suspend/resume routines
2. Check if the driver is running when doing a suspend, so that we won't
enable it by mistake on resume.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17047-1: drm/mxsfb: Fix suspend/resume
Robert Chiras [Fri, 8 Dec 2017 14:19:15 +0000 (16:19 +0200)]
MLK-17047-1: drm/mxsfb: Fix suspend/resume

MXSFB should always request bus_freq when enabled and release bus_freq
when disabled. Also, when suspend/resume occurs, check if the driver is
running, so what we won't enable it by mistake in resume.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17115: drm/mxsfb: Add support for vblank
Robert Chiras [Fri, 8 Dec 2017 08:23:15 +0000 (10:23 +0200)]
MLK-17115: drm/mxsfb: Add support for vblank

Currently, the vblank support is not correctly implemented in MXSFB_DRM
driver. Thix patch addresses this issue, so that vblank will be
supported by MXSFB_DRM driver.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17805: drm: imx: dcss: fix resume without HDMI cable
Laurentiu Palcu [Fri, 8 Dec 2017 13:54:19 +0000 (15:54 +0200)]
MLK-17805: drm: imx: dcss: fix resume without HDMI cable

When no HDMI cable is in, the device is runtime suspended. Hence,
there's nothing to resume in this case.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17140-2: drm: imx: dcss: Change CTXLD trigger values
Laurentiu Palcu [Fri, 8 Dec 2017 12:42:05 +0000 (14:42 +0200)]
MLK-17140-2: drm: imx: dcss: Change CTXLD trigger values

After activating the PM QoS, the old triggers didn't work anymore. Also,
this will remove a hardcoded value that might not work for all
resolutions.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17140-1: drm: imx: dcss: add PM QoS
Laurentiu Palcu [Thu, 7 Dec 2017 10:57:19 +0000 (12:57 +0200)]
MLK-17140-1: drm: imx: dcss: add PM QoS

PM QoS is needed so that cpuidle doesn not influence DCSS performance.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMMFMWK-7806: drm: imx: dcss: check up/down scale ratios
Laurentiu Palcu [Wed, 6 Dec 2017 09:03:50 +0000 (11:03 +0200)]
MMFMWK-7806: drm: imx: dcss: check up/down scale ratios

When scaling up/down, DCSS has limits that cannot be exceeded. This
patch adds checks before the plane is updated and rejects those planes
that exceed the up/down scale limits.

Currently, the limit is 3:1 for downscaling and 1:3 for upscaling for
both video and graphics channels.

When support for WR_SCL/RD_SRC will be added, these limits will increase
to the following values:
 * video: 7:1 downscale, 1:7 upscale
 * graphics: 5:1 downscale, 1:5 upscale

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17133-03 tty: serial: lpuart: directly terminate rx dma chans in .shutdown()
Fugang Duan [Fri, 8 Dec 2017 08:12:50 +0000 (16:12 +0800)]
MLK-17133-03 tty: serial: lpuart: directly terminate rx dma chans in .shutdown()

No need to wait dma_wait event, directly terminate rx dma chans
in .shutdown() callback.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
7 years agoMLK-17133-02 tty: serial: lpuart: add runtime pm support
Fugang Duan [Fri, 8 Dec 2017 01:57:19 +0000 (09:57 +0800)]
MLK-17133-02 tty: serial: lpuart: add runtime pm support

Add runtime pm support to manage lpuart clock and its power domain
to save power in system idle and system suspend stages.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
7 years agoMLK-17133-01 tty: serial: lpuart: only enable wakeup interrupt when wakeup enabled
Fugang Duan [Fri, 1 Dec 2017 06:27:39 +0000 (14:27 +0800)]
MLK-17133-01 tty: serial: lpuart: only enable wakeup interrupt when wakeup enabled

Current driver suppose system disable irq when wakeup is not enabled
like below follow, so it always enable the wakeup interrupt in .suspend_noirq().
dpm_suspend_noirq()
device_wakeup_arm_wake_irqs()
if (device_may_wakeup(wirq->dev))
enable_irq_wake(wirq->irq);
irq_set_irq_wake(irq, 1);
suspend_device_irqs();
if (irqd_is_wakeup_set(&desc->irq_data))
__disable_irq(desc);
device_suspend_noirq(dev);
...

But in i.MX8x chips, the gic-v3 chip->irq_disable() is not implemented,
so the device's irq line is not masked in noirq stage. Then lpuart interrupt
can wake up system even if it is not enabled as wakeup source.

To avoid the issue, only enable wakeup interrupt when it is enabled as
wakeup source.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
7 years agoMLK-17124 imx8: pm-domains: fix clock rate may lost due to domain off during probe...
Dong Aisheng [Thu, 7 Dec 2017 12:23:53 +0000 (20:23 +0800)]
MLK-17124 imx8: pm-domains: fix clock rate may lost due to domain off during probe phase

With current design, there may be a clock state issue lost due to driver
probe fail and power domain go to OFF. Then the next driver probe using the
same domain and clocks may fail because the kernel already caches the last clk
settings, the next retry will return directly. As a result, driver may believe
the the clk setting is passed but actually no in HW. So a state mismatach
happenes between SW and HW.

This is actually a nature limitation with current design as there's no state
alignment mechanism between clk SW status and HW status. Power Domain and CLK
subsystem are two separate subsystems in current kernel design, re-architecure
the kernel power domain and clk probably is the best way to handle this issue.

However, this patch implements a quick workaround to trap the possible state
lost case and give the driver one more chance to re-set the clk when power
domain is enabled. This can tempororily fix this issue although may be not
be so good from architecture point of view.

One note is that as a parent clk rate restore will cause the clk recalc
to all possible child clks which may result in child clk previous state lost
due to power domain lost before,  we have to first walk through all child clks
to retrieve the state via clk_hw_get_rate which bypassed the clk recalc,
then we can restore them one by one.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-17058 media: csi: fix spurious warning message
Robby Cai [Thu, 7 Dec 2017 12:22:25 +0000 (20:22 +0800)]
MLK-17058 media: csi: fix spurious warning message

When boot up with 4K HDMI display, and at same time do a capture with
720p (or above), meet following message.

[  241.572132] mx6s-csi 30a90000.csi1_bridge: 82300000 != 82300000
[  241.604974] mx6s-csi 30a90000.csi1_bridge: 82700000 != 82700000
[  241.638305] mx6s-csi 30a90000.csi1_bridge: 82b00000 != 82b00000
[  241.704969] mx6s-csi 30a90000.csi1_bridge: 82300000 != 82300000
...

cast the type of unsigned long to unsigned int before compare two variables
to fix it.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
(cherry picked from commit 0972b05917dd5bd3d6aa28e57b7181d647da28b8)

7 years agoMLK-17116-2 media: mipi_csi: Adjust hs_settle and send_level for low resolution
Robby Cai [Thu, 7 Dec 2017 07:05:42 +0000 (15:05 +0800)]
MLK-17116-2 media: mipi_csi: Adjust hs_settle and send_level for low resolution

Change the hs_settle and fifo_send_level setting for 640x480 and 720x480 input
resolution.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
(cherry picked from commit 3c081af366e250ff011319d80c5706ae7b8e38ca)

7 years agoMLK-17116-1 media: camera: use simpler way for 20MHz mclk setting
Robby Cai [Thu, 7 Dec 2017 07:00:33 +0000 (15:00 +0800)]
MLK-17116-1 media: camera: use simpler way for 20MHz mclk setting

For ov5640, the simpler way is to make PLL1 same. Here's changing PRE_DIV0.
"24MHz / 3" equals to "20MHz / 2.5", hereby the reg 3037[3:0] = 7.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
(cherry picked from commit bf7d2bb06ca3bdf88a8aa86ac39b7d3f44134ea5)

7 years agoMLK-15110-23 drm/imx: dpu: kms: Add prefetch support
Liu Ying [Mon, 19 Jun 2017 03:56:01 +0000 (11:56 +0800)]
MLK-15110-23 drm/imx: dpu: kms: Add prefetch support

This patch adds prefetch support so that we may use prefetch engine
where possible.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-22 drm/imx: dpu: crtc: Evade the first dumb frame for DPR/PRG errata
Liu Ying [Thu, 22 Jun 2017 03:33:26 +0000 (11:33 +0800)]
MLK-15110-22 drm/imx: dpu: crtc: Evade the first dumb frame for DPR/PRG errata

To workaround the errata TKT320950, DPR/PRG need to evade the first dumb frame
which is generated by DPU.  The way we achieve that is to bypass TCON(but set
the TCON sync signals and KA_CHUCK strobe signal up) before enabling the DPU
display controller, and then enable the display controller, wait for the frame
index starting to move and finally switch TCON to operation mode.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-21 gpu: imx: dpu: framegen: Add timestamp support for frame index
Liu Ying [Thu, 22 Jun 2017 03:16:32 +0000 (11:16 +0800)]
MLK-15110-21 gpu: imx: dpu: framegen: Add timestamp support for frame index

This patch adds framegen timestamp support for the frame index feature.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-20 gpu: imx: dpu: fetcheco: Fixup stride when we use prefetch
Liu Ying [Tue, 1 Aug 2017 03:28:16 +0000 (11:28 +0800)]
MLK-15110-20 gpu: imx: dpu: fetcheco: Fixup stride when we use prefetch

When we use prefetch, we use DPR and PRG to do frame input cropping.
Thus, the stride of fetcheco is the stride of cropped frame, which means
the value of the stride is cropped_width * bytes_per_pixel.  Since the
pixel format has to be NV12 or NV21 when we use prefetch, we assume the
cropped_width stands for how many UV we have in bytes for one line, while
bytes_per_pixel should be 8bits for every U or V component.  Also, to
address TKT339017, when we use prefetch engine for fetcheco, we need to
round the stride up to the fetcheco burst size, i.e., burst length
multiplies 8 bytes.  According to TKT343664, the buffer base address has
to align to burst size, so we'll pick an appropriate burst size value in
fetcheco_source_stride().

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-19 gpu: imx: dpu: fetchdecode: Fixup stride when we use prefetch
Liu Ying [Wed, 28 Jun 2017 07:55:24 +0000 (15:55 +0800)]
MLK-15110-19 gpu: imx: dpu: fetchdecode: Fixup stride when we use prefetch

When we use prefetch, we use DPR and PRG to do frame input cropping.  Thus,
the stride of fetchdecode is the stride of cropped frame, which means the
value of the stride is cropped_width * bytes_per_pixel.  Also, to address
TKT339017, when we use prefetch engine for fetchdecode, we need to round
the frame stride up to the fetchdecode burst size, i.e., burst length
multiplies 8 bytes.  According to TKT343664, the buffer base address has
to align to burst size, so we'll pick an appropriate burst size value in
fetchdecode_source_stride().

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-18 gpu: imx: dpu: fetcheco: Add helper fetcheco_set_burstlength()
Liu Ying [Mon, 7 Aug 2017 05:24:21 +0000 (13:24 +0800)]
MLK-15110-18 gpu: imx: dpu: fetcheco: Add helper fetcheco_set_burstlength()

This patch adds helper fetcheco_set_burstlength() so that
the burst length of fetcheco can be set to appropriate value.
When we don't use prefetch engine, the burst length is set to
the maximal value - 16.  When we use prefetch engine, the burst
length should make the buffer base address align to burst size
but not greater than 16.  This alignment operation can address
the issue recorded by TKT343664.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-17 gpu: imx: dpu: fetchdecode: Add helper fetchdecode_set_burstlength()
Liu Ying [Mon, 7 Aug 2017 05:19:35 +0000 (13:19 +0800)]
MLK-15110-17 gpu: imx: dpu: fetchdecode: Add helper fetchdecode_set_burstlength()

This patch adds helper fetchdecode_set_burstlength() so that
the burst length of fetchdecode can be set to appropriate value.
When we don't use prefetch engine, the burst length is set to
the maximal value - 16.  When we use prefetch engine, the burst
length should make the buffer base address align to burst size
but not greater than 16.  This alignment operation can address
the issue recorded by TKT343664.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-16 gpu: imx: dpu: fetcheco: Add helpers to set/get fetcheco off pin
Liu Ying [Tue, 1 Aug 2017 05:03:36 +0000 (13:03 +0800)]
MLK-15110-16 gpu: imx: dpu: fetcheco: Add helpers to set/get fetcheco off pin

This patch adds some helpers to set/get fetcheco off pin.
We need to pin fetcheco off when the primary plane is disabled and the
relevant fetcheco is feed by prefetch engine.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-15 gpu: imx: dpu: fetchdecode: Add DPR support
Liu Ying [Mon, 19 Jun 2017 03:39:56 +0000 (11:39 +0800)]
MLK-15110-15 gpu: imx: dpu: fetchdecode: Add DPR support

This patch adds DPR support for fetchdecode in the DPU base driver.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-14 arm64: dts: fsl-imx8qxp-mek: Add DPR and PRG support
Liu Ying [Fri, 18 Aug 2017 02:03:04 +0000 (10:03 +0800)]
MLK-15110-14 arm64: dts: fsl-imx8qxp-mek: Add DPR and PRG support

This patch adds DPR and PRG support.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-13 arm64: dts: fsl-imx8qxp-lpddr4-arm2: Add DPR and PRG support
Liu Ying [Mon, 19 Jun 2017 06:03:16 +0000 (14:03 +0800)]
MLK-15110-13 arm64: dts: fsl-imx8qxp-lpddr4-arm2: Add DPR and PRG support

This patch adds DPR and PRG support.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-12 arm64: dtsi: fsl-imx8qxp: Add DPR and PRG support
Liu Ying [Mon, 19 Jun 2017 06:01:29 +0000 (14:01 +0800)]
MLK-15110-12 arm64: dtsi: fsl-imx8qxp: Add DPR and PRG support

This patch adds DPR and PRG support.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-11 arm64: dtsi: fsl-imx8qxp: Add DPR0/1 irq resources for DPU
Liu Ying [Tue, 20 Jun 2017 09:39:22 +0000 (17:39 +0800)]
MLK-15110-11 arm64: dtsi: fsl-imx8qxp: Add DPR0/1 irq resources for DPU

The Display Prefetch Resolve(DPR) engine is the prefetch engine of DPU.
This patch adds the DPR0/1's irq resources for DPU.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-10 clk: imx: clk-imx8qxp: Add IMX8QXP_DC0_DPR1_APB/B_CLK support
Liu Ying [Mon, 19 Jun 2017 05:50:15 +0000 (13:50 +0800)]
MLK-15110-10 clk: imx: clk-imx8qxp: Add IMX8QXP_DC0_DPR1_APB/B_CLK support

This patch adds IMX8QXP_DC0_DPR1_APB_CLK and IMX8QXP_DC0_DPR1_B_CLK clocks
support.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-9 arm64: dts: fsl-imx8qm-mek: Add DPR and PRG support
Liu Ying [Thu, 7 Dec 2017 04:41:05 +0000 (12:41 +0800)]
MLK-15110-9 arm64: dts: fsl-imx8qm-mek: Add DPR and PRG support

This patch adds DPR and PRG support.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-8 arm64: dts: fsl-imx8qm-lpddr4-arm2: Add DPR and PRG support
Liu Ying [Mon, 19 Jun 2017 03:06:59 +0000 (11:06 +0800)]
MLK-15110-8 arm64: dts: fsl-imx8qm-lpddr4-arm2: Add DPR and PRG support

This patch adds DPR and PRG support.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-7 arm64: dtsi: fsl-imx8qm: Add DPR and PRG support
Liu Ying [Mon, 8 May 2017 04:58:17 +0000 (12:58 +0800)]
MLK-15110-7 arm64: dtsi: fsl-imx8qm: Add DPR and PRG support

This patch adds DPR and PRG support.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-6 arm64: dtsi: fsl-imx8qm: Add DPR0/1/2/3 irq resources for DPU0/1
Liu Ying [Tue, 20 Jun 2017 09:13:31 +0000 (17:13 +0800)]
MLK-15110-6 arm64: dtsi: fsl-imx8qm: Add DPR0/1/2/3 irq resources for DPU0/1

The Display Prefetch Resolve(DPR) engine is the prefetch engine of DPU.
This patch adds the DPR0/1/2/3's irq resources for DPU0/1.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-5 gpu: imx: dpu: Name inner DPU interrupts explicitly
Liu Ying [Tue, 20 Jun 2017 08:59:23 +0000 (16:59 +0800)]
MLK-15110-5 gpu: imx: dpu: Name inner DPU interrupts explicitly

We will support DPR interrupts via DPU core driver.
In order to distinguish bewteen the inner DPU interrupts and the DPR
interrupts, let's rename some software stuffs which are related to
DPU interrupts so that they may show they are DPU inner explicitly.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-4 gpu: imx: dpu: Select IMX8_PRG and IMX8_DPRC in Kconfig
Liu Ying [Mon, 19 Jun 2017 05:05:23 +0000 (13:05 +0800)]
MLK-15110-4 gpu: imx: dpu: Select IMX8_PRG and IMX8_DPRC in Kconfig

Since we needs to use PRG and DPR in DPU base driver, let's select
the two drivers when we enable DPU.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-3 gpu: imx: Add i.MX8 DPR(Display Prefetch Resolve) support
Liu Ying [Mon, 3 Jul 2017 05:07:23 +0000 (13:07 +0800)]
MLK-15110-3 gpu: imx: Add i.MX8 DPR(Display Prefetch Resolve) support

The Display Prefetch Resolve(DPR) is a processor of fetching display data
before the display pipeline which needs data to drive pixels in the active
display region.  The data is transformed, or resolved from a variety of
tiled buffer formats into linear format.  The DPR transaction sequences are
issued with a high level of DRAM efficiency.  This patch adds the base
driver support for i.MX8qm/qxp DPR.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-2 gpu: imx: Add i.MX8 PRG(Prefetch Resolve Gasket) support
Liu Ying [Mon, 3 Jul 2017 03:35:52 +0000 (11:35 +0800)]
MLK-15110-2 gpu: imx: Add i.MX8 PRG(Prefetch Resolve Gasket) support

The Pretch Resolve Gasket(PRG) is a digital core function as a gasket
interface between RTRAM controller and DPU.  The main function of PRG
is to convert the AXI interface to RTRAM interface and remapping the
ARADDR to a RTRAM address.  This patch adds the base driver support
for i.MX8qm/qxp PRG.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15110-1 drm/fourcc: Add Amphion tiled layout format modifier
Liu Ying [Thu, 3 Aug 2017 08:00:46 +0000 (16:00 +0800)]
MLK-15110-1 drm/fourcc: Add Amphion tiled layout format modifier

Amphion VPU has a tiled layout using 8x128 pixel vertical strips,
where each strip contains 1x16 groups of 8x8 pixels in a row-major layout.

Signed-off-by: Song Bing <bing.song@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-17126-6: arm64 dts: Add hdmi dts for imx8qm mek
Sandor Yu [Fri, 8 Dec 2017 08:23:59 +0000 (16:23 +0800)]
MLK-17126-6: arm64 dts: Add hdmi dts for imx8qm mek

Add fsl-imx8qm-mek-hdmi.dts for imx8qm mek board.

BuildInfo:
 - SCFW e0362348, IMX-MKIMAGE 9841373a, ATF e173337
 - U-Boot 2017.03-imx_v2017.03+g3535868

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17126-5: arm64 dts: Move hdmi compatible srting
Sandor Yu [Fri, 8 Dec 2017 08:23:07 +0000 (16:23 +0800)]
MLK-17126-5: arm64 dts: Move hdmi compatible srting

Move imx8qm hdmi/dp compatible srting from soc specific
dts to board specific dts.

BuildInfo:
  - SCFW e0362348, IMX-MKIMAGE 9841373a, ATF e173337
  - U-Boot 2017.03-imx_v2017.03+g3535868

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17126-4: hdp: Fix V/Hsync polarity issue
Sandor Yu [Fri, 8 Dec 2017 08:16:48 +0000 (16:16 +0800)]
MLK-17126-4: hdp: Fix V/Hsync polarity issue

Remove v/hsync polarity adjust function.
Add pixel link mux configuration function for imx8qm.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17126-3: hdmi api: Fix h/v sync polarity issue
Sandor Yu [Fri, 8 Dec 2017 08:41:21 +0000 (16:41 +0800)]
MLK-17126-3: hdmi api: Fix h/v sync polarity issue

Fix H/V Sync polarity issue.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17126-2: hdp: Support imx8qm HDMI function
Sandor Yu [Thu, 7 Dec 2017 10:04:03 +0000 (18:04 +0800)]
MLK-17126-2: hdp: Support imx8qm HDMI function

Add phy reset before hdmi/dp phy init.
Reparent hdmi pixel clock to av_pll.
Combine DP and HDMI ipg clock function.
Add DP and HDMI pixel clock set rate function.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17126-1: hdp api: workaround for imx8qm HDMI DDC R/W issue
Sandor Yu [Fri, 8 Dec 2017 06:54:26 +0000 (14:54 +0800)]
MLK-17126-1: hdp api: workaround for imx8qm HDMI DDC R/W issue

HDMI DDC R/W function is not supported by imx8qm HDMI FW.
Skip the function for imx8qm before the issue is fixed in FW.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-16976-6 ARM64: dts: fsl-imx8qxp: let USB have wakeup capability
Peter Chen [Fri, 8 Dec 2017 08:25:19 +0000 (16:25 +0800)]
MLK-16976-6 ARM64: dts: fsl-imx8qxp: let USB have wakeup capability

Let PM code know USB has wake system up capability.

BuildInfo:
- SCFW 245582b, IMX-MKIMAGE 0ad6069a, ATF 6bd98a3
- U-Boot 2017.03-imx_v2017.03+gfa65b0a

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16976-5 ARM64: dts: fsl-imx8qxp-mek: add 12V source capability for Type-C
Peter Chen [Fri, 8 Dec 2017 03:44:47 +0000 (11:44 +0800)]
MLK-16976-5 ARM64: dts: fsl-imx8qxp-mek: add 12V source capability for Type-C

The MEK hardware design supports 12V power source, update src-pdos for it.
And It doesn't support power sink, so remove additional sink PDOS setting.

BuildInfo:
- SCFW 245582b, IMX-MKIMAGE 0ad6069a, ATF 6bd98a3
- U-Boot 2017.03-imx_v2017.03+gfa65b0a

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16976-4 usb: cdns3: add power management support
Peter Chen [Fri, 1 Dec 2017 06:13:06 +0000 (14:13 +0800)]
MLK-16976-4 usb: cdns3: add power management support

This patch set adds both runtime and system-level pm support.
For runtime-pm: both host and device wakeup events are supported.
For system-pm: only host wakeup events are supported, device wakeup
events are from other peripherals, and will support later.

BuildInfo:
- SCFW 245582b, IMX-MKIMAGE 0ad6069a, ATF 6bd98a3
- U-Boot 2017.03-imx_v2017.03+gfa65b0a

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16976-3 ARM64: dts: fsl-imx8qm-mek: add USB support
Peter Chen [Tue, 28 Nov 2017 06:09:23 +0000 (14:09 +0800)]
MLK-16976-3 ARM64: dts: fsl-imx8qm-mek: add USB support

- USB2 Dual-role support, and below rework is needed:
Remove R295, R296, R122, and install R116, R117, R127

- USB3 Dual-role support

BuildInfo:
- SCFW 245582b, IMX-MKIMAGE 0ad6069a, ATF 6bd98a3
- U-Boot 2017.03-imx_v2017.03+gfa65b0a

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16976-2 ARM64: dts: fsl-imx8qm: let USB have wakeup capability
Peter Chen [Fri, 1 Dec 2017 03:10:29 +0000 (11:10 +0800)]
MLK-16976-2 ARM64: dts: fsl-imx8qm: let USB have wakeup capability

Let PM code know USB has wake system up capability.

BuildInfo:
- SCFW 245582b, IMX-MKIMAGE 0ad6069a, ATF 6bd98a3
- U-Boot 2017.03-imx_v2017.03+gfa65b0a

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16976-1 ARM64: dts: fsl-imx8: add OTG register regions for Cadence USB3
Peter Chen [Fri, 24 Nov 2017 09:15:04 +0000 (17:15 +0800)]
MLK-16976-1 ARM64: dts: fsl-imx8: add OTG register regions for Cadence USB3

Add OTG register regions for Cadence USB3.

BuildInfo:
- SCFW 245582b, IMX-MKIMAGE 0ad6069a, ATF 6bd98a3
- U-Boot 2017.03-imx_v2017.03+gfa65b0a

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-17089-8: ASoC: fsl_amix: support suspend & resume for imx8
Viorel Suman [Thu, 7 Dec 2017 13:54:56 +0000 (15:54 +0200)]
MLK-17089-8: ASoC: fsl_amix: support suspend & resume for imx8

Base on latest power management design in MLK-17074, every driver
need to enter runtime suspend state in suspend, so the driver should
call the pm_runtime_force_suspend in suspend. With this implementation
the suspend function almost same as runtime suspend function. so remove
the suspend function, just use pm_runtime_force_suspend instead.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17117: arm64: dts: fsl-imx8mq-evk: Add support for dual-display
Robert Chiras [Thu, 7 Dec 2017 12:40:13 +0000 (14:40 +0200)]
MLK-17117: arm64: dts: fsl-imx8mq-evk: Add support for dual-display

Add a DTS file which will have both the lcdif and dcss nodes enabled and
configured.
The DCSS will work with HDMI output, while the eLCDIF will work with
ADV7535 DSI-HDMI converter.
Also, remove lcdif-rm67191.dts from Makefile, since lcdif is limited to
720p. This combination is no longer working, until we have the timings
for 720p for the MIPI panel.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17090: drm/mxsfb: Update mxsfb with additional pixel formats
Robert Chiras [Wed, 6 Dec 2017 15:43:30 +0000 (17:43 +0200)]
MLK-17090: drm/mxsfb: Update mxsfb with additional pixel formats

Since version 4 of eLCDIF, there are some registers that can do
transformations on the input data, like re-arranging the pixel
components. By doing that, we can support more pixel formats.
This patch adds support for X/ABGR and RGBX/A. Although, the local alpha
is not supported by eLCDIF, the alpha pixel formats were added to the
supported pixel formats but it will be ignored. This was necessary since
there are systems (like Android) that requires such pixel formats.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMGS-3495 [#imx-701] gpu failed to power off when nothing to be update
Yuchou Gan [Fri, 8 Dec 2017 16:22:11 +0000 (00:22 +0800)]
MGS-3495 [#imx-701] gpu failed to power off when nothing to be update

Merge fix patch from VSI. Tested on wayland,the power could be cut
off in a few seconds, if ctrl + c to terminate a running program making
gpu idle

Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
Reviewed-by: Yuchou Gan <yuchou.gan@nxp.com>
Reviewed-by: Xianzhong <xianzhong.li@nxp.com>
7 years agoMLK-17110 usb: dwc3: use system_freezable_wq for role change work
Li Jun [Fri, 8 Dec 2017 08:56:06 +0000 (16:56 +0800)]
MLK-17110 usb: dwc3: use system_freezable_wq for role change work

To avoid deadlock after system resume if the role changes notification
is sent while system resume, we need to drain the work handling until
thawed.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agostaging: typec: tcpm: Do not send PING msgs in TCPM
Badhri Jagan Sridharan [Mon, 28 Aug 2017 17:23:21 +0000 (10:23 -0700)]
staging: typec: tcpm: Do not send PING msgs in TCPM

PING messages are used to monitor the connect/disconnect.
However, when PD is carried over CC, so this is not required.

Also, the spec does not clearly say if PD is possible when
Type-c is connected to Type-A/B. So, removing sending
PING messages altogether.

Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f451ac9e4c6dd2c9ee5397a28a60084fc77f63d7)

7 years agoMLK-17112 gpu: imx: dpu: Ensure the dpu core is late suspended & early resumed
Liu Ying [Thu, 7 Dec 2017 08:53:02 +0000 (16:53 +0800)]
MLK-17112 gpu: imx: dpu: Ensure the dpu core is late suspended & early resumed

The dpu core driver needs to do some cleanup work for the
upper layer drivers, so it should be late suspended and
early resumed.  This patch ensures this by changing driver
PM hook definitions to use SET_LATE_SYSTEM_SLEEP_PM_OPS
instead of SET_SYSTEM_SLEEP_PM_OPS.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-17104 drivers: clk: imx: change the VPU related clock flags of imx8mq
Bai Ping [Fri, 22 Sep 2017 06:58:49 +0000 (14:58 +0800)]
MLK-17104 drivers: clk: imx: change the VPU related clock flags of imx8mq

When the system reaches the passive critical trip point, VPU device cooling
need to change the clock rate on the fly. So change the VPU related clocks
flags to make sure the clock rate can be changed successfully.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-17083 soc: imx: limit VPU/CPU bandwidth for lcdif on i.MX8MQ
Anson Huang [Wed, 6 Dec 2017 13:51:32 +0000 (21:51 +0800)]
MLK-17083 soc: imx: limit VPU/CPU bandwidth for lcdif on i.MX8MQ

Config NOC to limit bandwidth to 4GB for both VPU
and CPU to avoid lcdif flickering only when lcdif is enabled.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
(cherry picked from commit 8ab89ebeb94a423792bf588bdf2354c5960d8f13)

7 years agoMLK-17094 dma: fsl-edma-v3: add suspend/resume to restore back channel registers
Robin Gong [Mon, 4 Dec 2017 07:35:09 +0000 (15:35 +0800)]
MLK-17094 dma: fsl-edma-v3: add suspend/resume to restore back channel registers

Add suspend to save channel registers and resume to restore them back since
edmav3 may powered off in suspend.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
7 years agoMLK-17120: arm64: dts: assign the clock rate for GPMI NAND in DT
Han Xu [Thu, 7 Dec 2017 20:28:34 +0000 (14:28 -0600)]
MLK-17120: arm64: dts: assign the clock rate for GPMI NAND in DT

Assign the clock rate for GPMI NAND on i.MX8QXP ARM2 device tree.

To keep the same clock rate after system suspend/resume, we need to set
assign a clock rate for GPMI NAND, otherwise the timing register won't
match with the clock setting.

The code change also a workaround for SCU clock rate setting. NAND use a
very low clock freq (22Mhz) and safe timing to identify which chips were
connected. This low freq divide from high freq parent clock(1Ghz) caused
the SCU clock divider go beyond the limit (31)

SCU need to implement the clk_round_rate to found this issue and return
error value to upper layer. Right now assign 50Mhz for GPMI initial
clock as a workaround.

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-17081 arm64: imx8mq: export chip unique id
Frank Li [Mon, 4 Dec 2017 17:59:39 +0000 (11:59 -0600)]
MLK-17081 arm64: imx8mq: export chip unique id

cat /sys/devices/soc0/soc_uid
1b1331d6f0609502

Signed-off-by: Frank Li <Frank.Li@nxp.com>
7 years agoMLK-17092 staging: typec: enable vbus voltage low alarm
Li Jun [Wed, 6 Dec 2017 15:55:51 +0000 (23:55 +0800)]
MLK-17092 staging: typec: enable vbus voltage low alarm

We use vbus low voltage alarm to start vbus discharge to meet
timing requirement on turning off vbus for power swap from
source to sink, per type-C port controller spec(tcpci), the
Voltage Alarms Power status reporting is disabled by default,
so we need enable it at tcpci init.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-17077 staging: typec: clear vbus change event in irq handler
Li Jun [Wed, 6 Dec 2017 14:05:31 +0000 (22:05 +0800)]
MLK-17077 staging: typec: clear vbus change event in irq handler

For vbus change event, we need read the vbus status to clear
the alert. Current code do this in queue work, this has problem
on single core running, the queue work of vbus change may have
no chance to be scheduled as we continue receive the vbus change
event in threaded irq.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16986-5: arm64: dts: fsl-imx8mq.dtsi: Define max-res of lcdif node to 720p
Robert Chiras [Wed, 6 Dec 2017 09:31:48 +0000 (11:31 +0200)]
MLK-16986-5: arm64: dts: fsl-imx8mq.dtsi: Define max-res of lcdif node to 720p

Limit the maximum resolution supported by LCDIF to 1280x720, for better
performance when used with DCSS in dual-display mode.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com
7 years agoMLK-16986-4: drm/mxsfb: Add max-res property for MXSFB
Robert Chiras [Wed, 6 Dec 2017 09:31:21 +0000 (11:31 +0200)]
MLK-16986-4: drm/mxsfb: Add max-res property for MXSFB

For stability issues, we want to limit the maximum resolution supported
by the MXSFB (eLCDIF) driver.
This patch adds a new property which we can use to impose such
limitation.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com
7 years agoMLK-16986-3: drm/imx: Add a delay to enable function in nwl_dsi-imx
Robert Chiras [Tue, 5 Dec 2017 16:36:02 +0000 (18:36 +0200)]
MLK-16986-3: drm/imx: Add a delay to enable function in nwl_dsi-imx

To allow the PLL to become stable before enabling the clocks, we may
need a delay. This patch adds a new property to specify this delay from
DTS file.

Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16986-2: drm/imx: Fix nwl_dsi-imx driver
Robert Chiras [Tue, 5 Dec 2017 07:34:14 +0000 (09:34 +0200)]
MLK-16986-2: drm/imx: Fix nwl_dsi-imx driver

Since the ADV7535 can change the DSI lanes used in mode_set, we need to
set up the Mixel PHY speed again, in enable() function, so that we will
take into account the new DSI lanes.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com
7 years agoMLK-16986-1: phy: Fix Mixel PHY driver best_match
Robert Chiras [Tue, 5 Dec 2017 07:24:24 +0000 (09:24 +0200)]
MLK-16986-1: phy: Fix Mixel PHY driver best_match

When setting up the CM, CN and CO decimal values for DPHY PLL, these
values should only be rounded up when a "best_match" is requested. Some
DSI receivers requires the DSI clock to be exactly matched with the
pixel clock.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com
7 years agodrm/vc4: Add T-format scanout support.
Eric Anholt [Thu, 8 Jun 2017 00:13:35 +0000 (17:13 -0700)]
drm/vc4: Add T-format scanout support.

The T tiling format is what V3D uses for textures, with no raster
support at all until later revisions of the hardware (and always at a
large 3D performance penalty).  If we can't scan out V3D's format,
then we often need to do a relayout at some stage of the pipeline,
either right before texturing from the scanout buffer (common in X11
without a compositor) or between a tiled screen buffer right before
scanout (an option I've considered in trying to resolve this
inconsistency, but which means needing to use the dirty fb ioctl and
having some update policy).

T-format scanout lets us avoid either of those shadow copies, for a
massive, obvious performance improvement to X11 window dragging
without a compositor.  Unfortunately, enabling a compositor to work
around the discrepancy has turned out to be too costly in memory
consumption for the Raspbian distribution.

Because the HVS operates a scanline at a time, compositing from T does
increase the memory bandwidth cost of scanout.  On my 1920x1080@32bpp
display on a RPi3, we go from about 15% of system memory bandwidth
with linear to about 20% with tiled.  However, for X11 this still ends
up being a huge performance win in active usage.

This patch doesn't yet handle src_x/src_y offsetting within the tiled
buffer.  However, we fail to do so for untiled buffers already.

Signed-off-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/20170608001336.12842-1-eric@anholt.net
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
(cherry picked from commit 98830d91da082b0285d35bdf5b5ae98decac7df6)