linux.git
7 years agoMLK-16810 ARM64: dts: freescale: imx8mq: set timer stop flag in suspend
Anson Huang [Tue, 14 Nov 2017 13:02:21 +0000 (21:02 +0800)]
MLK-16810 ARM64: dts: freescale: imx8mq: set timer stop flag in suspend

System counter's clock is disabled in suspend, set flag
for arch timer driver's awareness.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16812 drm/imx: ldb: Let system PM behave properly when we are unbinded
Liu Ying [Tue, 14 Nov 2017 05:28:41 +0000 (13:28 +0800)]
MLK-16812 drm/imx: ldb: Let system PM behave properly when we are unbinded

The system power management operations should get correct driver data
before going on to further handling.  When the component is unbinded,
driver data should be set to NULL so that the system power management
may be bypassed(return early).  This way, we may prevent the system power
management from using any invalid driver data.

Fixes: 915ac0ad7369 ("MLK-16581-7 drm/imx: ldb: Add system power management support")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-16695-4: mipi_csi: fix build error
Guoniu.Zhou [Tue, 14 Nov 2017 08:24:56 +0000 (16:24 +0800)]
MLK-16695-4: mipi_csi: fix build error

Delete #ifdef CONFIG_PM_SLEEP statement which
lead to build error.

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

7 years agoMLK-16695-3: mipi_csi: Change printk to dev_dbg
Guoniu.Zhou [Fri, 10 Nov 2017 03:09:21 +0000 (11:09 +0800)]
MLK-16695-3: mipi_csi: Change printk to dev_dbg

Messages in ISI irq handler are for debugging, so
change printk to dev_dbg for this purpose.

The width and height of image information need output
in debug process.

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

7 years agoMLK-16695-2: mipi_csi: Add pm suspend and resume support
Guoniu.Zhou [Fri, 10 Nov 2017 03:01:46 +0000 (11:01 +0800)]
MLK-16695-2: mipi_csi: Add pm suspend and resume support

Add power manager suspend and resume support for ISI

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

7 years agoMLK-16695-1: mipi_csi: Add pm suspend and resume
Guoniu.Zhou [Fri, 10 Nov 2017 01:58:20 +0000 (09:58 +0800)]
MLK-16695-1: mipi_csi: Add pm suspend and resume

Add mipi_csi power manager suspend and resume support.

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

7 years agoMLK-16777 PCI: imx: enable pcie pm on mscale
Richard Zhu [Tue, 14 Nov 2017 02:22:16 +0000 (10:22 +0800)]
MLK-16777 PCI: imx: enable pcie pm on mscale

Enable the PCIE PM on mScale.
- Refine the codes.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
7 years agoMLK-16798-2: arm64: defconfig: CONFIG_AHCI_IMX=y
Leonard Crestez [Fri, 10 Nov 2017 11:43:22 +0000 (13:43 +0200)]
MLK-16798-2: arm64: defconfig: CONFIG_AHCI_IMX=y

Enabling sata on imx8qm was done by adding "default y", this should just
be modified in config instead.

Fixes: 1d09794d6387 ("MLK-16684-3 ata: imx: enable imx8qm sata")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
7 years agoMLK-16798-1: ata: imx: Fix AHCI_IMX Kconfig dependency
Leonard Crestez [Thu, 9 Nov 2017 18:53:06 +0000 (20:53 +0200)]
MLK-16798-1: ata: imx: Fix AHCI_IMX Kconfig dependency

Enabling sata on imx8qm was done by adding "default y", this should just
be modified in config instead.

Also fix the dependency list to include SOC_IMX53 || COMPILE_TEST.

Fixes: 1d09794d6387 ("MLK-16684-3 ata: imx: enable imx8qm sata")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
7 years agoMLK-16801-1: arm64: dts: fsl-imx8qm-lpddr4-arm2: Add DTS for 4 displays.
Oliver Brown [Mon, 13 Nov 2017 00:59:32 +0000 (18:59 -0600)]
MLK-16801-1: arm64: dts: fsl-imx8qm-lpddr4-arm2: Add DTS for 4 displays.

Add DTS for 4 displays: 2 LVDS with it6263 and 2 MIPI with adv7535.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
7 years agoMLK-15473-7: crypto: caam: Fix CAAM driver build for i.MX6
Aymen Sghaier [Mon, 13 Nov 2017 09:56:02 +0000 (10:56 +0100)]
MLK-15473-7: crypto: caam: Fix CAAM driver build for i.MX6

  Add a check for CONFIG_HAVE_IMX8_SOC befor imx8_get_soc_revision() call
 to avoid i.MX6 build fail. The generic imx_get_soc_revision() call is
 not ready to use.

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
7 years agoMLK-16698-5: arm64: defconfig: Build in RM67191 panel driver
Robert Chiras [Wed, 25 Oct 2017 13:56:37 +0000 (16:56 +0300)]
MLK-16698-5: arm64: defconfig: Build in RM67191 panel driver

Enable the Raydium RM67171 drm panel driver as built-in in defconfig.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16698-4: arm64: dts: fsl-imx8qxp-mek: Enable mipi-dsi with rm67191
Oliver Brown [Fri, 27 Oct 2017 19:30:46 +0000 (14:30 -0500)]
MLK-16698-4: arm64: dts: fsl-imx8qxp-mek: Enable mipi-dsi with rm67191

Enable the MIPI-DSI to RM67191 OLED display panel path on the MX8QXP MEK
board.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16698-3: arm64: dts: fsl-imx8qxp-lpddr4-arm2: Enable mipi-dsi with rm67191
Robert Chiras [Thu, 2 Nov 2017 12:41:31 +0000 (14:41 +0200)]
MLK-16698-3: arm64: dts: fsl-imx8qxp-lpddr4-arm2: Enable mipi-dsi with rm67191

Enable the MIPI-DSI to RM67191 OLED display panel path on the MX8QXP
LPDDR4 board.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16698-2: arm64: dts: fsl-imx8qm-lpddr4-arm2: Enable mipi-dsi with rm67191
Robert Chiras [Fri, 27 Oct 2017 11:51:34 +0000 (14:51 +0300)]
MLK-16698-2: arm64: dts: fsl-imx8qm-lpddr4-arm2: Enable mipi-dsi with rm67191

Enable the MIPI-DSI to RM67191 OLED display panel path on the MX8QM
LPDDR4 development board.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16698-1: drm/panel: Add panel driver for Raydium RM67191
Robert Chiras [Mon, 16 Oct 2017 13:24:59 +0000 (16:24 +0300)]
MLK-16698-1: drm/panel: Add panel driver for Raydium RM67191

Add support for the OLED display based on MIPI-DSI protocol from Raydium:
RM67191.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16804-08 driver: soc: Reduce NOC/AHB/MAIN_AXI to save SOC power for audio playback
Anson Huang [Wed, 8 Nov 2017 10:17:22 +0000 (18:17 +0800)]
MLK-16804-08 driver: soc: Reduce NOC/AHB/MAIN_AXI to save SOC power for audio playback

reduce the NOC, main AXI and AHB bus clock frequency to save power when DDR enter low
frequency mode. VDDSOC is ~195mA during video play, and ~180mA in idle.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-16804-07 ARM64: dts: Add cpuidle state info node for imx8mq
Bai Ping [Fri, 10 Nov 2017 09:01:12 +0000 (17:01 +0800)]
MLK-16804-07 ARM64: dts: Add cpuidle state info node for imx8mq

Add cpuidle states node for imx8mq.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
7 years agoMLK-16804-06 driver: soc: Optimize the DDR frequency in audio playback case
Bai Ping [Wed, 8 Nov 2017 09:58:00 +0000 (17:58 +0800)]
MLK-16804-06 driver: soc: Optimize the DDR frequency in audio playback case

If audio device is the only that access to ddr memory, the DDR
frequency can be reduce to 25MHz to save power. when DDR run in
25MHz frequency, the memory bandwidth is about 66MB/s, it can
meet the performance requirement for audio only case.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
7 years agoMLK-16804-05 driver: soc: add the irq affinity call for child irqchip on imx8mq
Bai Ping [Wed, 8 Nov 2017 09:55:20 +0000 (17:55 +0800)]
MLK-16804-05 driver: soc: add the irq affinity call for child irqchip on imx8mq

On i.MX8MQ, we need the handle the correspoding IMR registers in gpc
to make sure the IRQ affinity to the specific core can be wakeup
successfully from power down idle state.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
7 years agoMLK-16804-04 driver: irqchip: Add IPI SW workaround for imx8mq
Bai Ping [Wed, 8 Nov 2017 09:48:47 +0000 (17:48 +0800)]
MLK-16804-04 driver: irqchip: Add IPI SW workaround for imx8mq

On i.MX8MQ, when the CPU core is in power down state,
the IPI can NOT wakeup the core anymore(ERR011171), so using the
external IRQ32 to wakeup the core in power down idle
state successfully.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
7 years agoMLK-16804-03 driver: clk: Add video pll2 output gate clk on imx8mq
Bai Ping [Wed, 8 Nov 2017 09:44:23 +0000 (17:44 +0800)]
MLK-16804-03 driver: clk: Add video pll2 output gate clk on imx8mq

The Video PLL2 has a output enable bit to do clk gate,
So we need to register this gate to save power.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
7 years agoMLK-16804-02 arm64: configs: enable the system counter timer for nxp imx8
Bai Ping [Mon, 13 Nov 2017 03:23:24 +0000 (11:23 +0800)]
MLK-16804-02 arm64: configs: enable the system counter timer for nxp imx8

Enable the system counter timer by default.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
7 years agoMLK-16804-01 driver: clocksource: Add nxp system counter broadcast timer
Bai Ping [Sun, 5 Nov 2017 07:31:09 +0000 (15:31 +0800)]
MLK-16804-01 driver: clocksource: Add nxp system counter broadcast timer

On NXP i.MX8MQ SOC, it has system counter module for ARM
generic timer implementation. In this system counter module
it also has compare frame module to provide timer support.
So we can use it as an alternative clockevent device for
broadcast timer purpose when CPU core enter power down state
with local timer stopped.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
7 years agoMLK-16806 - [i.MX8QXP/Malone]: segment fault in gdb environment
Zhou Peng-B04994 [Mon, 13 Nov 2017 04:07:57 +0000 (12:07 +0800)]
MLK-16806 - [i.MX8QXP/Malone]: segment fault in gdb environment

function wait_event_interruptible_timeout may return some special value
in gdb debug environment, so we need to add additional check to these
return values, otherwise, interrupt will reported wrongly

Signed-off-by: Zhou Peng-B04994 <eagle.zhou@nxp.com>
7 years agoMLK-16805 - [i.MX8MQ/Hantro]: Enable runtime bus frequency
Zhou Peng-B04994 [Mon, 13 Nov 2017 04:00:38 +0000 (12:00 +0800)]
MLK-16805 - [i.MX8MQ/Hantro]: Enable runtime bus frequency

Add operation to request/release bus in runtime suspend/resume functions

Signed-off-by: Zhou Peng-B04994 <eagle.zhou@nxp.com>
7 years agoMLK-16803 arm64: dts: imx8mq-evk: removed the reserved ATF space
Peng Fan [Mon, 13 Nov 2017 01:05:34 +0000 (09:05 +0800)]
MLK-16803 arm64: dts: imx8mq-evk: removed the reserved ATF space

ATF has been moved to OCRAM, there is no need to reserve space
for ATF in DRAM space.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16800: dma: mxs-dma: correctly handle mxs-dma clock
Han Xu [Fri, 10 Nov 2017 23:37:22 +0000 (17:37 -0600)]
MLK-16800: dma: mxs-dma: correctly handle mxs-dma clock

enable mxs-dma clock before HW reset and disable clock after it.

BuildInfo:
- SCFW 15d20cde, IMX-MKIMAGE ff9860c5, ATF
- U-Boot 2017.03-00003-gd09f5db

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-16799-2: mtd: flexspi: support runtime pm for flexspi
Han Xu [Fri, 10 Nov 2017 21:33:24 +0000 (15:33 -0600)]
MLK-16799-2: mtd: flexspi: support runtime pm for flexspi

enabled runtime pm for flexspi, also removed the redundant clock.
Tested with the latest SCFW and ATF.

BuildInfo:
- SCFW 15d20cde, IMX-MKIMAGE ff9860c5, ATF
- U-Boot 2017.03-00003-gd09f5db

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-16799-1: arm64: dts: remove the unnecessary clock for flexspi
Han Xu [Fri, 10 Nov 2017 21:29:36 +0000 (15:29 -0600)]
MLK-16799-1: arm64: dts: remove the unnecessary clock for flexspi

flexspi only need one clock source, removed the redundant one from
device tree.

BuildInfo:
- SCFW 15d20cde, IMX-MKIMAGE ff9860c5, ATF 0
- U-Boot 2017.03-00003-gd09f5db

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-15473-6: crypto: caam: Enable CAAM driver for i.MX8 QuadXPlus
Aymen Sghaier [Fri, 10 Nov 2017 09:02:01 +0000 (10:02 +0100)]
MLK-15473-6: crypto: caam: Enable CAAM driver for i.MX8 QuadXPlus

 Add caam node to fsl-imx8qxp device-tree

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
7 years agoMLK-15473-5: crypto: caam: Enable CAAM driver for i.MX8 QuadMax
Aymen Sghaier [Fri, 10 Nov 2017 09:01:38 +0000 (10:01 +0100)]
MLK-15473-5: crypto: caam: Enable CAAM driver for i.MX8 QuadMax

 Add caam node to fsl-imx8qm device-tree

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
7 years agoMLK-15473-4: crypto: caam: Enable CAAM driver for i.MX8 mScale
Aymen Sghaier [Fri, 10 Nov 2017 09:00:50 +0000 (10:00 +0100)]
MLK-15473-4: crypto: caam: Enable CAAM driver for i.MX8 mScale

 Add caam node to fsl-imx8mq device-tree

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
7 years agoMLK-15473-3: defconfig: Enable CONFIG_CRYPTO_DEV_FSL_CAAM
Aymen Sghaier [Fri, 10 Nov 2017 08:59:58 +0000 (09:59 +0100)]
MLK-15473-3: defconfig: Enable CONFIG_CRYPTO_DEV_FSL_CAAM

 Enable the CAAM driver flag in defconfig file.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
7 years agoMLK-15473-2: fsl-sec4.txt: Update CAAM device-tree documentation
Aymen Sghaier [Fri, 10 Nov 2017 08:55:39 +0000 (09:55 +0100)]
MLK-15473-2: fsl-sec4.txt: Update CAAM device-tree documentation

 Add a new property in device tree specific to i.MX8 only: first-jr-index.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
7 years agoMLK-15473-1: crypto: caam: Add CAAM driver support for iMX8 soc family
Aymen Sghaier [Fri, 10 Nov 2017 08:53:57 +0000 (09:53 +0100)]
MLK-15473-1: crypto: caam: Add CAAM driver support for iMX8 soc family

  Enable CAAM driver for i.MX8 family:
   - Use a Job ring for RNG instantiation rather than DECO, even
     for i.MX6/7 families.
   - Use of aliased CAAM registers instead of original registers in page 0
     since page 0 is no more accessible in i.MX8 family except mScale.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
7 years agodrm: Add four ioctls for managing drm mode object leases [v7]
Keith Packard [Wed, 8 Nov 2017 13:09:28 +0000 (15:09 +0200)]
drm: Add four ioctls for managing drm mode object leases [v7]

drm_mode_create_lease

        Creates a lease for a list of drm mode objects, returning an
        fd for the new drm_master and a 64-bit identifier for the lessee

drm_mode_list_lesees

        List the identifiers of the lessees for a master file

drm_mode_get_lease

        List the leased objects for a master file

drm_mode_revoke_lease

        Erase the set of objects managed by a lease.

This should suffice to at least create and query leases.

Changes for v2 as suggested by Daniel Vetter <daniel.vetter@ffwll.ch>:

 * query ioctls only query the master associated with
   the provided file.

 * 'mask_lease' value has been removed

 * change ioctl has been removed.

Changes for v3 suggested in part by Dave Airlie <airlied@gmail.com>

 * Add revoke ioctl.

Changes for v4 suggested by Dave Airlie <airlied@gmail.com>

 * Expand on the comment about the magic use of &drm_lease_idr_object
 * Pad lease ioctl structures to align on 64-bit boundaries

Changes for v5 suggested by Dave Airlie <airlied@gmail.com>

 * Check for non-negative object_id in create_lease to avoid debug
   output from the kernel.

Changes for v6 provided by Dave Airlie <airlied@gmail.com>
 * For non-universal planes add primary/cursor planes to lease

   If we aren't exposing universal planes to this userspace client,
   and it requests a lease on a crtc, we should implicitly export the
   primary and cursor planes for the crtc.

   If the lessee doesn't request universal planes, it will just see
   the crtc, but if it does request them it will then see the plane
   objects as well.

   This also moves the object look ups earlier as a side effect, so
   we'd exit the ioctl quicker for non-existant objects.

 * Restrict leases to crtc/connector/planes.

   This only allows leasing for objects we wish to allow.

Changes for v7 provided by Dave Airlie <airlied@gmail.com>

 * Check pad args are 0
 * Check create flags and object count are valid.
 * Check return from fd allocation
 * Refactor lease idr setup and add some simple validation
 * Use idr_mutex uniformly (Keith)

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
7 years agodrm: Check mode object lease status in all master ioctl paths [v4]
Keith Packard [Wed, 8 Nov 2017 10:53:11 +0000 (12:53 +0200)]
drm: Check mode object lease status in all master ioctl paths [v4]

Attempts to modify un-leased objects are rejected with an error.
Information returned about unleased objects is modified to make them
appear unusable and/or disconnected.

Changes for v2 as suggested by Daniel Vetter <daniel.vetter@ffwll.ch>:

 * With the change in the __drm_mode_object_find API to pass the
   file_priv along, we can now centralize most of the lease-based
   access checks in that function.

 * A few places skip that API and require in-line checks.

Changes for v3 provided by Dave Airlie <airlied@redhat.com>

 * remove support for leasing encoders.
 * add support for leasing planes.

Changes for v4

 * Only call drm_lease_held if DRIVER_MODESET.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
7 years agodrm: Add drm_object lease infrastructure [v5]
Keith Packard [Tue, 7 Nov 2017 16:41:10 +0000 (18:41 +0200)]
drm: Add drm_object lease infrastructure [v5]

This provides new data structures to hold "lease" information about drm mode
setting objects, and provides for creating new drm_masters which have access to
a subset of the available drm resources.

An 'owner' is a drm_master which is not leasing the objects from another
drm_master, and hence 'owns' them.

A 'lessee' is a drm_master which is leasing objects from some other drm_master.
Each lessee holds the set of objects which it is leasing from the lessor.

A 'lessor' is a drm_master which is leasing objects to another drm_master. This
is the same as the owner in the current code.

The set of objects any drm_master 'controls' is limited to the set of objects it
leases (for lessees) or all objects (for owners).

Objects not controlled by a drm_master cannot be modified through the various
state manipulating ioctls, and any state reported back to user space will be
edited to make them appear idle and/or unusable. For instance, connectors always
report 'disconnected', while encoders report no possible crtcs or clones.

The full list of lessees leasing objects from an owner (either directly, or
indirectly through another lessee), can be searched from an idr
in the drm_master of the owner.

Changes for v2 as suggested by Daniel Vetter <daniel.vetter@ffwll.ch>:

* Sub-leasing has been disabled.

* BUG_ON for lock checking replaced with lockdep_assert_held

* 'change' ioctl has been removed.

* Leased objects can always be controlled by the lessor; the
  'mask_lease' flag has been removed

* Checking for leased status has been simplified, replacing
  the drm_lease_check function with drm_lease_held.

Changes in v3, some suggested by Dave Airlie <airlied@gmail.com>

* Add revocation. This allows leases to be effectively revoked by
  removing all of the objects they have access to. The lease itself
  hangs around as it's hanging off a file.

* Free the leases IDR when the master is destroyed

* _drm_lease_held should look at lessees, not lessor

* Allow non-master files to check for lease status

Changes in v4, suggested by Dave Airlie <airlied@gmail.com>

* Formatting and whitespace changes

Changes in v5 (airlied)

* check DRIVER_MODESET before lease destroy call
* check DRIVER_MODESET for lease revoke (Chris)
* Use idr_mutex uniformly for all lease elements of struct drm_master. (Keith)

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
7 years agodrm: Pass struct drm_file * to __drm_mode_object_find [v2]
Keith Packard [Wed, 8 Nov 2017 12:08:19 +0000 (14:08 +0200)]
drm: Pass struct drm_file * to __drm_mode_object_find [v2]

This will allow __drm_mode_object_file to be extended to perform
access control checks based on the file in use.

v2: Also fix up vboxvideo driver in staging

[airlied: merging early as this is an API change]

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
7 years agodrm: Add new LEASE debug level
Keith Packard [Tue, 7 Nov 2017 16:28:37 +0000 (18:28 +0200)]
drm: Add new LEASE debug level

Separate out lease debugging from the core.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
7 years agoMLK-16748-03: dts: Add fsl-imx8mq-evk-drm.dts for drm driver
Sandor Yu [Thu, 9 Nov 2017 08:31:03 +0000 (16:31 +0800)]
MLK-16748-03: dts: Add fsl-imx8mq-evk-drm.dts for drm driver

Enable DCSS DRM and HDMI DRM driver.
Disable DCSS Framebuffer and HDMI Framebuffer driver.

Set IMX8MQ_CLK_DISP_APB_SRC source from IMX8MQ_SYS2_PLL_125M temporary,
will be set back to IMX8MQ_SYS1_PLL_800M
after DCSS APB clock affect HDMI Core clock issue resolved on B0 SOC.

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

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

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

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

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoPM / Runtime: Defer resuming of the device in pm_runtime_force_resume()
Ulf Hansson [Thu, 13 Oct 2016 14:58:54 +0000 (16:58 +0200)]
PM / Runtime: Defer resuming of the device in pm_runtime_force_resume()

When the pm_runtime_force_suspend|resume() helpers were invented, we still
had CONFIG_PM_RUNTIME and CONFIG_PM_SLEEP as separate Kconfig options.

To make sure these helpers worked for all combinations and without
introducing too much of complexity, the device was always resumed in
pm_runtime_force_resume().

More precisely, when CONFIG_PM_SLEEP was set and CONFIG_PM_RUNTIME was
unset, we needed to resume the device as the subsystem/driver couldn't
rely on using runtime PM to do it.

As the CONFIG_PM_RUNTIME option was merged into CONFIG_PM a while ago, it
removed this combination, of using CONFIG_PM_SLEEP without the earlier
CONFIG_PM_RUNTIME.

For this reason we can now rely on the subsystem/driver to use runtime PM
to resume the device, instead of forcing that to be done in all cases. In
other words, let's defer the runtime resume to a later point when it's
actually needed.

Complemented by: Dong Aisheng:
Used to fix a already runtime suspended device gets force resume
too early to access other non-available devices. e.g. I2C.

[Cherry-picked-by: Dong Aisheng <aisheng.dong@nxp.com>

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7 years agoMLK-16757-2 can: flexcan: implement runtime pm
Dong Aisheng [Tue, 31 Oct 2017 10:06:44 +0000 (18:06 +0800)]
MLK-16757-2 can: flexcan: implement runtime pm

Implement runtime PM which will:
1) Keep device in suspend state (clocks disabled) if it's not openned
2) Make Power Domain framework be able to shutdown the corresponding power
domain of this device.

Reviewed-by: Frank Li <frank.li@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-16757-1 can: flexcan: disable clocks during suspend
Dong Aisheng [Mon, 30 Oct 2017 11:13:38 +0000 (19:13 +0800)]
MLK-16757-1 can: flexcan: disable clocks during suspend

Flexcan will be stopped during suspend if no wakeup function required
and enabled after resume accordingly. During this period, we could
explicitly disable clocks.

We do this by moving the clk_prepare_enable/clk_disable_unprepare into
flexcan_chip_start and flexcan_chip_stop functions which will be called
during suspend/resume function.

Reviewed-by: Frank Li <frank.li@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMLK-16735 usb: host: add XHCI_CDNS_HOST flag
Peter Chen [Thu, 9 Nov 2017 08:58:40 +0000 (16:58 +0800)]
MLK-16735 usb: host: add XHCI_CDNS_HOST flag

The NXP Cadence XHCI host has the same issue with Intel's,
it is triggered by reboot test, the test case is described
at this jira ticket.

BuildInfo:
- SCFW 8dcff26, IMX-MKIMAGE ea027c4b, ATF
- U-Boot 2017.03-imx_v2017.03_4.9.51_imx8_beta1+g6dc7b0f

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16738: ARM64: dts: qxp-mek: amix: move SAIs MCLKs to AUD_PLL1
Viorel Suman [Fri, 10 Nov 2017 08:32:31 +0000 (10:32 +0200)]
MLK-16738: ARM64: dts: qxp-mek: amix: move SAIs MCLKs to AUD_PLL1

Move AMIX SAIs MCLKs to AUD_PLL1 and double the frequency
in order to support 64k rate.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
7 years agoMLK-16775-2 usb: xhci: plat: only do high bus freq for runtime pm
Li Jun [Thu, 9 Nov 2017 16:16:48 +0000 (00:16 +0800)]
MLK-16775-2 usb: xhci: plat: only do high bus freq for runtime pm

Remove xhci_suspend and xhci_resume as i.MX8MQ dwc3 can't support it,
add high bus request and release, and enable runtime pm by default.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agousb: host: plat: Enable xHCI plat runtime PM
Baolin Wang [Wed, 19 Apr 2017 13:55:45 +0000 (16:55 +0300)]
usb: host: plat: Enable xHCI plat runtime PM

Enable the xHCI plat runtime PM for parent device to suspend/resume
xHCI. Also call pm_runtime_forbid() in probe() function to force users
to explicitly enable runtime pm using power/control in sysfs, in case
some parent devices didn't implement runtime PM callbacks.

[set do_wakeup to true when runtime suspending -Mathias]
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b0c69b4bace3703a29e08dda2b5a10e1073cb9cd)

7 years agousb: xhci: plat: Enable async suspend/resume
Andrew Bresticker [Fri, 7 Apr 2017 14:56:49 +0000 (17:56 +0300)]
usb: xhci: plat: Enable async suspend/resume

USB host controllers can take a significant amount of time to suspend
and resume, adding several hundred miliseconds to the kernel resume
time. Since the XHCI controller has no outside dependencies (other than
clocks, which are suspended late/resumed early), allow it to suspend and
resume asynchronously.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c70a1529b29cb1362ade5dd113313fb945e32c3e)

7 years agoMLK-16775-1 usb: dwc3: gadget: add high bus freq support
Li Jun [Tue, 7 Nov 2017 17:19:26 +0000 (01:19 +0800)]
MLK-16775-1 usb: dwc3: gadget: add high bus freq support

Add high bus request for connection to host in reset handling,
and high bus release for disconnection.

Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMGS-3349 [#ccc] [imx8qm] Met segmentation fault when run GLES samples stress on GPU0...
Yuchou Gan [Fri, 10 Nov 2017 13:34:41 +0000 (21:34 +0800)]
MGS-3349 [#ccc] [imx8qm] Met segmentation fault when run GLES samples stress on GPU0, GPU1 and bridged mode

cma limit feature is for gpu/dpu/vpu buffer sharing,
cma preempt feature is required for gpu mmu table setup.

remove cma limit flag for video memory since imx8 g2d use ion.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Yuchou Gan <yuchou.gan@nxp.com>
7 years agoMLK-16738: ASoC: fsl: amix: move SAIs MCLKs to AUD_PLL1
Viorel Suman [Thu, 9 Nov 2017 15:28:59 +0000 (17:28 +0200)]
MLK-16738: ASoC: fsl: amix: move SAIs MCLKs to AUD_PLL1

Move AMIX SAIs MCLKs to AUD_PLL1 and double the frequency
in order to support 64k rate.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoRevert "MLK-16738: ASoC: fsl: amix: remove support for 64k and 96k rates"
Viorel Suman [Thu, 9 Nov 2017 15:28:58 +0000 (17:28 +0200)]
Revert "MLK-16738: ASoC: fsl: amix: remove support for 64k and 96k rates"

This reverts commit 0cc882c2d72c ("MLK-16738: ASoC: fsl: amix: remove
support for 64k and 96k rates").

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-16347-14: arm64: dts: fsl-imx8qxp-mek: Enable mipi-dsi with adv7535
Robert Chiras [Wed, 13 Sep 2017 11:52:50 +0000 (14:52 +0300)]
MLK-16347-14: arm64: dts: fsl-imx8qxp-mek: Enable mipi-dsi with adv7535

Enable the MIPI-DSI to ADV7535 DSI2HDMI converter path on the MX8QXP MEK
development board.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16347-13: arm64: dts: fsl-imx8qxp-lpddr4-arm2: Enable mipi-dsi with adv7535
Robert Chiras [Mon, 16 Oct 2017 12:51:06 +0000 (15:51 +0300)]
MLK-16347-13: arm64: dts: fsl-imx8qxp-lpddr4-arm2: Enable mipi-dsi with adv7535

Enable the MIPI-DSI to ADV7535 DSI2HDMI converter path on the MX8QXP LPDDR4
development board.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16347-12: arm64: dtsi: fsl-imx8qxp: Add mipi-dsi specific nodes
Robert Chiras [Mon, 16 Oct 2017 12:50:25 +0000 (15:50 +0300)]
MLK-16347-12: arm64: dtsi: fsl-imx8qxp: Add mipi-dsi specific nodes

Add support for mipi-dsi DRM driver in DTS files for i.MX8qxp
platform.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16347-11: clk: imx: imx8qxp: Add missing MIPI DSI clocks
Robert Chiras [Tue, 31 Oct 2017 15:26:19 +0000 (17:26 +0200)]
MLK-16347-11: clk: imx: imx8qxp: Add missing MIPI DSI clocks

Add missing clocks for MIPI-DSI SS: RX_ESC and TX_ESC
Also added the posibility to select clock parents for MIPI-DSI versus
LVDS.
The SCFW was changed, so now the LVDS pixel and phy clocks need to
specify their parrents.
Also, the TX_ESC and RX_ESC clocks from MIPI-DSI need to specify their
parrents in DTS files.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
7 years agoMLK-16347-10: arm64: defconfig: Change ADV7511 driver from module to built-in
Robert Chiras [Mon, 16 Oct 2017 12:35:15 +0000 (15:35 +0300)]
MLK-16347-10: arm64: defconfig: Change ADV7511 driver from module to built-in

Make the ADV7511 drm bridge driver as built-in, so the path MIPI-DSI to
ADV7535 will be available by default.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16347-9: arm64: defconfig: Build in NWL IMX DSI driver
Robert Chiras [Mon, 16 Oct 2017 12:33:46 +0000 (15:33 +0300)]
MLK-16347-9: arm64: defconfig: Build in NWL IMX DSI driver

Enable the MIPI-DSI drm driver as built-in in defconfig.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16347-8: arm64: dts: fsl-imx8qm-lpddr4-arm2: Enable mipi-dsi with adv7535
Robert Chiras [Mon, 16 Oct 2017 12:21:07 +0000 (15:21 +0300)]
MLK-16347-8: arm64: dts: fsl-imx8qm-lpddr4-arm2: Enable mipi-dsi with adv7535

Enable the MIPI-DSI to ADV7535 DSI2HDMI converter path on the MX8QM LPDDR4
development board.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16347-7: arm64: dtsi: fsl-imx8qm: Add mipi-dsi specific nodes
Robert Chiras [Mon, 16 Oct 2017 12:18:53 +0000 (15:18 +0300)]
MLK-16347-7: arm64: dtsi: fsl-imx8qm: Add mipi-dsi specific nodes

Add support for mipi-dsi DRM driver in DTS files for i.MX8qm platform.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16347-6: gpu: drm: bridge: adv7511: Add new compatible string
Robert Chiras [Thu, 19 Oct 2017 12:07:51 +0000 (15:07 +0300)]
MLK-16347-6: gpu: drm: bridge: adv7511: Add new compatible string

Added "adi,adv7535" to the adv7511 drm bridge and adi,adv7511.txt doc,
since the driver can also support the ADV7535 chipset (upgrade of ADV7533).

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16347-5: gpu: imx: dpu: TCON adjustment
Oliver Brown [Sat, 9 Sep 2017 00:58:22 +0000 (19:58 -0500)]
MLK-16347-5: gpu: imx: dpu: TCON adjustment

The DPU TCON register regarding hsync/vsync are incorrectly
initialized. So, adjust vsync start to align with hsync start.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16347-4: drm/imx: Add mipi-dsi driver for mx8
Robert Chiras [Fri, 14 Jul 2017 12:31:09 +0000 (15:31 +0300)]
MLK-16347-4: drm/imx: Add mipi-dsi driver for mx8

Add support for the NorthWest Logic MIPI-DSI controller found
in the following i.MX8 platforms: i.MX8qm, i.MX8qxp and i.MX8mq.
This is the MIPI-DSI encoder containing the platform specific changes
and it uses the NWL MIPI-DSI bridge.
Currently only qm and qxp are tested with this driver. The mq support
will be added later.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16347-3: drm/bridge: Add Northwest Logic DSI transmitter support
Robert Chiras [Wed, 27 Sep 2017 10:45:07 +0000 (13:45 +0300)]
MLK-16347-3: drm/bridge: Add Northwest Logic DSI transmitter support

Add support for the NorthWest Logit MIPI-DSI controller found in mx8
platforms: i.MX8qm, i.MX8qxp and i.MX8mq.
The NWL MIPI-DSI driver is implemented as a DRM bridge.
The MIPI-DSI encoder will contain the platform specific changes and will
use this bridge.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16347-2: Documentation: devicetree: Added nwl to vendor-prefixes
Robert Chiras [Mon, 16 Oct 2017 11:07:24 +0000 (14:07 +0300)]
MLK-16347-2: Documentation: devicetree: Added nwl to vendor-prefixes

Added nwl to Documentation in vendor-prefixes.txt, since a new driver
from Nortwest Logic was added to devicetree.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16347-1: phy: add phy driver for mipi-dsi on mx8
Robert Chiras [Fri, 14 Jul 2017 12:31:56 +0000 (15:31 +0300)]
MLK-16347-1: phy: add phy driver for mipi-dsi on mx8

Implement the DPHY from MIPI-DSI found on i.MX8 platforms (QM, QXP and MQ)
as a phy driver.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-16789 tty: serial: lpuart: keep ipg clock enable during .uart_resume_port()
Fugang Duan [Thu, 9 Nov 2017 06:38:32 +0000 (14:38 +0800)]
MLK-16789 tty: serial: lpuart: keep ipg clock enable during .uart_resume_port()

Ensure ipg clock enable during .uart_resume_port() that call set
ops->set_mctrl() before ops->startup().

BuildInfo:
 - SCFW daf9431c, IMX-MKIMAGE 1c6fc7d8, ATF f2547fb
 - U-Boot 2017.03-00097-gd7599cf

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
7 years agoMLK-16776 staging: typec: tcpci: use vbus from partner for EXTCON_USB
Li Jun [Tue, 7 Nov 2017 13:32:51 +0000 (21:32 +0800)]
MLK-16776 staging: typec: tcpci: use vbus from partner for EXTCON_USB

Change to use the vbus from partner to notify EXTCON_USB.
This is to work around the case of source only typec port
connecting to Host PC via a Rp fixed cable.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16774 usb: gadget: utp: fix coverity CID 414727 issue
Li Jun [Tue, 7 Nov 2017 10:40:19 +0000 (18:40 +0800)]
MLK-16774 usb: gadget: utp: fix coverity CID 414727 issue

CID 414727: Explicit null dereferenced (FORWARD_NULL)
var_deref_op: Dereferencing null pointer uud.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16786: dma: mxs-dma: fix the unbalanced runtime pm counter
Han Xu [Wed, 8 Nov 2017 21:55:27 +0000 (15:55 -0600)]
MLK-16786: dma: mxs-dma: fix the unbalanced runtime pm counter

mxs-dma init function will call runtime pm init, the redundant
pm_runtime_force_resume will mess up the counter. Also remove some
unnecessary code.

 BuildInfo:
  - SCFW 66189d08, IMX-MKIMAGE ea027c4b, ATF
  - U-Boot 2017.03-imx_4.9.51_8qm_beta1_8qxp_alpha+g325ac1e

Signed-off-by: Han Xu <han.xu@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
7 years agoMLK-16785: spi: lpspi: enable runtime pm for lpspi
Han Xu [Wed, 8 Nov 2017 21:52:58 +0000 (15:52 -0600)]
MLK-16785: spi: lpspi: enable runtime pm for lpspi

enable the runtime pm for lpspi module

 BuildInfo:
  - SCFW 66189d08, IMX-MKIMAGE ea027c4b, ATF
  - U-Boot 2017.03-imx_4.9.51_8qm_beta1_8qxp_alpha+g325ac1e

Signed-off-by: Han Xu <han.xu@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
7 years agoMLK-16738: ASoC: fsl: amix: remove support for 64k and 96k rates
Viorel Suman [Wed, 8 Nov 2017 09:22:29 +0000 (11:22 +0200)]
MLK-16738: ASoC: fsl: amix: remove support for 64k and 96k rates

Remove support for 64k and 96k rates due to SAI MCLK freq limitations.

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

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

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

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

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

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

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

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

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

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-16713 i2c: imx-lpi2c: add runtime pm support
Fugang Duan [Fri, 27 Oct 2017 02:12:42 +0000 (10:12 +0800)]
MLK-16713 i2c: imx-lpi2c: add runtime pm support

- Add runtime pm support to dynamicly manage the ipg and per clocks.
- Put the suspend to suspend_noirq.
- Call .pm_runtime_force_suspend() to force runtime pm suspended
  in .suspend_noirq().

BuildInfo:
  - SCFW 88456c73, IMX-MKIMAGE 06bc2767, ATF a438801
  - U-Boot 2017.03-imx_v2017.03_4.9.51_imx8_beta1+g7953d47

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-16782 net: fec: double check the mii interrupt status
Fugang Duan [Wed, 8 Nov 2017 06:11:12 +0000 (14:11 +0800)]
MLK-16782 net: fec: double check the mii interrupt status

Double check the mii interrupt status during mdio bus accessing
to avoid interrupt lost in timeout case.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-16781 net: fec: add eee mode tx lpi support
Fugang Duan [Thu, 2 Nov 2017 10:20:16 +0000 (18:20 +0800)]
MLK-16781 net: fec: add eee mode tx lpi support

The i.MX8MQ ENET version support IEEE802.3az eee mode, add
eee mode tx lpi enable to support ethtool interface.

usage:
1. set sleep and wake timer to 5ms:
ethtool --set-eee eth0 eee on tx-lpi on tx-timer 5000
2. check the eee mode:
~# ethtool --show-eee eth0
EEE Settings for eth0:
        EEE status: enabled - active
        Tx LPI: 5000 (us)
        Supported EEE link modes:  100baseT/Full
                                   1000baseT/Full
        Advertised EEE link modes:  100baseT/Full
                                    1000baseT/Full
        Link partner advertised EEE link modes:  100baseT/Full

Note: For realtime case and IEEE1588 ptp case, it should disable
EEE mode.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-16779 net: fec: enable busfreq for arm64 platform
Fugang Duan [Wed, 1 Nov 2017 04:34:41 +0000 (12:34 +0800)]
MLK-16779 net: fec: enable busfreq for arm64 platform

Enable busfreq for arm64 platform.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-16783 arm64: imx8qm-mek: add mlb support
Gao Pan [Tue, 7 Nov 2017 08:25:03 +0000 (16:25 +0800)]
MLK-16783 arm64: imx8qm-mek: add mlb support

add mlb support for imx8qm mek board

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
7 years agoMLK-16742-4: ASoC: imx-cs42888: fix DAPM routes
Viorel Suman [Tue, 7 Nov 2017 13:39:49 +0000 (15:39 +0200)]
MLK-16742-4: ASoC: imx-cs42888: fix DAPM routes

ASRC DAPM routes not needed when ASRC node is not specified.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-16693-2: mipi_csi: fix null video name setting
Guoniu.Zhou [Thu, 2 Nov 2017 07:01:54 +0000 (15:01 +0800)]
MLK-16693-2: mipi_csi: fix null video name setting

Setting video device name before memset operation
lead to null value of vdev->name

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

7 years agoMLK-16693-1: mipi_csi: Add enum framesize ioctl
Guoniu.Zhou [Thu, 2 Nov 2017 03:18:08 +0000 (11:18 +0800)]
MLK-16693-1: mipi_csi: Add enum framesize ioctl

Enum framesize include VIDIOC_ENUM_FRAMESIZES and
VIDIOC_ENUM_FRAMEINTERVALS cmd.

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

7 years agoMLK-16692-2: mipi_csi: Add S_PARM and G_PARM ioctl
Guoniu.Zhou [Thu, 2 Nov 2017 01:33:14 +0000 (09:33 +0800)]
MLK-16692-2: mipi_csi: Add S_PARM and G_PARM ioctl

Add VIDIOC_S_PARM and VIDIOC_G_PARM ioctl to support
to get and set camera parameters

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

7 years agoMLK-16692-1: csi: Identify which camera really connect to interface
Guoniu.Zhou [Tue, 31 Oct 2017 01:57:25 +0000 (09:57 +0800)]
MLK-16692-1: csi: Identify which camera really connect to interface

There maybe 0-4 cameras can connected to interface at
the same time. Add this ioctl to identify which camera
really connect to the interface.

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

7 years agoMLK-16682 usb: cdns3: gadget: delete useless is_iso_flag
Peter Chen [Mon, 23 Oct 2017 08:53:52 +0000 (16:53 +0800)]
MLK-16682 usb: cdns3: gadget: delete useless is_iso_flag

Since the runtime endpoint type is decided by device descriptors,
we delete useless is_iso_flag which is decided during the initialization.
It also fixed a bug the max_packet_size is determined wrongly for
high/full speed connection.

BuildInfo:
- SCFW 8dcff26, IMX-MKIMAGE ea027c4b, ATF
- U-Boot 2017.03-imx_v2017.03_4.9.51_imx8_beta1+g6dc7b0f

Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16727-4 ARM64: dts: fsl-imx8qxp-mek: change PD role as source only
Peter Chen [Tue, 7 Nov 2017 07:21:42 +0000 (15:21 +0800)]
MLK-16727-4 ARM64: dts: fsl-imx8qxp-mek: change PD role as source only

At MEK hardware design, the PD is source only, so the software must
configure PTN5110 as source only, otherwise, there is an inrush higher
voltage at vbus when connects to PC due to EN_SRC is enabled at DRP
mode, and causes some PC are shut down.

BuildInfo:
- SCFW 8dcff26, IMX-MKIMAGE ea027c4b, ATF
- U-Boot 2017.03-imx_v2017.03_4.9.51_imx8_beta1+g6dc7b0f

Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16727-3 usb: cdns3: force vbus status accordingly
Peter Chen [Tue, 31 Oct 2017 02:50:14 +0000 (10:50 +0800)]
MLK-16727-3 usb: cdns3: force vbus status accordingly

Since the controller doesn't know vbus status well due to IC limitation,
it needs to force vbus status for controller when the connection and
disconnection occur.

BuildInfo:
- SCFW 8dcff26, IMX-MKIMAGE ea027c4b, ATF
- U-Boot 2017.03-imx_v2017.03_4.9.51_imx8_beta1+g6dc7b0f

Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16727-2 Revert "MLK-16285-5 extcon: extcon-ptn5110: only sends EXTCON_USB_HOST...
Peter Chen [Mon, 30 Oct 2017 06:07:16 +0000 (14:07 +0800)]
MLK-16727-2 Revert "MLK-16285-5 extcon: extcon-ptn5110: only sends EXTCON_USB_HOST event"

This reverts 'commit cca4c561e412 ("MLK-16285-5 extcon: extcon-ptn5110:
only sends EXTCON_USB_HOST event")'

Some controllers (eg, Cadence USB3) need to know vbus disconnection
status for its internal state machine, so we need Type-C chip to
send this event as well.

BuildInfo:
- SCFW 8dcff26, IMX-MKIMAGE ea027c4b, ATF
- U-Boot 2017.03-imx_v2017.03_4.9.51_imx8_beta1+g6dc7b0f

Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16727-1 usb: cdns3: needs to handle disconnection at device mode
Peter Chen [Mon, 30 Oct 2017 05:43:52 +0000 (13:43 +0800)]
MLK-16727-1 usb: cdns3: needs to handle disconnection at device mode

The IP has some issues to detect vbus status correctly, we have to
force vbus status accordingly, so we need a status to indicate
vbus disconnection, and add some code to let control know vbus
removal, in that case, the controller's state mechine can be correct.

In this commit, we increase one role 'CDNS3_ROLE_END' to for
this status.

BuildInfo:
- SCFW 8dcff26, IMX-MKIMAGE ea027c4b, ATF
- U-Boot 2017.03-imx_v2017.03_4.9.51_imx8_beta1+g6dc7b0f

Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
7 years agoMLK-16772 gpu: imx: dpu: cf: Add safety_stream_cf_color module parameter support
Liu Ying [Mon, 6 Nov 2017 02:35:46 +0000 (10:35 +0800)]
MLK-16772 gpu: imx: dpu: cf: Add safety_stream_cf_color module parameter support

This patch adds safety_stream_cf_color module parameter support so that
users may set the default color generated by the constframe units(4 and 5)
of safety streams.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-16771 drm/imx: dpu: kms: Change to use a better KMS
Liu Ying [Mon, 23 Oct 2017 04:57:55 +0000 (12:57 +0800)]
MLK-16771 drm/imx: dpu: kms: Change to use a better KMS

This patch improves DPU KMS by the following means:
1) Wait for shadow registers being loaded in ->atomic_flush()
   to make sure there is no intermediate register values being
   loaded when doing atomic update.
2) Improve CRTC enablement/disablement sequences/configurations
   according to spec.
3) Remove the FGDM__PRIM framegen display mode from ->mode_set_nofb()
   and always use FGDM__SEC_ON_TOP mode so that we may prepare
   for introducing a safety stream solution in the future.
4) Better vblank on/off and vblank event handling, though there
   should be no essential improvements.
5) Some fixes for adding correct CRTC/plane/connector states
   in the full atomic state in dpu_drm_atomic_check().
6) Remove CRTC and plane states from the full atomic state where
   possible to improve atomic update performance.
7) Introduce a plane group mutex to protect plane source mask and
   vproc source mask.  This is a little bit superfluous due to
   the protection provided by the atomic helper, but just one of
   the DPU core itself.

The changes are in a bundle to avoid any unexpected drawbacks
of introducing them at a smaller granularity.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-16755 video: fbdev: mipi_dsi_northwest: fix a linker error when do 64bit div
Fancy Fang [Thu, 2 Nov 2017 05:43:39 +0000 (13:43 +0800)]
MLK-16755 video: fbdev: mipi_dsi_northwest: fix a linker error when do 64bit div

Compiling the 64-bit integer direct division statement by
32-bit GCC compiler may trigger below linker error:

"
drivers/built-in.o: In function `mipi_dsi_enable':
core.c:(.text+0x2ad48): undefined reference to `__aeabi_uldivmod'
core.c:(.text+0x2ad60): undefined reference to `__aeabi_uldivmod'
core.c:(.text+0x2ada4): undefined reference to `__aeabi_uldivmod'
core.c:(.text+0x2ade8): undefined reference to `__aeabi_uldivmod'
core.c:(.text+0x2aed4): undefined reference to `__aeabi_uldivmod'
drivers/built-in.o:core.c:(.text+0x2af00): more undefined references to
`__aeabi_uldivmod' follow
make: *** [vmlinux] Error 1
"

In this case, use 'do_div()' can solve this linker error.
This patch changes all the 'DIV_ROUND_CLOSEST()' to its
64-bit version 'DIV_ROUND_CLOSEST_ULL()' and also uses
'do_div()' to replace all the direct division operations
if required.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-16769-5: mtd: gpmi-nand runtime pm code change
Han Xu [Tue, 7 Nov 2017 22:25:17 +0000 (16:25 -0600)]
MLK-16769-5: mtd: gpmi-nand runtime pm code change

acquire/release dma in runtime pm resume/suspend to proper get/put dma
resources.

 BuildInfo:
  - SCFW 60e110f9, IMX-MKIMAGE e131af10, ATF
  - U-Boot 2017.03-imx_4.9.51_8qm_beta1_8qxp_alpha+gfcc9bdc

Signed-off-by: Han Xu <han.xu@nxp.com>