1
0
Fork 0
Commit Graph

881827 Commits (420a357a1b43c57383c74a548a9a3714b6da7de2)

Author SHA1 Message Date
Zhou Peng 420a357a1b MLK-24009-3 arm64: imx8mm: vpu: h1: fix build issue as module
release clk to avoid memory leak

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2020-05-15 12:39:05 +08:00
Zhou Peng 76d95bf263 MLK-24009-2 arm64: imx8mp: vpu: g1/g2: fix build issue as module
release clk to avoid memory leak

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2020-05-15 12:39:05 +08:00
Zhou Peng 099a3ae272 MLK-24009-1 arm64: imx8mp: vpu: vc8000e: fix build issue as module
change module device table name to fix build error as module
rename the c source name to avoid conflict with h1
release clk avoid memory leak
fix typo error in core index

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2020-05-15 12:39:05 +08:00
Sandor Yu 3a91e9d0de MLK-24040: drm: imx: pavi: Combine pai and pvi powerup/down function
Combine pvi and pai power up/down functions to pavi_powerup/down
function. Move clock enable/disable function to power function.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2020-05-15 10:17:12 +08:00
Fancy Fang ea4f7e2d01 MLK-24002-2 drm/imx: lcdifv3: put controller enable to CRTC
Move the controller enablement from atomic plane update to
the CRTC's atomic enable, since some bridge(e.g. IT6263)
requires data stream from CRTC to be ready for its config.

But this controller enablement change won't cause any side
effect, since the CRTC enable and plane update can be done
in one frame interval and to next frame all configurations
can take effect, which has the same behavior as before.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
2020-05-15 10:08:52 +08:00
Fancy Fang bfa7236c84 MLK-24002-1 drm/imx: lcdifv3: enable shadow load for plane update
After the atomic plane update, the shadow load should be
enabled to make sure its update can take effect on next
frame in any cases. And this enable is better to be done
in CRTC's atomic_flush() which is called after plane's
atomic_update() is called.

Besides, the shadow load enable in controller enable is
unnecessary, so remove it.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
2020-05-15 10:08:30 +08:00
Li Yang 2ff28a22ad mxc: vpu_maline: Fix Kconfig to depends on VIDEO_V4L2
This fixes build issue when MEDIA_SUPPORT is configured as module.

Signed-off-by: Li Yang <leoyang.li@nxp.com>
2020-05-15 09:17:49 +08:00
Li Yang 7af6a9a777 mxc: vpu_malone: fix build issue as module
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2020-05-15 09:17:39 +08:00
Han Xu 529d3dc133 MLK-24011: mtd: nand: gpmi: removed the redundant runtime_pm ops
remove the redundant pm_runtime_get_sync introduced in last code rebase

Signed-off-by: Han Xu <han.xu@nxp.com>
2020-05-14 18:04:08 -05:00
Han Xu 5dde5bcfd7 MLK-24007: mtd: rawnand: gpmi: fix the random DMA timeout issue
To get better performance, current gpmi driver collected and chained all
small DMA transfers in gpmi_nfc_exec_op, the whole chain triggered and
wait for complete at the end.

But some random DMA timeout found in this new driver, with the help of
ftrace, we found the root cause is as follows:

Take gpmi_ecc_read_page() as an example, gpmi_nfc_exec_op collected 6
DMA transfers and the DMA chain triggered at the end. It waits for bch
completion and check jiffies if it's timeout. The typical function graph
shown below,

   63.216351 |   1)               |  gpmi_ecc_read_page() {
   63.216352 |   1)   0.750 us    |    gpmi_bch_layout_std();
   63.216354 |   1)               |    gpmi_nfc_exec_op() {
   63.216355 |   1)               |      gpmi_chain_command() {
   63.216356 |   1)               |        mxs_dma_prep_slave_sg() {
   63.216357 |   1)               |          /* mxs chan ccw idx: 0 */
   63.216358 |   1)   1.750 us    |        }
   63.216359 |   1)               |        mxs_dma_prep_slave_sg() {
   63.216360 |   1)               |          /* mxs chan ccw idx: 1 */
   63.216361 |   1)   2.000 us    |        }
   63.216361 |   1)   6.500 us    |      }
   63.216362 |   1)               |      gpmi_chain_command() {
   63.216363 |   1)               |        mxs_dma_prep_slave_sg() {
   63.216364 |   1)               |          /* mxs chan ccw idx: 2 */
   63.216365 |   1)   1.750 us    |        }
   63.216366 |   1)               |        mxs_dma_prep_slave_sg() {
   63.216367 |   1)               |          /* mxs chan ccw idx: 3 */
   63.216367 |   1)   1.750 us    |        }
   63.216368 |   1)   5.875 us    |      }
   63.216369 |   1)               |      /* gpmi_chain_wait_ready */
   63.216370 |   1)               |      mxs_dma_prep_slave_sg() {
   63.216372 |   1)               |        /* mxs chan ccw idx: 4 */
   63.216373 |   1)   3.000 us    |      }
   63.216374 |   1)               |      /* gpmi_chain_data_read */
   63.216376 |   1)               |      mxs_dma_prep_slave_sg() {
   63.216377 |   1)               |        /* mxs chan ccw idx: 5 */
   63.216378 |   1)   2.000 us    |      }
   63.216379 |   1)   1.125 us    |      mxs_dma_tx_submit();
   63.216381 |   1)   1.000 us    |      mxs_dma_enable_chan();
   63.216712 |   0)   2.625 us    |  mxs_dma_int_handler();
   63.216717 |   0)   4.250 us    |  bch_irq();
   63.216723 |   0)   1.250 us    |  mxs_dma_tasklet();
   63.216723 |   1)               |      /* jiffies left 250 */
   63.216725 |   1) ! 372.000 us  |    }
   63.216726 |   1)   2.625 us    |    gpmi_count_bitflips();
   63.216730 |   1) ! 379.125 us  |  }

but it's not gurantee that bch irq handled always after dma irq handled,
sometimes bch_irq comes first and gpmi_nfc_exec_op won't wait anymore,
another gpmi_nfc_exec_op may get invoked before last DMA chain IRQ
handled, this messed up the next DMA chain and causes DMA timeout. Check
the trace log when issue happened.

   63.218923 |   1)               |  gpmi_ecc_read_page() {
   63.218924 |   1)   0.625 us    |    gpmi_bch_layout_std();
   63.218926 |   1)               |    gpmi_nfc_exec_op() {
   63.218927 |   1)               |      gpmi_chain_command() {
   63.218928 |   1)               |        mxs_dma_prep_slave_sg() {
   63.218929 |   1)               |          /* mxs chan ccw idx: 0 */
   63.218929 |   1)   1.625 us    |        }
   63.218931 |   1)               |        mxs_dma_prep_slave_sg() {
   63.218931 |   1)               |          /* mxs chan ccw idx: 1 */
   63.218932 |   1)   1.750 us    |        }
   63.218933 |   1)   5.875 us    |      }
   63.218934 |   1)               |      gpmi_chain_command() {
   63.218934 |   1)               |        mxs_dma_prep_slave_sg() {
   63.218935 |   1)               |          /* mxs chan ccw idx: 2 */
   63.218936 |   1)   1.875 us    |        }
   63.218937 |   1)               |        mxs_dma_prep_slave_sg() {
   63.218938 |   1)               |          /* mxs chan ccw idx: 3 */
   63.218939 |   1)   1.625 us    |        }
   63.218939 |   1)   5.875 us    |      }
   63.218940 |   1)               |      /* gpmi_chain_wait_ready */
   63.218941 |   1)               |      mxs_dma_prep_slave_sg() {
   63.218942 |   1)               |        /* mxs chan ccw idx: 4 */
   63.218942 |   1)   1.625 us    |      }
   63.218943 |   1)               |      /* gpmi_chain_data_read */
   63.218944 |   1)               |      mxs_dma_prep_slave_sg() {
   63.218945 |   1)               |        /* mxs chan ccw idx: 5 */
   63.218947 |   1)   2.375 us    |      }
   63.218948 |   1)   0.625 us    |      mxs_dma_tx_submit();
   63.218949 |   1)   1.000 us    |      mxs_dma_enable_chan();
   63.219276 |   0)   5.125 us    |  bch_irq();                  <----
   63.219283 |   1)               |      /* jiffies left 250 */
   63.219285 |   1) ! 358.625 us  |    }
   63.219286 |   1)   2.750 us    |    gpmi_count_bitflips();
   63.219289 |   1) ! 366.000 us  |  }
   63.219290 |   1)               |  gpmi_ecc_read_page() {
   63.219291 |   1)   0.750 us    |    gpmi_bch_layout_std();
   63.219293 |   1)               |    gpmi_nfc_exec_op() {
   63.219294 |   1)               |      gpmi_chain_command() {
   63.219295 |   1)               |        mxs_dma_prep_slave_sg() {
   63.219295 |   0)   1.875 us    |  mxs_dma_int_handler();      <----
   63.219296 |   1)               |          /* mxs chan ccw idx: 6 */
   63.219297 |   1)   2.250 us    |        }
   63.219298 |   1)               |        mxs_dma_prep_slave_sg() {
   63.219298 |   0)   1.000 us    |  mxs_dma_tasklet();
   63.219299 |   1)               |          /* mxs chan ccw idx: 0 */
   63.219300 |   1)   1.625 us    |        }
   63.219300 |   1)   6.375 us    |      }
   63.219301 |   1)               |      gpmi_chain_command() {
   63.219302 |   1)               |        mxs_dma_prep_slave_sg() {
   63.219303 |   1)               |          /* mxs chan ccw idx: 1 */
   63.219304 |   1)   1.625 us    |        }
   63.219305 |   1)               |        mxs_dma_prep_slave_sg() {
   63.219306 |   1)               |          /* mxs chan ccw idx: 2 */
   63.219306 |   1)   1.875 us    |        }
   63.219307 |   1)   6.000 us    |      }
   63.219308 |   1)               |      /* gpmi_chain_wait_ready */
   63.219308 |   1)               |      mxs_dma_prep_slave_sg() {
   63.219309 |   1)               |        /* mxs chan ccw idx: 3 */
   63.219310 |   1)   2.000 us    |      }
   63.219311 |   1)               |      /* gpmi_chain_data_read */
   63.219312 |   1)               |      mxs_dma_prep_slave_sg() {
   63.219313 |   1)               |        /* mxs chan ccw idx: 4 */
   63.219314 |   1)   1.750 us    |      }
   63.219315 |   1)   0.625 us    |      mxs_dma_tx_submit();
   63.219316 |   1)   0.875 us    |      mxs_dma_enable_chan();
   64.224227 |   1)               |      /* jiffies left 0 */

In the first gpmi_nfc_exec_op, bch_irq comes first and gpmi_nfc_exec_op
exits, but DMA IRQ still not happened yet until the middle of following
gpmi_nfc_exec_op, the first DMA transfer index get messed and DMA get
timeout.

To fix the issue, when there is bch ops in DMA chain, the
gpmi_nfc_exec_op should wait for both completions rather than bch
completion only.

Signed-off-by: Han Xu <han.xu@nxp.com>
2020-05-14 17:15:25 -05:00
Laurentiu Palcu dc084f9d92 LF-621: drm/imx/dcss: add back disabled formats
The YUV formats were removed from graphics plane and RGB ones were removed from
video planes. That's because, in general, one will use a window manager and the
UI will always reside on the graphics plane, while video playback will go to
the overlay planes.

However, this move affects users using custom applications that would like to
use 2 graphics planes and one video plane. Or 3 graphics planes.

DCSS is perfectly capable of scanning out RGB/YUV linear formats on all 3
pipes. Only tiled and tiled-compressed formats need special treatment:
tiled-compressed graphics has to always go to pipe 1 (since DEC400D is needed
for uncompressing the graphics format) whilst tiled-uncompressed and
tiled-compressed VPU formats need to always go to pipes 2 and 3 (DTRC will
handle de-tiling and decompression).

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
2020-05-14 13:54:40 +03:00
Shijie Qin 2f97227dd6 MA-17115 mxc: vpu_malone: send error event when firmware exception
When firmware exception, send error event instead of eos event,
avoid doubt or might send eos event twice(exception + parsed eos data).

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
2020-05-14 18:37:49 +08:00
Richard Zhu af235be442 MLK-24008 PCI: imx: refine the codes to do compliance tests
- Don't limit to only PCIe GEN1 when do the compliance tests.
- Configure the TX drive level of iMX865 PHY, adjust the peak output
voltage to pass the PCIe GEN1 compliance tests.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
2020-05-14 11:31:16 +08:00
Liu Ying 0735da29ed MLK-23981 arm64: imx8x-mek.dtsi: Enable adma_pwm node in display specific DT file
The current DT file for the i.MX8x MEK platform has a pin conflict for
IMX8QXP_SPI0_CS1 bewteen the sai1 node and the adma_pwm node(as needed
by the parallel display panel backlight control).  This patch enables
the adma_pwm node in display specific DT file to avoid the conflict.
Also, the lcdif_backlight is moved to display specific as it is
referencing the adma_pwm node.

Fixes: 62408b1461 ("LF-1189-13 arm64: dts: imx8qxp-mek: Add adma_pwm support")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-05-14 09:19:03 +08:00
Fugang Duan 00a7149821 MLK-23997 arm: dts: imx6qdl: increase the PAD drive strength for usdhc2
Increase the PAD drive strength for usdhc2 to avoid cmd53 error.

Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
2020-05-13 11:19:32 +08:00
Peng Fan 6566c7b54a MLK-23995 mailbox: imx: fix build warning
Fix below build warning:
warning: format ‘%li’ expects argument of type ‘long int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
"Exceed max msg size (%li) on TX, got: %i\n",

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-05-13 10:44:15 +08:00
Adrian Alonso 1d631c17d7 MLK-23925: dts: arm64: freescale: imx8mn audio board
iMX8MN DDR4 and LPDDR4 SOM on Audio Board 2.0
enable base support, ADC and SPDIF.

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
2020-05-12 13:23:03 -05:00
Adrian Alonso 6f6ce7b7ad MLK-23924: dts: arm64: freescale: imx8mm audio board
iMX8MM LPDDR4 SOM on Audio Board 2.0 enable base support
SPDIF, ADC and dual DAC

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
2020-05-12 13:22:45 -05:00
Adrian Alonso 66a3ff6507 MLK-23923: dts: arm64: freescale: imx8mm sai mclk0 dummy clk
Add missing sai mclk0 dummy clk expected by SAI
driver, fix error:
fsl-sai 30020000.sai: failed to get mclk0 clock: -2

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
2020-05-12 13:21:51 -05:00
Adrian Alonso 6feb394010 MLK-23922-2: dts: arm64: freescale: imx8mm evk 8mic swpdm
imx8mm EVK 8mic Rev E PDM to PCM software
decimation support MIC capture on SAI5

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
2020-05-12 13:21:09 -05:00
Adrian Alonso 1c0d6cc131 MLK-23922-1: dts: arm64: freescale: imx8mm evk 8mic revE
Add support for 8mic rev E PDM mic array board
support for gpio leds and software keys events:

SW1: KEY_F9 Factory reset for Android
SW2: VOLUME_MUTE
SW3: VOLUME_UP
SW4: VOLUME_DOWN

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
2020-05-12 13:20:50 -05:00
Adrian Alonso 7238c03e56 MLK-23921: sound: soc: imx-pdm: update driver constrains
Update drivers constrains, limit sample rates to
[8Khz - 64Khz] and up to 8 channels.
Use SND_SOC_DAIFMT_PDM format type and remove
tdm slot settings to allow capture from multiple
SAI_RxD pins.

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
2020-05-12 13:20:34 -05:00
Adrian Alonso 710953489d MLK-23920: dts: arm64: freescale: imx8mm evk pca6416 vcc supply
Add missing vcc-supply assing buck4_reg which corresponds
to VDD_3V3 from pmic, fixes probe pca6416 driver

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
2020-05-12 13:20:02 -05:00
Dragos Rosioru 8ff6f78434 MLK-23223: arm64: imx_v8_defconfig: enable extra CRYPTO_* symbols
Enable generic SW crypto algorithms needed for tcrypt speed tests

Signed-off-by: Dragos Rosioru <dragos.rosioru@nxp.com>
2020-05-12 18:13:30 +03:00
Dragos Rosioru fbd0c68859 MLK-23223: ARM: imx_v7_defconfig: enable extra CRYPTO_* symbols
Enable generic SW crypto algorithms needed for tcrypt speed tests

Signed-off-by: Dragos Rosioru <dragos.rosioru@nxp.com>
2020-05-12 18:13:30 +03:00
Viorel Suman db31c447ee MLK-23991: ASoC: fsl_xcvr: drop eARC -> ARC fallback
The criteria used to drop eARC mode into ARC mode
makes eARC function to fail. Drop it for now.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-05-12 16:13:15 +03:00
Shengjiu Wang 97547b2288 MLK-23990: arm64: dts: imx8mp-evk-rpmsg: Add power domain for rpmsg i2s
Lower power audio needs the audiomix power domain be enabled when running
For the resource in audiomix is used by M7 core.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-12 18:14:00 +08:00
Franck LENORMAND 2e2d8dc156 MLK-23822: soc: imx: secvio: Fix boot message when nvmem not initialised
When the nvmem subsystem is not initialised at boot, the probe
will fail and an error message will be displayed.
In this case the message should not be printed as the driver will
be probed later.

This patch checks the error code from nvmem before printing the
message.

It also fixes the cleaning path as the driver was not exiting
properly.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2020-05-11 17:46:23 +02:00
Fugang Duan 7b8a2d17a1 MLK-23977 arm: dts: imx7d: enable NXP 88w8987 wlan for sdb board
Enable NXP 88w8987 wlan support:
- insert AW-CM358-uSD card into micro SD slot

Reviewed-by: Yang Tian <yang.tian@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
2020-05-11 18:25:31 +08:00
Shengjiu Wang 464e926718 MLK-23975: ASoC: imx-dsp: Remove wrong dapm route
With route "Playback" -> "Playback", dapm will enable
the "Playback" widget to be power on, there is this same
widget for codec component, then codec will enter
the SND_SOC_BIAS_ON level, then mclk is enabled

When the mclk is bound with a power domain, the power
domain will be enabled always.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Peng Zhang <peng.zhang_8@nxp.com>
2020-05-11 17:44:04 +08:00
Liu Ying c2b595f2d9 MLK-23959 arm64: imx8-ss-dc0/1.dtsi: Correct dpu node interrupt properties
The dpu node 'interrupts' and 'interrupt-names' properties should
reflect all dpu interrupts including the missing 'reserved' interrupt.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
2020-05-11 15:00:15 +08:00
Shengjiu Wang cacd4e1389 MLK-23970: ASoC: fsl_dsp: workaround for no reset controller
On imx8mp, there is no dedicated reset controller for DSP and
there is no dedicated power domain for DSP.

The power of DSP is bound with audiomix, so we need to check
the DSP status for judging the audiomix is reset or not.

We use the PID register for status check, after reset, it will
be set to zero, when DSP is used we set it to 1.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Peng Zhang <peng.zhang_8@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-05-11 14:50:55 +08:00
Robin Gong f25b74f785 MLK-23659-2: arm64: dts: imx8mn: add snvs clock for snvs_pwrkey
Make same change as i.mx8mp.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
2020-05-11 19:15:11 +08:00
Robin Gong b5aadaa4a5 MLK-23659-1: arm64: dts: imx8mp: add snvs clock for snvs_pwrkey
Since snvs clock runtime management added for snvs_rtc, all snvs_pwrkey
should also added snvs clock, otherwise, snvs clock will be off after
snvs-rct driver suspend and snvs_pwrkey interrupt may come after that,
hence, kernel will hang.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
2020-05-11 19:15:11 +08:00
Shengjiu Wang 6d730b27cc MLK-23965: ASoC: fsl_dsp: Fix the error handler in probe
Fix the error handler in probe. otherwise the resource
can't be release when error happen.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Peng Zhang <peng.zhang_8@nxp.com>
2020-05-11 10:51:16 +08:00
Peter Chen 89d4fd8b0b
MLK-23913-7 usb: cdns3: ep0: re-init request list at cdns3_ep0_config
It is better to re-init request list for EP0 when the EP0 begins to
uses.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2020-05-11 07:14:37 +08:00
Peter Chen f7f8a6ec4b
MLK-23913-6 usb: cdns3: gadget: refine the stop flow
The new usb_gadget_disconnect API includes both calling class
driver's disconnect and calling .pullup at udc driver, so we
could simply your udc driver handling.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2020-05-11 07:14:37 +08:00
Peter Chen 291cd74401
MLK-23913-5 usb: cdns3: gadget: clear the interrupt status when disconnect the host
We do not want to handle any interrupts after usb_gadget_disconnect
is called.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2020-05-11 07:14:37 +08:00
Peter Chen 62faac59a9
MLK-23913-4 usb: cdns3: gadget: set fast access bit
Below is the recommendation from Cadence designer:
Using this bit to be sure that PHY clock is keeping up in active
state. It's good to keep Fast Access bit enabled as long as there
is any access to USB register.

It is used to fix the potential ARM core hang when visit controller
register after DEVDS is set.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2020-05-11 07:14:37 +08:00
Peter Chen 6aaf410cb5
MLK-23913-3 usb: cdns3: gadget: prev_req->trb is NULL for ep0
And there are no multiple TRBs on EP0 and WA1 workaround,
so it doesn't need to change TRB for EP0. It fixes below oops.

configfs-gadget gadget: high-speed config #1: b
android_work: sent uevent USB_STATE=CONFIGURED
Unable to handle kernel read from unreadable memory at virtual address 0000000000000008
Mem abort info:
android_work: sent uevent USB_STATE=DISCONNECTED
  ESR = 0x96000004
  EC = 0x25: DABT (current EL), IL = 32 bits

  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
Data abort info:
  ISV = 0, ISS = 0x00000004
  CM = 0, WnR = 0
user pgtable: 4k pages, 48-bit VAs, pgdp=00000008b5bb7000
[0000000000000008] pgd=0000000000000000
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 2 PID: 430 Comm: HwBinder:401_1 Not tainted 5.4.24-06071-g6fa8921409c1-dirty #77
Hardware name: Freescale i.MX8QXP MEK (DT)
pstate: 60400085 (nZCv daIf +PAN -UAO)
pc : cdns3_gadget_ep_dequeue+0x1d4/0x270
lr : cdns3_gadget_ep_dequeue+0x48/0x270
sp : ffff800012763ba0
x29: ffff800012763ba0 x28: ffff00082c653c00
x27: 0000000000000000 x26: ffff000068fa7b00
x25: ffff0000699b2000 x24: ffff00082c6ac000
x23: ffff000834f0a480 x22: ffff000834e87b9c
x21: 0000000000000000 x20: ffff000834e87800
x19: ffff000069eddc00 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000
x15: 0000000000000000 x14: 0000000000000000
x13: 0000000000000000 x12: 0000000000000001
x11: ffff80001180fbe8 x10: 0000000000000001
x9 : ffff800012101558 x8 : 0000000000000001
x7 : 0000000000000006 x6 : ffff000835d9c668
x5 : ffff000834f0a4c8 x4 : 0000000096000000
x3 : 0000000000001810 x2 : 0000000000000000
x1 : ffff800024bd001c x0 : 0000000000000001
Call trace:
 cdns3_gadget_ep_dequeue+0x1d4/0x270
 usb_ep_dequeue+0x34/0xf8
 composite_dev_cleanup+0x154/0x170
 configfs_composite_unbind+0x6c/0xa8
 usb_gadget_remove_driver+0x44/0x70
 usb_gadget_unregister_driver+0x74/0xe0
 unregister_gadget+0x28/0x58
 gadget_dev_desc_UDC_store+0x80/0x110
 configfs_write_file+0x1e0/0x2a0
 __vfs_write+0x48/0x90
 vfs_write+0xe4/0x1c8
 ksys_write+0x78/0x100
 __arm64_sys_write+0x24/0x30
 el0_svc_common.constprop.0+0x74/0x168
 el0_svc_handler+0x34/0xa0
 el0_svc+0x8/0xc
Code: 52830203 b9407660 f94042e4 11000400 (b9400841)
---[ end trace 1574516e4c1772ca ]---
Kernel panic - not syncing: Fatal exception
SMP: stopping secondary CPUs
Kernel Offset: disabled
CPU features: 0x0002,20002008
Memory Limit: none
Rebooting in 5 seconds..

Fixes: f616c3bda4 ("usb: cdns3: Fix dequeue implementation")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2020-05-11 07:14:37 +08:00
Peter Chen 064543d565
MLK-23913-2 usb: cdns3: gadget: assign interrupt number to gadget structure
Assign interrupt number to USB gadget structure.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2020-05-11 07:14:37 +08:00
Peter Chen cc523480d5
MLK-23913-1 usb: gadget: core: sync interrupt before unbind the udc
The threaded interrupt handler may still be called after the
usb_gadget_disconnect is called, it causes the structures used
at interrupt handler was freed before it uses, eg the
usb_request. This issue usually occurs we remove the udc function
during the transfer. Below is the example when doing stress
test for android switch function, the EP0's request is freed
by .unbind (configfs_composite_unbind -> composite_dev_cleanup),
but the threaded handler accesses this request during handling
setup packet request.

In fact, there is no protection between unbind the udc
and udc interrupt handling, so we have to avoid the interrupt
handler is occurred or scheduled during the .unbind flow.

init: Sending signal 9 to service 'adbd' (pid 18077) process group...
android_work: did not send uevent (0 0 000000007bec2039)
libprocessgroup: Successfully killed process cgroup uid 0 pid 18077 in 6ms
init: Service 'adbd' (pid 18077) received signal 9
init: Sending signal 9 to service 'adbd' (pid 18077) process group...
libprocessgroup: Successfully killed process cgroup uid 0 pid 18077 in 0ms
init: processing action (init.svc.adbd=stopped) from (/init.usb.configfs.rc:14)
init: Received control message 'start' for 'adbd' from pid: 399 (/vendor/bin/hw/android.hardware.usb@1.

init: starting service 'adbd'...
read descriptors
read strings
Unable to handle kernel read from unreadable memory at virtual address 000000000000002a
android_work: sent uevent USB_STATE=CONNECTED
Mem abort info:
  ESR = 0x96000004
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
Data abort info:
  ISV = 0, ISS = 0x00000004
  CM = 0, WnR = 0
user pgtable: 4k pages, 48-bit VAs, pgdp=00000000e97f1000
using random self ethernet address
[000000000000002a] pgd=0000000000000000
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 232 Comm: irq/68-5b110000 Not tainted 5.4.24-06075-g94a6b52b5815 #92
Hardware name: Freescale i.MX8QXP MEK (DT)
pstate: 00400085 (nzcv daIf +PAN -UAO)
using random host ethernet address
pc : composite_setup+0x5c/0x1730
lr : android_setup+0xc0/0x148
sp : ffff80001349bba0
x29: ffff80001349bba0 x28: ffff00083a50da00
x27: ffff8000124e6000 x26: ffff800010177950
x25: 0000000000000040 x24: ffff000834e18010
x23: 0000000000000000 x22: 0000000000000000
x21: ffff00083a50da00 x20: ffff00082e75ec40
x19: 0000000000000000 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000
x15: 0000000000000000 x14: 0000000000000000
x13: 0000000000000000 x12: 0000000000000001
x11: ffff80001180fb58 x10: 0000000000000040
x9 : ffff8000120fc980 x8 : 0000000000000000
x7 : ffff00083f98df50 x6 : 0000000000000100
x5 : 00000307e8978431 x4 : ffff800011386788
x3 : 0000000000000000 x2 : ffff800012342000
x1 : 0000000000000000 x0 : ffff800010c6d3a0
Call trace:
 composite_setup+0x5c/0x1730
 android_setup+0xc0/0x148
 cdns3_ep0_delegate_req+0x64/0x90
 cdns3_check_ep0_interrupt_proceed+0x384/0x738
 cdns3_device_thread_irq_handler+0x124/0x6e0
 cdns3_thread_irq+0x94/0xa0
 irq_thread_fn+0x30/0xa0
 irq_thread+0x150/0x248
 kthread+0xfc/0x128
 ret_from_fork+0x10/0x18
Code: 910e8000 f9400693 12001ed7 79400f79 (3940aa61)
---[ end trace c685db37f8773fba ]---
Kernel panic - not syncing: Fatal exception
SMP: stopping secondary CPUs
Kernel Offset: disabled
CPU features: 0x0002,20002008
Memory Limit: none
Rebooting in 5 seconds..

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2020-05-11 07:14:30 +08:00
Viorel Suman e8bc5163ce ASoC: fsl_xcvr: use SAI PLL for SPDIF playback
Use SAI PLL for SPDIF playback in order to allow
full duplex mode.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-10 22:12:29 +03:00
Viorel Suman 8618fe69cc arm64: dtsi: imx8mp: add SAI PLL bus clock
IMX8MP_CLK_AUDIOMIX_AUDPLL_ROOT gate controls
SAI PLL bus clock - it must be enabled if SAI PLL
programming is required.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-10 22:11:25 +03:00
Viorel Suman c9d58f88c8 clk: imx: clk-audiomix: Add SAI PLL frequencies
Add SAI PLL frequencies.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2020-05-10 22:11:20 +03:00
Anson Huang 02c7cf674c MLK-23908 mailbox: imx: ONLY IPC MU needs IRQF_NO_SUSPEND flag
IPC MU has no power domain assigned and there could be IPC
during noirq suspend phase, so IRQF_NO_SUSPEND flag is needed
for IPC MU. However, for other MUs, they have power domain
assigned and their power will be turned off during noirq suspend
phase, but their interrupts are NOT disabled even after their
power turned off, it will cause system crash when mailbox driver
trys to handle pending interrupts but the MU power is accidently
turned off.

So, IRQF_NO_SUSPEND flag should ONLY be added to IPC MU which
has power domain managed by SCU, then all other MUs' pending
interrupts after noirq suspend phase will be handled after
system resume.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2020-05-09 21:18:51 +08:00
Peng Fan 3199791727 MLK-23960-4 arm64: imx_v8_defconfig: select i2c backend driver
Select i2c backend driver, so i2c pv driver could work.

Acked-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-05-09 18:31:20 +08:00
Peng Fan 3e6c470550 MLK-23960-3 arm64: dts: imx8qm-dom0: fix passthrough node
We need passthrough sdhc0_lpcg and enlarge irqsteer_lvds0
to simplify dom0 dts and make domu could access the address space

Acked-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-05-09 18:31:19 +08:00
Peng Fan bf7843fbbb MLK-23960-2 xen: swtiotlb: fix free coherent
To ARM64, the alloc/free path is not aligned. So the free path
is not correct currently. It was designed for X86.

This patch is not a mature fix, just a temp workaround to avoid
ARM64 dom0 panic.

Acked-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-05-09 18:31:19 +08:00
Peng Fan d7c076fd29 MLK-23960-1 clk: imx: scu: not attach pd for UART_0 in xen dom0
Since linux itself create clk scu devices which is not available
to xen, xen not able to disable this device.

However UART_0 device has been occupied by xen.

So avoid runtime pd disable this power domain, ignore it for xen dom0.

Otherwise system will hang.

Acked-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-05-09 18:31:19 +08:00