linux.git
6 years agoMLK-21080-07 nvmem: imx-scu-ocotp: Depend on HAVE_IMX_SC
Leonard Crestez [Mon, 11 Mar 2019 18:00:21 +0000 (20:00 +0200)]
MLK-21080-07 nvmem: imx-scu-ocotp: Depend on HAVE_IMX_SC

Upstream rejected ARCH_MXC_ARM64 in favor of defining ARCH_MXC for
arm64 so the current condition is never enabled.

Make it depend on HAVE_IMX_SC instead because it depends on SCFW API.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21080-06 thermal: imx_sc: Depend on HAVE_IMX_SC
Leonard Crestez [Mon, 11 Mar 2019 17:57:21 +0000 (19:57 +0200)]
MLK-21080-06 thermal: imx_sc: Depend on HAVE_IMX_SC

Upstream rejected ARCH_MXC_ARM64 in favor of defining ARCH_MXC for
arm64 so the current condition is never enabled.

Make it depend on HAVE_IMX_SC instead because it depends on SCFW API.

Fixes: 166ac38501ae ("MLK-14972-02 driver: thermal: Add i.MX8QM/QXP thermal support")

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21080-05 gpio: Kconfig: Make GPIO_MXC_PAD_WAKEUP depend on HAVE_IMX_SC
Leonard Crestez [Mon, 11 Mar 2019 17:22:55 +0000 (19:22 +0200)]
MLK-21080-05 gpio: Kconfig: Make GPIO_MXC_PAD_WAKEUP depend on HAVE_IMX_SC

Upstream rejected ARCH_MXC_ARM64 in favor of defining ARCH_MXC for
arm64 so the current condition is never enabled.

Make it depend on HAVE_IMX_SC instead because it depends on SCFW API.

Fixes: e972661a45c5 ("MLK-19305-2 gpio: mxc: add gpio PAD wakeup support")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21051 dt-bindings: pinctrl: Sync SCFW header to commit ef4a5057
Leonard Crestez [Fri, 8 Mar 2019 13:07:33 +0000 (15:07 +0200)]
MLK-21051 dt-bindings: pinctrl: Sync SCFW header to commit ef4a5057

Replace manually added pads with defines from SCFW export package.

Fixes: 197e0b941b37 ("MLK-21052-23 dt-bindings: pads-imx8qm: Add pads missing from SCFW API")
Fixes: 14f4ea8d1a1c ("MLK-21052-14 dt-bindings: pads-imx8qxp: Add pads missing from SCFW API")

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 21dc9c9834783b13999fcdd1d9dbe50c4ae730ae)

6 years agoMLK-20958-2 imx8: Replace SC_R_LAST with SC_R_NONE in DTB
Leonard Crestez [Wed, 27 Feb 2019 19:50:44 +0000 (21:50 +0200)]
MLK-20958-2 imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit f573dbd5ce119740ad30b663e3599cb75e6f67ed)

6 years agoMLK-20099-2 PCI: imx: use ext osc as pcie refclk on 8mm
Richard Zhu [Fri, 8 Mar 2019 07:26:47 +0000 (15:26 +0800)]
MLK-20099-2 PCI: imx: use ext osc as pcie refclk on 8mm

Use the external osc as the pcie refclk on 8mm evk board.
- Do not turn off the over ride of rc's clkreq#, when
L1SS is not enabled.
NOTE: L1SS_EN would be set at both RC and EP by
pcie_config_aspm_link when the L1SS is supported
by the link.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
6 years agoMMIOT-152 Update Secure Data Path physical address
Olivier Masse [Tue, 22 Jan 2019 16:19:14 +0000 (17:19 +0100)]
MMIOT-152 Update Secure Data Path physical address

Change-Id: I5837a5d54e2e27503b532b811d477f1d142b2b99
Signed-off-by: Olivier Masse <olivier.masse@nxp.com>
(cherry picked from commit 3ba5908a9e5efa3b5698da3a5c57572e2155f621)

6 years agoMMIOT-152: imx8mm RDC configuration update
Olivier Masse [Thu, 27 Sep 2018 13:11:12 +0000 (15:11 +0200)]
MMIOT-152: imx8mm RDC configuration update

Change-Id: I8fb3b2515b6fa02cbb7c6849fd0661e4f3f66ee7
Signed-off-by: Olivier Masse <olivier.masse@nxp.com>
(cherry picked from commit 4b862c5dadd165310e1bdae7894b8f8f6f7b4f7e)

6 years agoMMIOT-152: imx8mm: update SDP physical memory space
Olivier Masse [Wed, 26 Sep 2018 16:09:17 +0000 (18:09 +0200)]
MMIOT-152: imx8mm: update SDP physical memory space

Change-Id: I410909ce69f79846c8956c185570af2e933c829a
Signed-off-by: Olivier Masse <olivier.masse@nxp.com>
(cherry picked from commit b46e3b88cb3c2353201463c46cb634babc01f0ab)

6 years agoMMIOT-152 imx8mm drm device tree
Olivier Masse [Tue, 25 Sep 2018 13:58:07 +0000 (15:58 +0200)]
MMIOT-152 imx8mm drm device tree

Change-Id: Ic43bc3086562edc513f125605d416fe928c12135
Signed-off-by: Olivier Masse <olivier.masse@nxp.com>
(cherry picked from commit 0879ae0289bb034ecf3d990b2e35024ad5464645)

6 years agoMLK-20998 ARM: dts: imx7ulp: move testing features to EVKB.
Shenwei Wang [Thu, 28 Feb 2019 15:08:57 +0000 (09:08 -0600)]
MLK-20998 ARM: dts: imx7ulp: move testing features to EVKB.

Move the emmc/lpuart/sdcard/sensor/spi-slave testing features
from EVK to EVKB board.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
(cherry picked from commit d8a1f7ccec0154bea139ae58dde9e1b181e0b9d8)

6 years agoMLK-20416-4 ARM: dts: imx7ulp-evkb: add dtb for RK055IQH042 panel support
Fancy Fang [Tue, 20 Nov 2018 08:11:22 +0000 (16:11 +0800)]
MLK-20416-4 ARM: dts: imx7ulp-evkb: add dtb for RK055IQH042 panel support

On IMX7ULP-EVKB board, add a new dtb 'imx7ulp-evk-rm68191
-qhd.dts' to enable the 'RK055IQH042' MIPI panel display
on this platform.

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

6 years agoMLK-20416-3 ARM: dts: imx7ulp-evkb: add dtb for RK055AHD042 panel support
Fancy Fang [Tue, 20 Nov 2018 07:45:05 +0000 (15:45 +0800)]
MLK-20416-3 ARM: dts: imx7ulp-evkb: add dtb for RK055AHD042 panel support

On IMX7ULP-EVKB board, add a new dtb 'imx7ulp-evk-rm68200
-wxga.dts' to enable the 'RK055AHD042' MIPI panel display
on this platform.

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

6 years agoMLK-20397 dts: arm: imx7ulp: add SOMB and EVKB revA board support
Andy Duan [Fri, 16 Nov 2018 03:59:50 +0000 (11:59 +0800)]
MLK-20397 dts: arm: imx7ulp: add SOMB and EVKB revA board support

The main difference for EVKB(SOMB REVA + EVKB RevA) comparing with
EVK(SOM RevB2 + BB RevB1):
- SOMB REVA change: WIFI module Cypress 1DX replace with QCA 1PJ
- BB EVKB RevA change: MIPI connector

The EVKB board focus on default functions on board without rework,
WIFI/BT, and MIPI feature test. Currently, the patch don't consider
other functions with rework needed.

Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 84e25f0ec7ae0cbb216b05bfae7fde4cde56e8ee)

6 years agoMLK-20724: uapi: add RGBA to exend V4L2 standard format for android usage
Guoniu.Zhou [Mon, 14 Jan 2019 06:23:03 +0000 (14:23 +0800)]
MLK-20724: uapi: add RGBA to exend V4L2 standard format for android usage

Android has RGBA format output but V4L2 framework do not have this format
.In order to support this in our mem2mem driver, we need to extend V4L2
format.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 24c970a517e1e4a860967255b0cca62c6e2f3c2e)
Only add uapi part to help yocto build
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoASoC: fsl: refine the asrc driver for imx8qm
Viorel Suman [Sun, 30 Apr 2017 15:11:00 +0000 (18:11 +0300)]
ASoC: fsl: refine the asrc driver for imx8qm

The clock source of ASRC in imx8qm is changed.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit b791083c0c38b324dc0544532c1e2398a5fd0e66)
Port early because uapi diffs could break yocto
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21085 uapi: Add missing imx8 headers
Srikanth Krishnakar [Sun, 3 Mar 2019 11:39:46 +0000 (17:09 +0530)]
MLK-21085 uapi: Add missing imx8 headers

Copy missing uapi headers from rel_imx_4.14.98_2.0.0_ga_rc1 to help
userspace build.

VPU code will be ported later.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoARM: dts: imx6ull: Add imx6ull-tempmon property
Vipul Kumar [Wed, 6 Mar 2019 12:51:08 +0000 (18:21 +0530)]
ARM: dts: imx6ull: Add imx6ull-tempmon property

As per 'commit 2067b757e972 ("ARM: dts: imx6ul: Add imx6ul-tempmon")'
added tempmon property.

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
(cherry picked from commit 56e54055c129fcbf8e4971e73e583c3f14e95da0)

6 years agoMLK-21084 arm64: dts: Copy all imx8 dts
Leonard Crestez [Thu, 7 Mar 2019 14:22:26 +0000 (16:22 +0200)]
MLK-21084 arm64: dts: Copy all imx8 dts

Copy all from rel_imx_4.14.98_2.0.0_ga_rc1 in order to help external
build systems.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21060 i2c: lpi2c: Fix clk fetch
Leonard Crestez [Wed, 6 Mar 2019 13:08:16 +0000 (15:08 +0200)]
MLK-21060 i2c: lpi2c: Fix clk fetch

During porting commit ede264acf031 ("MLK-14982-1 imx8: lpi2c: add ipg
clk for lpi2c driver") which replaced the single clk
with clk_ipg and clk_per was skipped.

Part of the code was later added in commit 96dbdd8c3d0b ("MLK-16713 i2c:
imx-lpi2c: add runtime pm support") except the "clk" field was kept and
clk_get calls were not updated.

Fix imx7ulp boot by fetching both clocks.

Fixes: 96dbdd8c3d0b ("MLK-16713 i2c: imx-lpi2c: add runtime pm support")

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21059-5 arm64: defconfig: Enable imx8mm
Leonard Crestez [Tue, 5 Mar 2019 22:57:11 +0000 (00:57 +0200)]
MLK-21059-5 arm64: defconfig: Enable imx8mm

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21059-4 arm64: Kconfig: Add imx8mm support
Leonard Crestez [Tue, 5 Mar 2019 22:35:25 +0000 (00:35 +0200)]
MLK-21059-4 arm64: Kconfig: Add imx8mm support

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21059-3 arm64: dts: Add imx8mm support
Leonard Crestez [Tue, 5 Mar 2019 22:35:41 +0000 (00:35 +0200)]
MLK-21059-3 arm64: dts: Add imx8mm support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21059-2 pinctrl: Add imx8qmm support
Leonard Crestez [Tue, 5 Mar 2019 22:39:29 +0000 (00:39 +0200)]
MLK-21059-2 pinctrl: Add imx8qmm support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21059-1 clk: Add imx8mm support
Leonard Crestez [Tue, 5 Mar 2019 22:40:56 +0000 (00:40 +0200)]
MLK-21059-1 clk: Add imx8mm support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21054-6 arm64: defconfig: Enable imx8mq
Leonard Crestez [Mon, 4 Mar 2019 21:26:35 +0000 (23:26 +0200)]
MLK-21054-6 arm64: defconfig: Enable imx8mq

Also disable fbdev dcss (does not build and is not needed) and enable
SERIAL_IMX_CONSOLE for debugging on 8m.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21054-5 arm64: Kconfig: Add imx8mq support
Leonard Crestez [Mon, 4 Mar 2019 21:41:47 +0000 (23:41 +0200)]
MLK-21054-5 arm64: Kconfig: Add imx8mq support

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21054-4 arm64: dts: Add imx8mq support
Leonard Crestez [Mon, 4 Mar 2019 21:54:59 +0000 (23:54 +0200)]
MLK-21054-4 arm64: dts: Add imx8mq support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21054-3 pinctrl: Enable imx8mq support
Leonard Crestez [Mon, 4 Mar 2019 22:00:36 +0000 (00:00 +0200)]
MLK-21054-3 pinctrl: Enable imx8mq support

Copy pin header from rel_imx_4.14.98_2.0.0_ga_rc1 and enable
compilation. The C code of the driver was already accepted in v4.19 in
an acceptable form so we use that.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21054-2 clk: Add imx8mq support
Leonard Crestez [Mon, 4 Mar 2019 21:45:47 +0000 (23:45 +0200)]
MLK-21054-2 clk: Add imx8mq support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21054-1 soc: imx: Add gpc-psci
Leonard Crestez [Tue, 5 Mar 2019 13:10:20 +0000 (15:10 +0200)]
MLK-21054-1 soc: imx: Add gpc-psci

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21057 serial: imx: Restore proper init of shadow registers
Leonard Crestez [Tue, 5 Mar 2019 17:24:11 +0000 (19:24 +0200)]
MLK-21057 serial: imx: Restore proper init of shadow registers

Upstream commit 3a0ab62f43de ("serial: imx: implement shadow registers
for UCRx and UFCR") made the imx_uart_readl/writel functions use a
"cache" to avoid reads/writers to hardware for some registers.

Those values need to be initialized once at probe time using real reads
from hardware; using imx_uart_readl for this is obviously non-functional

Fixes: 372312842fe7 ("tty: serial: imx: use imx_uart_writel() and imx_uart_readl()")

This is required for imx8mq to boot and likely fixes other things.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Andy Duan <fugang.duan@nxp.com>
6 years agoMLK-17597-1: i.MX8MQ workaround affecting other SoCs
Nitin Garg [Thu, 15 Feb 2018 21:30:51 +0000 (15:30 -0600)]
MLK-17597-1: i.MX8MQ workaround affecting other SoCs

Fix iMX8MQ workaround to be specific to that
machine.

Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
(cherry picked from commit 5fc3246190546c455f47fa3094ee717bd84a167c)

6 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>
(cherry picked from commit d3244056f749c0ce590a671e215eb39fff336fc2)

6 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>
(cherry picked from commit 0bd34ee2e4dd4e728d688b6bee1ef2e6e3498b41)

6 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>
(cherry picked from commit f69eab1d013361bc7e520541a361752dfc644670)

6 years agoMLK-21052-28 arm64: defconfig: Enable imx8qm support
Leonard Crestez [Mon, 4 Mar 2019 18:25:52 +0000 (20:25 +0200)]
MLK-21052-28 arm64: defconfig: Enable imx8qm support

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-16005-2 arm64: tlb: add the SW workaround for i.MX8QM TKT340553
Jason Liu [Thu, 15 Jun 2017 22:55:33 +0000 (06:55 +0800)]
MLK-16005-2 arm64: tlb: add the SW workaround for i.MX8QM TKT340553

on i.MX8QM TO1.0, there is an issue: the bus width between A53-CCI-A72
is limited to 36bits.TLB maintenance through DVM messages over AR channel,
some bits will be forced(truncated) to zero as the followings:

ASID[15:12] is forced to 0
VA[48:45] is forced to 0
VA[44:41] is forced to 0
VA[39:36] is forced to 0

This issue will result in the TLB aintenance across the clusters not working
as expected due to some VA and ASID bits get truncated and forced to be zero.

The SW workaround is: use the vmalle1is if VA larger than 36bits or
ASID[15:12] is not zero, otherwise, we use original TLB maintenance path.

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
(cherry picked from commit c9eb1788558f07dfda0c15b684f79aedb4bfa623)
This is still required for current imx8qm B0 chips.
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-27 soc: imx: Add imx8 soc driver
Leonard Crestez [Mon, 4 Mar 2019 18:52:11 +0000 (20:52 +0200)]
MLK-21052-27 soc: imx: Add imx8 soc driver

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-26 arm64: Kconfig: Add ARCH_FSL_IMX8QM
Leonard Crestez [Mon, 4 Mar 2019 18:22:32 +0000 (20:22 +0200)]
MLK-21052-26 arm64: Kconfig: Add ARCH_FSL_IMX8QM

Kconfig snippets based on rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-25 arm64: dts: Add imx8qm support
Leonard Crestez [Mon, 4 Mar 2019 18:11:10 +0000 (20:11 +0200)]
MLK-21052-25 arm64: dts: Add imx8qm support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-24 pinctrl: Add imx8qm support
Leonard Crestez [Mon, 4 Mar 2019 18:21:33 +0000 (20:21 +0200)]
MLK-21052-24 pinctrl: Add imx8qm support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-23 dt-bindings: pads-imx8qm: Add pads missing from SCFW API
Leonard Crestez [Mon, 4 Mar 2019 18:09:29 +0000 (20:09 +0200)]
MLK-21052-23 dt-bindings: pads-imx8qm: Add pads missing from SCFW API

These are used in dts but missing in SCFW headers so copy definitions
from imx_4.14.y

See MLK-21051

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-22 clk: Add imx8qm support
Leonard Crestez [Mon, 4 Mar 2019 18:12:25 +0000 (20:12 +0200)]
MLK-21052-22 clk: Add imx8qm support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-21 arm64: defconfig: Enable ARCH_FSL_IMX8QXP
Leonard Crestez [Mon, 4 Mar 2019 21:06:08 +0000 (23:06 +0200)]
MLK-21052-21 arm64: defconfig: Enable ARCH_FSL_IMX8QXP

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-20 arm64: Kconfig: Add imx8qxp support
Leonard Crestez [Fri, 1 Mar 2019 16:48:47 +0000 (18:48 +0200)]
MLK-21052-20 arm64: Kconfig: Add imx8qxp support

Kconfig snippets based on rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-19 arm64: dts: Add imx8x support
Leonard Crestez [Fri, 1 Mar 2019 14:35:01 +0000 (16:35 +0200)]
MLK-21052-19 arm64: dts: Add imx8x support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-18 pinctrl: Add imx8qxp support
Leonard Crestez [Mon, 4 Mar 2019 08:50:24 +0000 (10:50 +0200)]
MLK-21052-18 pinctrl: Add imx8qxp support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1 and add minor build fix in
pinctrl-scu.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-17 clk: imx8qxp: Add imx8qxp support
Leonard Crestez [Fri, 1 Mar 2019 17:31:31 +0000 (19:31 +0200)]
MLK-21052-17 clk: imx8qxp: Add imx8qxp support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-16 soc: imx8: Add SC-based pm domain support
Leonard Crestez [Fri, 1 Mar 2019 20:20:52 +0000 (22:20 +0200)]
MLK-21052-16 soc: imx8: Add SC-based pm domain support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-15 dt-bindings: soc: Add imx8 PD support
Leonard Crestez [Fri, 1 Mar 2019 17:47:26 +0000 (19:47 +0200)]
MLK-21052-15 dt-bindings: soc: Add imx8 PD support

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-14 dt-bindings: pads-imx8qxp: Add pads missing from SCFW API
Leonard Crestez [Fri, 1 Mar 2019 17:45:00 +0000 (19:45 +0200)]
MLK-21052-14 dt-bindings: pads-imx8qxp: Add pads missing from SCFW API

These are used in dts but missing in SCFW headers so copy definitions
from imx_4.14.y

See MLK-21051

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-13 soc: imx: Add SCFW support
Leonard Crestez [Fri, 1 Mar 2019 19:05:22 +0000 (21:05 +0200)]
MLK-21052-13 soc: imx: Add SCFW support

This is enabled via CONFIG_HAVE_IMX_SC

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-12 soc: imx: Redefine sc_rsrc_t to uint32_t from uint16_t
Leonard Crestez [Tue, 5 Mar 2019 08:06:57 +0000 (10:06 +0200)]
MLK-21052-12 soc: imx: Redefine sc_rsrc_t to uint32_t from uint16_t

This was changed at some point by SC firmware but imx linux releases
didn't pick up the change and some drivers don't even compile with a
16-bit sc_rsrc_t.

Fix by overwriting SC API with imx_4.14 definition.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-11 soc: imx: Add SCFW 1.4 export package
Leonard Crestez [Fri, 1 Mar 2019 15:22:49 +0000 (17:22 +0200)]
MLK-21052-11 soc: imx: Add SCFW 1.4 export package

Uses same layout as imx_4.14.y

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-10 soc: imx: Add fsl_sip headers
Leonard Crestez [Fri, 1 Mar 2019 20:46:49 +0000 (22:46 +0200)]
MLK-21052-10 soc: imx: Add fsl_sip headers

This file contains many defines for SIP calls to imx ATF.

Copy from rel_imx_4.14.98_2.0.0_ga_rc1

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-09 soc: imx: Fix building without HAVE_IMX_SRC
Leonard Crestez [Fri, 1 Mar 2019 19:00:06 +0000 (21:00 +0200)]
MLK-21052-09 soc: imx: Fix building without HAVE_IMX_SRC

If support for imx_src_is_m4_enabled is not compiled then just return
the default value "false".

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-08 clk: imx: Add CLK_SET_PARENT_NOCACHE
Ranjani Vaidyanathan [Wed, 10 Jan 2018 17:51:26 +0000 (11:51 -0600)]
MLK-21052-08 clk: imx: Add CLK_SET_PARENT_NOCACHE

Implement a CLK_SET_PARENT_NOCACHE flag in clk core for imx8 clk
implementation where the parent needs to be restore after PM domain is
up.

Reviewed-by: Anson Huang <anson.huang@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
(cherry picked from commit 87e997822c050fc7dc027a863c92f1f0b4816515)
[Leonard: split clk core part]
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-07 net: fec: Fix fec_devtype[IMX8QM] being imx6ul-fec
Leonard Crestez [Mon, 4 Mar 2019 13:03:43 +0000 (15:03 +0200)]
MLK-21052-07 net: fec: Fix fec_devtype[IMX8QM] being imx6ul-fec

This was incorrectly added to the fec_devtype array only by commit
088c766a5c04 ("MLK-10724-6 net: fec: add i.mx6ul enet support")

The rest of 8qm support was later added by commit d1a46676c8b8
("MLK-16781 net: fec: add eee mode tx lpi support")

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-06 usb: dwc3: Fix build failure by restoring err0 label in dwc3_probe
Leonard Crestez [Wed, 27 Feb 2019 20:13:05 +0000 (22:13 +0200)]
MLK-21052-06 usb: dwc3: Fix build failure by restoring err0 label in dwc3_probe

This label was removed by upstream commit 44feb8e6ea2d ("usb: dwc3: use
local copy of resource to fix-up register offset") but we added a new
probe state which needs this error handling label again.

Fixes: fc0d4039c7bf ("MLK-18922-2 usb: dwc3: add OTG capabilities handling")

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-05 ath10k: Fix build failure by adding debug_mask arg to ath10k_dbg
Leonard Crestez [Wed, 27 Feb 2019 20:03:03 +0000 (22:03 +0200)]
MLK-21052-05 ath10k: Fix build failure by adding debug_mask arg to ath10k_dbg

Changing ath10k_err to ath10k_dbg requires an additional debug_mask
argument.

Fixes: d239e779c497 ("MLK-17039 qca6174: clear error message during wifi bootup")

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-04 net: phy: at803x: Fix build failure by removing gpiod_reset again
Leonard Crestez [Wed, 27 Feb 2019 19:35:38 +0000 (21:35 +0200)]
MLK-21052-04 net: phy: at803x: Fix build failure by removing gpiod_reset again

Upstream removed this in commit bafbdd527d56 ("phylib: Add device reset
GPIO support") but it was added by mistake while backporting in a way
that breaks arm64 build.

Fixes: 0c27b23fd1b1 ("MLK-15309-01 net: phy: at803x: add EEE mode, 1.8V IO, led_act blinding workaround support")

This phy driver is used on imx8 mek boards.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-02 arm64: defconfig: Import imx_4.14.y defconfig
Leonard Crestez [Mon, 4 Mar 2019 20:35:17 +0000 (22:35 +0200)]
MLK-21052-02 arm64: defconfig: Import imx_4.14.y defconfig

Copy from rel_imx_4.14.98_2.0.0_ga_rc1
Cycle through savedefconfig
Disable various drivers which don't compile
Enable ARCH_MXC and FEC

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21052-01 arm64: add basic Kconfig symbols for i.MX8
Lucas Stach [Sun, 9 Dec 2018 14:26:06 +0000 (14:26 +0000)]
MLK-21052-01 arm64: add basic Kconfig symbols for i.MX8

Add basic Kconfig symbols to make the MXC architecture available
in the ARM64 world.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
(cherry picked from commit 930507c1830498e00ede089890f188de4a108cc7)
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoclk-imx6sl.c: remove duplicate definition of CCDR
Srikanth Krishnakar [Sun, 3 Mar 2019 11:39:46 +0000 (17:09 +0530)]
clk-imx6sl.c: remove duplicate definition of CCDR

This was introduced in upstream stable v4.19.21:
CommitID: ea225de3bd6656a34f76723eb61b32cff6d54021

drivers/clk/imx/clk-imx6sl.c:23:0: warning: "CCDR" redefined
 #define CCDR   0x04

drivers/clk/imx/clk-imx6sl.c:20:0: note: this is the location of the previous definition
 #define CCDR    0x4

Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
6 years agoARM: dts: imx6sll: add gpio clocks
Anson Huang [Fri, 22 Jun 2018 06:32:34 +0000 (14:32 +0800)]
ARM: dts: imx6sll: add gpio clocks

i.MX6SLL has GPIO clock gates in CCM CCGR, add
clock property for GPIO driver to make sure all
GPIO banks work as expected.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoARM: dts: imx6sll: add gpio-ranges property
Anson Huang [Fri, 20 Jul 2018 10:06:57 +0000 (18:06 +0800)]
ARM: dts: imx6sll: add gpio-ranges property

Add "gpio-ranges" property to establish connections between GPIOs
and PINs on i.MX6SLL pinctrl driver, for details, please refer to
Documentation/devicetree/bindings/gpio/gpio.txt of "gpio-ranges"
property.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoRevert "MLK-11495-03 ARM: imx: fix the ARM/IPG ratio when busfreq enabled"
Arulpandiyan Vadivel [Tue, 12 Feb 2019 05:16:01 +0000 (10:46 +0530)]
Revert "MLK-11495-03 ARM: imx: fix the ARM/IPG ratio when busfreq enabled"

This reverts commit 0919938115381fe9a19500af76da640fc18d5851.
Bus frequency fixes workaround changes are already in upstream.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoARM: dts: imx7d-sdb: Add missing lcdif display property
Vipul Kumar [Fri, 8 Feb 2019 06:03:17 +0000 (11:33 +0530)]
ARM: dts: imx7d-sdb: Add missing lcdif display property

As per 'commit 318e04958ffb ("MLK-18583: "Revert ARM: dts: imx7d-sdb: Add
DRM panel support"")', added missing lcdif display property.

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-14283: mxsfb: fix clock definitions for lcdif
Robert Chiras [Mon, 27 Feb 2017 13:19:50 +0000 (15:19 +0200)]
MLK-14283: mxsfb: fix clock definitions for lcdif

The mxsfb framebuffer driver uses three clock definitions, but only two
are defined in DTS for imx7s (also used by imx7d); because of this,
driver fails in probe. Since iMX7D uses only one clock, add the third clock
and make two of them dummy.
Also, add additional error messages for better identification of a
failing probe.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoARM: imx7s: Add CAAM page 0 definition in device tree
Vipul Kumar [Thu, 7 Feb 2019 12:03:29 +0000 (17:33 +0530)]
ARM: imx7s: Add CAAM page 0 definition in device tree

As per 'commit 543560697919 ("MLK-16959: crypto: caam Add CAAM
page 0 definition in device tree")', adding CAAM page 0
definition in imx7s.dtsi

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoARM: dts: imx7d: remove the duplicate entry of crypto
Vipul Kumar [Thu, 7 Feb 2019 11:59:21 +0000 (17:29 +0530)]
ARM: dts: imx7d: remove the duplicate entry of crypto

imx7s.dtsi already having crypto entry so removing duplicate
entry of crypto from imx7d.dtsi

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoARM: dts: imx7d-sdb: fix endpont node name for mipi_sensor
Vipul Kumar [Thu, 7 Feb 2019 11:54:48 +0000 (17:24 +0530)]
ARM: dts: imx7d-sdb: fix endpont node name for mipi_sensor

This fixes the below compilation warnings:

arch/arm/boot/dts/imx7d-sdb.dtb: Warning (graph_endpoint): /soc/aips-bus@30400000/mipi-csi@30750000/port/endpoint1: graph endpont node name should be 'endpoint'
arch/arm/boot/dts/imx7d-sdb.dtb: Warning (graph_endpoint): /soc/aips-bus@30400000/mipi-csi@30750000/port/endpoint2: graph endpont node name should be 'endpoint'

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoARM: dts: imx6dl: fix gpu node address
Vipul Kumar [Thu, 31 Jan 2019 11:49:17 +0000 (17:19 +0530)]
ARM: dts: imx6dl: fix gpu node address

This fixes the below mentioned boot time backtraces:

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.17-gf5efd42140de-dirty #1
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[<8010fc44>] (unwind_backtrace) from [<8010bc80>] (show_stack+0x10/0x14)
[<8010bc80>] (show_stack) from [<80a371fc>] (dump_stack+0x78/0x8c)
[<80a371fc>] (dump_stack) from [<8028b3fc>] (sysfs_warn_dup+0x58/0x64)
[<8028b3fc>] (sysfs_warn_dup) from [<8028b500>] (sysfs_create_dir_ns+0xb4/0xc8)
[<8028b500>] (sysfs_create_dir_ns) from [<80a3bfa0>] (kobject_add_internal+0x9c/0x2bc)
[<80a3bfa0>] (kobject_add_internal) from [<80a3c3b4>] (kobject_add+0x58/0xbc)
[<80a3c3b4>] (kobject_add) from [<80525244>] (device_add+0x100/0x604)
[<80525244>] (device_add) from [<807c98ac>] (of_platform_device_create_pdata+0x90/0xb8)
[<807c98ac>] (of_platform_device_create_pdata) from [<807c9ab4>] (of_platform_bus_create+0x198/0x22c)
[<807c9ab4>] (of_platform_bus_create) from [<807c9b00>] (of_platform_bus_create+0x1e4/0x22c)
[<807c9b00>] (of_platform_bus_create) from [<807c9c78>] (of_platform_populate+0x5c/0xac)
[<807c9c78>] (of_platform_populate) from [<80f0bde0>] (imx6q_init_machine+0x94/0x3c0)
[<80f0bde0>] (imx6q_init_machine) from [<80f038a8>] (customize_machine+0x20/0x30)
[<80f038a8>] (customize_machine) from [<801026b4>] (do_one_initcall+0x7c/0x1a8)
[<801026b4>] (do_one_initcall) from [<80f00e28>] (kernel_init_freeable+0x140/0x1d4)
[<80f00e28>] (kernel_init_freeable) from [<80a4a724>] (kernel_init+0x8/0x110)
[<80a4a724>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xd8073fb0 to 0xd8073ff8)
3fa0:                                     00000000 00000000 00000000 00000000
3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3fe0: 00000000 00000000 00000000 00000000 00000013 00000000

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoARM: dts: imx6sl.dtsi: fix gpu backtracing
Arulpandiyan Vadivel [Thu, 31 Jan 2019 12:24:40 +0000 (17:54 +0530)]
ARM: dts: imx6sl.dtsi: fix gpu backtracing

Fix below backtraces by adding unique name for each gpu nodes.

sysfs: cannot create duplicate filename '/bus/platform/devices/2200000.gpu'
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.17-03233-g8d8ad8d43f2c-dirty #3
Hardware name: Freescale i.MX6 SoloLite (Device Tree)
[<80112890>] (unwind_backtrace) from [<8010dc64>] (show_stack+0x10/0x14)
[<8010dc64>] (show_stack) from [<80b97fd4>] (dump_stack+0x88/0x9c)
[<80b97fd4>] (dump_stack) from [<802ecad4>] (sysfs_warn_dup+0x5c/0x68)
[<802ecad4>] (sysfs_warn_dup) from [<802ece60>] (sysfs_do_create_link_sd+0xc8/0xcc)
[<802ece60>] (sysfs_do_create_link_sd) from [<805d5db4>] (bus_add_device+0x78/0x130)
[<805d5db4>] (bus_add_device) from [<805d2a18>] (device_add+0x320/0x638)
[<805d2a18>] (device_add) from [<808b249c>] (of_platform_device_create_pdata+0x90/0xb8)
[<808b249c>] (of_platform_device_create_pdata) from [<808b2680>] (of_platform_bus_create+0x1b0/0x348)
[<808b2680>] (of_platform_bus_create) from [<808b26f0>] (of_platform_bus_create+0x220/0x348)
[<808b26f0>] (of_platform_bus_create) from [<808b29c4>] (of_platform_populate+0x80/0x108)
[<808b29c4>] (of_platform_populate) from [<8110c404>] (imx6sl_init_machine+0x30/0xd0)
[<8110c404>] (imx6sl_init_machine) from [<81103de8>] (customize_machine+0x20/0x30)
[<81103de8>] (customize_machine) from [<80102e9c>] (do_one_initcall+0x54/0x314)
[<80102e9c>] (do_one_initcall) from [<811011d8>] (kernel_init_freeable+0x360/0x3f0)
[<811011d8>] (kernel_init_freeable) from [<80bac9d8>] (kernel_init+0x8/0x114)
[<80bac9d8>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xa80b5fb0 to 0xa80b5ff8)

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoARM: dts: imx6sl: fix device tree structure for regulator nodes
Arulpandiyan Vadivel [Thu, 31 Jan 2019 12:20:12 +0000 (17:50 +0530)]
ARM: dts: imx6sl: fix device tree structure for regulator nodes

Fix regulator tree structure to avoid address-cell and size-cells conflicts.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agothermal: remove unused function imx_get_sensor_data
Arulpandiyan Vadivel [Wed, 30 Jan 2019 08:55:19 +0000 (14:25 +0530)]
thermal: remove unused function imx_get_sensor_data

Remove unused function imx_get_sensor_data() to fix compilation warnings.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agodrivers: pinctrl: Fix compilation warnings
Arulpandiyan Vadivel [Wed, 30 Jan 2019 05:04:50 +0000 (10:34 +0530)]
drivers: pinctrl: Fix compilation warnings

Fix compilation warnings by removing unused variables and adding missed
qualifiers.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoARM: dts: imx6sll: Fix compilation warnings
Arulpandiyan Vadivel [Tue, 29 Jan 2019 14:10:24 +0000 (19:40 +0530)]
ARM: dts: imx6sll: Fix compilation warnings

Fix below compilation warnings by adding address cells and size cells under
clock node.

Warning (reg_format): /clock-osc-24m:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
Warning (simple_bus_reg): Failed prerequisite 'reg_format'

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20216-4: video/fbdev/imx_dcss: remove useless function call
Laurentiu Palcu [Wed, 14 Nov 2018 12:55:55 +0000 (14:55 +0200)]
MLK-20216-4: video/fbdev/imx_dcss: remove useless function call

This fixes Coverity issue since the function does nothing. The function
only returns some values which are never used.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Fancy Fang <chen.fang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20216-3: video/fbdev/imx_dcss: remove unnecessary BUG_ONs
Laurentiu Palcu [Wed, 14 Nov 2018 12:50:43 +0000 (14:50 +0200)]
MLK-20216-3: video/fbdev/imx_dcss: remove unnecessary BUG_ONs

This fixes Coverity issue since num_pix_x and num_pix_y are unsigned and
the conditions are never true.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Fancy Fang <chen.fang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-3083 [#imx-662] fix kernel build error with kasan config
Xianzhong [Thu, 13 Jul 2017 02:28:14 +0000 (10:28 +0800)]
MGS-3083 [#imx-662] fix kernel build error with kasan config

hal/kernel/gc_hal_kernel_command.c: In function gckCOMMAND_Commit:
hal/kernel/gc_hal_kernel_command.c:2718:1:
error: the frame size of 2288 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

removed _commandBufferObject instrance, use kmalloc to avoid kasan error.

Date: Jul 13, 2017
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit d8d57e43a24bd02b375d7c6bd633ed236db19337)
(cherry picked from commit 484e3073adf47d27581482f268b01fe5fe219d18)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-13450-1 [#ccc] Switch layer memory allocation to virtual pool to improve performance.
Ivan.liu [Thu, 15 Nov 2018 05:58:54 +0000 (13:58 +0800)]
MA-13450-1 [#ccc] Switch layer memory allocation to virtual pool to improve performance.

Add DRM_VIV_GEM_VIRTUAL_POOL flags.
Switch to virtual pool when this flag is set.

Change-Id: I6e1e799cd0b4f81ed1ffbfdabe8f105325fa9644
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
(cherry picked from commit c4bd0fc803409c54d06e3554f4857922d6640925)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20450 Fix Linux NO SMP kernel - GPU
Cedric Neveux [Fri, 23 Nov 2018 10:24:08 +0000 (11:24 +0100)]
MLK-20450 Fix Linux NO SMP kernel - GPU

       - Fix GPU-viv drivers to build without SMP

Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
(cherry picked from commit 6558c2881b0cd1441708933fa1ac397f54b5aa70)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-13467 [#imx-1237] Fix kernel panic when running deqp module.
Ivan.liu [Tue, 20 Nov 2018 05:20:38 +0000 (13:20 +0800)]
MA-13467 [#imx-1237] Fix kernel panic when running deqp module.

Unable to handle kernel paging request at virtual address 1000100
[<ffff000008274ed8>] prefetch_freepointer.isra.37+0x8/0x14
[<ffff0000087bd3b0>] sync_file_create+0x28/0xc0
[<ffff000008b7c7e4>] gckOS_CreateNativeFence+0x74/0x110
[<ffff000008b89a78>] gckKERNEL_Dispatch+0xa54/0x15b0
[<ffff000008b8a8b8>] gckDEVICE_Dispatch+0x2e4/0x2f8
[<ffff000008b81160>] drv_ioctl+0x110/0x21c
[<ffff0000082b4478>] do_vfs_ioctl+0xb8/0x8b0
[<ffff0000082b4cf4>] SyS_ioctl+0x84/0x98

The reference count should be increased in one spin lock cycle.
Move spin lock out of _QueryIntegerId function.
Move signal reference count to gckOS_CreateNativeFence.

Change-Id: I1bf89b4de6055e5d0009baf7287f600696c4a529
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4363 [#imx-1246] fix coverity resource leak issue
Xianzhong [Fri, 16 Nov 2018 18:19:02 +0000 (02:19 +0800)]
MGS-4363 [#imx-1246] fix coverity resource leak issue

CID 3925877: Resource leak (RESOURCE_LEAK)
14. leaked_storage: Variable pages going out of scope leaks the storage it points to.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit a38d1b1ff31ce87a231588de1a2e24a787f87143)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-12928-2 [#imx-1199] Use gcdANDROID MARCO to control android build
Richard Liu [Wed, 31 Oct 2018 13:39:14 +0000 (21:39 +0800)]
MA-12928-2 [#imx-1199] Use gcdANDROID MARCO to control android build

Should use the correct build MARCO gcdANDROID to control android build.

Change-Id: I56a745b228a24ba502dc9771596aad78c1d8d808
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4376 [#imx-1238] fix low performance with CMA allocator
Xianzhong [Fri, 9 Nov 2018 18:37:56 +0000 (02:37 +0800)]
MGS-4376 [#imx-1238] fix low performance with CMA allocator

there are lots of PFNs busy message when run GPU tests:
 [  622.370671] alloc_contig_range: [4ea70, 4ea7c) PFNs busy
 [  626.518072] alloc_contig_range: [4ea90, 4ea9c) PFNs busy

this problem is related with CMA migration for fragments,

move CMA allocator after GFP to avoid memory migration,
also fix CMA preempt for contiguous memory request.

can improve CTS and gpubench benchmarks on M850D.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-13203-2 [#imx-1237] Fix kernel panic when do video plaback with dual display on...
Ivan.liu [Tue, 13 Nov 2018 01:00:17 +0000 (09:00 +0800)]
MA-13203-2 [#imx-1237] Fix kernel panic when do video plaback with dual display on 8mq.

BUG: scheduling while atomic: swapper/0/0/0x00010002
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.14.62 #1
Call trace:
[<ffff00000808b2e0>] dump_backtrace+0x0/0x414
[<ffff00000808b708>] show_stack+0x14/0x1c
[<ffff000008fbd00c>] dump_stack+0x90/0xb0
[<ffff00000810b8fc>] __schedule_bug+0x50/0x6c
[<ffff000008fd3b18>] __schedule+0x720/0x8a8
[<ffff000008fd3cd8>] schedule+0x38/0x9c
[<ffff000008fd40f0>] schedule_preempt_disabled+0x20/0x38
[<ffff000008fd51d8>] __mutex_lock.isra.9+0x4dc/0x4fc
[<ffff000008fd5208>] __mutex_lock_slowpath+0x10/0x18
[<ffff000008fd5240>] mutex_lock+0x30/0x38
[<ffff000008b79960>] gckOS_DestroySignal+0x30/0xcc
[<ffff000008baa3b8>] viv_fence_release+0x24/0x38
[<ffff0000087babcc>] dma_fence_release+0x38/0xf4
[<ffff0000087bb55c>] dma_fence_array_release+0x78/0xac
[<ffff0000087babcc>] dma_fence_release+0x38/0xf4
[<ffff0000087bb748>] irq_dma_fence_array_work+0x40/0x4c
[<ffff0000081d2878>] irq_work_run_list+0x68/0xa8
[<ffff0000081d28dc>] irq_work_run+0x24/0x40
[<ffff000008092440>] handle_IPI+0x300/0x330
[<ffff00000808197c>] gic_handle_irq+0x8c/0x184

Replace signal mutex lock with spin lock to handle signal in irq.

Change-Id: Id18e68f03bcb96c2aaf3ca8a0055fe6a64e8d10a
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4010 [#imx-919] Vulkan test met gpu hang on wayland
Ya Zhou [Tue, 23 Oct 2018 18:08:48 +0000 (02:08 +0800)]
MGS-4010 [#imx-919] Vulkan test met gpu hang on wayland

These case will generate a huge command object, which was divided into 33 Command Buffers to commit.
It will introduce a context switch within a command object. So add a mutex to avoid the Context switch.

Date: 23th Otc,2018
Signed-off-by Ya Zhou <ya.zhou@nxp.com>

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4338-5 [#imx-1217] remove duplicate query code for debugfs
Xianzhong [Mon, 22 Oct 2018 17:28:57 +0000 (01:28 +0800)]
MGS-4338-5 [#imx-1217] remove duplicate query code for debugfs

remove the duplicate code with gckGALDEVICE_QueryFrequency,
gckHARDWARE_QueryFrequency has correct fix for power management.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4338-3 [#imx-1217] fix kernel panic in gpu clock query
Xianzhong [Mon, 22 Oct 2018 17:28:11 +0000 (01:28 +0800)]
MGS-4338-3 [#imx-1217] fix kernel panic in gpu clock query

gpu clock and power can be turned off by global power management,
add global power semaphore protection to avoid clock-off in query.

also query GPU idle status to turn-off gpu clock/power properly.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4338-2 [#imx-1223] GPU memory optimization for page fault
Xianzhong [Mon, 22 Oct 2018 11:13:15 +0000 (19:13 +0800)]
MGS-4338-2 [#imx-1223] GPU memory optimization for page fault

GPU memory initialization will cause large boot time with 40ms.

If GPU memory is allocated from CMA, memset in cma kernel driver,
It is not necessary to add duplicated memset in GPU kernel driver.

Only GFP allocator need trigger a page fault with a simple write.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-4338-1 [#imx-1217] fix GPU probe delay to query frequency
Xianzhong [Mon, 22 Oct 2018 11:56:47 +0000 (19:56 +0800)]
MGS-4338-1 [#imx-1217] fix GPU probe delay to query frequency

it is not necessary to query frequency when hardware initialize,
there are two cases which really need to query frequency,
1. application query (such as openCL initialization) with ioctl,
2. debugfs with "cat /sys/kernel/debug/gc/clk"

removed the query from driver probe, no impact on real cases.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-13121-2 [#imx-1221] Fix kernel panic after reduce gpu reserved memory size.
Ivan.liu [Mon, 22 Oct 2018 01:19:06 +0000 (09:19 +0800)]
MA-13121-2 [#imx-1221] Fix kernel panic after reduce gpu reserved memory size.

Fix uint64_t to pointer conversion issue on 32bit platform.

Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-13121 [#imx-1221] Fix kernel panic after reduce gpu reserved memory size.
Ivan.liu [Thu, 18 Oct 2018 07:48:22 +0000 (15:48 +0800)]
MA-13121 [#imx-1221] Fix kernel panic after reduce gpu reserved memory size.

gckOS_MapPhysical is only used for contiguous memory to do map.
Actually LockVideoMemory already get the virtual address.
Remove gckOS_MapPhysical to support non contiguous memory.

Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMA-12928 [#imx-1199] Fix kernel panic issue caused by invalid ts_dma_buf pointer.
ivan.liu [Thu, 27 Sep 2018 06:28:27 +0000 (14:28 +0800)]
MA-12928 [#imx-1199] Fix kernel panic issue caused by invalid ts_dma_buf pointer.

There is kernel panic stack which caused by ts_dma_buf pointer.

[  136.041194] [<ffff000008722a8c>] drm_gem_object_init+0x94/0x98
[  136.047028] [<ffff000008748294>] __drm_gem_cma_create+0x40/0xb4
[  136.052950] [<ffff000008748808>] drm_gem_cma_prime_import_sg_table+0x48/0xa8
[  136.060000] [<ffff000008732e0c>] drm_gem_prime_import_dev+0x98/0x134
[  136.066352] [<ffff000008732eb8>] drm_gem_prime_import+0x10/0x18
[  136.072276] [<ffff00000876b144>] dcss_plane_atomic_set_base+0x174/0x2e4
[  136.078889] [<ffff00000876b700>] dcss_plane_atomic_update+0x44c/0x578
[  136.085331] [<ffff0000087134b0>] drm_atomic_helper_commit_planes+0xb4/0x1f0
[  136.092293] [<ffff00000876bea8>] dcss_drm_atomic_commit_tail+0xb4/0xe4
[  136.098820] [<ffff000008716ba8>] commit_tail+0x44/0x84
[  136.103958] [<ffff000008716bf8>] commit_work+0x10/0x18
[  136.109100] [<ffff0000080fa1a4>] process_one_work+0x140/0x3fc
[  136.114846] [<ffff0000080fa598>] worker_thread+0x138/0x3e4
[  136.120334] [<ffff000008101a00>] kthread+0x104/0x130
[  136.125300] [<ffff000008085064>] ret_from_fork+0x10/0x18

ts_dma_buf will become an invalid pointer when user process crashes.
And DRM commit will access invalid ts_dma_buf in kernel thread in async.
Change ts_dma_buf to ts_address to avoid invalid pointer issue.

Signed-off-by: ivan.liu <xiaowen.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20207-3 input: synaptics_dsx_i2c: fix coverity resource leak issue.
Haibo Chen [Tue, 20 Nov 2018 06:44:22 +0000 (14:44 +0800)]
MLK-20207-3 input: synaptics_dsx_i2c: fix coverity resource leak issue.

CID 3869707: Resource leak (RESOURCE_LEAK)
13. leaked_storage: Variable fhandler going out of scope leaks
the storage it points to

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit ddf57217892e9fefc4f04a09988f4b0ed3bf0f07)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20207-2: input: synaptics_dsx_i2c: fix coverity Unsigned compared against 0 issue.
Haibo Chen [Mon, 19 Nov 2018 09:34:44 +0000 (17:34 +0800)]
MLK-20207-2: input: synaptics_dsx_i2c: fix coverity Unsigned compared against 0 issue.

CID 3869705: Unsigned compared against 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero comparison of an
unsigned value is always true. attr_count >= 0.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 7380600ba0d0763b6081c07f5ddcb018a54314ca)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-20207-1: input: synaptics_dsx_i2c: fix coverity wrong sizeof argument issue
Haibo Chen [Mon, 19 Nov 2018 09:26:03 +0000 (17:26 +0800)]
MLK-20207-1: input: synaptics_dsx_i2c: fix coverity wrong sizeof argument issue

CID 3869704: Wrong sizeof argument (SIZEOF_MISMATCH)
suspicious_sizeof: Passing argument f1a->button_control.txrx_map of
type unsigned char * and argument 8 /* sizeof (f1a->button_control.txrx_map) */
to function synaptics_rmi4_i2c_read is suspicious.

Passing argument should be sizeof(unsigned char) rather than
sizeof(unsigned char *).

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 4583a0bc1ff6684e1d850eb50308ad8ae2fea627)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>