linux.git
7 years agoion: fix unmapped heap test settings **not for mainline**
Etienne Carriere [Thu, 24 Aug 2017 13:44:46 +0000 (15:44 +0200)]
ion: fix unmapped heap test settings **not for mainline**

If one enables ION_DUMMY_UNMAPPED_HEAP without providing the target
unmapped heap configuration settings (physical base address and size),
the kernel cannot build. This situation occurs in Linux test build
cases, i.e running the allmodconfig configuration.

This change overcomes the issue by providing default null settings for
both ION_DUMMY_UNMAPPED_BASE and ION_DUMMY_UNMAPPED_SIZE.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
(cherry picked from commit ac0c2c26b9819c5e95d56cb2d8937de0357eecaa
 linaro repo https://github.com/linaro-swg/linux.git
 tag optee-v4.9-20171005)

7 years agoion: unmapped heap support in ion dummy driver **not for mainline**
Etienne Carriere [Thu, 23 Mar 2017 13:03:05 +0000 (14:03 +0100)]
ion: unmapped heap support in ion dummy driver **not for mainline**

Add configuration ION_DUMMY_UNMAPPED_HEAP to enable optional definition
of a statically defined "unmapped" heap for test purpose: kernel config
must provide the memory pool base address and byte size.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
(cherry picked from commit 961993fde60ebd06715d1433f8eb265471a0f38c
 linaro repo https://github.com/linaro-swg/linux.git
 tag optee-v4.9-20171005)

7 years agoion: "unmapped" heap for secure data path **not for mainline**
Etienne Carriere [Thu, 23 Mar 2017 13:02:44 +0000 (14:02 +0100)]
ion: "unmapped" heap for secure data path **not for mainline**

OP-TEE/SDP (Secure Data Path) memory pools are created through ION
secure type heap" from Allwinner. This change renames "secure" into
"unmapped" as, from Linux point of view, the heap constraint is
manipulating unmapped memory pools/buffers.

"Unmapped" heap support is integrated in ION UAPI (actually this was
the Allwinner initial proposal) and ION DT parsing support.

Based in work from Sunny <sunny@allwinnertech.com> for Allwinner.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
(cherry picked from commit 4a95713514ddc3d55d5df213513aeec5a3717243
 linaro repo https://github.com/linaro-swg/linux.git
 tag optee-v4.9-20171005)

7 years agostaging/ion: add Allwinner ION "secure" heap **not for mainline**
Etienne Carriere [Thu, 23 Mar 2017 13:02:08 +0000 (14:02 +0100)]
staging/ion: add Allwinner ION "secure" heap **not for mainline**

Dumped from:
  https://github.com/loboris/OrangePI-Kernel/tree/master/linux-3.4
  0cc8d855adb
  Author: Sunny <sunny@allwinnertech.com> for Allwinner.

Changes made on original "secure heap" implementation:
- minor coding style: fix includes, empty lines and overlong lines,
  indentation, comment layout.
- Original path modified the ion uapi. We do not attempt to modify
  uapi/ion.h. "secure" (or "domain") heaps are under ID
  ION_HEAP_TYPE_CUSTOM + 1 (legacy 'secure heap type' value).

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
(cherry picked from commit e31dd54997b050b6a6965d7cfbc795492256847c
 linaro repo https://github.com/linaro-swg/linux.git
 tag optee-v4.9-20171005)

7 years agoMLK-17731 PCI: dwc: implement MSI-X support
Richard Zhu [Fri, 2 Mar 2018 09:24:05 +0000 (17:24 +0800)]
MLK-17731 PCI: dwc: implement MSI-X support

The DWC MSI controller does not support different MSI-X target addresses
and does not allow to route individual IRQs to different CPUs. Aside
from those shortcomings it is able to support MSI-X just fine.

Some devices like the Intel i210 network controller depend on MSI-X to
be available to enable all hardware features, so even a feature limited
implementation of MSI-X on the host side is useful.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
7 years agoMLK-17544 PCI: imx: change the imx6 specific name
Richard Zhu [Tue, 27 Feb 2018 07:49:40 +0000 (15:49 +0800)]
MLK-17544 PCI: imx: change the imx6 specific name

Replace the specific name imx6_xxx by imx_xxx.
Since all imx6/7/8 PCIe use the same driver.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
7 years agoMLK-17732-2: SM store: Support iMX8QX and iMX8QM
Franck LENORMAND [Fri, 9 Mar 2018 17:05:49 +0000 (18:05 +0100)]
MLK-17732-2: SM store: Support iMX8QX and iMX8QM

The iMX8 QX and QM have SECO/SCU enabled and the access
to SM registers is different as long as the addresses of
the pages.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
7 years agoMLK-17732-1: defconfig: imx8m: Enable SM keystore and test
Franck LENORMAND [Thu, 8 Mar 2018 11:13:07 +0000 (12:13 +0100)]
MLK-17732-1: defconfig: imx8m: Enable SM keystore and test

We enable the SM keystore and its test by default to be
tested at the boot of the kernel.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
7 years agoMLK-17648-2: drm: imx: dcss: Load the HDR10 from header file
Laurentiu Palcu [Fri, 9 Mar 2018 12:12:58 +0000 (14:12 +0200)]
MLK-17648-2: drm: imx: dcss: Load the HDR10 from header file

This commit allows one to select if a firmware file is used, for loading
the HDR10 tables, or a header. By default, this will be header file.
This is until a proper way of passing the file from bootloader is found.

Also, fix a minor bug which made parsing the tables over the actual data
limit.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17648-1: drm: imx: dcss: add HDR10 module tables
Laurentiu Palcu [Fri, 9 Mar 2018 12:09:00 +0000 (14:09 +0200)]
MLK-17648-1: drm: imx: dcss: add HDR10 module tables

This commit adds HDR10 tables as a header. Using a FW file is
problematic since the tables need to be available immediately after
boot. After the rootfs is mounted, as is the case for loading a FW file,
it's already too late if some conversion tables are needed.

This usually happens if the output pipe is configured as YUV420.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17743 ASoC: codecs: ak4458: Fix mute gpio mixed with pdn gpio
Cosmin-Gabriel Samoila [Fri, 9 Mar 2018 09:49:58 +0000 (11:49 +0200)]
MLK-17743 ASoC: codecs: ak4458: Fix mute gpio mixed with pdn gpio

Fix bug when PDN gpio is requested instead of mute gpio.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-17580: ASoC: fsl: sai: check for pinctrl status
Viorel Suman [Fri, 9 Mar 2018 10:41:42 +0000 (12:41 +0200)]
MLK-17580: ASoC: fsl: sai: check for pinctrl status

For some cases (like AMIX) pinctrl may be null - this
breaks SAI functionality. Enforce pinctrl null pointer
checking prior calling any function which involves
pins state changes.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
7 years agoMLK-17740 ARM: imx_v7_defconfig: enable wireless HOSTAP
Fugang Duan [Thu, 8 Mar 2018 10:43:10 +0000 (18:43 +0800)]
MLK-17740 ARM: imx_v7_defconfig: enable wireless HOSTAP

Add wireless HOSTAP config enable for i.MX7ULP Murata 1PJ (Qca9377-3).

Reviewed-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17603 arm: dts: imx7d-sdb-epdc: enable enet1 for epdc extra dts file
Fugang Duan [Thu, 1 Mar 2018 01:48:05 +0000 (09:48 +0800)]
MLK-17603 arm: dts: imx7d-sdb-epdc: enable enet1 for epdc extra dts file

Enable enet1 for epdc extra dts file since only enet2 has pin conflict
with epdc.

Reviewed-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17739 tty: serial: imx: clear wakeup flag before enable wakeup interrupt
Fugang Duan [Tue, 6 Mar 2018 09:41:14 +0000 (17:41 +0800)]
MLK-17739 tty: serial: imx: clear wakeup flag before enable wakeup interrupt

It is better to clear wakeup flag in status register before enable
wakeup interrupt bits, which can avoid system suspend fail during
devices no irq suspend stage.

Reviewed-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17738 tty: serial: lpuart: restore console setting after power lost
Fugang Duan [Mon, 5 Mar 2018 10:45:51 +0000 (18:45 +0800)]
MLK-17738 tty: serial: lpuart: restore console setting after power lost

i.MX7ULP enter VLLS mode that lpuart module power off and registers
all lost no matter the port is wakeup source.

For console port, console baud rate setting lost and print messy
log when enable the console port as wakeup source. To avoid the
issue happen, user should not enable uart port as wakeup source
in VLLS mode, or restore console setting.

The patch is to add one fixup to restore console port register setting
for i.MX7ULP platform.

Reviewed-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17737 net: fec: fix the struct define issue
Fugang Duan [Fri, 23 Feb 2018 03:32:27 +0000 (11:32 +0800)]
MLK-17737 net: fec: fix the struct define issue

Fix the cherry pick and merge issue by below commit on kernel 4.9:
Fixes: 19b76fd012ce ("net: fec: add stop mode support for dts register set")

Reviewed-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-17736-02 dts: imx7ulp-evk: add interrupt property for rpmsg io node
Fugang Duan [Fri, 9 Mar 2018 03:04:18 +0000 (11:04 +0800)]
MLK-17736-02 dts: imx7ulp-evk: add interrupt property for rpmsg io node

Add interrupt property for rpmsg io node.

Reviewed-by: Robin Gong<yibin.gong@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17736-01 gpio: imx-rpmsg: add gpio interrupt chip support
Fugang Duan [Thu, 1 Feb 2018 05:53:24 +0000 (13:53 +0800)]
MLK-17736-01 gpio: imx-rpmsg: add gpio interrupt chip support

Add gpio interrupt chip support that only support wakeup feature
by M4 core.

Reviewed-by: Robin Gong<yibin.gong@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17735 ARM: imx: pm-rpmsg: ensure the pm is late suspended and early resumed
Fugang Duan [Wed, 7 Mar 2018 10:41:21 +0000 (18:41 +0800)]
MLK-17735 ARM: imx: pm-rpmsg: ensure the pm is late suspended and early resumed

Since some drivers using rpmsg io as wakeup source enable the wakeup
in suspend stage, then it has to ensure pm rpmsg driver pm sleep is
late suspended and early resumed, otherwise M4 will wakeup A core
directly even if there has no wakeup signal.

Reviewed-by: Robin Gong<yibin.gong@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17580: ARM64: dts: support DSD512 for ak4497
Viorel Suman [Thu, 8 Mar 2018 12:46:07 +0000 (14:46 +0200)]
MLK-17580: ARM64: dts: support DSD512 for ak4497

Add a dedicated DSD512 pinmux group for DSD512 in order
to eliminate the noise caused by a hight MCLK rate.
With the new option the SAI1 BCLK is routed to codec MCLK pin.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com
7 years agoMLK-17580: ASoC: fsl: sai: Use DSD helper
Viorel Suman [Thu, 8 Mar 2018 12:43:34 +0000 (14:43 +0200)]
MLK-17580: ASoC: fsl: sai: Use DSD helper

Replace DSD related code with calls to DSD helper functions.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com
7 years agoMLK-17580: ASoC: fsl: dsd: Add DSD utilities helper
Viorel Suman [Thu, 8 Mar 2018 12:37:30 +0000 (14:37 +0200)]
MLK-17580: ASoC: fsl: dsd: Add DSD utilities helper

Add DSD utilities helper.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com
7 years agoMLK-17734-2: ASoC: fsl: ak5558: Remove support for 192KHz in TDM mode
Daniel Baluta [Thu, 8 Mar 2018 17:04:19 +0000 (19:04 +0200)]
MLK-17734-2: ASoC: fsl: ak5558: Remove support for 192KHz in TDM mode

Using TDM256 mode (our only supported mode) in order to
support 192KHz we would need a MCLK of 192000 * 512 = 98304000.

But maximum frequency supported by the Audio PLL is 4.91 MHz.

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-17734-1: ASoC: fsl: imx-ak5558: Fix TDM mode for 8kHz / 16Khz
Daniel Baluta [Thu, 8 Mar 2018 16:55:32 +0000 (18:55 +0200)]
MLK-17734-1: ASoC: fsl: imx-ak5558: Fix TDM mode for 8kHz / 16Khz

In order for TDM to correctly work we need that MCLK and
BCLK to follow the values in Table 9.

Thus,
* TDM128: BCLK = 128fs, MCLK = 128-1024fs
* TDM256: BCLK = 256fs, MCLK = 256-1024fs
* TDM512: BCLK = 512fs, MCLK = 512-1024fs

We assume only support TDM256 for the moment.

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-17647: drm: imx: dcss: fix the flip_done timed out problem
Laurentiu Palcu [Thu, 8 Mar 2018 09:47:05 +0000 (11:47 +0200)]
MLK-17647: drm: imx: dcss: fix the flip_done timed out problem

The commit:

44c45128 - MLK-17634-1: drm: imx: dcss: send vblank event from ISR

made some changes related to vblank handling. However, it looks like
they were not robust enough and, sometimes, the flip events are not
sent. This happens only when playing videos over Weston.

This patch, effectively, reverts those changes.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMGS-3724 increase the core clock rate for qxp B0 board.
Yuchou Gan [Fri, 9 Mar 2018 14:37:15 +0000 (22:37 +0800)]
MGS-3724 increase the core clock rate for qxp B0 board.

The qxp B0 board gpu core clock rate is 700MHz, increase to it.

Signed-off-by: Yuchou Gan<yuchou.gan@nxp.com>
7 years agoMLK-17689-3: arm64: dts: fsl-imx8mq-evk: Fix clocks for DCSS-RM67191
Robert Chiras [Thu, 8 Mar 2018 11:53:53 +0000 (13:53 +0200)]
MLK-17689-3: arm64: dts: fsl-imx8mq-evk: Fix clocks for DCSS-RM67191

Currently, the default clock configuration for DCSS configures the pixel
clock to be sourced from VIDEO_PLL2, but this source cannot be used by the
DSI PHY_REF clock.
So, in order to make DCSS working with DSI, we need to have them both
(DCSS and DSI PHY) use the same clock source: VIDEO_PLL1.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17692-4: imx hdp: Add pixel clock return check
Sandor Yu [Thu, 8 Mar 2018 08:14:36 +0000 (16:14 +0800)]
MLK-17692-4: imx hdp: Add pixel clock return check

Return 0 if pixel clock isn't supported by hdmi phy.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17692-3: imx hdp: Remove CDN vic table
Sandor Yu [Tue, 6 Mar 2018 09:17:35 +0000 (17:17 +0800)]
MLK-17692-3: imx hdp: Remove CDN vic table

Remove CDN vic table and replace with drm_display_mode.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17692-2: defconfig: Remove FB_MX8_HDMI
Sandor Yu [Tue, 6 Mar 2018 09:11:04 +0000 (17:11 +0800)]
MLK-17692-2: defconfig: Remove FB_MX8_HDMI

Remove FB_MX8_HDMI.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17692-1: fbdev: Remove imx8 hdmi fb driver
Sandor Yu [Tue, 6 Mar 2018 09:01:18 +0000 (17:01 +0800)]
MLK-17692-1: fbdev: Remove imx8 hdmi fb driver

imx8 hdmi fb driver is not maintain.
imx8 hdmi function have implemented with DRM framework
in driver/gpu/drm/imx folder.
So remove hdmi fb driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-17730 rtc: rtc-imx-sc: only print once for read time error
Anson Huang [Thu, 8 Mar 2018 03:23:17 +0000 (11:23 +0800)]
MLK-17730 rtc: rtc-imx-sc: only print once for read time error

As RTC read time will be called periodically, to avoid
too many error messages when RTC is NOT ready in SCFW,
change the error print to only print once.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-17698-6 ARM64: dts: freescale: imx8qm: enable mek board pmic thermal zone
Anson Huang [Wed, 7 Mar 2018 06:01:39 +0000 (14:01 +0800)]
MLK-17698-6 ARM64: dts: freescale: imx8qm: enable mek board pmic thermal zone

Enable i.MX8QM MEK board PMIC thermal zone.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-17698-5 thermal: imx_sc: add PMIC thermal sensor for i.MX8QM
Anson Huang [Tue, 6 Mar 2018 08:33:09 +0000 (16:33 +0800)]
MLK-17698-5 thermal: imx_sc: add PMIC thermal sensor for i.MX8QM

Remove unused thermal sensors and add PMIC thermal sensors
for i.MX8QM.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-17698-4 ARM64: dts: freescale: imx8qxp: enable mek board pmic thermal zone
Anson Huang [Wed, 7 Mar 2018 05:53:40 +0000 (13:53 +0800)]
MLK-17698-4 ARM64: dts: freescale: imx8qxp: enable mek board pmic thermal zone

Enable i.MX8QXP MEK board PMIC thermal zone.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-17698-3 thermal: imx_sc: add PMIC thermal sensors for i.MX8QXP
Anson Huang [Tue, 6 Mar 2018 07:39:46 +0000 (15:39 +0800)]
MLK-17698-3 thermal: imx_sc: add PMIC thermal sensors for i.MX8QXP

Add PMIC thermal sensors for i.MX8QXP.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-17698-2 ARM64: dts: freescale: imx8qxp: update thermal zone info
Anson Huang [Tue, 6 Mar 2018 07:37:25 +0000 (15:37 +0800)]
MLK-17698-2 ARM64: dts: freescale: imx8qxp: update thermal zone info

Update thermal zone number, including CPU thermal
zone and DRC thermal zone.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-17698-1 thermal: imx_sc: use system controller thermal sensor for A35 CPU
Anson Huang [Tue, 6 Mar 2018 07:37:10 +0000 (15:37 +0800)]
MLK-17698-1 thermal: imx_sc: use system controller thermal sensor for A35 CPU

Now that SCFW (0d43db9 SCF-22: Move SCU controls to SYSTEM.
Allows AP to use SCU temp sensor.) exposes SCU's temp sensor
for AP, and it is placed more close to i.MX8QXP A35 core, so
it should be used as A35's CPU thermal sensor, add this change
and move DRC temp sensor to a new thermal zone.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-17729: ARM64: dts: Add power domains for display resources
Oliver Brown [Wed, 7 Mar 2018 19:27:47 +0000 (13:27 -0600)]
MLK-17729: ARM64: dts: Add power domains for display resources

Some resources are being enabled without the associated resource being
powered up.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
7 years agoMLK-17672 lpspi: fix clock polarity issue and DBT issue
Gao Pan [Tue, 6 Mar 2018 01:25:10 +0000 (09:25 +0800)]
MLK-17672 lpspi: fix clock polarity issue and DBT issue

1. Fix code error of changing lpspi clock polarity.

2. Set one SPI clock period for DBT parameter.

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Reviewed-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-17701 swiotlb-xen: implement xen_swiotlb_get_sgtable callback
Andrii Anisov [Tue, 7 Feb 2017 17:58:03 +0000 (19:58 +0200)]
MLK-17701 swiotlb-xen: implement xen_swiotlb_get_sgtable callback

Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
(cherry picked from commit 69369f52d28a34c84acb6f2a8a585e743441566a)

on 8QM A0, video play use ion to allocate buffer and mmap buffer,
there is a call dma_get_sgtable, but xen arm not implement that.
when playing video, GPU driver will use sg dma address, but because
of xen_swiotlb_get_sgtable not implemented, sg->amd_address is not
exactly the address that ion allocated. This patch fixes the issue.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Leonard Crestez <leonard.crestez@nxp.com>
7 years agoSound: SoC: codecs: Put AK4458 codec in manual mode
Cosmin-Gabriel Samoila [Wed, 7 Mar 2018 09:45:22 +0000 (11:45 +0200)]
Sound: SoC: codecs: Put AK4458 codec in manual mode

We cannot both derive SAI BCLK for 384KHz-S32/768KHz-S16 and
respect the codec MCLK restrictions shown in AK4458 datasheet
Table 5, 6 and 7.
Since we can have same master clock for SAI and Codec in Manual
Mode, we've chosen to use it instead of Auto Mode.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoSound: Soc: fsl: Set SAI Channel Mode to Output Mode
Cosmin-Gabriel Samoila [Wed, 7 Mar 2018 09:35:07 +0000 (11:35 +0200)]
Sound: Soc: fsl: Set SAI Channel Mode to Output Mode

Transmit data pins will output zero when slots are masked or channels
are disabled. In CHMOD TDM mode, transmit data pins are tri-stated when
slots are masked or channels are disabled. When data pins are tri-stated,
there is noise on some channels when FS clock value is high and data is
read while fsclk is transitioning from high to low.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
7 years agoMLK-17569-2: hdp: add channel/speaker allocation for 4 channel
Shengjiu Wang [Wed, 7 Mar 2018 10:27:48 +0000 (18:27 +0800)]
MLK-17569-2: hdp: add channel/speaker allocation for 4 channel

According to CEA-861-E section 6.6.2, add channel/speaker
allocation configuration for 4 channel.
0x0: FL, FR
0x3: FL, FR, LFE, FC
0x1F:FL, FR, LFE, FC, RL, RR, FLC, FRC

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
7 years agoMLK-17569-1: hdp: fix channel swapping issue for hdmi audio
Shengjiu Wang [Wed, 7 Mar 2018 10:23:23 +0000 (18:23 +0800)]
MLK-17569-1: hdp: fix channel swapping issue for hdmi audio

There is channel swapping issue for 4 channel and 8 channel audio.
After dump the register, found that SMPL2PKT_CNFG is not set
correctly, the reason is that F_NUM_OF_I2S_PORTS should be
F_NUM_OF_I2S_PORTS_S.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
7 years agoMLK-17156-7: ASoC: imx-rpmsg: use rpmsg codec instead the dummy
Shengjiu Wang [Wed, 7 Mar 2018 03:14:53 +0000 (11:14 +0800)]
MLK-17156-7: ASoC: imx-rpmsg: use rpmsg codec instead the dummy

use the rpmsg_wm8960 codec instead of the dummy codec

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-17156-6: ASoC: imx-pcm-rpmsg: fix get codec data failed
Shengjiu Wang [Tue, 6 Mar 2018 04:46:18 +0000 (12:46 +0800)]
MLK-17156-6: ASoC: imx-pcm-rpmsg: fix get codec data failed

Receive message is only used when the type is B. originally
we copy the receive message to revg_msg all the time, when
the message type is C, which will overide the revg_msg, which
cause the get codec data command return wrong value.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-17156-5: ASoC: imx-pcm-rpmsg: register rpmsg codec
Shengjiu Wang [Wed, 7 Mar 2018 03:15:23 +0000 (11:15 +0800)]
MLK-17156-5: ASoC: imx-pcm-rpmsg: register rpmsg codec

register rpmsg codec after the rpmsg-audio-channel is
ready.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-17156-4: ASoC: rpmsg_wm8960: add rpmsg_wm8960 codec
Shengjiu Wang [Wed, 7 Mar 2018 03:14:29 +0000 (11:14 +0800)]
MLK-17156-4: ASoC: rpmsg_wm8960: add rpmsg_wm8960 codec

This codec is accessed by rpmsg. As the wm8960 is controlled
mainly by M4, so we only add volume in this rpmsg_wm8960 codec.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-17156-3: ASoC: fs_rpmsg_i2s: update the protocol for i2c message
Shengjiu Wang [Tue, 6 Mar 2018 04:45:22 +0000 (12:45 +0800)]
MLK-17156-3: ASoC: fs_rpmsg_i2s: update the protocol for i2c message

rpmsg provide command for A7 side to set the codec value and get
codec value by i2c. In this case, the A7 can control the codec.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-17156-2: ARM: dts: update dts for demo audio in A7 domain
Shengjiu Wang [Tue, 6 Mar 2018 04:46:45 +0000 (12:46 +0800)]
MLK-17156-2: ARM: dts: update dts for demo audio in A7 domain

This is dts is for demo SAI + codec in A7 domain, which need to
do i2c hardware rework, connect the wm8960 to i2c7.
for this is for demo usage, so don't need the headphone plug/unplug
event, so remove the iomux for this case.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-17156-1: ASoC: fsl_sai: update register offset for ULP B0
Shengjiu Wang [Tue, 6 Mar 2018 03:45:30 +0000 (11:45 +0800)]
MLK-17156-1: ASoC: fsl_sai: update register offset for ULP B0

ULP B0 integrate the latest SAI IP, there is version id and
parameter id register in the beginning, so update the offset
for ULP B0

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-17696: Change resource from PID_0 to SYSTEM for scu control.
Adriana Reus [Tue, 6 Mar 2018 13:28:03 +0000 (15:28 +0200)]
MLK-17696: Change resource from PID_0 to SYSTEM for scu control.

Syncs with the following change in scfw.

    Author: Chuck Cannon <chuck.cannon@freescale.com>
    Date:   Mon Mar 5 07:44:27 2018 -0600

    SCF-22: Move SCU controls to SYSTEM. Allows AP to use SCU temp
    sensor.

BuildInfo:
  - SCFW e56d4c0a, IMX-MKIMAGE d4e440b2, ATF 4af5ca0
  - U-Boot 2017.03-imx_v2017.03_4.9.51_imx8_beta2+gf195c38

Tested-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Nitin Garg <nitin.garg@nxp.com>
Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
7 years agoMLK-17645: drm: imx: dcss: fix DTRC start issue
Laurentiu Palcu [Tue, 6 Mar 2018 11:56:55 +0000 (13:56 +0200)]
MLK-17645: drm: imx: dcss: fix DTRC start issue

The following commit:

af01350 - MLK-17634-18: drm: imx: dcss: optimize context loading and DDR
bus load

introduced a regression. During my attempts to fix various green screen
issues, I modified the DTRC start routine by enabling the other register
bank, not the current one.

Unfortunately, this was committed by mistake...

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17655: drm: imx: hdp: send HDR metadata when property is set
Laurentiu Palcu [Fri, 2 Mar 2018 08:56:15 +0000 (10:56 +0200)]
MLK-17655: drm: imx: hdp: send HDR metadata when property is set

HDR metadata infoframe was sent only when doing a mode set. However,
kmssink is using the same device as Weston and mode setting messes up
with Weston's plane state.

This patch allows for the HDR metadata to be sent out to the sink when
the property is set. Hence, no need for a mode set.

Also, the older functionality allowed only for 4K@60 to be used for HDR.
However, HDR is not about resolution. This patch will also allow to go
to HDR mode in other resolutions as well.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17671-2: drm: imx: hdp: mscale: remove delay at the end of mode setting
Laurentiu Palcu [Tue, 6 Mar 2018 09:18:54 +0000 (11:18 +0200)]
MLK-17671-2: drm: imx: hdp: mscale: remove delay at the end of mode setting

Since DCSS was moved to use VIDEO2_PLL clock, HDMI phy clock is not used
anymore. Hence, this delay here is not necessary. It's been added inside
DCSS driver.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17671-1: drm: imx: dcss: add a delay after changing the pixel clock
Laurentiu Palcu [Tue, 6 Mar 2018 09:08:49 +0000 (11:08 +0200)]
MLK-17671-1: drm: imx: dcss: add a delay after changing the pixel clock

DCSS needs some time to stabilize after switching to a new pixel clock.
All interrupts will delayed till the clock stabilizes and we'll end up
getting warnings about VBLANK interrupt taking more than 50ms to arrive.

This patch adds a 500ms delay after switching to a new clock. This will
allow DCSS to stabilize before enabling CRTC and DTG channels.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17689-2: arm64: dts: fsl-imx8mq-evk: Fix clocks for DCSS-ADV7535
Robert Chiras [Tue, 6 Mar 2018 10:40:34 +0000 (12:40 +0200)]
MLK-17689-2: arm64: dts: fsl-imx8mq-evk: Fix clocks for DCSS-ADV7535

Currently, the default clock configuration for DCSS configures the pixel
clock to be sourced from VIDEO_PLL2, but this source cannot be used by
the DSI PHY_REF clock.
So, in order to make DCSS working with DSI, we need to have them both
(DCSS and DSI PHY) use the same clock source: VIDEO_PLL1.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17689-1: drm:imx: dcss: Fix DCSS clock selection for MIPI
Robert Chiras [Tue, 6 Mar 2018 09:56:56 +0000 (11:56 +0200)]
MLK-17689-1: drm:imx: dcss: Fix DCSS clock selection for MIPI

Fix the clock source selection for MIPI use-case.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17685-2: Enable CCI400 PMU in defconfig
Frank Li [Tue, 6 Mar 2018 05:23:47 +0000 (23:23 -0600)]
MLK-17685-2: Enable CCI400 PMU in defconfig

Enable CCI400 PMU config

Signed-off-by: Frank Li <Frank.Li@nxp.com>
7 years agoMLK-17685-1 Enable CCI perfomance monitor
Frank Li [Mon, 5 Mar 2018 11:27:05 +0000 (05:27 -0600)]
MLK-17685-1 Enable CCI perfomance monitor

perf list

  CCI_400_r1/cycles/                                 [Kernel PMU event]
  CCI_400_r1/mi_retry_speculative_fetch,source=?/    [Kernel PMU event]
  CCI_400_r1/mi_rrq_stall_barrier_hazard,source=?/   [Kernel PMU event]
  CCI_400_r1/mi_rrq_stall_hi_prio_rtq_full,source=?/ [Kernel PMU event]
  CCI_400_r1/mi_rrq_stall_low_prio_rtq_full,source=?/ [Kernel PMU event]
  CCI_400_r1/mi_rrq_stall_master_id_hazard,source=?/ [Kernel PMU event]
  CCI_400_r1/mi_rrq_stall_mid_prio_rtq_full,source=?/ [Kernel PMU event]
  CCI_400_r1/mi_rrq_stall_qvn_vn0,source=?/          [Kernel PMU event]
  CCI_400_r1/mi_rrq_stall_qvn_vn1,source=?/          [Kernel PMU event]
  CCI_400_r1/mi_rrq_stall_qvn_vn2,source=?/          [Kernel PMU event]
  CCI_400_r1/mi_rrq_stall_qvn_vn3,source=?/          [Kernel PMU event]

Signed-off-by: Frank Li <Frank.Li@nxp.com>
7 years agoMLK-17646 gpu: imx: dpu: Correct number of fg instances in plane group resource
Liu Ying [Fri, 2 Mar 2018 04:44:05 +0000 (12:44 +0800)]
MLK-17646 gpu: imx: dpu: Correct number of fg instances in plane group resource

The resources for a plane group are shared by the two display streams
of one DPU.  Thus, the two Framegen(fg) instances of one DPU should be
in the plane group resource.  The resource users may find the fg instance
onto which the resources are built via the stream id.  This patch corrects
the number of fg instances in a plane group resource from one to two.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-15071: ASoC: fsl: imx-ak4497: Fix clk for 384KHz and 786KHz
Viorel Suman [Mon, 12 Feb 2018 10:35:19 +0000 (12:35 +0200)]
MLK-15071: ASoC: fsl: imx-ak4497: Fix clk for 384KHz and 786KHz

With the current multipliers SAI isn't able to derive a correct bitclk.

e.g: When playing at 786Khz with current multiplier

MCLK = 22579200, requested freq 22579200 but SAI wants:
MCLK = (DIV + 1) * 2 * freq [SAI TCR2], so an acceptable solution
is to add a 2x factor to mclk.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
7 years agovideo: mxfsb: Fix endless -EPROBE_DEFER with empty disp_dev
Leonard Crestez [Fri, 23 Feb 2018 16:03:04 +0000 (18:03 +0200)]
video: mxfsb: Fix endless -EPROBE_DEFER with empty disp_dev

Since f7b48681ec68 ("MLK-16137 video: fbdev: add defer probe for mxs framebuffer")
the mxsfb_dispdrv_init function will return -EPROBE_DEFER on all
mxc_dispdrv_gethandle failures. That makes sense because all
mxc_dispdrv_entry are registered in their respective probe functions and
an absent entry should result in probing mxsfb later.

However in some cases an the disp_dev is empty and those configurations
now result in enless EPROBE_DEFER loops. Fix this by accepting empty
disp_dev at the start of mxsfb_dispdrv_init.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
7 years agovideo: mxsfb: Fix leaking videomem if dispdrv not ready
Leonard Crestez [Fri, 23 Feb 2018 15:18:18 +0000 (17:18 +0200)]
video: mxsfb: Fix leaking videomem if dispdrv not ready

This is a large leak and repeated probing can even exhaust CMA

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17623: imx8 scu: Explicitly make irq optional
Leonard Crestez [Wed, 7 Feb 2018 19:27:45 +0000 (21:27 +0200)]
MLK-17623: imx8 scu: Explicitly make irq optional

The MU works just fine without interrupts because sc_call_rpc will poll
waiting for a response. Make this explicit because it allows easier
emulation for virtualization.

The request_irq error is just reported but doesn't fail the probe,
however failing to set that irq as a wake source is fatal.

This was introduced recently:
commit 3b20aa779f33 ("MLK-17072-1: soc: imx: sc: ipc: enable MU
interrupt as wakeup source")

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17650-2: arm64: dts: fsl-imx8mq-evk: Update adv7535
Robert Chiras [Fri, 2 Mar 2018 09:35:53 +0000 (11:35 +0200)]
MLK-17650-2: arm64: dts: fsl-imx8mq-evk: Update adv7535

Since the ADV7535 address for DSI-CEC can be configured from DTS file,
update the ADV7535 specific files in order to remove the disabling
camera node and update the ADV7535 node to use a different i2c address.
Currently 0x3c was used, conflicting with camera. Now, program ADV7535
to use 0x3b for the DSI-CEC memory map.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17650-1: drm/bridge: adv7511: Add support for programmable i2c addresses
Robert Chiras [Fri, 2 Mar 2018 09:31:50 +0000 (11:31 +0200)]
MLK-17650-1: drm/bridge: adv7511: Add support for programmable i2c addresses

The DSI-HDMI converter, ADV7535, driver uses four i2c memory maps: MAIN,
DSI-CEC, EDID and PACKET.
While the MAIN address is hard-coded in the ROM chip, the other three
can be programmed into the MAIN memory map.
Currently, the three memory maps addresses, that can be programmed, are
hard-coded into the code.
In order to avoid conflicts with other i2c clients on the bus, update
the driver to use configurable addresses specified in DTS file.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
7 years agoMLK-17641 thermal: imx: Fix race condition in imx_thermal_probe()
Anson Huang [Thu, 1 Mar 2018 08:45:28 +0000 (16:45 +0800)]
MLK-17641 thermal: imx: Fix race condition in imx_thermal_probe()

Upstream reports below race condition:

When device boots with T > T_trip_1 and requests interrupt,
the race condition takes place. The interrupt comes before
THERMAL_DEVICE_ENABLED is set. This leads to an attempt to
reading sensor value from irq and disabling the sensor,
based on the data->mode field, which expected to be
THERMAL_DEVICE_ENABLED, but still stays as THERMAL_DEVICE_DISABLED.
Afher this issue sensor is never re-enabled, as the driver state is wrong.

Fix this problem by setting the 'data' members prior to requesting
the interrupts.

Signed-off-by: Mikhail Lappo <mikhail.lappo@esrlabs.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
7 years agodrm/fb: add support for not enabling fbcon on non-desktop displays [v2]
Dave Airlie [Mon, 16 Oct 2017 04:08:39 +0000 (05:08 +0100)]
drm/fb: add support for not enabling fbcon on non-desktop displays [v2]

We don't want fbcon to get used on non-desktop dislays,
don't pass them as enabled connectors to the fb helper setup.

This prevents my HMD from getting disorted fbcon, and from
affecting other displays console.

v2: Change description from non-standard to non-desktop

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
(cherry-picked b5f053882ff19a8ce from git://people.freedesktop.org/~airlied/linux)

7 years agodrm: add connector info/property for non-desktop displays [v2]
Dave Airlie [Thu, 1 Mar 2018 13:38:11 +0000 (15:38 +0200)]
drm: add connector info/property for non-desktop displays [v2]

This adds the infrastructure needed to quirk displays
using edid and to mark them a non-desktop.

A non-desktop display is one which shouldn't normally be included
as a part of a desktop environment.

This is meant to cover head mounted devices like HTC Vive.

v2: Change description from non-standard to non-desktop, add docs

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
(Ported 66660d4cf21b7dfcb25 from git://people.freedesktop.org/~airlied/linux)

7 years agoMLK-17639-2: ARM64: dts: enable spdif rx for HDMI ARC
Shengjiu Wang [Wed, 27 Dec 2017 09:12:11 +0000 (17:12 +0800)]
MLK-17639-2: ARM64: dts: enable spdif rx for HDMI ARC

enable spdif rx for HDMI ARC

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
7 years agoMLK-17639-1: hdp: enable HDMI ARC with common API
Shengjiu Wang [Thu, 1 Mar 2018 03:34:24 +0000 (11:34 +0800)]
MLK-17639-1: hdp: enable HDMI ARC with common API

Define __ARC_CONFIG__ to enable HDMI ARC

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
7 years agoMLK-17626: drm: imx: dcss: fix "ctxld error" messages
Laurentiu Palcu [Thu, 1 Mar 2018 08:36:51 +0000 (10:36 +0200)]
MLK-17626: drm: imx: dcss: fix "ctxld error" messages

The problem arised because of a combination of 2 commits:

Commit 1:

"2a70f32 - MLK-17232-2: drm: imx: dcss: ignore SB_PEND_DISP_ACTIVE
interrupt"

disabled the SB_PEND_DISP_ACTIVE interrupt because of a problem in SOC.
However, it did not remove the flag from CTXLD_IRQ_ERROR macro.

Commit 2:

"f0e3911 - MLK-17459-1: drm: imx: dcss: change ctxld irq handling"

moved the bottom half interrupt handling to top half. By doing that, the
top half did not exit immediately if IRQ_COMPLETION condition was met
and continued evaluating if any interrupts in CTXLD_IRQ_ERROR flags
were triggered.

This patch removes SB_PEND_DISP_ACTIVE interrupt flag from
CTXLD_IRQ_ERROR macro.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-19: drm: imx: dcss: set crtc output pipe to P010 only if sink suports YUV420
Laurentiu Palcu [Tue, 27 Feb 2018 11:11:19 +0000 (13:11 +0200)]
MLK-17634-19: drm: imx: dcss: set crtc output pipe to P010 only if sink suports YUV420

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-18: drm: imx: dcss: optimize context loading and DDR bus load
Laurentiu Palcu [Mon, 26 Feb 2018 14:16:19 +0000 (16:16 +0200)]
MLK-17634-18: drm: imx: dcss: optimize context loading and DDR bus load

This will lower the amount of ctxld entries sent, if configuration has
not changed much. Also, disable channel 0 if alpha is 0 and global alpha
is used. This will lower the DDR load, depending on graphics channel
resolution.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-17: drm: imx: dcss: make P010 tiled formats work
Laurentiu Palcu [Thu, 22 Feb 2018 08:42:59 +0000 (10:42 +0200)]
MLK-17634-17: drm: imx: dcss: make P010 tiled formats work

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-16: drm: imx: dcss: make 10-bit formats work with HDR
Laurentiu Palcu [Tue, 20 Feb 2018 13:06:49 +0000 (15:06 +0200)]
MLK-17634-16: drm: imx: dcss: make 10-bit formats work with HDR

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-15: drm: imx: dcss: handle P010 format
Laurentiu Palcu [Mon, 19 Feb 2018 14:01:14 +0000 (16:01 +0200)]
MLK-17634-15: drm: imx: dcss: handle P010 format

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-14: drm: imx: dcss: Add basic HDR10 support
Laurentiu Palcu [Wed, 14 Feb 2018 12:06:41 +0000 (14:06 +0200)]
MLK-17634-14: drm: imx: dcss: Add basic HDR10 support

This patch adds basic HDR10 support. However, full support depends on
subsequent patches.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-13: drm: imx: dcss: remove the dcss-tables header
Laurentiu Palcu [Mon, 12 Feb 2018 11:01:54 +0000 (13:01 +0200)]
MLK-17634-13: drm: imx: dcss: remove the dcss-tables header

The tables header is no longer necessary as dcss.fw file will be used
from now on to store LUT and CSC tables.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-12: drm: imx: hdp: Send HDR metadata to the sink
Laurentiu Palcu [Mon, 12 Feb 2018 08:23:48 +0000 (10:23 +0200)]
MLK-17634-12: drm: imx: hdp: Send HDR metadata to the sink

If the HDR metadata proprety is set, then the metadata will be sent
to the sink at the next mode set.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-11: drm: imx: dcss: make DCSS use VIDEO2_PLL2 clock
Laurentiu Palcu [Wed, 7 Feb 2018 14:51:34 +0000 (16:51 +0200)]
MLK-17634-11: drm: imx: dcss: make DCSS use VIDEO2_PLL2 clock

This clock is needed by HDR10 so this patch makes DCSS use VIDEO2_PLL2
for the rest of the resolutions as well.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-10: clk: imx8m: add support for 27MHz phy clock and fix pll2 round/set...
Laurentiu Palcu [Wed, 7 Feb 2018 14:48:12 +0000 (16:48 +0200)]
MLK-17634-10: clk: imx8m: add support for 27MHz phy clock and fix pll2 round/set rate functions

The SSCG PLL2 is identical to PLL1, hence make the rounding/setting
functions reflect that.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-9: clk: imx8m: add VIDEO2_PLL2 clock tree
Laurentiu Palcu [Wed, 7 Feb 2018 14:25:59 +0000 (16:25 +0200)]
MLK-17634-9: clk: imx8m: add VIDEO2_PLL2 clock tree

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-8: drm: imx: dcss: read HDR10 LUTs/CSCs from FW file
Laurentiu Palcu [Mon, 22 Jan 2018 07:50:23 +0000 (09:50 +0200)]
MLK-17634-8: drm: imx: dcss: read HDR10 LUTs/CSCs from FW file

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-7: drm: imx: dcss: remove unused dcss_hdr10_priv structure member
Laurentiu Palcu [Sat, 27 Jan 2018 14:05:25 +0000 (16:05 +0200)]
MLK-17634-7: drm: imx: dcss: remove unused dcss_hdr10_priv structure member

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-6: drm: imx: dcss: add P010 drm format
Laurentiu Palcu [Fri, 19 Jan 2018 13:15:58 +0000 (15:15 +0200)]
MLK-17634-6: drm: imx: dcss: add P010 drm format

This is 10-bit per channel YUV420 semi-planar.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-5: drm: imx: dcss: overlay planes support HDR
Laurentiu Palcu [Fri, 19 Jan 2018 13:04:37 +0000 (15:04 +0200)]
MLK-17634-5: drm: imx: dcss: overlay planes support HDR

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agodrm: add helper functions for YCBCR420 handling
Shashank Sharma [Thu, 13 Jul 2017 15:33:14 +0000 (21:03 +0530)]
drm: add helper functions for YCBCR420 handling

This patch adds helper functions for YCBCR 420 handling.
These functions do:
- check if a given video mode is YCBCR 420 only mode.
- check if a given video mode is YCBCR 420 also mode.

V2: Added YCBCR functions as helpers in DRM layer, instead of
    keeping it in I915 layer.
V3: Added handling for YCBCR-420 only modes too.
V4: EXPORT_SYMBOL(drm_find_hdmi_output_type)
V5: Addressed review comments from Danvet:
    - %s/drm_find_hdmi_output_type/drm_display_info_hdmi_output_type
    - %s/drm_can_support_ycbcr_output/drm_display_supports_ycbcr_output
    - %s/drm_can_support_this_ycbcr_output/
drm_display_supports_this_ycbcr_output
    - pass drm_display_info instead of drm_connector for consistency
    - For drm_get_highest_quality_ycbcr_supported doc, move the variable
      description above, and then the function description.
V6: Add only YCBCR420 helpers (Ville)
V7: Addressed review comments from Ville
    - Remove cea_vic_valid() check.
    - Fix indentation.
    - Make input parameters to helpers, const.

Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Jose Abreu <Jose.Abreu@synopsys.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1499960000-9232-9-git-send-email-shashank.sharma@intel.com
[vsyrjala: Fix sparse indentation warn]
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
7 years agodrm/edid: parse ycbcr 420 deep color information
Shashank Sharma [Thu, 13 Jul 2017 15:33:13 +0000 (21:03 +0530)]
drm/edid: parse ycbcr 420 deep color information

CEA-861-F spec adds ycbcr420 deep color support information
in hf-vsdb block. This patch extends the existing hf-vsdb parsing
function by adding parsing of ycbcr420 deep color support from the
EDID and adding it into display information stored.

V2: Rebase
V3: Rebase
V4: Moved definition of y420_dc_modes into this patch, where its used
    (Ville)
V5: Optimize function, if(conditions) not reqd (Ville)
V6: Rebase
V7: Rebase

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1499960000-9232-8-git-send-email-shashank.sharma@intel.com
[vsyrjala: Fix sparse indentation warn]
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
7 years agodrm/edid: parse sink information before CEA blocks
Shashank Sharma [Thu, 13 Jul 2017 15:33:09 +0000 (21:03 +0530)]
drm/edid: parse sink information before CEA blocks

CEA-861-F adds ycbcr capability map block, for HDMI 2.0 sinks.
This block contains a map of indexes of CEA modes, which can
support YCBCR 420 output also. To avoid multiple parsing of same
CEA block, let's parse the sink information and get this map, before
parsing CEA modes.

This patch moves the call to drm_add_display_info function, before the
mode parsing block.

V4: Introduced new patch in the series
V5: Move this patch before 4:2:0 parsing patch (ville)
    Added r-b from Ville
V6: Rebase
V7: Rebase

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1499960000-9232-4-git-send-email-shashank.sharma@intel.com
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
7 years agodrm/edid: parse YCBCR420 videomodes from EDID
Shashank Sharma [Fri, 14 Jul 2017 10:33:46 +0000 (16:03 +0530)]
drm/edid: parse YCBCR420 videomodes from EDID

HDMI 2.0 spec adds support for YCBCR420 sub-sampled output.
CEA-861-F adds two new blocks in EDID's CEA extension blocks,
to provide information about sink's YCBCR420 output capabilities.

These blocks are:

- YCBCR420vdb(YCBCR 420 video data block):
This block contains VICs of video modes, which can be sopported only
in YCBCR420 output mode (Not in RGB/YCBCR444/422. Its like a normal
SVD block, valid for YCBCR420 modes only.

- YCBCR420cmdb(YCBCR 420 capability map data block):
This block gives information about video modes which can support
YCBCR420 output mode also (along with RGB,YCBCR444/422 etc) This
block contains a bitmap index of normal svd videomodes, which can
support YCBCR420 output too.
So if bit 0 from first vcb byte is set, first video mode in the svd
list can support YCBCR420 output too. Bit 1 means second video mode
from svd list can support YCBCR420 output too, and so on.

This patch adds two bitmaps in display's hdmi_info structure, one each
for VCB and VDB modes. If the source is HDMI 2.0 capable, this patch
adds:
- VDB modes (YCBCR 420 only modes) in connector's mode list, also makes
  an entry in the vdb_bitmap per vic.
- VCB modes (YCBCR 420 also modes) only entry in the vcb_bitmap.

Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
V2: Addressed
    Review comments from Emil:
    - Use 1ULL<<i instead of 1<<i to make sure the output is 64bit.
    - Use the suggested method for updating dbmap.
    - Add documentation for YCBCR420_vcb_map to fix kbuild warning.

    Review comments from Ville:
    - Do not expose the YCBCR420 flags in uabi layer, keep it internal.
    - Save a map of YCBCR420 modes for future reference.
    - Check db length before trying to parse extended tag.
    - Add a warning if there are > 64 modes in capability map block.
    - Use y420cmdb in function names and macros while dealing with vcb
      to be aligned with spec.
    - Move the display information parsing block ahead of mode parsing
      blocks.

V3: Addressed design/review comments from Ville
    - Do not add flags in video modes, else we have to expose them to user
    - There should not be a UABI change, and kernel should detect the
      choice of the output based on type of mode, and the bitmaps.
    - Use standard bitops from kernel bitmap header, instead of calculating
      bit positions manually.

V4: Addressed review comments from Ville:
    - s/ycbcr_420_vdb/y420vdb
    - s/ycbcr_420_vcb/y420cmdb
    - Be less verbose on description of do_y420vdb_modes
    - Move newmode variable in the loop scope.
    - Use svd_to_vic() to get a VIC, instead of 0x7f
    - Remove bitmap description for CMDB modes & VDB modes
    - Dont add connector->ycbcr_420_allowed check for cmdb modes
    - Remove 'len' variable, in is_y420cmdb function, which is used
      only once
    - Add length check in is_y420vdb function
    - Remove unnecessary if (!db) check in function parse_y420cmdb_bitmap
    - Do not add print about YCBCR 420 modes
    - Fix indentation in few places
    - Move ycbcr420_dc_modes in next patch, where its used
    - Add a separate patch for movement of drm_add_display_info()

V5: Addressed review comments from Ville:
    - Add the patch which cleans up the current EXTENDED_TAG usage
    - Make y420_cmdb_map u64
    - Do not block ycbcr420 modes while parsing the EDID, rather
      add a separate helper function to prune ycbcr420-only modes from
      connector's probed modes.

V6: Rebase
V7: Move this patch after the 420_only validation patch (Ville)
V8: Addressed review comments from Ville
    - use cea_vic_valid check before adding cmdb/vdb modes
    - add check for i < 64 while adding cmdb modes
    - use 1ULL while checking bitmap

Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1500028426-14883-1-git-send-email-shashank.sharma@intel.com
[vsyrjala: Fix checkpatch complaints and indentation]
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
7 years agodrm/edid: cleanup patch for CEA extended-tag macro
Shashank Sharma [Thu, 13 Jul 2017 15:33:10 +0000 (21:03 +0530)]
drm/edid: cleanup patch for CEA extended-tag macro

CEA-861-F introduces extended tag codes for EDID extension blocks,
which indicates the actual type of the data block. The code for
using exteded tag is 0x7, whereas in the existing code, the
corresponding macro is named as "VIDEO_CAPABILITY_BLOCK"

This patch renames the macro and usages from "VIDEO_CAPABILITY_BLOCK"
to "USE_EXTENDED_TAG"

V2: Add extended tag code check for video capabilitiy block (ville)
V3: Ville:
- Use suggested names for macros
- Check the block length first, before checking the extended tag
V4: Fix commit message (David)
V5: Introduced this patch into HDMI-YCBCR-output series
V6: Rebase
V7: Rebase

Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1499960000-9232-5-git-send-email-shashank.sharma@intel.com
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
7 years agodrm: add helper to validate YCBCR420 modes
Shashank Sharma [Thu, 13 Jul 2017 15:33:11 +0000 (21:03 +0530)]
drm: add helper to validate YCBCR420 modes

YCBCR420 modes are supported only on HDMI 2.0 capable sources.
This patch adds:
- A drm helper to validate YCBCR420-only mode on a particular
  connector. This function will help pruning the YCBCR420-only
  modes from the connector's modelist.
- A bool variable (ycbcr_420_allowed) in the drm connector structure.
  While handling the EDID from HDMI 2.0 sinks, its important to know
  if the source is capable of handling YCBCR420 output, so that no
  YCBCR 420 modes will be listed for sources which can't handle it.
  A driver should set this variable if it wants to see YCBCR420 modes
  in the modedb.

V5: Introduced the patch in series.
V6: Squashed two patches (validate YCBCR420 and add YCBCR420
   identifier)
V7: Addressed review comments from Vile:
    - Move this patch before we add 420 modes from EDID.
    - No need for drm_valid_cea_vic() check, function back to non-static.
    - Update MODE_STATUS with NO_420 condition.
    - Introduce y420_vdb_modes variable in this patch

Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1499960000-9232-6-git-send-email-shashank.sharma@intel.com
[vsyrjala: Drop the now bogus EXPORT_SYMBOL(drm_valid_cea_vic)]
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
7 years agoMLK-17634-4: drm: move hdr_panel_metadata to drm_hdmi_info
Laurentiu Palcu [Thu, 25 Jan 2018 09:27:46 +0000 (11:27 +0200)]
MLK-17634-4: drm: move hdr_panel_metadata to drm_hdmi_info

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-3: drm: edid: fix hdr infoframe creation routine
Laurentiu Palcu [Mon, 12 Feb 2018 08:09:57 +0000 (10:09 +0200)]
MLK-17634-3: drm: edid: fix hdr infoframe creation routine

The frame->type was overwritten, instead of setting the frame->metadata_type
field.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agoMLK-17634-2: drm: edid: add support for HLG EOTF
Laurentiu Palcu [Fri, 9 Feb 2018 08:07:35 +0000 (10:07 +0200)]
MLK-17634-2: drm: edid: add support for HLG EOTF

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
7 years agodrm: Enable HDR infoframe support
Uma Shankar [Fri, 19 Jan 2018 12:42:00 +0000 (14:42 +0200)]
drm: Enable HDR infoframe support

Enable Dynamic Range and Mastering Infoframe for HDR
content, which is defined in CEA 861.3 spec.

 The metadata will be computed based on blending
policy in userspace compositors and passed as a connector
property blob to driver. The same will be sent as infoframe
to panel which support HDR.

Signed-off-by: Uma Shankar <uma.shankar@intel.com>