Commit Graph

1234686 Commits

Author SHA1 Message Date
Xu Yang
9437748c78 LF-15173-1 dt-bindings: phy: imx8mq-usb: fix fsl,phy-tx-vboost-level-microvolt property
The ticket TKT0676370 shows the description of TX_VBOOST_LVL is wrong
in register PHY_CTRL3 bit[31:29].

  011: Corresponds to a launch amplitude of 1.12 V.
  010: Corresponds to a launch amplitude of 1.04 V.
  000: Corresponds to a launch amplitude of 0.88 V.

After updated:

  011: Corresponds to a launch amplitude of 0.844 V.
  100: Corresponds to a launch amplitude of 1.008 V.
  101: Corresponds to a launch amplitude of 1.156 V.

This will correct it accordingly.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-30 16:29:39 +08:00
Xu Yang
af7c47e578 dt-bindings: phy: imx8mq-usb: add compatible "fsl,imx95-usb-phy"
The usb phy in i.MX95 is compatible with i.MX8MP's, this will add a
compatible "fsl,imx95-usb-phy" for i.MX95. Also change reg maxItems
to 2 since i.MX95 needs another regmap to control Type-C Assist (TCA)
block. Since i.MX95 usb phy is able to switch SS lanes, this will also
add orientation-switch and port property to the file.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Link: https://lore.kernel.org/r/20240911061720.495606-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-30 16:29:38 +08:00
Ming Qian
3b53d8b471 LF-15180: media: imx-jpeg: Account for data_offset when getting image address
Applications may set data_offset when it refers to an output queue. So
driver need to account for it when getting the start address of input
image in the plane.

Meanwhile data_offset is included in bytesused. So the data_offset
should be subtracted from the payload of input image.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-30 15:51:06 +08:00
Jiyu Yang
1e18a7646b LF-15186-3 dts: remove gpumix_blk_ctrl register
same as LF-11706 in lf-6.12.y, remove blk_ctrl register for gpu

Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
Reviewed-by: Xianzhong Li <xianzhong.li@nxp.com>
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-29 11:50:40 +08:00
Jiyu Yang
1045958fd4 LF-15186-2 gpu: remove IMX_GPU_BLK_CTRL
same as LF-11706 in lf-6.12.y, need use the latest SM dev branch

Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
Reviewed-by: Xianzhong Li <xianzhong.li@nxp.com>
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-29 11:50:40 +08:00
Jiyu Yang
55018aa9dd LF-15186-1 gpu: remove gpumix block ctrl
same as LF-11706 in lf-6.12.y, add directive for the gpumix reset control,
which has been moved into SM.

Change-Id: Ide9d01e34cd6b9061d177f70c6caacb785732f22
Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
Reviewed-by: Xianzhong Li <xianzhong.li@nxp.com>
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-29 11:50:40 +08:00
Liu Ying
1ab4f3d81e LF-15170 drm/imx: dpu95-crtc: Queue state event early for page flip
Page flip is done usually with DRM vblank event.  To ensure the page flip
case works efficiently, move queueing state event prior to waiting for
ExtDst SHDLD done instead of the other way around so that DRM vblank event
can be handled in vblank IRQ handler as soon as possible because this
enables DisEngCFG frame complete IRQ(vblank IRQ) early enough.  Note that
DisEngCFG frame complete IRQ comes after ExtDst SHDLD IRQ comes about a
time duration of an entire vblank, so timing is critical if the vblank time
duration is short.  A problematic case caused by missing the critical
timing is that low page flip frame rate is seen on i.MX95 B0 EVK with
RM692C9 MIPI DSI panel.

Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-25 17:05:09 +08:00
Liu Ying
53f47a4cc1 LF-15139 drm/imx: dpu95: Add VScaler support for i.MX95 B0 SoC
Now that VScaler4 issue in i.MX95 A0/A1 SoC is fixed in i.MX95 B0 SoC, use
soc_device_match() to figure out the i.MX95 SoC revision and enable VScaler4
support only for B0.  Only add scaling support for VScaler4 in KMS because
it's not clear how to support de-interlacing.  While at it, initialize
VScaler9 as a blit engine component in the DPU95 core driver.

Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-25 15:03:52 +08:00
Liu Ying
f9e55df6e0 LF-15176 drm/imx: dpu95-plane: Add scaling filter property
Add scaling filter property for plane so that users may choose to use
DRM_SCALING_FILTER_DEFAULT or DRM_SCALING_FILTER_NEAREST_NEIGHBOR
filters.  By default, use DRM_SCALING_FILTER_DEFAULT(linear) filter.

Suggested-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-25 15:03:52 +08:00
Wei Fang
2bf7775093 LF-14991 arm64: dts: imx95-19x19: Add SMMU support for NETC
Add SMMU support for NETC of i.MX95 B0.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-25 10:43:04 +08:00
Clark Wang
a618e4b6cb LF-15009 arm64: dts: imx95: update the DTS files for TJA1103 RMII mode
Update the settings in imx95-19x19-evk-tja1103-rmii.dts to support it
only on i.MX95 B0 chip.
 - enetc0 can be enabled at the same time
 - ENETREF will always use 250MHz
 - only need one ref clock pad

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-25 10:43:03 +08:00
Xu Yang
8ae0b84079 usb: dwc3: imx8mp: add snps,tx-max-burst property to limit tx maxburst on i.MX95 A1
When USB3.0 host controller send data to OUT endpoint of USB device,
the data may be corrupted on USB bus if the controller send more than
4 1024 byte packets in one data burst transfer. This can be workaround
by changing the max burst size for tx transfer. According to the testing,
set max burst size to 4 can work fine for both U-disk and USB SSD devices.
This patch will also set snps,tx-thr-num-pkt to 1, although this property
doesn't have impact on the performance, but it's needed to make
snps,tx-max-burst take effect.

To limit tx maxburst on i.MX95 A1, this will call soc_device_match() to
match A1 chip.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-24 16:30:33 +08:00
Xu Yang
c5e8139354 LF-15002 Revert "LF-11008 arm64: dts: imx95: add snps,tx-max-burst property to workaround USB3.0 host controller EP OUT issue"
This reverts commit 010d4e215d.

Since i.MX95 B0 has fixed this IP issue. So remove this workaround now.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-24 16:30:32 +08:00
Jiyu Yang
ea1ccc106e MGS-8182 arm64: dts: update the gpu clkid
use GPU_CGC(174) to manage the GPU clock source since i.MX95 B0

Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 18:11:16 +08:00
Zhou Peng
55c1e61714 LF-14286-2: mxc: vpu: wave6: remove the second parameter in __assign_str()
fix potential compiler issue on many platforms:
error: macro "__assign_str" passed 2 arguments, but takes just 1

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:26:58 +08:00
Zhou Peng
a792be88ba MA-23263: mxc: vpu: wave6: Allow 2x2 cropping size for the encoder.
enhance crop feature with 2x2 alignment

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:26:44 +08:00
Zhou Peng
8e8c10515d LF-14462: mxc: vpu: wave6: Add 'identical size ranges' feature for vpu encoder
Increase W6_MAX_ENC_PIC_HEIGHT from 2304 to 4096

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:26:34 +08:00
Ming Qian
b33d9ef0f0 MA-23237-2: mxc: vpu: wave6: Support decoding size up to 4096x4096
The wave6 decoder support identical size ranges horizontally as
vertically.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Ming Zhou <ming.zhou@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:26:23 +08:00
Ming Qian
d60f271ccc MA-23268-3: mxc: vpu: wave6: Handle colorspace change
When colorspace change, but size is not changed, firmware still trigger
a source chagne event.

1. Implement decoder start cmd.
2. Report V4L2_EVENT_SRC_CH_COLORSPACE if only colorspace change
3. Don't do buffer allocation again if only colorspace change
4. Use macro to magic number 32

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:26:12 +08:00
Ming Qian
36922ae53f MA-23268-2: media: docs: dev-decoder: Trigger dynamic source change for colorspace
If colorspace changes, the client needs to renegotiate the pipeline,
otherwise the decoded frame may not be displayed correctly.

When a colorspace change in the stream, the decoder sends a
V4L2_EVENT_SOURCE_CHANGE event with changes set to
V4L2_EVENT_SRC_CH_COLORSPACE. After client receive this source change
event, then client can switch to the correct stream setting. And each
frame can be displayed properly.

So add colorspace as a trigger parameter for dynamic resolution change.

Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:26:02 +08:00
Ming Qian
7b2fbfc9f4 MA-23268-1: media: v4l: dev-decoder: Add source change V4L2_EVENT_SRC_CH_COLORSPACE
Add a new source change V4L2_EVENT_SRC_CH_COLORSPACE that
indicates colorspace change in the stream.
The change V4L2_EVENT_SRC_CH_RESOLUTION will always affect
the allocation, but V4L2_EVENT_SRC_CH_COLORSPACE won't.

Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:25:34 +08:00
Ming Qian
e88de905f5 CARPL-471: mxc: vpu: wave6: Guarantee vpu power state in requiring work
In requiring work, driver need to access register, if it's scheduled too
late, and the instance has been destroyed due to timeout, then it will
led to kernel panic.

====== V4L2DEC: 1.24.0 build on Jul 24 2024 02:25:45. ======
[video] on_pad_added: Found v4l2h264dec element
[  170.658267] SError Interrupt on CPU0, code 0x00000000be000011 – SError
[  170.658279] CPU: 0 PID: 110 Comm: irq/204-vpu_irq Not tainted 6.6.36-lts-next-g5348b0336fb3-dirty #1
[  170.658284] Hardware name: NXP i.MX95 19X19 board (DT)
[  170.658287] pstate: 60400009 (nZCv daif +PAN UAO -TCO -DIT -SSBS BTYPE=-)
[  170.658292] pc : wave6_vpu_ctrl_require_buffer+0x5c/0x150
[  170.658308] lr : wave6_vpu_ctrl_require_buffer+0x118/0x150
[  170.658313] sp : ffff80008398bd20
[  170.658314] x29: ffff80008398bd30 x28: 0000000000000000 x27: 0000000000000000
[  170.658323] x26: ffff8000800f5758 x25: ffff8000800f31c4 x24: 0000000000000000
[  170.658329] x23: ffff800083363010 x22: ffff000081217e80 x21: ffff800083363000
[  170.658334] x20: ffff000081268c80 x19: ffff000081268e10 x18: 0000000000000001
[  170.658340] x17: ffff0003fdfffb10 x16: 0000000000000100 x15: 0000000000000000
[  170.658345] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000352f2f
[  170.658350] x11: 0000000000181000 x10: ffff80009fe01000 x9 : 0000000000000000
[  170.658356] x8 : ffff80008984d000 x7 : 0000000000000000 x6 : 000000000000003f
[  170.658361] x5 : 0000000000000040 x4 : 0000000000000000 x3 : ffff80008106bcf8
[  170.658366] x2 : 0000000000000000 x1 : ffff800084b305f4 x0 : ffff800084b30000
[  170.658374] Kernel panic - not syncing: Asynchronous SError Interrupt
[  170.658376] CPU: 0 PID: 110 Comm: irq/204-vpu_irq Not tainted 6.6.36-lts-next-g5348b0336fb3-dirty #1
[  170.658380] Hardware name: NXP i.MX95 19X19 board (DT)
[  170.658383] Call trace:
[  170.658385]  dump_backtrace+0x90/0xe8
[  170.658395]  show_stack+0x18/0x24
[  170.658400]  dump_stack_lvl+0x48/0x60
[  170.658408]  dump_stack+0x18/0x24
[  170.658413]  panic+0x324/0x380
[  170.658419]  nmi_panic+0x8c/0x90
[  170.658423]  arm64_serror_panic+0x6c/0x78
[  170.658427]  arm64_is_fatal_ras_serror+0x3c/0xac
[  170.658432]  do_serror+0x5c/0x70
[  170.658435]  el1h_64_error_handler+0x30/0x48
[  170.658441]  el1h_64_error+0x64/0x68
[  170.658445]  wave6_vpu_ctrl_require_buffer+0x5c/0x150
[  170.658450]  wave6_vpu_irq_thread+0x68/0x114
[  170.658454]  irq_thread_fn+0x2c/0xa8
[  170.658460]  irq_thread+0x160/0x248
[  170.658466]  kthread+0x110/0x114
[  170.658471]  ret_from_fork+0x10/0x20
[  170.658477] SMP: stopping secondary CPUs
[  170.658486] Kernel Offset: disabled
[  170.658487] CPU features: 0x0,c0000000,40028143,1000721b
[  170.658491] Memory Limit: none
[  170.873278] {}{}[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]{}{}

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:25:22 +08:00
Ming Qian
31699a5f0b CARPL-467-2: mxc: vpu: wave6: Preallocate some work buffer
Firmware may require work buffer in handling create_instance,
that dma_alloc_coherent with GFP_KERNEL may spend too much
time, that may led to CREATE_INSTANCE timeout, then fail the
pipeline.

So just preallocate some work buffers, to reduce the probability of
timeout

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:25:11 +08:00
Ming Qian
ec0d4d6468 CARPL-467-1: mxc: vpu: wave6: Add delay in read_poll_timeout
Make delay interval in read_poll_timeout, take the initiative to
yield the scheduling.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:24:59 +08:00
Ming Qian
25da9355ba LF-14286: mxc: vpu: wave6: update to driver v1.3.11
update wave6 v4l2 driver to v1.3.11,
and fix the following issues:

1. NXPSEU-377: solve encoder rc issue
2. reduce the required sram size from 96K to 82K

and retain the following changes:

1. fix compile errors
2. LF-11686-9: mxc: vpu: wave6: report the firmware git sha code
3. LF-10942-1: mxc: vpu: wave6: add a debugfs to get the firmware log
4. LF-10942-2: mxc: vpu: wave6: support to reload firmware
5. LF-13605: sync bounce buffer
6. LF-13681: arm64: virtio video: adjust 6.12 version
7. increase some error log levels

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-22 17:24:43 +08:00
Peng Fan
6aaa52e448 LF-15094 clocksource: timer-imx-sysctr: Restrict the quirk for i.MX95 A0/A1.
Because soc device is not ready when sysctr probes, so directly use
smccc to get soc version. For i.MX95 B0, no need to quirk to workaround
the system counter issue.

Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-21 10:17:33 +08:00
Peng Fan
1e4af140c0 LF-15093 imx95: Set iommus for SDHC
Add iommus property for SDHC

Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-21 10:17:32 +08:00
Yanan Yang
8835cd9bec LF-14924 thermal: imx91: change the register DATA0 read value type
Read the temperature returns "Resource temporarily unavailable" when
it's below 0 degree. Because the register DATA0 is a 16-bit signed value,
but the origin code converted directly unsigned 32-bit into a signed
32-bit value.

This patch adds a new 16-bit signed variable and uses readw to replace
readl.

Signed-off-by: Yanan Yang <yanan.yang@nxp.com>
Signed-off-by: Joy Zou <joy.zou@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-09 17:24:36 +08:00
Joy Zou
316c686548 LF-14753 thermal: imx91: change continuous mode into periodic one-shot mode
The continuous mode has been deleted form imx91 RM, so change
the driver use mode.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-04-09 17:24:35 +08:00
Florin Leotescu
86aad7676d LF-14922 net: enetc: Fix null pointer accces in fsl-netc-prb-ierb driver probe
Fix NULL pointer access occurring when the 'netc-interfaces' property
is missing or not properly defined in DTS. The parsing function,
netc_prb_parse_if, expects to find "netc-interfaces" property
definition to allocate memory for pi->ifmode array.

Signed-off-by: Florin Leotescu <florin.leotescu@nxp.com>
Reviewed-by: Wei Fang <wei.fang@nxp.com>
2025-03-26 17:14:17 +02:00
Michael Glembotzki
d8f7322db0 nvmem: imx-ocotp-fsb-s400: BUG: Fix the word count
Only a block size of 4 bytes is supported, so divide the offset by 4 to obtain
the correct word count, as is done in other drivers such as: imx-ocotp.c

How to reproduce the bug?
e.g. try to write first word of the MAC_ADDR1 on imx93
FUSE_DEV=/sys/bus/nvmem/devices/fsb_s400_fuse0/nvmem
OFFSET_MAC=315
dd if=<binfile> of=$FUSE_DEV bs=4 count=1 seek=$OFFSET_MAC conv=notrunc

fsl-se-fw se-fw2: Command Id[214], Status=0x29, Indicator=0xA7
ELE_WRONG_SIZE_FAILURE_IND:0xA7, because the fuse being programmed
is not in the SoC fuse map.

Signed-off-by: Michael Glembotzki <Michael.Glembotzki@iris-sensing.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-03-20 13:23:54 +08:00
Richard Zhu
d67b11a271 LF-13936 PCI: imx6: Correct PME_TURN_OFF kick off method on i.MX95
The previouse PME_TURN_OFF kick off method on i.MX95 is wrong.
The PME_TURN_OFF_REQ (BIT19 of PE0_TX_MSG_REQ) should be toggled to
issue PME_TURN_OFF message on i.MX95.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
Tested-by: Sherry Sun <sherry.sun@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-03-03 10:27:04 +08:00
Haibo Chen
6cfe169543 LF-14048 gpio: pca953x: do not enable regmap cache when there is no regulator
Regmap cache mechanism is enabled in default. Thus, IO expander wouldn't
handle GPIO set really before resuming back.

But there are cases need to toggle gpio in NO_IRQ stage.
e.g. To align with PCIe specification, PERST# signal connected on the IO
expander must be toggled during PCIe RC's NO_IRQ_RESUME.

Do not enable the regmap cache when IO expander doesn't have the regulator
during system PM. That means the power of IO expander would be kept on,
and the GPIOs of the IO expander can be toggled really during system PM.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Tested-by: Sherry Sun <sherry.sun@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-03-03 10:27:03 +08:00
Joy Zou
6f6bc10c9c LF-14498: arm64: dts: imx91: Correct ENET1_TD3 and I2C2_SCL pad macro name
Correct typo for pad macro name of ENET1_TD3 and I2C2_SCL.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-02-18 15:24:37 +08:00
Vladimir Oltean
e0f9e2afd4 staging: fsl_qbman: don't dereference portal affine to CPU when it's redirected
When using a cmdline such as "bportals=s0 qportals=s0", Linux is given a
single QMan and a single BMan portal which is shared among all CPUs, and
accessed with locking.

This is only supported for the staging SDK QBMan driver and not for the
upstream variant.

In a strange twist of events, qman_create_affine_slave() also sets
affine_portals[] for CPUs which use the portal affine to a different CPU
(aka "slaves" here), and just have portal->sharing_redirect set to that
other portal.

But that panics the kernel hard, because these dummy portals, not
having been created by qman_create_portal(), have uninitialized struct
qm_portal :: addr, eqcr, dqrr, etc, but also portal->config. So any time
these are dereferenced, the kernel panics.

There are actually 2 code paths which are in this situation:

qman_enable_irqs()
-> qm_isr_status_clear()
   -> __qm_isr_write()
      -> __qm_out(&portal->addr, ...) // portal->addr uninitialized

qm_shutdown_fq()
-> qm_get_portal_for_channel()
   -> qman_p_get_portal_config()
      -> &p->config->public_cfg // p->config uninitialized

Both functions were actually copied over from the upstream QBMan driver
(for the purpose of kexec support), which does not support portal
sharing and thus the problem does not exist there.

Actually, we need to take into consideration in these code paths only
those affine portals created by qman_create_affine_portal(), and not the
fake ones with sharing_redirect. The qman_create_affine_portal() sets
the CPU in the &affine_mask retrievable through qman_affine_cpus().

This is also the way in which dpaa_eth_add_channel() from
drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c avoids the
fake channels, when dereferencing the affine_cpus[] array through the
qman_get_affine_portal() API method.

Fixes: a218c908c8 ("staging: fsl_qbman: account for pre-initialized BARs in case of kexec")
Fixes: 78ff3aa0713b ("staging: fsl_qbman: use correct portal for static dequeues in qm_shutdown_fq()")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
2024-11-20 01:01:49 +02:00
Jiwei.Fu
2abe654c77 AIR-12331: neutron: Merge dtcm and dtcm-ring buffer together
neutron requires more memory to support large size firmware, merge
dtcm and dtcm-ring buffer for larger contiguous memory.

Signed-off-by: Jiwei.Fu <jiwei.fu@nxp.com>
Reviewed-by: Forrest Shi <xuelin.shi@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-19 16:15:29 +08:00
Jiwei.Fu
91817fe5b6 AIR-11882: neutron: Enable neutron memory cache to improve npu benchmark performance
To improve performance, we have implemented zero-copy optimization for
neutron NPU, and third-party inference engines such as tflite can use
neutron memory directly, thus avoiding to perform memcpy between neutron
ddr memory and application context as follows:
- Avoid copying input data from application to neutron memory.
- Avoid copying output data from neutron memory back to the application.

This patch enables the memory cache and let the driver maintain the
memory and cache coherency.The main changes are:
- Flush the input buffer cache for device before starting inference.
- Invalidate the output buffer cache for cpu after inference is complete.
- Flush other constant data for device via IOCTL in preparation.

Signed-off-by: Jiwei.Fu <jiwei.fu@nxp.com>
Reviewed-by: Forrest Shi <xuelin.shi@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-19 16:15:19 +08:00
Laurentiu Palcu
da02bb4fef LF-13923 media: nxp: imx8-isi: better handle the m2m usage_count
Currently, if streamon/streamoff calls are imbalanced we can either end up
with a negative ISI m2m usage_count (if streamoff() is called more times
than streamon()) in which case we'll not be able to restart the ISI pipe
next time, or the usage_count never gets to 0 and the pipe is never
switched off.

To avoid that, add a 'streaming' flag to mxc_isi_m2m_ctx_queue_data and use it
in the streamon/streamoff to avoid incrementing/decrementing the usage_count
uselessly, if called multiple times from the same context.

Fixes: cf21f328fc ("media: nxp: Add i.MX8 ISI driver")
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Tested-by: Guoniu Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-18 20:24:05 +08:00
Laurentiu Palcu
d0fd392ad3 LF-13267 media: nxp: imx8-isi: fix v4l2-compliance test errors
Running the v4l2-compliance (1.27.0-5208, SHA: af114250d48d) on the m2m
device fails on the MMAP streaming tests, with the following messages:

fail: v4l2-test-buffers.cpp(240): g_field() == V4L2_FIELD_ANY
fail: v4l2-test-buffers.cpp(1508): buf.qbuf(node)

Apparently, the driver does not properly set the field member of
vb2_v4l2_buffer struct, returning the default V4L2_FIELD_ANY value which
is against the guidelines.

Fixes: cf21f328fc ("media: nxp: Add i.MX8 ISI driver")
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Guoniu Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-18 20:23:21 +08:00
Chancel Liu
0c14168d8d LF-13795: ASoC: fsl_xcvr: Move rate constraint function to probe()
It may cause confict between constraint variable read and write if
there is more than one stream running. Move rate constraint function to
probe() can avoid it.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-15 15:25:11 +08:00
Laurentiu Palcu
91d5fa5dda LF-13725 media/i2c: ox03c10: initialize custom control values
Currently, interrogating the controls, before they're set for the first
time, will return all-zero values. To fix this, use the init() callback
in the v4l2_ctrl_type_ops structure to populate the initial control
values.

Also, when running the sensor initialization sequence, make sure we
don't cache the settings for the embedded data because they do not
contain register values. They contain ranges. Otherwise we'll end up
with wrong register values in the regmap cache.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Tested-by: Celine Laurencin <celine.laurencin@nxp.com>
Reviewed-by: Celine Laurencin <celine.laurencin@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-13 17:23:47 +08:00
Laurentiu Palcu
102df048cb LF-13840 media/i2c: ox03c10: change embedded data registers
Currently, the registers returned in the embedded data contain RW
registers for gains and exposure. That affects the way the registers are
updated which does not follow the specifications. Using the RO registers
fixes the problem. Also, move the embedded data initialization sequence
to the end and add a comment to be easier to find it out in the future.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Mirela Rabulea <Mirela.rabulea@nxp.com>
Tested-by: Celine Laurencin <celine.laurencin@nxp.com>
Reviewed-by: Celine Laurencin <celine.laurencin@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-13 17:23:45 +08:00
Laurentiu Mihalcea
014e2f7f99 LF-13863: ASoC: sof: imx95: request/release mbox channels during suspend/resume
The imx95 driver requests the necessary mailbox channels during imx-dsp's
probe operation. If WAKEUP domain is shut down during system suspend, MU7A
(used by Linux side) will end up losing its register state. This means that
GI's will end up being masked when the system is resumed (since GIER is set
to 0x0, which means all GI's are masked). As such, SOF will assert the GIP
bits required for triggering an interrupt on Linux side but no interrupt
will be triggered since GI's are masked, thus resulting on a crash on
Linux side as it will assume that the firmware did not boot.

This was reproduced using the following steps:
	1) Put Linux into suspend-to-RAM state by running:
		echo 'mem' > /sys/power/state
	2) Put SM into idle mode by running:
		idle
	3) Resume the system by running:
		wakeupsource

What seems to happen is that if all CPUs are either in STOP/SLEEP
state and SM is put into idle state it will attempt to system suspend,
during which WAKEUP domain is powered off, thus leading to the
aforementioned register state loss. If SM is not put into idle state,
then WAKEUP domain is not powered off, thus if step 2) is left out then
everything will work as expected.

To fix this, make sure the mailbox channels are requested during resume()
and released during suspend(). This way, by requesting the mailbox
channels during resume() we make sure to unmask the GI's used in firmware
communcation.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-12 19:02:40 +08:00
Rahul Kumar Yadav
aa31dd8e0b LF-13853: firmware: imx: se-fw: fix uninitialized err variable
Initialized the err variable to fix the coverity issue,
"Uninitialized scalar variable"

Signed-off-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-11 14:20:22 +01:00
Liu Ying
d4c4988333 LF-12723 mxc IPUv3: device: Set ipu_task_thread affinity properly
The ipu_task_thread thread ran by kthread_run() could be excuted
before kthread_run() returns especially when 'nosmp' or 'maxcpus=1'
kernel bootup parameters are used.  So, in this case, the thread[0]
or thread[1] entries in struct ipu_soc are not yet set before
ipu_task_thread() references them to set thread affinity, hence a
NULL pointer de-referencing issue happens.  Fix this by referencing
*current* task in ipu_task_thread() instead of the uninitialized
thread[0] or thread[1] entries.

This fixes an old bug introduced by the below commit in linux-imx:
commit 0d36f8226d22 ("ENGR00175724-2 IPU: change ipu_device thread
process mode to interrupt mode.")

Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-11 14:12:41 +08:00
Han Xu
d2bee818ea LF-13849: arm64: lsdk.config: Add the ifc_nand to lsdk config
The following community commit make FSL_IFC config selectable, but the
side effect is disabling the built-in FSL_IFC_NAND drive, add the related
configs back to the lsdk config file to enable this driver by default.

Fixes: c22649e217 ("memory: fsl_ifc: Make FSL_IFC config visible and selectable")

Signed-off-by: Han Xu <han.xu@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-09 08:05:38 +08:00
Chancel Liu
7df20a47c0 LF-13805: ASoC: fsl_micfil: Constrain the volume range
RM has incorrect recommended volume range settings. There's big noise
with high volume values. Constrain the adjustable volume range to 0~7
as a software workaround.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-08 15:25:28 +08:00
Alice Yuan
2ad65bfb0b LF-12531: imx: pi: fix capture image bottom edge green line
When i.MX91 platform use MT9M114 sonsor, the capture image bottom edge
will meet green line for 100%. It caused by the vsync signals of parallel
csi and sensor, they are opposite, so the vsync output to pixel link
need to be inverted.

Signed-off-by: Alice Yuan <alice.yuan@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-06 17:00:15 +08:00
Shengjiu Wang
e3bde0053a LF-13778-6: arm64: dts: imx91: Use IMX91_CLK_SPDIF_IPG as spdif IPG clock
IMX91_CLK_BUS_WAKEUP is not accurate IPG clock,
IMX91_CLK_SPDIF_IPG is the correct clock.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-05 17:10:43 +08:00
Shengjiu Wang
f157e6f165 LF-13778-5: arm64: dts: imx93: Use IMX93_CLK_SPDIF_IPG as spdif IPG clock
IMX93_CLK_BUS_WAKEUP is not accurate IPG clock,
IMX93_CLK_SPDIF_IPG is the correct clock.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2024-11-05 17:10:42 +08:00