linux.git
5 years agoMLK-22257: VPU Decoder: clear pending cmd if cmd is timeout
ming_qian [Fri, 12 Jul 2019 07:24:31 +0000 (15:24 +0800)]
MLK-22257: VPU Decoder: clear pending cmd if cmd is timeout

if cmd is timeout, driver will set hang_status,
if driver doesn't clear the pending cmd who is timeout,
driver will prevent the next cmd to execute.

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22112-3 media: mipi_csi: replace reset flow for phy
Robby Cai [Fri, 14 Jun 2019 05:52:56 +0000 (13:52 +0800)]
MLK-22112-3 media: mipi_csi: replace reset flow for phy

After dispmix reset driver has been introduced, use reset control framework
to do the PHY reset for mipi csi.

BuildInfo:
 - ATF fecb1ef

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 2f6744d6ba2045b51846fe6b8b280b854a12c475)

5 years agoMLK-22112-2 arm64: dts: define resets property for mipi csi
Robby Cai [Fri, 14 Jun 2019 05:51:20 +0000 (13:51 +0800)]
MLK-22112-2 arm64: dts: define resets property for mipi csi

The dispmix-reset device can be used to control MIPI CSI PHY reset.
Define 'resets' property for it to replace 'dispmix_gpr' usage.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6a1711de8b1c79f87a7b6ffd592988c916a53202)

5 years agoMLK-22112-1 arm64: dts: imx8mm: decrease the iomem range for csi bridge
Robby Cai [Fri, 14 Jun 2019 02:19:55 +0000 (10:19 +0800)]
MLK-22112-1 arm64: dts: imx8mm: decrease the iomem range for csi bridge

it's conflicted with dispmix-reset device and will meet the following error.

[    1.630523] mx6s-csi 32e20000.csi1_bridge: can't request region for resource [mem 0x32e20000-0x32e2ffff]

decrease the range to avoid the conflict.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit b0e530f7598e6bc315e68adff310e9f7f5a452d9)

5 years agoMLK-22250: VPU Decoder: get seq info from event data instead of rpc
ming_qian [Thu, 11 Jul 2019 01:31:59 +0000 (09:31 +0800)]
MLK-22250: VPU Decoder: get seq info from event data instead of rpc
memory

There is rick getting seq info from rpc
It is also compatible with previous practices

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22218 arm64: imx8qm: configure Open Drain for SIM_IO pin
Joakim Zhang [Fri, 5 Jul 2019 04:02:00 +0000 (12:02 +0800)]
MLK-22218 arm64: imx8qm: configure Open Drain for SIM_IO pin

Configure Open Drain for SIM_IO pin. SIM_IO should be configured to Open
Drain and Pull Up.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-22217 mxc: emvsim: add value adjustment for cwt/bwt timer
Joakim Zhang [Sat, 1 Jun 2019 02:40:33 +0000 (10:40 +0800)]
MLK-22217 mxc: emvsim: add value adjustment for cwt/bwt timer

Add value adjustment for cwt/bwt timer, otherwise it will fail with
ultimate cwt/bwt value.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-22216 mxc: emvsim: last character need be transmitted separately with no guard...
Joakim Zhang [Sat, 22 Jun 2019 07:07:41 +0000 (15:07 +0800)]
MLK-22216 mxc: emvsim: last character need be transmitted separately with no guard time

It can't receive when transmitting on EMVSIM IP. ICC will send response
quickly when Terminal transmits last character with guard time. If the
response came to Terminal before the guard time expired, the Terminal
would not receive the respone. So should transmit last character with no
guard time.

This patch intends to fix the communication failure when setting guard
time.

This will cause about 1 ETU delay before transmitting last character
(according to timing measured), but it does not matter.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-22215 mxc: emvsim: correct irq mask and clear irq status before receiving
Joakim Zhang [Thu, 23 May 2019 04:08:17 +0000 (12:08 +0800)]
MLK-22215 mxc: emvsim: correct irq mask and clear irq status before receiving

Just clean up the code and normalize the code.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-22214 mxc: emvsim: clean up the code in ATR stage
Joakim Zhang [Thu, 23 May 2019 01:49:15 +0000 (09:49 +0800)]
MLK-22214 mxc: emvsim: clean up the code in ATR stage

Clean up the code in ATR stage.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-22213 mxc: emvsim: read TS character before updating value of GPCNT1
Joakim Zhang [Thu, 23 May 2019 01:17:47 +0000 (09:17 +0800)]
MLK-22213 mxc: emvsim: read TS character before updating value of GPCNT1

Should read TS character before updating value of GPCNT1, because TS
character will also cost 12 etus.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-22211 mxc: emvsim: should not clear PEF/FEF flag in irq handler
Joakim Zhang [Tue, 4 Jun 2019 01:41:46 +0000 (09:41 +0800)]
MLK-22211 mxc: emvsim: should not clear PEF/FEF flag in irq handler

Shouldn't clear PEF/FEF flag in irq handler as they are just a flag which
can't trigger interrupt. And they will be check later in irq handler.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-22210 mxc: emvsim: enable ICM mode
Joakim Zhang [Sat, 1 Jun 2019 06:19:51 +0000 (14:19 +0800)]
MLK-22210 mxc: emvsim: enable ICM mode

Once detected a valid TS, the ICM bit is cleared and the data format bit,
IC bit , is set to appropriate value depending on the data format
detected using the initial character.

When TS is 0x3B (direct convention) in cold reset, and then become 0x3F
(inverse convention) in warm reset, it will not in ICM mode.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-22154 clk: imx: Correct the usb ctrl clock's parent
Jacky Bai [Tue, 2 Jul 2019 08:50:38 +0000 (16:50 +0800)]
MLK-22154 clk: imx: Correct the usb ctrl clock's parent

The USB_CTRL clock's parent clock should be from USB_BUS clock,
so correct it to maintain the correct clock relationship.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit 90f40d4d891cc7b321a52bd99b2ff4fe1c98cb93)

5 years agoMLK-21957-3: ASoC: fsl_sai: add bitcount and timestamp controls
Viorel Suman [Wed, 5 Jun 2019 13:46:32 +0000 (13:46 +0000)]
MLK-21957-3: ASoC: fsl_sai: add bitcount and timestamp controls

Bitcount and timestamp support added in SAI IP recently.
Add the related controls in SAI driver.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
5 years agoMLK-22247 sound: asoc: change micfil default settings
Irina Patru [Wed, 10 Jul 2019 11:13:28 +0000 (11:13 +0000)]
MLK-22247 sound: asoc: change micfil default settings

Previous default settings resulted in loose dynamic
range and low sound level.
New default configuration changes:
 - outgain = 2
 - quality mode = VLQ0
 - dc remover = bypass

Signed-off-by: Irina Patru <ioana-irina.patru@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
5 years agousb: chipidea: udc: workaround for endpoint conflict issue
Peter Chen [Mon, 17 Jun 2019 01:49:07 +0000 (09:49 +0800)]
usb: chipidea: udc: workaround for endpoint conflict issue

An endpoint conflict occurs when the USB is working in device mode
during an isochronous communication. When the endpointA IN direction
is an isochronous IN endpoint, and the host sends an IN token to
endpointA on another device, then the OUT transaction may be missed
regardless the OUT endpoint number. Generally, this occurs when the
device is connected to the host through a hub and other devices are
connected to the same hub.

The affected OUT endpoint can be either control, bulk, isochronous, or
an interrupt endpoint. After the OUT endpoint is primed, if an IN token
to the same endpoint number on another device is received, then the OUT
endpoint may be unprimed (cannot be detected by software), which causes
this endpoint to no longer respond to the host OUT token, and thus, no
corresponding interrupt occurs.

There is no good workaround for this issue, the only thing the software
could do is numbering isochronous IN from the highest endpoint since we
have observed most of device number endpoint from the lowest.

Cc: <stable@vger.kernel.org> #v3.14+
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c19dffc0a9511a7d7493ec21019aefd97e9a111b)

5 years agoMLK-22251:VPU Decoder: send fw reset cmd directly
ming_qian [Thu, 11 Jul 2019 05:03:42 +0000 (13:03 +0800)]
MLK-22251:VPU Decoder: send fw reset cmd directly

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22241-4 imx: include fsl_hvc.h
Peng Fan [Thu, 11 Jul 2019 00:59:36 +0000 (08:59 +0800)]
MLK-22241-4 imx: include fsl_hvc.h

Fix build break, this file was missed when adding xen 4.19 support.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoMLK-22038: VPU Decoder: cancel work when suspend
ming_qian [Wed, 10 Jul 2019 01:34:59 +0000 (09:34 +0800)]
MLK-22038: VPU Decoder: cancel work when suspend

fix kernel panic when suspend

WARNING: CPU: 0 PID: 6579 at kernel/workqueue.c:2069
process_one_work+0x58/0x318

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22241-3 arm: mm: xen: use __GPF_DMA32 for arm64
Peng Fan [Tue, 9 Jul 2019 08:11:34 +0000 (16:11 +0800)]
MLK-22241-3 arm: mm: xen: use __GPF_DMA32 for arm64

arm64 shares some code under arch/arm/xen, including mm.c.
However ZONE_DMA is removed by commit
ad67f5a6545("arm64: replace ZONE_DMA with ZONE_DMA32").
So to ARM64, need use __GFP_DMA32.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
5 years agoMLK-22241-2 imx: ipc: include back HVC SC
Peng Fan [Tue, 9 Jul 2019 08:07:39 +0000 (16:07 +0800)]
MLK-22241-2 imx: ipc: include back HVC SC

This is a porting from 4.14.98
commit <b042bb0ec66e> ("MLK-18592-1 soc: imx: use vendor hvc to communiate with SCU")
to make dom0 share same MU channel with XEN.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
5 years agoMLK-22241-1 arm64: dts: fix dom0/u
Peng Fan [Tue, 9 Jul 2019 08:05:03 +0000 (16:05 +0800)]
MLK-22241-1 arm64: dts: fix dom0/u

lvds/dpu related reg property changed, so need to update dom0 to
passthrought the original reg to domu, however xen only support
4KB page, so enlarge the passthrough area, this not hurt linux,
it only let xen create big stage 2 mapping.

Drop some reg property in DomU, because domu dts include
fsl-imx8qm-device.dtsi, need to align with dtsi to avoid override
reg, otherwise domu might access wrong reg.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
5 years agoMLK-20780 virtio_ring: check dma_mem for xen_domain
Peng Fan [Mon, 21 Jan 2019 02:44:49 +0000 (10:44 +0800)]
MLK-20780 virtio_ring: check dma_mem for xen_domain

on i.MX8QM, M4_1 is communicating with DomU using rpmsg with a fixed
address as the dma mem buffer which is predefined.

Without this patch, the flow is:
vring_map_one_sg -> vring_use_dma_api
                 -> dma_map_page
       -> __swiotlb_map_page
                ->swiotlb_map_page
->__dma_map_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir);
However we are using per device dma area for rpmsg, phys_to_virt
could not return a correct virtual address for virtual address in
vmalloc area. Then kernel panic.

With this patch, vring_use_dma_api will return false, and
vring_map_one_sg will return sg_phys(sg) which is the correct phys
address in the predefined memory region.
vring_map_one_sg -> vring_use_dma_api
                 -> sg_phys(sg)

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

5 years agoMLK-18789-3: arm64: defconfig: Add Seiko panel to defconfig
Robert Chiras [Fri, 10 Aug 2018 07:09:02 +0000 (10:09 +0300)]
MLK-18789-3: arm64: defconfig: Add Seiko panel to defconfig

Add Seiko 43WVF1G panel to our defconfig.
Needed for QXP eLCDIF.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
5 years agoMLK-18789-2: drm/bridge: Add driver for legacy Freescale Seiko 43WVFIG adapter
Robert Chiras [Mon, 8 Oct 2018 16:47:43 +0000 (19:47 +0300)]
MLK-18789-2: drm/bridge: Add driver for legacy Freescale Seiko 43WVFIG adapter

This is an adapter card made for the 4.3", 800x480, LCD panel Seiko
43WVFIG. The LCD panel is a 24bit DPI bus, while the adapter card has
two ports: 18-bit and 24-bit data input. For the 18-bit data input, the
adapter card is demuxing some of the data lines, in order to feed all of
the 24 lines needed by the LCD.
This driver handles both this use-cases.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
5 years agoMGS-4989 GPU: integrate 6.4.0.RC1 kernel driver
Xianzhong [Tue, 9 Jul 2019 17:10:51 +0000 (01:10 +0800)]
MGS-4989 GPU: integrate 6.4.0.RC1 kernel driver

include more bug-fixing for Vulkan 1.1 and NN driver

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
5 years agoMLK-22038: don't clear instance before reset firmware
ming_qian [Mon, 8 Jul 2019 05:33:42 +0000 (13:33 +0800)]
MLK-22038: don't clear instance before reset firmware

reset firmware may be called after snapshot,
in this case, we shouldn't clear instance,
otherwise, the stream will hang

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22039: Revert "MLK-19365: crypto: ccm: Cache aligned auth_data"
Horia Geantă [Wed, 3 Jul 2019 13:12:38 +0000 (16:12 +0300)]
MLK-22039: Revert "MLK-19365: crypto: ccm: Cache aligned auth_data"

This reverts commit 486222e88ce3bbc5dd7727e48901d1bf507d3892.

Now that the IV update is done by CAAM engine, the cacheline sharing issue
is no longer noticed. Thus this fix is no longer needed.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
5 years agoMLK-22039: Revert "MLK-14785 CAAM: Fix gcm.c to work correctly with CAAM"
Horia Geantă [Wed, 3 Jul 2019 13:12:23 +0000 (16:12 +0300)]
MLK-22039: Revert "MLK-14785 CAAM: Fix gcm.c to work correctly with CAAM"

This reverts commit 80e2831298dc83891d8e6b5d4d71b3692aa74e30.

Now that the IV update is done by CAAM engine, the cacheline sharing issue
is no longer noticed. Thus this fix is no longer needed.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
5 years agoMLK-22039: Revert "crypto: gcm: Fixed compilation error"
Horia Geantă [Wed, 3 Jul 2019 13:12:12 +0000 (16:12 +0300)]
MLK-22039: Revert "crypto: gcm: Fixed compilation error"

This reverts commit 9134c5ada2853c883e632bc35a19759f282f6591.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
5 years agoMLK-22039: Revert "MLK-19365: crypto: gcm: Cache aligned auth_data"
Horia Geantă [Wed, 3 Jul 2019 13:12:03 +0000 (16:12 +0300)]
MLK-22039: Revert "MLK-19365: crypto: gcm: Cache aligned auth_data"

This reverts commit dd624114c50b1a8cb1bec091e20eaf2539695cde.

Now that the IV update is done by CAAM engine, the cacheline sharing issue
is no longer noticed. Thus this fix is no longer needed.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
5 years agoMLK-22039: crypto: caam - update IV using HW support
Horia Geantă [Mon, 10 Jun 2019 13:30:59 +0000 (16:30 +0300)]
MLK-22039: crypto: caam - update IV using HW support

Modify drivers to perform skcipher IV update using the crypto engine,
instead of performing the operation in SW.

Besides being more efficient, this also fixes IV update for CTR mode.

Output HW S/G table is appended with an entry pointing to the same
IV buffer used as input (which is now mapped BIDIRECTIONAL).

AS (Algorithm State) parameter of the OPERATION command is changed
from INIFINAL to INIT in descriptors used by ctr(aes), cbc(aes).
This is needed since in case FINAL bit is set, HW skips IV updating
in the Context Register for the last data block.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 334d37c9e26364511f0673ef155e2ad207316e90)

backported to imx_4.19.y

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
5 years agoMLK-22039: crypto: caam - use len instead of nents for bulding HW S/G table
Horia Geantă [Mon, 10 Jun 2019 13:30:58 +0000 (16:30 +0300)]
MLK-22039: crypto: caam - use len instead of nents for bulding HW S/G table

Currently, conversion of SW S/G table into HW S/G layout relies on
nents returned by sg_nents_for_len(sg, len).
However this leaves the possibility of HW S/G referencing more data
then needed: since buffer length in HW S/G entries is filled using
sg_dma_len(sg), the last entry in HW S/G table might have a length
that is bigger than needed for the crypto request.

This way of S/G table conversion is fine, unless after converting a table
more entries have to be appended to the HW S/G table.
In this case, crypto engine would access data from the S/G entry having
the incorrect length, instead of advancing in the S/G table.
This situation doesn't exist, but the upcoming implementation of
IV update for skcipher algorithms needs to add a S/G entry after
req->dst S/G (corresponding to output IV).

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 059d73eea6409873446a858dd64a5bec9bf68b70)

backported to imx_4.19.y

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
5 years agoMLK-22039: crypto: caam - limit output IV to CBC to work around CTR mode DMA issue
Ard Biesheuvel [Fri, 31 May 2019 08:13:06 +0000 (10:13 +0200)]
MLK-22039: crypto: caam - limit output IV to CBC to work around CTR mode DMA issue

The CAAM driver currently violates an undocumented and slightly
controversial requirement imposed by the crypto stack that a buffer
referred to by the request structure via its virtual address may not
be modified while any scatterlists passed via the same request
structure are mapped for inbound DMA.

This may result in errors like

  alg: aead: decryption failed on test 1 for gcm_base(ctr-aes-caam,ghash-generic): ret=74
  alg: aead: Failed to load transform for gcm(aes): -2

on non-cache coherent systems, due to the fact that the GCM driver
passes an IV buffer by virtual address which shares a cacheline with
the auth_tag buffer passed via a scatterlist, resulting in corruption
of the auth_tag when the IV is updated while the DMA mapping is live.

Since the IV that is returned to the caller is only valid for CBC mode,
and given that the in-kernel users of CBC (such as CTS) don't trigger the
same issue as the GCM driver, let's just disable the output IV generation
for all modes except CBC for the time being.

Fixes: 854b06f76879 ("crypto: caam - properly set IV after {en,de}crypt")
Cc: Horia Geanta <horia.geanta@nxp.com>
Cc: Iuliana Prodan <iuliana.prodan@nxp.com>
Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit ed527b13d800dd515a9e6c582f0a73eca65b2e1b)

backported to imx_4.19.y

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
5 years agoMLK-22039: crypto: caam - print IV only when non NULL
Sascha Hauer [Thu, 23 May 2019 08:50:27 +0000 (10:50 +0200)]
MLK-22039: crypto: caam - print IV only when non NULL

Since eaed71a44ad9 ("crypto: caam - add ecb(*) support") the IV can be
NULL, so only dump it when it's non NULL as designated by the ivsize
variable.

Fixes: eaed71a44ad9 ("crypto: caam - add ecb(*) support")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit f6b99b6e18657aa1222b0c51ad20ac674e764281)

backported to imx_4.19.y

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
5 years agoMLK-22039: crypto: caam - print debugging hex dumps after unmapping
Sascha Hauer [Thu, 16 May 2019 14:24:42 +0000 (16:24 +0200)]
MLK-22039: crypto: caam - print debugging hex dumps after unmapping

For encryption the destination pointer was still mapped, so the hex dump
may be wrong. The IV still contained the input IV while printing instead
of the output IV as intended.

For decryption the destination pointer was still mapped, so the hex dump
may be wrong. The IV dump was correct.

Do the hex dumps consistenly after the buffers have been unmapped and
in case of IV copied to their final destination.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit bb992bc418e12d4658d39e037f610e0d03940d86)

backported to imx_4.19.y

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
5 years agoMLK-22039: Revert "MLK-14611 Fix CBC mode support by returning a correct IV"
Horia Geantă [Tue, 2 Jul 2019 15:40:26 +0000 (18:40 +0300)]
MLK-22039: Revert "MLK-14611 Fix CBC mode support by returning a correct IV"

This reverts commit 618cb36b4c141a7a03a0ae3a6606843667619118.

This commit is no longer needed, since issue is fixed by
commit 854b06f76879 ("crypto: caam - properly set IV after {en,de}crypt")
which is already in the tree, plus commits
ed527b13d800 ("crypto: caam - limit output IV to CBC to work around CTR mode DMA issue")
059d73eea640 ("crypto: caam - use len instead of nents for bulding HW S/G table")
334d37c9e263 ("crypto: caam - update IV using HW support")
that are upstream and will be backported.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
5 years agoMLK-22199: mxc-jpeg: Fix mxc-jpeg to build as module
Mirela Rabulea [Thu, 4 Jul 2019 14:38:18 +0000 (17:38 +0300)]
MLK-22199: mxc-jpeg: Fix mxc-jpeg to build as module

The error was:
ERROR: "mxc_jpeg_enc_mode_go" [drivers/media/platform/imx8/mxc-jpeg.ko]
undefined!...(mxc_jpeg_enc_mode_go is defined in mxc-jpeg-hw.c)

Change the Makefile to build mxc-jpeg-encdec object from
these two: mxc-jpeg-hw.o mxc-jpeg.o

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
5 years agoMLK-22206 VPU Decoder: modify vpu log print method
Shijie Qin [Fri, 5 Jul 2019 08:05:02 +0000 (16:05 +0800)]
MLK-22206 VPU Decoder: modify vpu log print method

vpu error log modify to non-maskable
VPU_WARN / VPU_EVENT / VPU_INFO info unified use bit map method

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-22195 VPU Decoder: ensure when framework update seqinfo which not be changed
Shijie Qin [Thu, 4 Jul 2019 11:27:51 +0000 (19:27 +0800)]
MLK-22195 VPU Decoder: ensure when framework update seqinfo which not be changed

FW maybe quickly parse twice different sequence header and report
seq_hdr_found event, need to ensure when frame update seqinfo which not
be changed

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-22201 mxc: mlb: fix interrupt rw lock dead lock
Clark Wang [Fri, 28 Jun 2019 09:10:36 +0000 (17:10 +0800)]
MLK-22201 mxc: mlb: fix interrupt rw lock dead lock

If read lock is called in mlb150_trans_complete_check, when the same
lock is called from interrupt at the same time it will result in:

[   73.688839] WARNING: inconsistent lock state
[   73.693116] 5.2.0-rc3-next-20190607-20092-ge32edc4b91df-dirty #38 Not tainted
[   73.700256] --------------------------------
[   73.704533] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-R} usage.
[   73.710546] mxc_mlb_test.ou/612 [HC0[0]:SC0[0]:HE1:SE1] takes:
[   73.716386] 554a05da (mlb_devinfo[1].tx_rbuf.rb_lock){-?--}, at: mxc_mlb150_ioctl+0x6a8/0x9a8
[   73.724937] {IN-HARDIRQ-W} state was registered at:
[   73.729827]   _raw_write_lock+0x28/0x38
[   73.733669]   mlb_tx_isr+0x54/0xf8
[   73.737078]   mlb_ahb_isr+0x98/0x124
[   73.740668]   __handle_irq_event_percpu+0x48/0x360
[   73.745467]   handle_irq_event_percpu+0x28/0x7c
[   73.750002]   handle_irq_event+0x38/0x5c
[   73.753934]   handle_fasteoi_irq+0xc0/0x17c
[   73.758125]   generic_handle_irq+0x20/0x34
[   73.762228]   __handle_domain_irq+0x64/0xe0
[   73.766422]   gic_handle_irq+0x4c/0xa8
[   73.770179]   __irq_svc+0x70/0x98
[   73.773506]   cpuidle_enter_state+0x164/0x574
[   73.777869]   cpuidle_enter_state+0x164/0x574
[   73.782232]   cpuidle_enter+0x28/0x38
[   73.785905]   do_idle+0x220/0x2c0
[   73.789226]   cpu_startup_entry+0x18/0x20
[   73.793247]   start_kernel+0x3f4/0x4a0

Fix this by always using irq save rw locks in trans_complete_check.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-22164 VPU Decoder: check input frame type before update to ring buffer
Shijie Qin [Fri, 5 Jul 2019 06:45:47 +0000 (14:45 +0800)]
MLK-22164 VPU Decoder: check input frame type before update to ring buffer

On Andorid, will re-transfer codec info after seek, hence need to
check it and insert sequence header for some format which inserted
header by driver, especailly for RV format.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-22189: VPU Decoder: fix hang after set trick mode
ming_qian [Thu, 4 Jul 2019 02:27:20 +0000 (10:27 +0800)]
MLK-22189: VPU Decoder: fix hang after set trick mode

To avoid tsm buffer overflow,
driver will check the pre buffer count before enqueue data,
but after trick, tsm will be resync when enqueue the first data,
but now the pre buffer count may be too large,
driver will prevent enqueue data,
so the tsm can't be resync, it cause the hang.

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-21957-2: ASoC: fsl_sai: read SAI version and params in probe
Viorel Suman [Thu, 20 Jun 2019 10:25:15 +0000 (13:25 +0300)]
MLK-21957-2: ASoC: fsl_sai: read SAI version and params in probe

Read SAI IP version and parameters in probe function.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 53f74d740629b877e3703d770a3de93514c00092)

5 years agoMLK-21957-1: ASoC: fsl_sai: remove reset code from dai_probe
Viorel Suman [Tue, 18 Jun 2019 13:16:19 +0000 (16:16 +0300)]
MLK-21957-1: ASoC: fsl_sai: remove reset code from dai_probe

SAI software reset is done in runtime resume,
there is no need to do it in fsl_sai_dai_probe.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 0202e4297ee40dcadd67d7bb5cf86262b9389436)

5 years agoMLK-22197 ASoC: fsl_micfil: add micfil dc remover amixer control
Irina Patru [Thu, 4 Jul 2019 12:09:00 +0000 (15:09 +0300)]
MLK-22197 ASoC: fsl_micfil: add micfil dc remover amixer control

Add control for DC Remover Control register:
11b - DC Remover is bypassed
00b - DC Remover is cut-off at 21Hz
01b - DC Remover is cut-off at 83Hz
10b - DC Remover is cut-off at 152Hz

This control modifies DC mode for all channels. For more
information see DC Remover Block Diagram in micfil
reference manual.

Signed-off-by: Irina Patru <ioana-irina.patru@nxp.com>
5 years agoMLK-22165: VPU Decoder: ignore the invalid timestamp of codec data
ming_qian [Wed, 3 Jul 2019 08:04:10 +0000 (16:04 +0800)]
MLK-22165: VPU Decoder: ignore the invalid timestamp of codec data

To ensure the first timestamp after seek is valid,
the timestamp of codec data should be ignore,
and merge its size to the next frame.

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22163: VPU Decoder: constraint value range of color aspects
ming_qian [Wed, 3 Jul 2019 03:09:06 +0000 (11:09 +0800)]
MLK-22163: VPU Decoder: constraint value range of color aspects

sPrimariesMap max 10
sMatrixCoeffsMap max 10
sTransfersMap max 18

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22141: VPU Decoder: fix consumed length calculation error
ming_qian [Wed, 3 Jul 2019 01:50:26 +0000 (09:50 +0800)]
MLK-22141: VPU Decoder: fix consumed length calculation error

when check whether the rptr is cross over,
the stream size must be taken into account.

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
5 years agoMLK-22138: VPU Decoder: distinguish seek and resolution change to avoid
ming_qian [Mon, 1 Jul 2019 02:08:36 +0000 (10:08 +0800)]
MLK-22138: VPU Decoder: distinguish seek and resolution change to avoid
hang on android

In resolution change, driver should avoid abort,
otherwise stream may hang.
In seek, driver shouldn't ignore abort,
otherwise the timestamp may be incorrect and led to hang on android.
So driver need distinguish seek and resolution change.
When do seek, output and capture will both be streamoff,
but resolution change, the output won't be streamoff.

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-21953-03 arm64: imx8mn: Fix-up power domains ids
Abel Vesa [Mon, 1 Jul 2019 08:30:24 +0000 (11:30 +0300)]
MLK-21953-03 arm64: imx8mn: Fix-up power domains ids

When cherry-picked from imx_4.14.y, the power-domains
node was using domain-ids. In order to work on imx_4.19.y
the reg property has to be used instead. This also implies
the address-cells and size-cells properties have to be added.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
5 years agoSSI-73: crypto: caam - support for imx8mn
Iuliana Prodan [Fri, 14 Jun 2019 09:15:30 +0000 (12:15 +0300)]
SSI-73: crypto: caam - support for imx8mn

CAAM support for imx8mn is based on the existing imx8 support

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
5 years agoMLK-21880-3 drm/imx: lcdif-dsim: change DISPMIX reset for IMX8MN
Fancy Fang [Tue, 28 May 2019 05:57:43 +0000 (13:57 +0800)]
MLK-21880-3 drm/imx: lcdif-dsim: change DISPMIX reset for IMX8MN

According to the design spec for IMX8MN platform, the GPR reset
module for DISPMIX has some changes. So the reset code should be
adjusted accordingly. This is a temporary solution and will be
improved later.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
5 years agoMLK-21953-01 soc: imx: Add power domain driver support imx8mn
Jacky Bai [Mon, 10 Jun 2019 05:43:19 +0000 (13:43 +0800)]
MLK-21953-01 soc: imx: Add power domain driver support imx8mn

Add compatible string for i.MX8MN for power domain driver
support.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
5 years agoMLK-21871 net: fec: get mac address from fuse for imx8mn platform
Fugang Duan [Wed, 22 May 2019 08:35:14 +0000 (16:35 +0800)]
MLK-21871 net: fec: get mac address from fuse for imx8mn platform

Enable imx8mn platform to get mac address from efuse.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-21880-2 drm/imx: add IMX8MN compatible for LCDIF and DSIM
Fancy Fang [Tue, 28 May 2019 04:02:38 +0000 (12:02 +0800)]
MLK-21880-2 drm/imx: add IMX8MN compatible for LCDIF and DSIM

Add a compatible string which includes 'imx8mn' for both
LCDIF and DSIM drivers.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
5 years agoMLK-22131 can: flexcan: fix CAN coverity issue
Joakim Zhang [Thu, 27 Jun 2019 09:56:14 +0000 (17:56 +0800)]
MLK-22131 can: flexcan: fix CAN coverity issue

Fix CAN coverty issue.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
5 years agoMLK-20290: mxc-jpeg: Inject a default Huffman table for the decoder
Mirela Rabulea [Wed, 26 Jun 2019 13:38:29 +0000 (16:38 +0300)]
MLK-20290: mxc-jpeg: Inject a default Huffman table for the decoder

So far, the configuration stream was used only for the encoder, but
it is actually possible to use it for the decoder too, in order to inject
a default Huffman table, because the CAST IP decoder gets stuck for jpegs
that do not contain any Huffman table.
Add dht_needed member in the context structure, and set it true when a
jpeg without any DHT marker is detected. In such case, the decoder will
also operate in 2 phases: first DHT injection, then user buffer decode;
this is done by chaining a configuration  descriptor before the decoding
descriptor. The configuration stream is set-up in the s_fmt ioctl with
the minimum resolution.

Also print an error when a jpeg smaller than the minimum size, 64x64
according to imx8qxp errata ERR050135, is detected.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
5 years agoMLK-22133 VPU Decoder: check frame slice count for RV format
Shijie Qin [Fri, 28 Jun 2019 05:27:30 +0000 (13:27 +0800)]
MLK-22133 VPU Decoder: check frame slice count for RV format

Check calculated frame slice count in order to avoid alloc
exception memory due to abnormal slice count

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-22129 drm/imx: dpu: kms: Ensure array idx m >= 0 before accessing sources[]
Liu Ying [Fri, 28 Jun 2019 02:44:43 +0000 (10:44 +0800)]
MLK-22129 drm/imx: dpu: kms: Ensure array idx m >= 0 before accessing sources[]

This patch checks array index 'm' in function
dpu_atomic_assign_plane_source_per_crtc() to make sure it's
no less than zero before using it to access array sources[].

Detected by CoverityScan, CID#6231988 ("Negative array index read")

Signed-off-by: Liu Ying <victor.liu@nxp.com>
5 years agoMLK-21987-1 soc: imx: Add speed grading fuse check for i.MX8MN
Anson Huang [Mon, 10 Jun 2019 01:56:16 +0000 (09:56 +0800)]
MLK-21987-1 soc: imx: Add speed grading fuse check for i.MX8MN

Add speed grading fuse check to constrain CPU OPP according
to market segment and speed grading fuse map,

Market_Segment[1:0]:
'00' - Consumer 0C to 95C
'01' - Ext. Consumer -20C to 105C
'10' - Industrial -40C to 105C
'11' - Automotive -40C to 125C

SPEED_GRADING[5:0]:
SPEED_GRADE[5:4]    SPEED_GRADE[3:0]    MHz
      xx                0000            2300
      xx                0001            2200
      xx                0010            2100
      xx                0011            2000
      xx                0100            1900
      xx                0101            1800
      xx                0110            1700
      xx                0111            1600
      xx                1000            1500
      xx                1001            1400
      xx                1010            1300
      xx                1011            1200
      xx                1100            1100
      xx                1101            1000
      xx                1110             900
      xx                1111             800

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
5 years agoMLK-21823-5 soc: imx: Add i.MX8MN soc id driver support
Anson Huang [Fri, 24 May 2019 05:59:15 +0000 (13:59 +0800)]
MLK-21823-5 soc: imx: Add i.MX8MN soc id driver support

This patch adds new SoC i.MX8MN's soc id driver support.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
5 years agoMLK-21963-3 ARM64: dts: imx8m[mn]: Define resets for LCDIF and DSIM
Fancy Fang [Thu, 13 Jun 2019 05:25:34 +0000 (13:25 +0800)]
MLK-21963-3 ARM64: dts: imx8m[mn]: Define resets for LCDIF and DSIM

The dispmix-reset device can be used to control the LCDIF and
DSIM bus reset and clock enable. So define 'resets' property
for both LCDIF and DSIM for this purpose which will be used to
replace 'dispmix_gpr' usage.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
5 years agoMLK-21963-1 reset: Add driver for dispmix reset
Fancy Fang [Wed, 5 Jun 2019 10:04:17 +0000 (18:04 +0800)]
MLK-21963-1 reset: Add driver for dispmix reset

This is an reset driver to implement a reset controller
device DISPMIX on IMX8MM and IMX8MN platforms. Dispmix
reset is used to reset or enable related buses and clks
for the submodules in DISPMIX.

All the dispmix resets are divided into three subgroups:
sft_rstn, clk_en and mipi_rst, and each of them contains
several reset lines to control several different modules
on and off in DISPMIX which doesn't require the standard
reset flow, but only line assert and deassert operations.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
5 years agoMLK-21963-2 ARM64: dts: imx8m[mn]: Add 'dispmix-reset' device
Fancy Fang [Wed, 5 Jun 2019 10:54:17 +0000 (18:54 +0800)]
MLK-21963-2 ARM64: dts: imx8m[mn]: Add 'dispmix-reset' device

Create a new device node 'dispmix-reset' to describe the
reset controller in DISPMIX to control several submodules
bus and clock reset and enable. All the reset lines can be
divided into three groups: sft_rstn, clk_en and mipi_rst.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
5 years agoMLK-22096-2 arm64: dts: add i.MX8MN root/inmate dts
Peng Fan [Mon, 24 Jun 2019 09:47:43 +0000 (17:47 +0800)]
MLK-22096-2 arm64: dts: add i.MX8MN root/inmate dts

Add root inmate dts for jailhouse 1st and 2nd linux.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
5 years agoMLK-22075 arm64: dts: imx8mn: Update CPU OPP table
Anson Huang [Fri, 21 Jun 2019 01:26:17 +0000 (09:26 +0800)]
MLK-22075 arm64: dts: imx8mn: Update CPU OPP table

Update i.MX8MN CPU OPP table according to datasheet
Rev.B,06/2019.

According to design requirement, to achieve best CPU
performance, although DDR4 EVK board is working at NM
mode, but VDD_SOC will use 0.95v(OD mode) and VDD_ARM
can move between 0.95v and 1.0v, 0.95v to support
1.2GHz/1.4GHz, and 1.0v to support 1.5GHz.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
5 years agoSSI-73: arm64: dts: imx8mn: add crypto support
Iuliana Prodan [Fri, 14 Jun 2019 09:16:04 +0000 (12:16 +0300)]
SSI-73: arm64: dts: imx8mn: add crypto support

Add crypto, caam_sm, caam_snvs and caam_secvio nodes in device
tree for CAAM, secure memory support and security violation reports.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
5 years agoMLK-21886-3: media: imx: Add camera dts for imx815 platform
Guoniu.Zhou [Wed, 29 May 2019 03:21:52 +0000 (11:21 +0800)]
MLK-21886-3: media: imx: Add camera dts for imx815 platform

Camera subsystem is consist of ISI, MIPI CSI and OV5640. Add
device node in dts for them.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-21993 ARM64: freescale: Add busfreq node for imx8mn
Jacky Bai [Tue, 11 Jun 2019 06:35:56 +0000 (14:35 +0800)]
MLK-21993 ARM64: freescale: Add busfreq node for imx8mn

Add the busfreq node for i.MX8MN to support the
busfreq driver.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
5 years agoMLK-21987-2 arm64: dts: imx8mn: Constrain CPU OPP for DDR4 EVK board
Anson Huang [Mon, 10 Jun 2019 02:01:20 +0000 (10:01 +0800)]
MLK-21987-2 arm64: dts: imx8mn: Constrain CPU OPP for DDR4 EVK board

DDR4 EVK board is working at NOD mode, according to design, all
supplies MUST be in NOD mode, that means CPU frequency can ONLY
be 1.2GHz.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
5 years agoMLK-21953-02 ARM64: dts: imx: Add power domain node for imx8mn
Jacky Bai [Wed, 5 Jun 2019 08:15:22 +0000 (16:15 +0800)]
MLK-21953-02 ARM64: dts: imx: Add power domain node for imx8mn

Add the power domain node for i.MX8MN.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
5 years agoMLK-21940-8: ARM64: dts: Support EASRC with ak5558
Shengjiu Wang [Tue, 4 Jun 2019 10:18:56 +0000 (18:18 +0800)]
MLK-21940-8: ARM64: dts: Support EASRC with ak5558

For the EASRC + WM8524 can only support P2P playback, so used
EASRC + AK5558 to show the capiblity of P2P capture.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
5 years agoMLK-21909-2: ARM64: dts: fix fsl,dataline issue
Shengjiu Wang [Tue, 4 Jun 2019 10:17:42 +0000 (18:17 +0800)]
MLK-21909-2: ARM64: dts: fix fsl,dataline issue

The fsl,dataline is not compatible with latest sai driver

Fixes: c72c3a2e7ac8 ("MLK-21823-2 arm64: dts: freescale: add i.MX8MN DT files")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
5 years agoMLK-21938 arm64: dts: imx8mn-ddr4-evk: Improve model/compatible name
Anson Huang [Tue, 4 Jun 2019 08:07:15 +0000 (16:07 +0800)]
MLK-21938 arm64: dts: imx8mn-ddr4-evk: Improve model/compatible name

Add DDR type into model/compatible name.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
5 years agoMLK-21909: ARM64: dts: add dts for supporting ak5558 codec
Shengjiu Wang [Tue, 28 May 2019 11:39:05 +0000 (19:39 +0800)]
MLK-21909: ARM64: dts: add dts for supporting ak5558 codec

The AK5558 conflict with MICFIL, so add another dts for it

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
5 years agoMLK-21868-4 ARM64: dts: fsl-imx8mn.dtsi: align the USDHC setting
Haibo Chen [Mon, 27 May 2019 08:03:31 +0000 (16:03 +0800)]
MLK-21868-4 ARM64: dts: fsl-imx8mn.dtsi: align the USDHC setting

When setting the usdhc PER clock rate, USDHC1 use the IMX8MN_CLK_USDHC1,
but usdhc3 use the IMX8MN_CLK_USDHC3_ROOT, this is a little bit confuse.
Here align to use IMX8MN_CLK_USDHCx, besides, we can use it directlly
when we want to assign clock parent.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
5 years agoMLK-21868-3 ARM64: dts: fsl-imx8mn-ddr4-evk: clear the SION for usdhc clock pad
Haibo Chen [Mon, 27 May 2019 07:57:36 +0000 (15:57 +0800)]
MLK-21868-3 ARM64: dts: fsl-imx8mn-ddr4-evk: clear the SION for usdhc clock pad

imx8mn usdhc clock pad do not need to set the SION, so clear it here

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
5 years agoMGS-4881 GPU MMU mapping to cover 2GB space
Minjie Zhuang [Wed, 29 May 2019 09:39:36 +0000 (17:39 +0800)]
MGS-4881 GPU MMU mapping to cover 2GB space

Set GPU MMU mapping to 2GB to match the default DDR setting to
avoid GPU unstable issue

Signed-off-by: Minjie Zhuang <minjie.zhuang@nxp.com>
5 years agoMLK-21887 ARM64: dts: imx8mn: correct pixel clock select for LCDIF
Fancy Fang [Wed, 29 May 2019 04:08:21 +0000 (12:08 +0800)]
MLK-21887 ARM64: dts: imx8mn: correct pixel clock select for LCDIF

According to the clock definitions, the 'IMX8MN_CLK_DISP_PIXEL_ROOT'
clock is a shared gate clock which should be used as the LCDIF pixel
clock, since if use 'IMX8MN_CLK_DISP_PIXEL', the clock tree will be
like:

video_pll1_ref_sel                    1            1    24000000          0
   video_pll1                         1            1   594000000          0
      video_pll1_bypass               1            1   594000000          0
         video_pll1_out               2            2   594000000          0
            dsi_phy_ref               1            1    27000000          0
            disp_pixel                1            1   118800000          0
               disp_pixel_clk           0            0   118800000

So the pixel clock gate on/off cannot be controlled by LCDIF driver.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
5 years agoMLK-21880-5 ARM64: dts: imx8mn-ddr4-evk: enable MIPI to HDMI display
Fancy Fang [Tue, 28 May 2019 04:15:45 +0000 (12:15 +0800)]
MLK-21880-5 ARM64: dts: imx8mn-ddr4-evk: enable MIPI to HDMI display

Enable MIPI to HDMI display for imx8mn-ddr4-evk board and disable
adv_bridge explicitly in imx8mn-ddr4-evk-rm67191 dtb since the MIPI
to HDMI display and the MIPI panel RM67191 cannot be enabled at the
same time.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
5 years agoMLK-21880-4 ARM64: dts: imx8mn: change compatible for LCDIF and DSIM
Fancy Fang [Tue, 28 May 2019 05:45:49 +0000 (13:45 +0800)]
MLK-21880-4 ARM64: dts: imx8mn: change compatible for LCDIF and DSIM

On IMX8MN platform, change the compatible for LCDIF and DSIM
to use the one which includes 'imx8mn' string.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
5 years agoMLK-21869 arm64: dts: enable rpmsg on imx8mn
Richard Zhu [Mon, 27 May 2019 05:24:11 +0000 (13:24 +0800)]
MLK-21869 arm64: dts: enable rpmsg on imx8mn

Enable the RPMSG on iMX8MN platforms.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
5 years agoMGS-4881 Enable GPU for M815S and Reserve 128M CMA for GPU
Minjie Zhuang [Tue, 28 May 2019 05:14:50 +0000 (13:14 +0800)]
MGS-4881  Enable GPU for M815S and Reserve 128M CMA for GPU

1.Enable GPU at fsl-imx8mn-ddr4-evk-rm67191.dts and fsl-imx8mn-ddr4-evk.dts

2.Need reserve 128M CMA for GPU instead of 2G

Date: 28th May, 2019.
Signed-off-by: Minjie Zhuang <minjie.zhuang@nxp.com>
5 years agoMLK-22096-1 clk: imx8mn: parse init-on-array
Peng Fan [Mon, 24 Jun 2019 09:45:09 +0000 (17:45 +0800)]
MLK-22096-1 clk: imx8mn: parse init-on-array

Follow i.MX8MM, add init-on-array logic to make jailhouse 2nd linux
could work.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
5 years agoMLK-21954 clk: imx: keep qspi clock always on if m core is enabled
Jacky Bai [Wed, 5 Jun 2019 08:24:31 +0000 (16:24 +0800)]
MLK-21954 clk: imx: keep qspi clock always on if m core is enabled

On i.MX8MN, in some user case, M7 will XIP running in QSPI,
so need to make sure QSPI clock is always on if M7 is enabled.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
5 years agoMLK-21823-7 arm64: defconfig: Select CONFIG_ARCH_FSL_IMX8MN by default
Bai Ping [Fri, 24 May 2019 06:01:34 +0000 (14:01 +0800)]
MLK-21823-7 arm64: defconfig: Select CONFIG_ARCH_FSL_IMX8MN by default

Enable CONFIG_ARCH_FSL_IMX8MN by default to support new
SoC i.MX8MN.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
5 years agoMLK-21823-2 arm64: dts: freescale: add i.MX8MN DT files
Bai Ping [Fri, 24 May 2019 03:19:48 +0000 (11:19 +0800)]
MLK-21823-2 arm64: dts: freescale: add i.MX8MN DT files

Add new SoC i.MX8MN's DT files and support it by default.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Ella Feng <ella.feng@nxp.com>
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Teo Hall <teo.hall@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
5 years agoMLK-21823-6 arm64: imx: Add i.MX8MN SoC support
Bai Ping [Fri, 24 May 2019 06:00:02 +0000 (14:00 +0800)]
MLK-21823-6 arm64: imx: Add i.MX8MN SoC support

Add new SoC i.MX8MN support, it will auto select those
necessary modules.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
5 years agoMLK-21823-4 clk: imx: Add i.MX8MN clock driver
Bai Ping [Fri, 24 May 2019 03:29:57 +0000 (11:29 +0800)]
MLK-21823-4 clk: imx: Add i.MX8MN clock driver

Add new SoC i.MX8MN's clock driver support.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
5 years agoMLK-21823-3 pinctrl: freescale: Add i.MX8MN driver
Bai Ping [Fri, 24 May 2019 03:23:38 +0000 (11:23 +0800)]
MLK-21823-3 pinctrl: freescale: Add i.MX8MN driver

Add new SoC i.MX8MN pinctrl driver support.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
5 years agoMLK-21823-1 dt-bindings: add i.MX8MN clock and pin header
Bai Ping [Fri, 24 May 2019 03:18:09 +0000 (11:18 +0800)]
MLK-21823-1 dt-bindings: add i.MX8MN clock and pin header

Add i.MX8MN clock and pin definition.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
5 years agoMLK-22033 media: camera: fix ov5640_mode_MAX value to avoid getting wrong info
Robby Cai [Thu, 27 Jun 2019 03:31:30 +0000 (11:31 +0800)]
MLK-22033 media: camera: fix ov5640_mode_MAX value to avoid getting wrong info

In the driver, ov5640_mode_MAX means index number (starting from 0), not the
total numbers for the modes. Fix it to prevent VIDIOC_ENUM_FRAMESIZES ioctl
to get wrong information.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
5 years agoMLK-22086 clk: imx: Keep the root clock gate always enabled for m4
Jacky Bai [Mon, 24 Jun 2019 09:09:02 +0000 (17:09 +0800)]
MLK-22086 clk: imx: Keep the root clock gate always enabled for m4

If the M4/M7 core is enabled, just skip registering the gate ops
to make sure the ROOT clock is always enabled for M core to simplify
the clock management due to the lack of domain control for the root
clock slice gate.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
5 years agoMLK-22090 VPU Decoder: report decode error event if alloc buffer fail
Shijie Qin [Tue, 25 Jun 2019 08:02:16 +0000 (16:02 +0800)]
MLK-22090 VPU Decoder: report decode error event if alloc buffer fail

If alloc dma buffer fail will affect normal decode, so report
V4L2_EVENT_DECODE_ERROR event, then shall be closed.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-22111 VPU Decoder: sync firmware RPC API about LWM level
Shijie Qin [Thu, 27 Jun 2019 02:22:00 +0000 (10:22 +0800)]
MLK-22111 VPU Decoder: sync firmware RPC API about LWM level

Added ability to set LWM level through MediaIPFW_Video_CodecParams,
uBSDMALWM in place of unused bbd_lum_thr. At present, just use
default value--64bytes.

When receive FIFO_LOW event before START_DONE, ignore it and don't
print info.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-22037-2 VPU Decoder: the resolution of g_fmt may be incorrect
Shijie Qin [Tue, 25 Jun 2019 07:38:13 +0000 (15:38 +0800)]
MLK-22037-2 VPU Decoder: the resolution of g_fmt may be incorrect

As JPEG format max support resolution is 8188x8188,so modify
VPU_DEC_MAX_WIDTH / VPU_DEC_MAX_HEIGTH from 4096x4096 to
8188x8188

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
5 years agoMLK-22097: VPU Decoder: speed up firmware boot after suspend
ming_qian [Tue, 25 Jun 2019 08:54:41 +0000 (16:54 +0800)]
MLK-22097: VPU Decoder: speed up firmware boot after suspend

If there is no any decode instance, after suspend,
firmware will boot again,
and before boot, it will cleanup memory,
the memory is large for mu, so it cost a lot of time.
If cpu cleanup this memory, and firmware skip this step,
the boot time can be greatly reduced.

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
5 years agoMLK-22087 media: adv7180: add device tree support
Robby Cai [Tue, 11 Jun 2019 11:01:39 +0000 (19:01 +0800)]
MLK-22087 media: adv7180: add device tree support

add adv7180 device support to help load module at booting time
when it's compiled as module.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>