linux.git
6 years agoMLK-21161-04 brcmfmac: fix 43455 CRC error under SDIO 3.0 SDR104 mode
Wright Feng [Mon, 18 Mar 2019 05:09:44 +0000 (13:09 +0800)]
MLK-21161-04 brcmfmac: fix 43455 CRC error under SDIO 3.0 SDR104 mode

This patch fixes 43455 CRC error while running throughput test with
suspend/resume stress test.

The continuous failure messages before system crash:
brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84
brcmfmac: brcmf_sdio_rxglom: glom read of 25600 bytes failed: -5
brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame
brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84
brcmfmac: brcmf_sdio_rxglom: glom read of 24576 bytes failed: -5
brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit d6e37c2eb0f6fc2b50172321a464337073038228)

6 years agoMLK-21161-03 brcmfmac: add sleep in bus suspend and cfg80211 resume functions
Wright Feng [Thu, 7 Mar 2019 07:37:27 +0000 (01:37 -0600)]
MLK-21161-03 brcmfmac: add sleep in bus suspend and cfg80211 resume functions

With asynchronous suspend/resume feature, suspend and resume callbacks to
be executed in parallel with each other. It makes bus changes the state to
BRCMF_BUS_DOWN before all brcmf_cfg80211_suspend IOVAR executions.
The same situation also happens in resume procedure and causes PM mode
keeps in PM_MAX after resume. In order to fix the race condition, We add
one second sleep in bus suspend and cfg80211 resume function.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit fdb676ce002039d7359b200b6c2cc728f41c05fa)

6 years agoMLK-21161-02 brcmfmac: validate ifp pointer in brcmf_txfinalize
Wright Feng [Wed, 21 Nov 2018 09:16:55 +0000 (03:16 -0600)]
MLK-21161-02 brcmfmac: validate ifp pointer in brcmf_txfinalize

We got ifp null pointer kernel panic in brcmf_txfinalize after removing
Wi-Fi USB dongle when data was transmitting, The root cause is that
interface was removed before calling brcmf_txfinalize in
brcmf_fws_dequeue_worker and finally caused kernel panic.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 3f94bfe6febc9762e340a69b6520242f27d20c85)

6 years agoMLK-21161-01 brcmfmac: To fix kernel crash on out of boundary access
Raveendran Somu [Tue, 13 Nov 2018 02:32:11 +0000 (20:32 -0600)]
MLK-21161-01 brcmfmac: To fix kernel crash on out of boundary access

To trunkcate the addtional bytes, if extra bytes are received.
Current code only have a warning and proceed without handling it.
But in one crash dump reported by DVT, these causes the
crash intermittently. So the processing is limit to the skb->len.

Signed-off-by: Raveendran Somu <raveendran.somu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit f7112c027e0c7447b05474b72934589bbbb8e298)

6 years agoMLK-20681 brcmfmac: add brcmfmac platform device pinctrl state support
Andy Duan [Fri, 4 Jan 2019 06:48:59 +0000 (14:48 +0800)]
MLK-20681 brcmfmac: add brcmfmac platform device pinctrl state support

Add brcmfmac platform device pinctrl state support. That is useful
for dynamically configurate pin group for different wlan chips.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 88f2834cd5b8cb8864af68d265b5bdee3000c4bf)

6 years agoMLK-20680 brcmfmac: add time delay for pcie device exit D3 mode
Andy Duan [Wed, 2 Jan 2019 10:05:00 +0000 (18:05 +0800)]
MLK-20680 brcmfmac: add time delay for pcie device exit D3 mode

- The current timeout value is not enough for MB transaction read
when modem enter D3 mode, so increase the timeout value to match
the D3 mode timing requirement.
- Add 10 ms delay for pcie device to exit D3 state and enter D0 state.
- Remove the duplicated code for SBMBX register access.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 05601af462145e27142e3d140e10a66d4a493d40)

6 years agoMLK-20679 brcmfmac: reset two D11 cores if chip has two D11 cores
Wright Feng [Mon, 3 Dec 2018 09:39:33 +0000 (17:39 +0800)]
MLK-20679 brcmfmac: reset two D11 cores if chip has two D11 cores

There are two D11 cores in RSDB chips like 4359. We have to reset two
D11 cores simutaneously before firmware download, or the firmware may
not be initialized correctly and cause "fw initialized failed" error.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked commit from 8f50bea9357af3088dba0103f0017d56763b0ae9)

6 years agoMLK-20678 brcmfmac: avoid the error log print when get the wowl_wakeind failed
Andy Duan [Mon, 24 Dec 2018 04:50:14 +0000 (12:50 +0800)]
MLK-20678 brcmfmac: avoid the error log print when get the wowl_wakeind failed

Not all chips support wowlan, then get wowlan wakeup event failed.
Change the log into debug level.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 47b205952ca6be6216e19a121f1fb400c5fcf7e7)

6 years agoMLK-21478-23 arm64: defconfig: add imx8mq usb phy and typec driver
Li Jun [Wed, 17 Apr 2019 01:51:45 +0000 (09:51 +0800)]
MLK-21478-23 arm64: defconfig: add imx8mq usb phy and typec driver

This patch enable imx8mq usb phy driver and typec related drivers.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-22 arm64: dts: imx8qxp-mek-rpmsg: use typec connector sub-node
Li Jun [Wed, 17 Apr 2019 05:51:09 +0000 (13:51 +0800)]
MLK-21478-22 arm64: dts: imx8qxp-mek-rpmsg: use typec connector sub-node

As the new kernel introduces the standard usb connector properties,
so use connector sub-node for typec.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-21 arm64: dts: imx8qxp-mek: use connector sub-node for typec
Li Jun [Wed, 17 Apr 2019 05:50:24 +0000 (13:50 +0800)]
MLK-21478-21 arm64: dts: imx8qxp-mek: use connector sub-node for typec

As the new kernel introduces the standard usb connector properties,
so use connector sub-node for typec.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-20 arm64: dts: imx8qm-mek: use connector sub-node for typec
Li Jun [Wed, 17 Apr 2019 05:49:19 +0000 (13:49 +0800)]
MLK-21478-20 arm64: dts: imx8qm-mek: use connector sub-node for typec

As the new kernel introduces the standard usb connector properties,
so use connector sub-node for typec.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-19 arm64: dts: imx8qm-mek-domu: use typec connector sub-node
Li Jun [Wed, 17 Apr 2019 05:48:26 +0000 (13:48 +0800)]
MLK-21478-19 arm64: dts: imx8qm-mek-domu: use typec connector sub-node

As the new kernel introduces the standard usb connector properties,
so use connector sub-node for typec.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-18 arm64: dts: imx8qm-mek-domu-dpu1: use connector sub-node
Li Jun [Wed, 17 Apr 2019 05:47:14 +0000 (13:47 +0800)]
MLK-21478-18 arm64: dts: imx8qm-mek-domu-dpu1: use connector sub-node

As the new kernel introduces the standard usb connector properties,
so use connector sub-node for typec.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-17 arm64: imx8mm-ddr4-val: use connector sub-node for typec
Li Jun [Wed, 17 Apr 2019 05:46:09 +0000 (13:46 +0800)]
MLK-21478-17 arm64: imx8mm-ddr4-val: use connector sub-node for typec

As the new kernel introduces the standard usb connector properties,
so use connector sub-node for typec.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-16 arm64: dts: imx8mq-evk: use connector sub-node for typec
Li Jun [Mon, 15 Apr 2019 12:03:42 +0000 (20:03 +0800)]
MLK-21478-16 arm64: dts: imx8mq-evk: use connector sub-node for typec

As the new kernel introduces the standard usb connector properties,
so use connector sub-node for typec.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-15 arm64: dts: imx8mm-evk: use connector sub-node for typec
Li Jun [Wed, 10 Apr 2019 05:18:02 +0000 (13:18 +0800)]
MLK-21478-15 arm64: dts: imx8mm-evk: use connector sub-node for typec

As the new kernel introduces the standard usb connector properties,
so use connector sub-node for typec.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-14 arm64: dts: fsl-imx8mq-ddr4-arm2: remove deprecated usb node
Li Jun [Mon, 15 Apr 2019 12:10:40 +0000 (20:10 +0800)]
MLK-21478-14 arm64: dts: fsl-imx8mq-ddr4-arm2: remove deprecated usb node

As we don't need 2 nodes for usb controller, so remove the nodes not
required.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-13 arm64: dts: imx8mq-evk: remove deprecated node for usb
Li Jun [Mon, 15 Apr 2019 12:02:39 +0000 (20:02 +0800)]
MLK-21478-13 arm64: dts: imx8mq-evk: remove deprecated node for usb

As we don't need 2 nodes for usb controller, so remove the nodes not
required.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-12 arm64: dtsi: imx8mq: use one node for usb dwc3 controller
Li Jun [Mon, 15 Apr 2019 11:59:30 +0000 (19:59 +0800)]
MLK-21478-12 arm64: dtsi: imx8mq: use one node for usb dwc3 controller

New dwc3 driver force to use one node for controller node, so switch
to use one node for dwc3 controller.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-11 usb: dwc3: use suspend clock from dt to set power down scale
Li Jun [Tue, 16 Apr 2019 06:02:38 +0000 (14:02 +0800)]
MLK-21478-11 usb: dwc3: use suspend clock from dt to set power down scale

Since the new dwc3 use bulk clks including the suspend clk, so we can
use it to calculate the power down scale value.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-2 usb: typec: tcpci: disable typec irq before register port
Li Jun [Wed, 17 Apr 2019 04:03:50 +0000 (12:03 +0800)]
MLK-21478-2 usb: typec: tcpci: disable typec irq before register port

Disable tcpci irq before tcpci_register_port() to make sure resource
ready before irq hanlding.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agoMLK-21478-1 usb: typec: tcpci: use correct driver data
Li Jun [Wed, 17 Apr 2019 04:31:06 +0000 (12:31 +0800)]
MLK-21478-1 usb: typec: tcpci: use correct driver data

As the driver data is tcpci_chip in new kernel, so correct this.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
6 years agophy: add driver for Freescale i.MX8MQ USB3 PHY
Li Jun [Thu, 15 Nov 2018 14:12:47 +0000 (15:12 +0100)]
phy: add driver for Freescale i.MX8MQ USB3 PHY

This is a cleaned up port of the downstream i.MX8MQ USB3 PHY driver.

Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
(cherry picked from commit efe81bea891586680a928ea5dde40eb1fff34be2)

6 years agodt-bindings: phy: add binding for Freescale i.MX8MQ USB3 PHY
Lucas Stach [Thu, 15 Nov 2018 14:12:46 +0000 (15:12 +0100)]
dt-bindings: phy: add binding for Freescale i.MX8MQ USB3 PHY

This adds the binding for the USB3 PHY found on the i.MX8M SoC.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
(cherry picked from commit 3c2ce40b2fbb52b5e861f8664f5422d39f11b39e)

6 years agoMLK-21118 arm64: defconfig: Enable CONFIG_VIDEO_MXC_CSI_CAMERA
Leonard Crestez [Tue, 16 Apr 2019 13:25:51 +0000 (16:25 +0300)]
MLK-21118 arm64: defconfig: Enable CONFIG_VIDEO_MXC_CSI_CAMERA

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
6 years agoMLK-21479 PCI: imx: refine the power on gpio manipulation
Richard Zhu [Wed, 17 Apr 2019 07:02:53 +0000 (15:02 +0800)]
MLK-21479 PCI: imx: refine the power on gpio manipulation

Turn on the power on gpio once is enough and this pin shouldn't be
re-configured in resume procedure again and again.
Thus, move the turn on operation of the power_on_gpio to the proper
place.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21474-2 arm64: defconfig: Enable MXC_MLB150
Leonard Crestez [Tue, 16 Apr 2019 14:47:14 +0000 (17:47 +0300)]
MLK-21474-2 arm64: defconfig: Enable MXC_MLB150

Missed during initial porting due to Kconfig logic

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21474-1 mxc mlb: Allow compilation on imx8
Leonard Crestez [Tue, 16 Apr 2019 14:45:47 +0000 (17:45 +0300)]
MLK-21474-1 mxc mlb: Allow compilation on imx8

Upstream rejected ARCH_FSL_IMX8QM so just depend on ARCH_MXC or
COMPILE_TEST.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
6 years agoMLK-21063 ARM64: dts: imx8qm-domu-car: fix lvds-pwm usage
Peng Fan [Wed, 6 Mar 2019 05:56:13 +0000 (13:56 +0800)]
MLK-21063 ARM64: dts: imx8qm-domu-car: fix lvds-pwm usage

Fix lvds-pwm usage, it needs to be under vehicle_rpmsg_m4 node for
android auto.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 31db2776c4cf4b27417c57f3c7c013085cee1528)
(cherry picked from commit 24f984a95e5043a50aea24f35b02d3737355b4e2)

6 years agoMLK-20990 ARM64: dts: imx8qm: domu: switch to use rpmsg i2c
Peng Fan [Tue, 26 Feb 2019 11:42:57 +0000 (19:42 +0800)]
MLK-20990 ARM64: dts: imx8qm: domu: switch to use rpmsg i2c

Switch to use rpmsg i2c to support android auto, because
android auto change to use rpmsg i2c.
Also add the alias node to let m4 could use it successfully, because
M4 side use the alias id as the BUSID.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Flynn xu <flynn.xu@nxp.com>
(cherry picked from commit d67968b6d6a583590a9e737f4a3d732dca5b078f)

6 years agoMLK-20977-3 ARM64: dts: imx8qm: update domu car
Peng Fan [Mon, 25 Feb 2019 13:25:37 +0000 (21:25 +0800)]
MLK-20977-3 ARM64: dts: imx8qm: update domu car

Update domu car dts according to android auto changes.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Flynn xu <flynn.xu@nxp.com>
(cherry picked from commit 8c3bc5b19ddc3fbac9fe04c504a7f0282b82beeb)

6 years agoMLK-21013 ARM64: dts: imx8qm: passthrough lvds pwm
Peng Fan [Thu, 28 Feb 2019 10:36:51 +0000 (18:36 +0800)]
MLK-21013 ARM64: dts: imx8qm: passthrough lvds pwm

Passthrough lvds pwm, otherwise dom0 will panic when reboot if
domu started and shutdown, because LVDS_1_PWM_0 is assigned
to domu and when domu shutdown, the resource will be powered
off, however dom0 still think it is powered on.

since lvds1_pwm is expected for domu, so let's passthrough it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Flynn xu <flynn.xu@nxp.com>
(cherry picked from commit abb243aba12a6649fad8114e298ff075b0a8399d)
(cherry picked from commit 9644178aeb4fc2a5b04824e7f6fb9cd9b5f7477f)

6 years agoMLK-20977-5 ARM64: dts: remove MIPI for m4
Peng Fan [Tue, 26 Feb 2019 08:07:39 +0000 (16:07 +0800)]
MLK-20977-5 ARM64: dts: remove MIPI for m4

The resources are wrongly added.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit af14fdef3b810f436582f3ff70822ebf05b8d361)

6 years agoMLK-20977-4 ARM64: dts: cleanup resources for SMMU
Peng Fan [Tue, 26 Feb 2019 01:19:42 +0000 (09:19 +0800)]
MLK-20977-4 ARM64: dts: cleanup resources for SMMU

Cleanup the resources that not could be set SID and remove the UNUSED

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Flynn xu <flynn.xu@nxp.com>
(cherry picked from commit e9d5d3b1056082b7eb1d8a6e1628c38d78c33933)

6 years agoMLK-20977-2 ARM64: dts: add resources for M41 usage
Peng Fan [Mon, 25 Feb 2019 07:02:54 +0000 (15:02 +0800)]
MLK-20977-2 ARM64: dts: add resources for M41 usage

When resources are owned by M41, we need to handle that correctly in
xen.

Also drop power doamins for xen,shared gpio, xen will power up the gpio.
gpio1 is owned by M41, so we also need to check its power status in xen.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Flynn xu <flynn.xu@nxp.com>
(cherry picked from commit 0c75f57c8fe13005e9c1c28940cc1f66fc613fdd)

6 years agoMLK-20977-1 ARM64: dts: remove cm41 from smmu
Peng Fan [Mon, 25 Feb 2019 06:57:11 +0000 (14:57 +0800)]
MLK-20977-1 ARM64: dts: remove cm41 from smmu

CM41 runs before CortexA, we should not use smmu to restrict it, because
smmu is owned by xen. Also remove MU_13/12 which is wrongly added
before.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Flynn xu <flynn.xu@nxp.com>
(cherry picked from commit 25c3a75e1566fe3c53002ed3fee698840e207245)

6 years agoMLK-21292 ARM64: dts: imx8mm: introduce inamte linux
Peng Fan [Fri, 29 Mar 2019 09:09:52 +0000 (17:09 +0800)]
MLK-21292 ARM64: dts: imx8mm: introduce inamte linux

Introduce inmate linux support for jailhouse, we need to benchmark
inmate OS, so choose linux. The clock/pin are preconfigured by 1st
root cell linux.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 00bf8b5eea2213896acf4e244ef1b63fb7abea85)

6 years agoMLK-21121-2: arm64: config: enable flexspi in defconfig
Han Xu [Tue, 16 Apr 2019 19:28:41 +0000 (14:28 -0500)]
MLK-21121-2: arm64: config: enable flexspi in defconfig

enabled the flexspi driver by default in defconfig

Signed-off-by: Han Xu <han.xu@nxp.com>
6 years agoMLK-21121-1: mtd: flexspi: enable quad_only quirk
Han Xu [Tue, 16 Apr 2019 19:26:00 +0000 (14:26 -0500)]
MLK-21121-1: mtd: flexspi: enable quad_only quirk

enable the quad_only quirk for the platforms only support up to Quad
I/O.

Signed-off-by: Han Xu <han.xu@nxp.com>
6 years agoMLK-19947-2 soc: imx: select CLKSRC_IMX_GPT for i.MX8QXP
Anson Huang [Tue, 16 Oct 2018 03:17:36 +0000 (11:17 +0800)]
MLK-19947-2 soc: imx: select CLKSRC_IMX_GPT for i.MX8QXP

Select CLKSRC_IMX_GPT for i.MX8QXP by default.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
(cherry picked from commit 73f73e4d11292f0342cdeb747b8c440806f464f1)

6 years agoMLK-19947-1 clocksource: gpt: add i.MX8QXP support
Anson Huang [Tue, 16 Oct 2018 03:15:06 +0000 (11:15 +0800)]
MLK-19947-1 clocksource: gpt: add i.MX8QXP support

i.MX8QXP will use GPT timer as platform broadcast time for waking
up CPUs when cluster is off, GPT timer needs to be probed after
clock driver ready, and GPT suspend is at syscore suspend phase,
to make the clock & power management as well as GPT save/restore
easy, all these things are done in TF-A.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
(cherry picked from commit 567a017241e1fe68be096d556c1088296f8d2068)

6 years agoMLK-19305-3 arm64: enable gpio PAD wakeup for i.MX8 platforms
Anson Huang [Thu, 23 Aug 2018 03:13:48 +0000 (11:13 +0800)]
MLK-19305-3 arm64: enable gpio PAD wakeup for i.MX8 platforms

Select gpio PAD wakeup for those i.MX8 platforms with
system controller present.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
(cherry picked from commit 61f3cc34747e5c8db1578c8aba5bd9592533cede)
(cherry picked from commit 9140333d00ff27da34b4e5abd6cf8cf6a3a0db6c)

6 years agoMLK-21455-3 arm64: defconfig: Enable NVMEM_IMX_OCOTP for imx8m fuses
Leonard Crestez [Fri, 12 Apr 2019 16:26:54 +0000 (19:26 +0300)]
MLK-21455-3 arm64: defconfig: Enable NVMEM_IMX_OCOTP for imx8m fuses

The NVMEM_IMX_OCOTP driver can be used for fuse access on imx8m*
platforms but was missed during initial porting.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-21455-2 nvmem: imx-ocotp: broaden Kconfig dependency
Lucas Stach [Thu, 28 Feb 2019 07:01:37 +0000 (08:01 +0100)]
MLK-21455-2 nvmem: imx-ocotp: broaden Kconfig dependency

The i.MX OCOTP controller is used in numerous Freescale/NXP
SoCs from the MXC family, so the strict dependency on the
i.MX6 SoC is too narrow. Broaden it to cover all the MXC
familiy members.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
(cherry picked from commit af6e0fd10a116fa8756171a2fe53e00b1d55ae96)

6 years agoMLK-21455-1 nvmem: allow to select i.MX nvmem driver for i.MX 7D
Stefan Agner [Sun, 3 Feb 2019 09:43:37 +0000 (09:43 +0000)]
MLK-21455-1 nvmem: allow to select i.MX nvmem driver for i.MX 7D

The imx-ocotp nvmem driver supports the i.MX 7D SoC too. Allow to select
the imx-ocotp driver even if only the i.MX 7D SoC has been selected.

Fixes: 711d45477931 ("nvmem: octop: Add i.MX7D support")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9f23379c67fa20b367ea53cfd989da5212316e6f)

6 years agoMLK-16204-4 nvmem: imx-ocotp: add i.mx8mq support and fix read
Peng Fan [Fri, 18 Aug 2017 03:19:08 +0000 (11:19 +0800)]
MLK-16204-4 nvmem: imx-ocotp: add i.mx8mq support and fix read

Add i.MX8MQ support and Fix read.

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

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 23bcfaac856f3f0de9f3113c9c447a6133157019)

6 years agoARM: dts: imx6ul: use nvmem-cells for cpu speed grading
Anson Huang [Fri, 14 Sep 2018 02:59:21 +0000 (10:59 +0800)]
ARM: dts: imx6ul: use nvmem-cells for cpu speed grading

On i.MX6UL, accessing OCOTP directly is wrong because the ocotp clock
needs to be enabled first, so use the nvmem-cells binding instead.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
(cherry picked from commit 44dca5db09efe6e03e5c50e2e093d823d9f0ffee)

6 years agocpufreq: imx6sx/imx6q: read OCOTP through nvmem for imx6sx/imx6q
Arulpandiyan Vadivel [Tue, 16 Apr 2019 06:10:05 +0000 (11:40 +0530)]
cpufreq: imx6sx/imx6q: read OCOTP through nvmem for imx6sx/imx6q

On i.MX6SX/i.MX6Q, accessing OCOTP directly is wrong because
the ocotp clock needs to be enabled first. Add support for reading
OCOTP through the nvmem API, and keep the old method there to
support old dtb.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
(cherry picked from commit 766bc770f5fc12dd85aa8b26c53ac310afb9e24b)

6 years agocpufreq: imx6q: read OCOTP through nvmem for imx6ul/imx6ull
Anson Huang [Mon, 8 Oct 2018 06:07:34 +0000 (14:07 +0800)]
cpufreq: imx6q: read OCOTP through nvmem for imx6ul/imx6ull

On i.MX6UL/i.MX6ULL, accessing OCOTP directly is wrong because
the ocotp clock needs to be enabled first. Add support for reading
OCOTP through the nvmem API, and keep the old method there to
support old dtb.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
(cherry picked from commit ef800b8b7eed1363b662477b134b489f44410530)

6 years agoARM: dts: imx6sx: use nvmem-cells for cpu speed grading
Arulpandiyan Vadivel [Tue, 16 Apr 2019 06:08:27 +0000 (11:38 +0530)]
ARM: dts: imx6sx: use nvmem-cells for cpu speed grading

On i.MX6SX, accessing OCOTP directly is wrong because the ocotp clock
needs to be enabled first, so use the nvmem-cells binding instead.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
(cherry picked from commit b98f7d8b72a7fce275c078a1a9c9dc12184500b5)

6 years agonvmem: imx-ocotp: add support for imx6ull
Vipul Kumar [Mon, 1 Apr 2019 06:58:46 +0000 (12:28 +0530)]
nvmem: imx-ocotp: add support for imx6ull

Enable ocotp driver support for imx6ull SoC.

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

6 years agodt-bindings: nvmem: imx-ocotp: add compatible string for imx6ull
Vipul Kumar [Mon, 1 Apr 2019 07:02:51 +0000 (12:32 +0530)]
dt-bindings: nvmem: imx-ocotp: add compatible string for imx6ull

Add new compatible string for i.MX6ULL SOC.

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

6 years agoARM: imx_v7_defconfig: Disable CONFIG_FSL_OTP
Vipul Kumar [Mon, 1 Apr 2019 06:51:13 +0000 (12:21 +0530)]
ARM: imx_v7_defconfig: Disable CONFIG_FSL_OTP

This patch disable OTP driver. Now, we are using CONFIG_NVMEM_IMX_OCOTP
driver. Due to CONFIG_FSL_OTP config, thermal_zone0 sub directory was not
created under /sys/devices/virtual/thermal/.

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

6 years agoARM: imx_v7_defconfig: Select CONFIG_NVMEM_IMX_OCOTP
Vipul Kumar [Mon, 1 Apr 2019 05:31:53 +0000 (11:01 +0530)]
ARM: imx_v7_defconfig: Select CONFIG_NVMEM_IMX_OCOTP

Select the i.mx ocotp driver.

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

6 years agocan: flexcan: remove duplicate entry of mailbox
Arulpandiyan Vadivel [Thu, 28 Mar 2019 09:13:02 +0000 (14:43 +0530)]
can: flexcan: remove duplicate entry of mailbox

Remove duplicate mailbox register entry from hardware register structure.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
(cherry picked from commit 0fb8da2c4060fa5c43cb9fd2fef6aee58a0d9235)

6 years agoarm: dts: imx6ul: removing dependency from imx6ul-14x14-evk.dtsi
Vipul Kumar [Fri, 22 Mar 2019 10:27:29 +0000 (15:57 +0530)]
arm: dts: imx6ul: removing dependency from imx6ul-14x14-evk.dtsi

This patch remove dependency from imx6ul-14x14-evk.dtsi. By including this
file, getting duplicate enteries for multiple nodes.

To fix the compilation error, added some nodes in imx6ul-14x14-evk.dts.

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

6 years agoclk: imx6ul: Remove the duplicate code
Vipul Kumar [Fri, 22 Mar 2019 05:52:14 +0000 (11:22 +0530)]
clk: imx6ul: Remove the duplicate code

This patch remve the duplicate code. Due to this code, getting following
logs at boot time:

failed to set rate of clk ahb to 99000000: -16
failed to set parent of clk periph to periph_clk2: -16
failed to set parent of clk periph_pre to pll2_bus: -16

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

6 years agoMLK-21472 drm: downgrade the drm/imx probe
Haibo Chen [Tue, 16 Apr 2019 08:50:00 +0000 (16:50 +0800)]
MLK-21472 drm: downgrade the drm/imx probe

Some driver under drm/imx depends on panel and bridge, but all these
driver use the same module_init() to register the driver, so the
default probe sequence will depends on the list in Makefile. Here
downgrade the drm/imx under the panel and bridge, otherwise will
meet the following during system boot:

 [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
 [drm] No driver support for vblank timestamp query.
 imx-drm display-subsystem: bound imx-lcdif-crtc.0 (ops lcdif_crtc_ops)
 imx_sec_dsim_drv 32e10000.mipi_dsi: version number is 0x1060200
 imx_sec_dsim_drv 32e10000.mipi_dsi: Failed to attach bridge: 32e10000.mipi_dsi
 imx_sec_dsim_drv 32e10000.mipi_dsi: failed to bind sec dsim bridge: -517
 imx-drm display-subsystem: failed to bind 32e10000.mipi_dsi (ops imx_sec_dsim_ops): -517
 imx-drm display-subsystem: master bind failed: -517

This patch can make MIPI DSI panel probe successfully at the first
time, rather than depends on the PROBE_DEFER.
Besides, for the MIPI DSI panel used on imx8mm/imx8mq, the panel and
touch share one RST pin, touch need the panel do the RST first to wake
up the touch chip, so also need to make sure the MIPI DSI panel probe
successfully before touch.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Acked-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-21457 mmc: block: delete the duplicate calling of mmc_cleanup_queue()
Haibo Chen [Tue, 16 Apr 2019 02:53:41 +0000 (10:53 +0800)]
MLK-21457 mmc: block: delete the duplicate calling of mmc_cleanup_queue()

Fix Mentor back porting issue. According to community log, need to
first backport the commit 57678e5a3d51 ("mmc: block: Delete gendisk
before cleaning up the request queue"), then can back porting the
commit be2ad281466f ("mmc: block: Prevent new req entering queue
after its cleanup"). But Mentor wrongly handle the sequence, and
wrongly handle the conflict, causing the mmc_cleanup_queue() is
called twice. When do sd hot plug test, will meet the following dump:

:~# mmc0: card aaaa removed
------------[ cut here ]------------
WARNING: CPU: 0 PID: 152 at block/blk-core.c:813 blk_cleanup_queue+0x140/0x144
Modules linked in:
CPU: 0 PID: 152 Comm: kworker/0:4 Not tainted 4.19.30-04275-gd0b5d3f8b43d #43
Hardware name: Freescale i.MX7ULP (Device Tree)
Workqueue: events_freezable mmc_rescan
[<8010f998>] (unwind_backtrace) from [<8010bbd8>] (show_stack+0x10/0x14)
[<8010bbd8>] (show_stack) from [<80a473d4>] (dump_stack+0x78/0x8c)
[<80a473d4>] (dump_stack) from [<8012f29c>] (__warn+0xdc/0xf4)
[<8012f29c>] (__warn) from [<8012f3cc>] (warn_slowpath_null+0x40/0x48)
[<8012f3cc>] (warn_slowpath_null) from [<803e3ec8>] (blk_cleanup_queue+0x140/0x144)
[<803e3ec8>] (blk_cleanup_queue) from [<8073f1b0>] (mmc_cleanup_queue+0x28/0x3c)
[<8073f1b0>] (mmc_cleanup_queue) from [<8073cec4>] (mmc_blk_remove_req.part.5+0x2c/0x90)
[<8073cec4>] (mmc_blk_remove_req.part.5) from [<8073d9fc>] (mmc_blk_remove+0xe8/0x1b0)
[<8073d9fc>] (mmc_blk_remove) from [<8072e57c>] (mmc_bus_remove+0x18/0x20)
[<8072e57c>] (mmc_bus_remove) from [<80534930>] (device_release_driver_internal+0x178/0x220)
[<80534930>] (device_release_driver_internal) from [<8053357c>] (bus_remove_device+0xcc/0xf8)
[<8053357c>] (bus_remove_device) from [<80530bc4>] (device_del+0x120/0x358)
[<80530bc4>] (device_del) from [<8072ebf0>] (mmc_remove_card+0x78/0x9c)
[<8072ebf0>] (mmc_remove_card) from [<80734044>] (mmc_sd_detect+0x3c/0x6c)
[<80734044>] (mmc_sd_detect) from [<8072dfa8>] (mmc_rescan+0xcc/0x3f4)
[<8072dfa8>] (mmc_rescan) from [<80146454>] (process_one_work+0x1f0/0x400)
[<80146454>] (process_one_work) from [<801471d8>] (worker_thread+0x44/0x580)
[<801471d8>] (worker_thread) from [<8014c014>] (kthread+0x148/0x150)
[<8014c014>] (kthread) from [<801010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xb095bfb0 to 0xb095bff8)
bfa0:                                     00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
---[ end trace 5bcff5fbec8eea08 ]---
Unable to handle kernel paging request at virtual address 3e700004
pgd = 5bbecc7f
[3e700004] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 152 Comm: kworker/0:4 Tainted: G        W         4.19.30-04275-gd0b5d3f8b43d #43
Hardware name: Freescale i.MX7ULP (Device Tree)
Workqueue: events_freezable mmc_rescan
PC is at __srcu_read_lock+0x1c/0x38
LR is at hctx_lock+0x1c/0x2c
pc : [<8017d91c>]    lr : [<803eedd4>]    psr: 20010093
sp : b095bdf8  ip : 20010013  fp : bf682d80
r10: b083d008  r9 : b083e810  r8 : 00000034
r7 : 00000001  r6 : 00000001  r5 : b09b8400  r4 : b095be00
r3 : 00000004  r2 : 00000001  r1 : b095be00  r0 : 3e700000
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c53c7d  Table: 90c9006a  DAC: 00000051
Process kworker/0:4 (pid: 152, stack limit = 0x37b997f7)
Stack: (0xb095bdf8 to 0xb095c000)
bde0:                                                       81004d08 803ef16c
be00: bf682d80 bd071de2 0000001c 00000000 b0415820 00000001 00000000 803ef278
be20: b08b1c0c b0415820 b083e800 8073f1a8 b08b1c00 b08b1c0c b083e800 8073cedc
be40: b083e800 b08b1c00 b083e808 8073d9fc 60010013 00000034 bf682d80 b083e808
be60: b083e83c 8104db84 00000000 00000034 b083e810 8072e57c b083e808 80534930
be80: b0141a30 b083e808 8104d598 81004d08 810fbf40 8053357c b083e800 b083e808
bea0: b083e860 80530bc4 bf686200 00000000 b083d268 00000000 bf682d80 80172038
bec0: 80db2040 bd071de2 bf686200 b083e800 b083e808 b083d000 bf686200 00000000
bee0: b083d268 00000000 bf682d80 8072ebf0 b083d000 ffffff85 b083d000 80734044
bf00: b083d264 b083d200 b083d000 8072dfa8 b083d264 b096b080 bf682d80 bf686200
bf20: 00000000 80146454 81003d00 bf682d98 b096b080 bf682d80 b096b094 81003d00
bf40: bf682d98 ffffe000 00000008 801471d8 b08e3a70 8109d940 80d256d0 b095a000
bf60: b0968b1c b0968b00 b0968ac0 00000000 b095a000 b096b080 80147194 b0081ea4
bf80: b0968b1c 8014c014 00000000 b0968ac0 8014becc 00000000 00000000 00000000
bfa0: 00000000 00000000 00000000 801010e8 00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[<8017d91c>] (__srcu_read_lock) from [<803eedd4>] (hctx_lock+0x1c/0x2c)
[<803eedd4>] (hctx_lock) from [<803ef16c>] (blk_mq_run_hw_queue+0x28/0xfc)
[<803ef16c>] (blk_mq_run_hw_queue) from [<803ef278>] (blk_mq_run_hw_queues+0x38/0x4c)
[<803ef278>] (blk_mq_run_hw_queues) from [<8073f1a8>] (mmc_cleanup_queue+0x20/0x3c)
[<8073f1a8>] (mmc_cleanup_queue) from [<8073cedc>] (mmc_blk_remove_req.part.5+0x44/0x90)
[<8073cedc>] (mmc_blk_remove_req.part.5) from [<8073d9fc>] (mmc_blk_remove+0xe8/0x1b0)
[<8073d9fc>] (mmc_blk_remove) from [<8072e57c>] (mmc_bus_remove+0x18/0x20)
[<8072e57c>] (mmc_bus_remove) from [<80534930>] (device_release_driver_internal+0x178/0x220)
[<80534930>] (device_release_driver_internal) from [<8053357c>] (bus_remove_device+0xcc/0xf8)
[<8053357c>] (bus_remove_device) from [<80530bc4>] (device_del+0x120/0x358)
[<80530bc4>] (device_del) from [<8072ebf0>] (mmc_remove_card+0x78/0x9c)
[<8072ebf0>] (mmc_remove_card) from [<80734044>] (mmc_sd_detect+0x3c/0x6c)
[<80734044>] (mmc_sd_detect) from [<8072dfa8>] (mmc_rescan+0xcc/0x3f4)
[<8072dfa8>] (mmc_rescan) from [<80146454>] (process_one_work+0x1f0/0x400)
[<80146454>] (process_one_work) from [<801471d8>] (worker_thread+0x44/0x580)
[<801471d8>] (worker_thread) from [<8014c014>] (kthread+0x148/0x150)
[<8014c014>] (kthread) from [<801010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xb095bfb0 to 0xb095bff8)
bfa0:                                     00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
Code: f10c0080 e590307c ee1d0f90 e0833102 (e7931000)
---[ end trace 5bcff5fbec8eea09 ]---
FAT-fs (mmcblk0p1): FAT read failed (blocknr 8)

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
6 years agoarm64: defconfig: Enable DSP config
Daniel Baluta [Mon, 15 Apr 2019 19:39:01 +0000 (22:39 +0300)]
arm64: defconfig: Enable DSP config

This pulls in code for talking with DSP.

Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
6 years agoMLK-20940: arm64: defconfig: Remove direct selection of CONFIG_RPMSG
Daniel Baluta [Mon, 15 Apr 2019 19:35:47 +0000 (22:35 +0300)]
MLK-20940: arm64: defconfig: Remove direct selection of CONFIG_RPMSG

This is already selected by others symbols e.g HAVE_IMX_RPMSG.

Fixes: ad284b230391bae ("MLK-20940-4 ARM64: defconfig: Add RPBUS and RPMSG config")
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
6 years agoMLK-21450-2: ARM64: defconfig: enable HDMI audio
Shengjiu Wang [Mon, 15 Apr 2019 10:38:42 +0000 (18:38 +0800)]
MLK-21450-2: ARM64: defconfig: enable HDMI audio

enable CONFIG_SND_SOC_IMX_CDNHDMI=y

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-21450-1: ASoC: imx-cdnhdmi: replace codec with component
Shengjiu Wang [Mon, 15 Apr 2019 10:30:20 +0000 (18:30 +0800)]
MLK-21450-1: ASoC: imx-cdnhdmi: replace codec with component

Fix the compile issue for snd_pcm_codec is removed

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-21441: ASoC: imx-audmix: register the card on a proper dev
Viorel Suman [Mon, 15 Apr 2019 12:46:47 +0000 (15:46 +0300)]
MLK-21441: ASoC: imx-audmix: register the card on a proper dev

Register the card on a proper dev pointer.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
6 years agoMGS-4683: integrate GPU 6.4.0 beta early version
Xianzhong [Tue, 16 Apr 2019 14:44:44 +0000 (22:44 +0800)]
MGS-4683: integrate GPU 6.4.0 beta early version

support new features for i.MX8 AI/ML:
1. Android NN with VXC acceleration
2. VXC NN adapter for Tensorflow Lite
3. Unified OpenVX for QM/QXP/mScale
4. OpenVX 1.2 with NN extension
5. Bridged GPU compute on 8QM

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
6 years agoASoC: fsl_audmix: cache pdev->dev pointer
Viorel Suman [Wed, 10 Apr 2019 11:06:39 +0000 (11:06 +0000)]
ASoC: fsl_audmix: cache pdev->dev pointer

There should be no trouble to understand dev = pdev->dev.
This can save some space to have more print info or save
some wrapped lines.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Suggested-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit ecf6715042cf0f738763fe34d1636b707961a58a)

6 years agoMLK-21115-2 ASoC: fsl: replace platform to component
Daniel Baluta [Mon, 15 Apr 2019 13:48:18 +0000 (16:48 +0300)]
MLK-21115-2 ASoC: fsl: replace platform to component

ASoC removed platform and replace it with component
in an effort to unify *all* ASoC components.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-20189-10: ASoC: fsl: dsp: Avoid unnecessary check
Daniel Baluta [Mon, 15 Apr 2019 13:48:06 +0000 (16:48 +0300)]
MLK-20189-10: ASoC: fsl: dsp: Avoid unnecessary check

strtab is always non-null so remove unnecessary check.

This is a follow up of patch
167a6d79f ("ASoC: fsl: Skip checking for string section type")
and finally fixes CID3901026

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
6 years agoMLK-21144 ASoC: fsl: Fix crash with multiple open/close
Daniel Baluta [Wed, 27 Mar 2019 08:25:22 +0000 (10:25 +0200)]
MLK-21144 ASoC: fsl: Fix crash with multiple open/close

Because we are re-initializing the proxy at close it might
happen that work is still pending which causes the following crash:

[   94.699835] Unable to handle kernel NULL pointer dereference at virtual address 00000008
[   94.707923] Mem abort info:
[   94.710722]   Exception class = DABT (current EL), IL = 32 bits
[   94.716637]   SET = 0, FnV = 0
[   94.719686]   EA = 0, S1PTW = 0
[   94.722822] Data abort info:
[   94.725698]   ISV = 0, ISS = 0x00000005
[   94.729530]   CM = 0, WnR = 0
[   94.732504] user pgtable: 4k pages, 48-bit VAs, pgd = ffff8008d9ba3000
[   94.739035] [0000000000000008] *pgd=0000000938419003, *pud=0000000000000000
[   94.746015] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[   94.751589] Modules linked in:
[   94.754652] CPU: 0 PID: 2068 Comm: kworker/0:2 Not tainted 4.14.98-dirty #75
[   94.761700] Hardware name: Freescale i.MX8QM MEK (DT)
[   94.766768] task: ffff8008f23ae200 task.stack: ffff000014378000
[   94.772705] PC is at process_one_work+0x34/0x414
[   94.777325] LR is at process_one_work+0x1e0/0x414

In order to fix this, we make sure that no work is pending before starting
the re-initialization.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 2c00c24be5f8b63636e3f9005e15a3de42058438)

6 years agoMLK-20793: ASoC: fsl_dsp: remove error message
Shengjiu Wang [Thu, 24 Jan 2019 07:20:52 +0000 (15:20 +0800)]
MLK-20793: ASoC: fsl_dsp: remove error message

With non fsl-imx8qxp-mek-dsp.dts, the clock is not assigned
to dsp node, which cause error message when kernel boot up.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit cac03181a5cddfa594a2afc31e36121855e3d507)

6 years agoMLK-20693-3: ASoC: fsl_dsp: Add clocks for peripheral devices
Shengjiu Wang [Wed, 9 Jan 2019 02:21:18 +0000 (10:21 +0800)]
MLK-20693-3: ASoC: fsl_dsp: Add clocks for peripheral devices

Add clocks for peripheral devices

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

6 years agoMLK-20693-2: ASoC: fsl_dsp_cpu: remove the clock operation
Shengjiu Wang [Wed, 9 Jan 2019 02:12:16 +0000 (10:12 +0800)]
MLK-20693-2: ASoC: fsl_dsp_cpu: remove the clock operation

Remove the clock operation in cpu dai, all clock will be
moved to platform driver.
The reason is that the suspend and resume of dsp is handled in
platform driver, if the clock is disabled before the suspend,
the dsp framework can't access the registers of device in suspend.

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

6 years agoMLK-20095-3: ASoC: fsl: dsp: Add ASRC clocks
Daniel Baluta [Mon, 15 Apr 2019 13:36:47 +0000 (16:36 +0300)]
MLK-20095-3: ASoC: fsl: dsp: Add ASRC clocks

We enable the ASRC clocks from CPU side. We only need
the following clocks: "mem", "ipg" and "asrc0..3".

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-20693-1: ASoC: fsl_dsp: remove this workaround of skip sections
Shengjiu Wang [Thu, 27 Dec 2018 08:23:59 +0000 (16:23 +0800)]
MLK-20693-1: ASoC: fsl_dsp: remove this workaround of skip sections

Revert "MLK-18497-13: ASoC: fsl: dsp: Skip SDRAM section update if
fw is already loaded"

This reverts commit a0cffd9a9299362f2b3a4d24b78a8574b736fdfa.

This is just to avoid reconfigure the edma isr handler in dsp
framework, which should be handled by dsp framework.

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

6 years agoMLK-20095-4: ASoC: fsl: Use hardwired system address offset source select for QM
Daniel Baluta [Fri, 14 Dec 2018 17:19:15 +0000 (19:19 +0200)]
MLK-20095-4: ASoC: fsl: Use hardwired system address offset source select for QM

We set system address offset select to 0 on QM because of the following reasons:
* SC_C_OFS_PERIPH, it is not available for QM
* SC_C_OFS_AUDIO, it is not used
* SC_C_OFS_IRQ, needs to get outside of the VPU.

A simplified version of the code is:

if (dsp_priv->dsp_board_type == DSP_IMX8QXP_TYPE) {
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_SEL, 1);
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_PERIPH, 0x5A);
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_IRQ, 0x51);
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_AUDIO, 0x80);
}
} else {
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_SEL, 0);
}

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 1607309080dca31c75f1cb7a2577afcb184fc291)

6 years agoMLK-20095-3: ASoC: fsl: Differentiate between QXP and QM
Daniel Baluta [Fri, 14 Dec 2018 17:15:07 +0000 (19:15 +0200)]
MLK-20095-3: ASoC: fsl: Differentiate between QXP and QM

On QM the DSP is inside the VPU subsystem while in QXP
it is inside the Audio DMA subsystem. For this reason
there are "subtle" differences.

Introduce new compatible string for QM to help us correctly
configure the DSP depending on the board they run.

dsp_mem_msg structure is shared with the DSP, so by introducing
new member dsp_board_type we can let DSP know on which target it runs.

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 1e63c7b0935f09c7f3cccb3bea04071be4bc5b67)

6 years agoMLK-17481-3: ASoC: fsl: Fix DSP memory mappings
Daniel Baluta [Wed, 23 May 2018 06:40:55 +0000 (09:40 +0300)]
MLK-17481-3: ASoC: fsl: Fix DSP memory mappings

We load DSP firmware from the ARM side at 0x556e8000 but because the
compiler generated memory layout starts at 0x596e8000 we need to do
some fixups.

Thus, each address (in DSP local memory) generated by the compiler
needs to be substracted an offset = 0x596e8000 - 0x556e8000 = 0x4000000.

Because this only happens on QM we will use dts to specify the offset.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 8d4518d2a5d956549e829470af15003d7adff841)
(cherry picked from commit 513befc82cd9b622ec145b3886f49f8551301c08)

6 years agoMLK-20189-6: ASoC: fsl: Skip checking for string section type
Daniel Baluta [Fri, 9 Nov 2018 09:35:46 +0000 (11:35 +0200)]
MLK-20189-6: ASoC: fsl: Skip checking for string section type

e_shstrndx already contains the section header index, so
shdr->sh_type will always be SHT_STRTAB.

Remove this redundant check and make Coverity happy.

Fixes: CID3901026
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 93a9e535f4d59c5e02cdfacca5ff59fd18193aec)

6 years agoMLK-20189-5: ASoC: fsl: dsp_proxy: Unlock proxy->lock on error path
Daniel Baluta [Thu, 8 Nov 2018 14:13:12 +0000 (16:13 +0200)]
MLK-20189-5: ASoC: fsl: dsp_proxy: Unlock proxy->lock on error path

xf_cmd_send_recv returns with lock taken if waiting was
interrupted by a signal.

This fixes Coverity issues: CID5233120 / CID5233060

Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 1e34cf3fb346b04ad47238141848f2e0f94566cd)

6 years agoMLK-20189-4: ASoC: fsl: library_load: Check return value for kernel_read
Daniel Baluta [Thu, 8 Nov 2018 14:02:40 +0000 (16:02 +0200)]
MLK-20189-4: ASoC: fsl: library_load: Check return value for kernel_read

Bail out if kernel_read returns an error.

Fixes: CID1477415

Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 3ba426cd2d6c6f38cf2fcbd4bb1c8a4577566892)

6 years agoMLK-20189-3: ASoC: fsl: library_load: Remove dead code
Daniel Baluta [Thu, 8 Nov 2018 13:52:08 +0000 (15:52 +0200)]
MLK-20189-3: ASoC: fsl: library_load: Remove dead code

At this point err is always 0. So, just remove the check.

Fixes: CID1477380

Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit f029b9ebfe20f9198308ad77b4b1f2707b4ff258)

6 years agoMLK-20189-2: ASoC: dsp: Replace atomic_dec_return with atomic_dec
Daniel Baluta [Thu, 8 Nov 2018 13:07:56 +0000 (15:07 +0200)]
MLK-20189-2: ASoC: dsp: Replace atomic_dec_return with atomic_dec

Return value is not used so better use atomic_dec.
This also silences coverity warning CID3344689.

Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit b44da5368dde3c9d6b5b5817900dea9ae79a1035)

6 years agoMLK-20189-1: ASoC: fsl: dsp: Unlock proxy->lock on error path
Daniel Baluta [Thu, 8 Nov 2018 12:40:50 +0000 (14:40 +0200)]
MLK-20189-1: ASoC: fsl: dsp: Unlock proxy->lock on error path

xf_cmd_recv will return with lock taken in two cases:
* msg was received
* waiting for msg was interrupted by a signal

Make sure we unlock proxy->lock in both cases.

This fixes Coverity issue: CID3335482.

Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 3f0ef6a5683ddc1776b290dbcea8411357d08a46)

6 years agoMLK-20222-4 sound: Update SCFW API
Ranjani Vaidyanathan [Fri, 2 Nov 2018 21:05:51 +0000 (16:05 -0500)]
MLK-20222-4 sound: Update SCFW API

Update SCFW API to the following commit:
"
   ("430d1e3646fbe75e339e18abf2330565eac906e0")
   Author: Chuck Cannon <chuck.cannon@nxp.com>
   Date:   Fri Nov 2 15:25:45 2018 -0500

   SCF-105: RN updates.
"

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
(cherry picked from commit a84fd02f0b4377e7c53cb2184bd5acd0a2896157)

6 years agoMLK-20094: ASoC: fsl: dsp: Fix crash in compress cleanup path
Daniel Baluta [Fri, 2 Nov 2018 15:20:53 +0000 (17:20 +0200)]
MLK-20094: ASoC: fsl: dsp: Fix crash in compress cleanup path

We must find a way to no longer touch resources after they are
cleand up.

Now, after a stress test we get the following crash:

[ 2156.863772] fsl-dsp 596e8000.dsp: xf_pool_alloc failed
[ 2156.869337] Unable to handle kernel NULL pointer dereference at
virtual address 00000060
[ 2157.148594] [<ffff000008d8839c>] _raw_spin_lock+0x14/0x48
[ 2157.153995] [<ffff000008b3e0b8>] xf_cmd_send_recv_complete+0x40/0xf0
[ 2157.160354] [<ffff000008b3e470>] xf_close+0x40/0x88
[ 2157.165239] [<ffff000008b3f7a4>] xaf_comp_delete+0x5c/0x70
[ 2157.170730] [<ffff000008b40530>] dsp_platform_compr_free+0xa0/0xe8
[ 2157.176917] [<ffff000008b287fc>] soc_compr_free_fe+0x144/0x1a0
[ 2157.182754] [<ffff000008b11b24>] snd_compr_free+0x64/0x98

This happens because:

1) dsp_platform_process work handler waits in a loop for
   messages to arrive.
2) when cplay process finishes it cleans up most of the
   resources.
3) when another cplay process starts it reinitializes the
  resources including queues for example.
4) a message will be generated and kernel will crash because
   dsp_platform_process uses the older queues.

A solution for this is to make sure dsp_platform_process work loop
is stopped at cleanup time.

We use is_active state and signal dsp_platform_process handler to
finish because we are on the cleanup path.

While at it replace cancel_work with cancel_work sync to be sure
that work handler ends before going on with the rest of the cleanup.

Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit c0f7ef8eaf096523e9ebe3acd818e5f67fdb639f)

6 years agoMLK-18279: ASoC: fsl_dsp: get the information of reserved memory from
Daniel Baluta [Mon, 15 Apr 2019 14:03:33 +0000 (17:03 +0300)]
MLK-18279: ASoC: fsl_dsp: get the information of reserved memory from
dts

The reserved memory for dsp is defined in dts file, however, the dsp
driver has also defined the address and size of this reserved memory,
which is repeated and inflexible.
So by cancelling the definition in dsp driver and use system API to
get the information of reserved memory from dts dynamically to fix
this problem.

Signed-off-by: Weiguang Kong <weiguang.kong@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
6 years agoMLK-21453: crypto: caam - fix Mentor's port, merge conflict resolutions
Horia Geantă [Mon, 15 Apr 2019 13:28:21 +0000 (16:28 +0300)]
MLK-21453: crypto: caam - fix Mentor's port, merge conflict resolutions

1. imx_4.14.y commit ("6c68d27892c4 MLK-18082: boot: dtsi: Align DTSI")
changes in Documentation/devicetree/bindings/crypto/fsl-sec4.txt were
omitted, add them now.

2. Some commits (see Fixes tags) are incomplete / merge conflict
resolutions are incorrect.

Fixes: 0cab3173f44a ("MLK-18082: ARM: dts: imx: Change size of caam-sm to correct size")
Fixes: 9c5e81b8410b ("MLK-9710-18 snvs - make SECVIO module device tree correct")
Reviewed-by: Franck LENORMAND <franck.lenormand@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
6 years agoMLK-19449: crypto: caam - Add Power Management
Franck LENORMAND [Tue, 19 Mar 2019 15:05:30 +0000 (16:05 +0100)]
MLK-19449: crypto: caam - Add Power Management

Add support for suspend and resume operation for PM in CAAM driver.

When the CAAM goes in suspend, the hardware is considered to do nothing.

On some platforms, the power of the CAAM is not turned off so it keeps
its configuration.

On other platforms, it doesn't so it is necessary to save the state of
the CAAM:
 - JRs MID
 - Address of input and output rings

Limitation:
When the CAAM is powered OFF, it is resetted so the JDKEK and TDKEK
changes. This impacts crypto transforms using MDHA split-keys
which are kept over suspend as they are encrypted with the JDKEK:
 - hmac(*) from caamhash.c
 - authenc(hmac(*),*) from caamalg.c
 - echainiv(authenc(hmac(*),*)) from caamalg.c
The issue was already present in current code so this patch does not
add a regression in this regard.

Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
6 years agoMLK-19449: crypto: caam - Change structure type representing DECO MID
Franck LENORMAND [Tue, 5 Mar 2019 13:20:34 +0000 (14:20 +0100)]
MLK-19449: crypto: caam - Change structure type representing DECO MID

The structure partid is not suitable to represent the DECO MID register.

This patch replace partid by masterid which is more appropriate.

Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
6 years agoSSI-35: crypto: caam - Do not rely on common index of jr
Franck LENORMAND [Fri, 15 Feb 2019 15:24:35 +0000 (16:24 +0100)]
SSI-35: crypto: caam - Do not rely on common index of jr

With current code, the index are stored in an array at their common index,
ie jr0 store at index 0, jr1 at 1, ...

It force to use buggy mechanic to compute it and is not scalable.

This patch removes the mechanic of computation of hardware register
addresses and the notion of first_jr_index.

Instead the first JR available is set to index 0 of the table and so on.

Legacy code was retrieving the index of the first jr to access registers.
With this new way, we simply always access the first jr.

This is working because after the configuration of the JR in ctl
(enable_jobrings), the driver checks that there is at least 1 JR.
Without this, we could create segfaults.

Fixes: de9807e6e0de ("MLK-15473-1: crypto: caam: Add CAAM driver support for iMX8 soc family")
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
6 years agocrypto: caam - lower SM test verbosity
Horia Geantă [Thu, 7 Feb 2019 18:07:04 +0000 (20:07 +0200)]
crypto: caam - lower SM test verbosity

Let's use dev_dbg() instead of dev_info() to minimize verbosity in case
we're not interested in low-level details.

While here, replace dev_info() with dev_err() in places where errors are
reported.

Reported-by: Abel Vesa <abel.vesa@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
6 years agoMLK-20204: drivers: crypto: caam: Remove deadcode on 32bit platform
Franck LENORMAND [Fri, 23 Nov 2018 15:06:45 +0000 (16:06 +0100)]
MLK-20204: drivers: crypto: caam: Remove deadcode on 32bit platform

When building on a platform with a 32bit DMA address, taking the
upper 32 bits makes no sense.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
6 years agoMLK-20204: drivers: crypto: caam: sm: test: Dealloc keyslot properly
Franck LENORMAND [Fri, 23 Nov 2018 10:47:18 +0000 (11:47 +0100)]
MLK-20204: drivers: crypto: caam: sm: test: Dealloc keyslot properly

Some keyslot values were used during deallocation
but were not initiliazed nor set properly.

drivers/crypto/caam/sm_test.c:446: CID 3901091 (#1 of 1):
  Type: Uninitialized scalar variable (UNINIT)
  Classification: Unclassified
  Severity: Unspecified
  Action: Modeling Required
  Owner: nxa21133
  Defect only exists locally.
drivers/crypto/caam/sm_test.c:98:
  1. var_decl: Declaring variable "keyslot24" without initializer.
drivers/crypto/caam/sm_test.c:113:
  2. path: Condition "!ctrlpriv", taking false branch.
drivers/crypto/caam/sm_test.c:118:
  3. path: Condition "kspriv == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:123:
  4. path: Condition "!units", taking false branch.
drivers/crypto/caam/sm_test.c:130:
  5. path: Condition "units < 2", taking false branch.
drivers/crypto/caam/sm_test.c:150:
  6. path: Condition "blob8 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:150:
  7. path: Condition "blob16 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:150:
  8. path: Condition "blob24 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:150:
  9. path: Condition "blob32 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:178:
  10. path: Condition "sm_keystore_slot_alloc(ksdev, unit,
  (16U /* (8 % 16) ? (8 >> 4) + 1 << 4 : 8 */), &keyslot8)", taking true
  branch.
drivers/crypto/caam/sm_test.c:179:
  11. path: Jumping to label "dealloc".
drivers/crypto/caam/sm_test.c:446:
  12. uninit_use_in_call: Using uninitialized value "keyslot24" when
  calling "sm_keystore_slot_dealloc".
drivers/crypto/caam/sm_store.c:771:
  12.1. path: Condition "smpriv->slot_alloc == NULL", taking false branch.
drivers/crypto/caam/sm_store.c:771:
  12.2. path: Condition "smpriv->pagedesc[unit].ksdata == NULL", taking
  false branch.
drivers/crypto/caam/sm_store.c:775:
  12.3. read_parm: Reading a parameter value.

drivers/crypto/caam/sm_test.c:445: CID 3901093 (#1 of 1):
  Type: Uninitialized scalar variable (UNINIT)
  Classification: Unclassified
  Severity: Unspecified
  Action: Modeling Required
  Owner: nxa21133
  Defect only exists locally.
drivers/crypto/caam/sm_test.c:98:
  1. var_decl: Declaring variable "keyslot16" without initializer.
drivers/crypto/caam/sm_test.c:113:
  2. path: Condition "!ctrlpriv", taking false branch.
drivers/crypto/caam/sm_test.c:118:
  3. path: Condition "kspriv == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:123:
  4. path: Condition "!units", taking false branch.
drivers/crypto/caam/sm_test.c:130:
  5. path: Condition "units < 2", taking false branch.
drivers/crypto/caam/sm_test.c:150:
  6. path: Condition "blob8 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:150:
  7. path: Condition "blob16 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:150:
  8. path: Condition "blob24 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:150:
  9. path: Condition "blob32 == NULL", taking false branch.
drivers/crypto/caam/sm_test.c:178:
  10. path: Condition "sm_keystore_slot_alloc(ksdev, unit,
  (16U /* (8 % 16) ? (8 >> 4) + 1 << 4 : 8 */), &keyslot8)", taking true
  branch.
drivers/crypto/caam/sm_test.c:179:
  11. path: Jumping to label "dealloc".
drivers/crypto/caam/sm_test.c:445:
  12. uninit_use_in_call: Using uninitialized value "keyslot16" when
  calling "sm_keystore_slot_dealloc".
drivers/crypto/caam/sm_store.c:771:
  12.1. path: Condition "smpriv->slot_alloc == NULL", taking false branch.
drivers/crypto/caam/sm_store.c:771:
  12.2. path: Condition "smpriv->pagedesc[unit].ksdata == NULL", taking
  false branch.
drivers/crypto/caam/sm_store.c:775:
  12.3. read_parm: Reading a parameter value.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
6 years agoMLK-20204: drivers: crypto: caam: sm: Remove deadcode
Franck LENORMAND [Fri, 23 Nov 2018 10:37:28 +0000 (11:37 +0100)]
MLK-20204: drivers: crypto: caam: sm: Remove deadcode

There was some code to free the keystore but the current
state of the function make this code unreachable so
remove it.

Coverity explanation:
drivers/crypto/caam/sm_store.c:654: CID 17839 (#1 of 1):
  Type: Logically dead code (DEADCODE)
  Classification: Bug
  Severity: Major
  Action: Fix Required
  Owner: nxa21133
  Defect only exists locally.
drivers/crypto/caam/sm_store.c:625:
  cond_null: Condition "keystore_data == NULL", taking true branch. Now
  the value of "keystore_data" is "NULL".
drivers/crypto/caam/sm_store.c:653:
  null: At condition "keystore_data != NULL", the value of "keystore_data"
  must be "NULL".
drivers/crypto/caam/sm_store.c:653:
  dead_error_condition: The condition "keystore_data != NULL" cannot be
  true.
drivers/crypto/caam/sm_store.c:654:
  dead_error_line: Execution cannot reach this statement:
  "kfree(keystore_data);".

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
6 years agoMLK-18345: drivers: caam: add support for i.mx8mm
Silvano di Ninno [Thu, 17 May 2018 16:44:03 +0000 (18:44 +0200)]
MLK-18345: drivers: caam: add support for i.mx8mm

Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
Reviewed-by: Franck Lenormand <franck.lenormand@nxp.com>
6 years agoMLK-21452 drivers/mxc/Kconfig: Only build imx8 vpu on arm64
Leonard Crestez [Mon, 15 Apr 2019 12:53:27 +0000 (15:53 +0300)]
MLK-21452 drivers/mxc/Kconfig: Only build imx8 vpu on arm64

There is no ARCH_MXC_ARM64 in 4.19 because upstream rejected it. We must
still check for ARM64 though because vpu compilation fails on 32-bit
platforms in multiple ways.

This fixes build for imx6/7

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-18662 iio: adc: imx8qxp_adc: add runtime suspend/resume support
Haibo Chen [Fri, 22 Jun 2018 07:50:28 +0000 (15:50 +0800)]
MLK-18662 iio: adc: imx8qxp_adc: add runtime suspend/resume support

Add runtime suspend/resume support for imx8QXP ADC

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

6 years agoMLK-18612-3 iio: adc: imx8qxp_adc: fix register setting
Haibo Chen [Thu, 14 Jun 2018 09:06:06 +0000 (17:06 +0800)]
MLK-18612-3 iio: adc: imx8qxp_adc: fix register setting

For the register CFG/TCTRLx/CMDLx/CMDHx, all the defined bits of
these register are setting, so no need to read the register
first, and use "|=", and will cause issue, the bit setting will be
impact by the last time setting. So write these register directlly.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 7e5abc21dda7a82900b6337360361ae0226b1876)

6 years agoMLK-18612-1 iio: adc: imx8qxp_adc: add 4 more input channel
Haibo Chen [Thu, 14 Jun 2018 08:08:40 +0000 (16:08 +0800)]
MLK-18612-1 iio: adc: imx8qxp_adc: add 4 more input channel

The ADC on imx8qxp/imx8qm totally has 8 differential external
analog inputs per instance.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 483083f734fedd5156f9c53d56355c9ad0a2d2da)