Commit Graph

1234650 Commits

Author SHA1 Message Date
Pankaj Gupta
2c2034c656 LF-13910-4: drivers: firmware: imx: se debug dump log file
Debugging feature to enable time synchronised logging of:
- the Message exchange over MU with FW.
- IOCTL(s)
- any user articulated debug messages.

The logs are saved to a file in the linux filesystem.

Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Acked-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Acked-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-05-28 10:38:55 +08:00
Pankaj Gupta
ad497d1c5b LF-13910-3: firmware: imx: additional changes to the upstream driver.
additional changes to the upstream driver.
- construct se_name from se_type_id and instance id
- move soc_register to info_list
- move fetch soc info function pointer to info_list
- ele soc fetch generalization
- ele debug dump

Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Acked-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Acked-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-05-28 10:38:49 +08:00
Pankaj Gupta
9dfd27b6b2 LF-13910-2: firmware: imx: add miscdev
Add the driver for communication interface to secure-enclave,
for exchanging messages with NXP secure enclave HW IP(s) like
EdgeLock Enclave from:
- User-Space Applications via character driver.

ABI documentation for the NXP secure-enclave driver.

User-space library using this driver:
- i.MX Secure Enclave library:
  -- URL: https://github.com/nxp-imx/imx-secure-enclave.git,
- i.MX Secure Middle-Ware:
  -- URL: https://github.com/nxp-imx/imx-smw.git

Squash: <8e91220ab110> ("drivers: fw: imx: increased wait-timeout value")
Squash: <a0c004d35ef4> ("firmware:imx: Fix cleanup of SE driver")
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Acked-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Acked-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-05-28 10:38:41 +08:00
Pankaj Gupta
a21e6e64e3 LF-13910-1: firmware: imx: add driver for NXP EdgeLock Enclave
NXP hardware IP(s) for secure-enclaves like Edgelock Enclave(ELE),
are embedded in the SoC to support the features like HSM, SHE & V2X,
using message based communication interface.

The secure enclave FW communicates on a dedicated messaging unit(MU)
based interface(s) with application core, where kernel is running.
It exists on specific i.MX processors. e.g. i.MX8ULP, i.MX93.

This patch adds the driver for communication interface to secure-enclave,
for exchanging messages with NXP secure enclave HW IP(s) like EdgeLock
Enclave (ELE) from Kernel-space, used by kernel management layers like
- DM-Crypt.

squash e7d2fac2d1ceb TBS: LF-14067: drivers: firmware: imx: se suspend-resume
squash c4c9b2f7cf710 TBS: drivers: firmware: imx: correct macro ELE_DEBUG_DUMP_RSP_SZ value

Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Acked-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Acked-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-05-28 10:38:08 +08:00
Pankaj Gupta
bdeff7cd56 LF-13910: remove base driver for secure-enclave
remove base driver for secure-enclave

Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-05-28 10:37:55 +08:00
Jason Liu
ab72b4936f Revert "LF-14286-2: mxc: vpu: wave6: remove the second parameter in __assign_str()"
This reverts commit 55c1e61714.

This commit breaks the build and no need for 6.6 kernel

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
2025-05-20 11:01:15 +08:00
Alice Guo
f7e7a3f151 LF-15138-2 nvmem: imx-ocotp-fsb-s400: fix the bug caused by not getting the se-fw2 device
When not getting the se-fw2 device, calling read_common_fuse() or
ele_write_fuse() will result in segmentation fault because fuse->se_dev
is a NULL pointer. Check fuse->se_dev to avoid this error.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-05-12 11:27:06 +08:00
Alice Guo
41adc16f98 LF-15138-1 nvmem: imx95: update imx-ocotp-fsb-s400.c for i.MX95
This update is according to i.MX95_Fusemap_v1.13_documentation.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
2025-05-12 11:27:05 +08:00
Liu Ying
d6b4952355 LF-15259 drm/imx: dpu95: Fix maximum FrameGen display clock frequency
Design team says that the frequency limitation mentioned at controller
specification is just a general guideline for the IP. The maximum frequency
depends on the process technology and SoC architecture requirement of the
SoC.  Specifically for i.MX95, the frequency of dspx_clk is signed off at
350MHz at UD/NM/OD mode.  So 350MHz is the limit of the chip, not 300MHz.

So, change maximum FrameGen display clock frequency from 300MHz to 350MHz.

Reported-by: Qiang Li <qiang.li@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-05-08 17:35:10 +08:00
Xu Yang
3132641783 LF-14995-3 arm64: dts: imx95: add some USB3 PHY tuning properties
Add some USB3 PHY tuning properties for imx95-15x15-evk and
imx95-19x19-evk boards.

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-30 16:29:40 +08:00
Xu Yang
48a046dcbf LF-15173-3 arm64: dts: imx8mp: fix USB3 PHY tuning parameters
Fix USB3 PHY tuning properties name and parameters value.

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-30 16:29:40 +08:00
Xu Yang
382c67812e LF-14995-2 phy: fsl-imx8mq-usb: add i.MX95 tuning support
The i.MX8MP and i.MX95 USB3 PHY have different tuning parameter for same
tuning field, this will add i.MX95 tuning support.

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-30 16:29:39 +08:00
Xu Yang
118c0dcb76 LF-15173-2 phy: fsl-imx8mq-usb: fix phy_tx_vboost_level_from_property()
The description of TX_VBOOST_LVL is wrong in register PHY_CTRL3
bit[31:29].

The updated description as below:
  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 fix the parsing function
phy_tx_vboost_level_from_property() to return correct value.

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-30 16:29:39 +08:00
Xu Yang
ac2107351a LF-14995-1 dt-bindings: phy: imx8mq-usb: add imx95 tuning support
The parameter value of below 3 properties are USB PHY specific. i.MX8MP
and i.MX95 USB PHY has different meanings. This will enlarge parameters
value and add constraints for them.

 - fsl,phy-tx-vref-tune-percent
 - fsl,phy-tx-rise-tune-percent
 - fsl,phy-comp-dis-tune-percent

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-30 16:29:39 +08:00
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