mbox series

[v9,00/13] CSI2RX support on J721E and AM62

Message ID 20230811-upstream_csi-v9-0-8943f7a68a81@ti.com
Headers show
Series CSI2RX support on J721E and AM62 | expand

Message

Jai Luthra Aug. 11, 2023, 10:47 a.m. UTC
From: Pratyush Yadav <p.yadav@ti.com>

Hi,

This series adds support for CSI2 capture on J721E. It includes some
fixes to the Cadence CSI2RX driver, and adds the TI CSI2RX wrapper driver.

This is the v9 of the below v8 series,
https://lore.kernel.org/r/20230731-upstream_csi-v8-0-fb7d3661c2c9@ti.com

Testing logs: https://gist.github.com/jailuthra/eaeb3af3c65b67e1bc0d5db28180131d

J721E CSI2RX driver can also be extended to support multi-stream
capture, filtering different CSI Virtual Channels (VC) or Data Types
(DT) to different DMA channels. A WIP series based on v7 is available
for reference at https://github.com/jailuthra/linux/commits/csi_multi_wip

I will rebase the multi-stream patches on the current series (v9) and
post them as RFC in the coming weeks.

Signed-off-by: Jai Luthra <j-luthra@ti.com>
---

Changelog from v8
=================

Range-diff: https://0x0.st/H_xh.diff

Dropped the following patches:
[v8 01/16] media: subdev: Export get_format helper for link validation
	- Using subdev's get_fmt directly instead
[v8 04/16] media: cadence: Add support for TI SoCs
	- Don't add a compatible if we are not using it in the driver
[v8 14/16] media: cadence: csi2rx: Support RAW8 and RAW10 formats
	- Squashed into a previous patch [v8 07/16]

For [05/13] media: cadence: csi2rx: Add get_fmt and set_fmt pad ops:
- Squash the patch adding RAW8 and RAW10 formats within this one
- Single line struct entries in formats[] array
- Skip specifiying redundant format.which entry in init_cfg()

For [06/13] media: cadence: csi2rx: Configure DPHY using link freq:
- Don't specify stream while calling .get_fmt()

For [07/13] media: cadence: csi2rx: Soft reset the streams before starting capture:
- Simplify reset sequence, minimizing delays

For [08/13] media: cadence: csi2rx: Set the STOP bit when stopping a stream:
- Better log message to avoid confusion between cadence streams and v4l2
  streams

For [13/13] media: ti: Add CSI2RX support for J721E:
- Allocate drain buffer at start of stream instead of doing it in the
  middle, and document why it is needed in comments
- Call subdev's get_fmt directly for link_validation()
- Cleanup height/width clamping and rounding code, document it in comments
- Return and check errors from setup_shim()
- s/subdev/source for cadence csi2rx's v4l2_subdev
- s/ti_csi2rx_init_subdev/ti_csi2rx_notifier_register
- Change copyright year/author list

---
Jai Luthra (1):
      media: dt-bindings: cadence-csi2rx: Add TI compatible string

Pratyush Yadav (12):
      media: dt-bindings: Make sure items in data-lanes are unique
      media: cadence: csi2rx: Unregister v4l2 async notifier
      media: cadence: csi2rx: Cleanup media entity properly
      media: cadence: csi2rx: Add get_fmt and set_fmt pad ops
      media: cadence: csi2rx: Configure DPHY using link freq
      media: cadence: csi2rx: Soft reset the streams before starting capture
      media: cadence: csi2rx: Set the STOP bit when stopping a stream
      media: cadence: csi2rx: Fix stream data configuration
      media: cadence: csi2rx: Populate subdev devnode
      media: cadence: csi2rx: Add link validation
      media: dt-bindings: Add TI J721E CSI2RX
      media: ti: Add CSI2RX support for J721E

 .../devicetree/bindings/media/cdns,csi2rx.yaml     |    1 +
 .../bindings/media/ti,j721e-csi2rx-shim.yaml       |  100 ++
 .../bindings/media/video-interfaces.yaml           |    1 +
 MAINTAINERS                                        |    7 +
 drivers/media/platform/cadence/cdns-csi2rx.c       |  181 ++-
 drivers/media/platform/ti/Kconfig                  |   12 +
 drivers/media/platform/ti/Makefile                 |    1 +
 drivers/media/platform/ti/j721e-csi2rx/Makefile    |    2 +
 .../media/platform/ti/j721e-csi2rx/j721e-csi2rx.c  | 1150 ++++++++++++++++++++
 9 files changed, 1448 insertions(+), 7 deletions(-)
---
base-commit: 21ef7b1e17d039053edaeaf41142423810572741
change-id: 20230727-upstream_csi-acbeabe038d8

Best regards,

Comments

Rob Herring (Arm) Aug. 11, 2023, 2:54 p.m. UTC | #1
On Fri, Aug 11, 2023 at 08:00:55AM -0600, Rob Herring wrote:
> 
> On Fri, 11 Aug 2023 16:17:34 +0530, Jai Luthra wrote:
> > From: Pratyush Yadav <p.yadav@ti.com>
> > 
> > TI's J721E uses the Cadence CSI2RX and DPHY peripherals to facilitate
> > capture over a CSI-2 bus. The TI CSI2RX platform driver glues all the
> > parts together.
> > 
> > Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > Signed-off-by: Jai Luthra <j-luthra@ti.com>
> > ---
> > NOTE:
> > 
> > This patch depends on
> > 9536cc949235 ("media: dt-bindings: cadence-csi2rx: Convert to DT schema")
> > which is part of linux-next.
> > 
> >  .../bindings/media/ti,j721e-csi2rx-shim.yaml       | 100 +++++++++++++++++++++
> >  1 file changed, 100 insertions(+)
> > 
> 
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
> 
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/ti,j721e-csi2rx-shim.yaml:
> Error in referenced schema matching $id: http://devicetree.org/schemas/media/cdns,csi2rx.yaml
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/ti,j721e-csi2rx-shim.example.dtb: ticsi2rx@4500000: csi-bridge@4504000: False schema does not allow {'compatible': ['ti,j721e-csi2rx', 'cdns,csi2rx'], 'reg': [[72368128, 4096]], 'clocks': [[4294967295, 26, 2], [4294967295, 26, 0], [4294967295, 26, 2], [4294967295, 26, 2], [4294967295, 26, 3], [4294967295, 26, 3]], 'clock-names': ['sys_clk', 'p_clk', 'pixel_if0_clk', 'pixel_if1_clk', 'pixel_if2_clk', 'pixel_if3_clk'], 'phys': [[4294967295]], 'phy-names': ['dphy'], 'ports': {'#address-cells': [[1]], '#size-cells': [[0]], 'port@0': {'reg': [[0]], 'endpoint': {'remote-endpoint': [[4294967295]], 'bus-type': [[4]], 'clock-lanes': [[0]], 'data-lanes': [[1, 2]]}}}}
> 	from schema $id: http://devicetree.org/schemas/media/ti,j721e-csi2rx-shim.yaml#
> Documentation/devicetree/bindings/media/ti,j721e-csi2rx-shim.example.dtb: /example-0/ticsi2rx@4500000/csi-bridge@4504000: failed to match any schema with compatible: ['ti,j721e-csi2rx', 'cdns,csi2rx']
> Documentation/devicetree/bindings/media/ti,j721e-csi2rx-shim.example.dtb: /example-0/ticsi2rx@4500000/csi-bridge@4504000: failed to match any schema with compatible: ['ti,j721e-csi2rx', 'cdns,csi2rx']

As noted, this can be ignored.

Rob
Julien Massot Aug. 24, 2023, 3:18 p.m. UTC | #2
Hi Jai,

On 8/11/23 12:47, Jai Luthra wrote:
> From: Pratyush Yadav <p.yadav@ti.com>
> 
> Hi,
> 
> This series adds support for CSI2 capture on J721E. It includes some
> fixes to the Cadence CSI2RX driver, and adds the TI CSI2RX wrapper driver.
> 
> This is the v9 of the below v8 series,
> https://lore.kernel.org/r/20230731-upstream_csi-v8-0-fb7d3661c2c9@ti.com
> 
> Testing logs: https://gist.github.com/jailuthra/eaeb3af3c65b67e1bc0d5db28180131d
> 
> J721E CSI2RX driver can also be extended to support multi-stream
> capture, filtering different CSI Virtual Channels (VC) or Data Types
> (DT) to different DMA channels. A WIP series based on v7 is available
> for reference at https://github.com/jailuthra/linux/commits/csi_multi_wip
> 
> I will rebase the multi-stream patches on the current series (v9) and
> post them as RFC in the coming weeks.
> 
> Signed-off-by: Jai Luthra <j-luthra@ti.com>
> ---

Thanks for your patches, I can confirm that the previous issue 
(repeating frames) that I saw on the v7 version is gone.

Tested-by: Julien Massot <julien.massot@collabora.com>

Regards,
Julien