Skip to contentSkip to conversation

media: staging/imx7: add i.MX7 media driver

PATCH Superseded Rui Miguel Silva 7 participants 28 messages Apr 23, 2018 – May 7, 2018

Subsystems (8)

v2 of 14 Superseded Latest is v14 →

lore
Share & tools
lore
#0 lore raw

v2 cover media: staging/imx7: add i.MX7 media driver

Hi,
This series introduces the Media driver to work with the i.MX7 SoC. it uses the already existing imx media core drivers but since the i.MX7, contrary to i.MX5/6, do not have an IPU and because of that some changes in the imx media core are made along this series to make it support that case.

This patches adds CSI and MIPI-CSI2 drivers for i.MX7, along with several configurations changes for this to work as a capture subsystem. Some bugs are also fixed along the line. And necessary documentation.

For a more detailed view of the capture paths, pads links in the i.MX7 please take a look at the documentation in PATCH 14.

The system used to test and develop this was the Warp7 board with an OV2680 sensor, which output format is 10-bit bayer. So, only MIPI interface was tested, a scenario with an parallel input would nice to have.

*Important note*, this code depends on Steve Longerbeam series [0]:
[PATCH v3 00/13] media: imx: Switch to subdev notifiers
which the merging status is not clear to me, but the changes in there make senses to this series

Bellow goes an example of the output of the pads and links and the output of v4l2-compliance testing.

The v4l-utils version used is:
v4l2-compliance SHA : 47d43b130dc6e9e0edc900759fb37649208371e4 from Apr 4th.

The Media Driver fail some tests but this failures are coming from code out of scope of this series (video-mux, imx-capture), and some from the sensor OV2680 but that I think not related with the sensor driver but with the testing and core.

The csi and mipi-csi entities pass all compliance tests.

Cheers,
Rui
[0]: https://www.mail-archive.com/[email protected]/msg128015.html

v1->v2:
Dan Carpenter:
- fix return paths and codes;
- fix clk_frequency validation and return code;
- handle the csi remove (release resources that was missing)
- revert the logic arround the ipu_present flag

Philipp Zabel:
- drop patch that changed the rgb formats and address the pixel/bus format in mipi_csis code.

MySelf:
- add patch that add ov2680 node to the warp7 dts, so the all data path is complete.
- add linux-clk mailing list to the clock patches cc:

media-ctl -p
Media controller API version 4.17.0

Media device information
------------------------
driver imx-media
model imx-media
serial
bus info
hw revision 0x0
driver version 4.17.0

Device topology
- entity 1: csi (2 pads, 2 links)

            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        pad0: Sink
                [fmt:SBGGR10_1X10/800x600 field:none]
                <- "csi_mux":2 [ENABLED]
        pad1: Source
                [fmt:SBGGR10_1X10/800x600 field:none]
                -> "csi capture":0 [ENABLED]

- entity 4: csi capture (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "csi":1 [ENABLED]

- entity 10: csi_mux (3 pads, 2 links)

             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev1
        pad0: Sink
                [fmt:unknown/0x0]
        pad1: Sink
                [fmt:SBGGR10_1X10/800x600 field:none]
                <- "imx7-mipi-csis.0":1 [ENABLED]
        pad2: Source
                [fmt:SBGGR10_1X10/800x600 field:none]
                -> "csi":0 [ENABLED]

- entity 14: imx7-mipi-csis.0 (2 pads, 2 links)

             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev2
        pad0: Sink
                [fmt:SBGGR10_1X10/800x600 field:none]
                <- "ov2680 1-0036":0 [ENABLED]
        pad1: Source
                [fmt:SBGGR10_1X10/800x600 field:none]
                -> "csi_mux":1 [ENABLED]

- entity 17: ov2680 1-0036 (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev3
pad0: Source
[fmt:SBGGR10_1X10/800x600 field:none] -> "imx7-mipi-csis.0":0 [ENABLED]

compliance tests:
v4l2-compliance SHA : 47d43b130dc6e9e0edc900759fb37649208371e4

Compliance test for device /dev/media0:

Media Driver Info:

        Driver name      : imx-media
        Model            : imx-media
        Serial           :
        Bus info         :
        Media version    : 4.17.0
        Hardware revision: 0x00000000 (0)
        Driver version   : 4.17.0

Required ioctls:
test MEDIA_IOC_DEVICE_INFO: OK

Allow for multiple opens:
test second /dev/media0 open: OK
test MEDIA_IOC_DEVICE_INFO: OK
test for unlimited opens: OK

Media Controller ioctls:

                Entity: 0x00000001 (Name: 'csi', Function: 0x00005002)
                Entity: 0x00000004 (Name: 'csi capture', Function: 0x00010001)
                Entity: 0x0000000a (Name: 'csi_mux', Function: 0x00005001)
                Entity: 0x0000000e (Name: 'imx7-mipi-csis.0', Function: 0x00005002)
                Entity: 0x00000011 (Name: 'ov2680 1-0036', Function: 0x00020001)
                Interface: 0x03000005 (Type: 0x00000200)
                Interface: 0x03000019 (Type: 0x00000203)
                Interface: 0x0300001b (Type: 0x00000203)
                Interface: 0x0300001d (Type: 0x00000203)
                Interface: 0x0300001f (Type: 0x00000203)
                Pad: 0x01000002
                Pad: 0x01000003
                Pad: 0x01000007
                Pad: 0x0100000b
                Pad: 0x0100000c
                Pad: 0x0100000d
                Pad: 0x0100000f
                Pad: 0x01000010
                Pad: 0x01000012
                Link: 0x02000006
                Link: 0x02000008
                Link: 0x02000013
                Link: 0x02000015
                Link: 0x02000017
                Link: 0x0200001a
                Link: 0x0200001c
                Link: 0x0200001e
                Link: 0x02000020
        test MEDIA_IOC_G_TOPOLOGY: OK
        Entities: 5 Interfaces: 5 Pads: 9 Links: 9
                Entity: 0x00000001 (Name: 'csi', Type: 0x00020000
                Entity: 0x00000004 (Name: 'csi capture', Type: 0x00010001
                Entity: 0x0000000a (Name: 'csi_mux', Type: 0x00020000
                Entity: 0x0000000e (Name: 'imx7-mipi-csis.0', Type: 0x00020000
                Entity: 0x00000011 (Name: 'ov2680 1-0036', Type: 0x00020001
                Entity Links: 0x00000001 (Name: 'csi')
                Entity Links: 0x00000004 (Name: 'csi capture')
                Entity Links: 0x0000000a (Name: 'csi_mux')
                Entity Links: 0x0000000e (Name: 'imx7-mipi-csis.0')
                Entity Links: 0x00000011 (Name: 'ov2680 1-0036')
        test MEDIA_IOC_ENUM_ENTITIES/LINKS: OK
        test MEDIA_IOC_SETUP_LINK: OK

--------------------------------------------------------------------------------

Compliance test for device /dev/video0:

Driver Info:

        Driver name      : imx-media-captu
        Card type        : imx-media-capture
        Bus info         : platform:csi
        Driver version   : 4.17.0
        Capabilities     : 0x84200001

Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:

        Driver name      : imx-media
        Model            : imx-media
        Serial           :
        Bus info         :
        Media version    : 4.17.0
        Hardware revision: 0x00000000 (0)
        Driver version   : 4.17.0

Interface Info:
ID : 0x03000005
Type : V4L Video
Entity Info:

        ID               : 0x00000004 (4)
        Name             : csi capture
        Function         : V4L2 I/O
        Pad 0x01000007   : Sink
          Link 0x02000008: from remote pad 0x1000003 of entity 'csi': Data, Enabled

Required ioctls:
test MC information (see 'Media Driver Info' above): OK test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
test second /dev/video0 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
fail: v4l2-test-input-output.cpp(420): G_INPUT not supported for a capture device
test VIDIOC_G/S/ENUMINPUT: FAIL
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)

Control ioctls:

                info: checking v4l2_queryctrl of control 'User Controls' (0x00980001)
                info: checking v4l2_queryctrl of control 'Exposure' (0x00980911)
                info: checking v4l2_queryctrl of control 'Gain, Automatic' (0x00980912)
                info: checking v4l2_queryctrl of control 'Gain' (0x00980913)
                info: checking v4l2_queryctrl of control 'Horizontal Flip' (0x00980914)
                info: checking v4l2_queryctrl of control 'Vertical Flip' (0x00980915)
                info: checking v4l2_queryctrl of control 'Camera Controls' (0x009a0001)
                info: checking v4l2_queryctrl of control 'Auto Exposure' (0x009a0901)
                info: checking v4l2_queryctrl of control 'Image Processing Controls' (0x009f0001)
                info: checking v4l2_queryctrl of control 'Test Pattern' (0x009f0903)
                info: checking v4l2_queryctrl of control 'Exposure' (0x00980911)
                info: checking v4l2_queryctrl of control 'Gain, Automatic' (0x00980912)
                info: checking v4l2_queryctrl of control 'Gain' (0x00980913)
                info: checking v4l2_queryctrl of control 'Horizontal Flip' (0x00980914)
                info: checking v4l2_queryctrl of control 'Vertical Flip' (0x00980915)
        test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
        test VIDIOC_QUERYCTRL: OK
                info: checking control 'User Controls' (0x00980001)
                info: checking control 'Exposure' (0x00980911)
                info: checking control 'Gain, Automatic' (0x00980912)
                info: checking control 'Gain' (0x00980913)
                info: checking control 'Horizontal Flip' (0x00980914)
                info: checking control 'Vertical Flip' (0x00980915)
                info: checking control 'Camera Controls' (0x009a0001)
                info: checking control 'Auto Exposure' (0x009a0901)
                info: checking control 'Image Processing Controls' (0x009f0001)
                info: checking control 'Test Pattern' (0x009f0903)
        test VIDIOC_G/S_CTRL: OK
                info: checking extended control 'User Controls' (0x00980001)
                info: checking extended control 'Exposure' (0x00980911)
                info: checking extended control 'Gain, Automatic' (0x00980912)
                info: checking extended control 'Gain' (0x00980913)
                info: checking extended control 'Horizontal Flip' (0x00980914)
                info: checking extended control 'Vertical Flip' (0x00980915)
                info: checking extended control 'Camera Controls' (0x009a0001)
                info: checking extended control 'Auto Exposure' (0x009a0901)
                info: checking extended control 'Image Processing Controls' (0x009f0001)
                info: checking extended control 'Test Pattern' (0x009f0903)
        test VIDIOC_G/S/TRY_EXT_CTRLS: OK
                info: checking control event 'User Controls' (0x00980001)
                fail: v4l2-test-controls.cpp(796): subscribe event for control 'User Controls' failed
        test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
        test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
        Standard Controls: 10 Private Controls: 0

Format ioctls:
info: found 1 formats for buftype 1
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK test VIDIOC_G/S_PARM: OK (Not Supported) test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK (Not Supported)

Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
info: test buftype Video Capture
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK

--------------------------------------------------------------------------------

Compliance test for device /dev/v4l-subdev0:

Media Driver Info:

        Driver name      : imx-media
        Model            : imx-media
        Serial           :
        Bus info         :
        Media version    : 4.17.0
        Hardware revision: 0x00000000 (0)
        Driver version   : 4.17.0

Interface Info:
ID : 0x03000019
Type : V4L Sub-Device
Entity Info:

        ID               : 0x00000001 (1)
        Name             : csi
        Function         : Video Interface Bridge
        Pad 0x01000002   : Sink
          Link 0x02000015: from remote pad 0x100000d of entity 'csi_mux': Data, Enabled
        Pad 0x01000003   : Source
          Link 0x02000008: to remote pad 0x1000007 of entity 'csi capture': Data, Enabled

Required ioctls:
test MC information (see 'Media Driver Info' above): OK

Allow for multiple opens:
test second /dev/v4l-subdev0 open: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)

Sub-Device ioctls (Sink Pad 0):
test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK test Try VIDIOC_SUBDEV_G/S_FMT: OK
test Try VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported) test Active VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK test Active VIDIOC_SUBDEV_G/S_FMT: OK
test Active VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported) test VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: OK (Not Supported)

Sub-Device ioctls (Source Pad 1):
test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK test Try VIDIOC_SUBDEV_G/S_FMT: OK
test Try VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported) test Active VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK test Active VIDIOC_SUBDEV_G/S_FMT: OK
test Active VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported) test VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: OK (Not Supported)

Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 0 Private Controls: 0

Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK (Not Supported) test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK (Not Supported)
test VIDIOC_TRY_FMT: OK (Not Supported)
test VIDIOC_S_FMT: OK (Not Supported)
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK (Not Supported)

Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK (Not Supported) test VIDIOC_EXPBUF: OK (Not Supported)

--------------------------------------------------------------------------------

Compliance test for device /dev/v4l-subdev1:

Media Driver Info:

        Driver name      : imx-media
        Model            : imx-media
        Serial           :
        Bus info         :
        Media version    : 4.17.0
        Hardware revision: 0x00000000 (0)
        Driver version   : 4.17.0

Interface Info:
ID : 0x0300001b
Type : V4L Sub-Device
Entity Info:

        ID               : 0x0000000a (10)
        Name             : csi_mux
        Function         : Video Muxer
        Pad 0x0100000b   : Sink
        Pad 0x0100000c   : Sink
          Link 0x02000013: from remote pad 0x1000010 of entity 'imx7-mipi-csis.0': Data, Enabled
        Pad 0x0100000d   : Source
          Link 0x02000015: to remote pad 0x1000002 of entity 'csi': Data, Enabled

Required ioctls:
test MC information (see 'Media Driver Info' above): OK

Allow for multiple opens:
test second /dev/v4l-subdev1 open: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)

Sub-Device ioctls (Sink Pad 0):
test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK (Not Supported)
fail: v4l2-test-subdevs.cpp(311): fmt.width == 0 || fmt.width == ~0U
fail: v4l2-test-subdevs.cpp(356): checkMBusFrameFmt(node, fmt.format)
test Try VIDIOC_SUBDEV_G/S_FMT: FAIL
test Try VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
test Active VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK (Not Supported)
fail: v4l2-test-subdevs.cpp(311): fmt.width == 0 || fmt.width == ~0U
fail: v4l2-test-subdevs.cpp(356): checkMBusFrameFmt(node, fmt.format)
test Active VIDIOC_SUBDEV_G/S_FMT: FAIL
test Active VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
test VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: OK (Not Supported)

Sub-Device ioctls (Sink Pad 1):
test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK (Not Supported)
fail: v4l2-test-subdevs.cpp(311): fmt.width == 0 || fmt.width == ~0U
fail: v4l2-test-subdevs.cpp(356): checkMBusFrameFmt(node, fmt.format)
test Try VIDIOC_SUBDEV_G/S_FMT: FAIL
test Try VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
test Active VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK (Not Supported)
fail: v4l2-test-subdevs.cpp(381): s_fmt.format.code == ~0U
test Active VIDIOC_SUBDEV_G/S_FMT: FAIL
test Active VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
test VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: OK (Not Supported)

Sub-Device ioctls (Source Pad 2):
test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK (Not Supported)
fail: v4l2-test-subdevs.cpp(311): fmt.width == 0 || fmt.width == ~0U
fail: v4l2-test-subdevs.cpp(356): checkMBusFrameFmt(node, fmt.format)
test Try VIDIOC_SUBDEV_G/S_FMT: FAIL
test Try VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
test Active VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK (Not Supported)
fail: v4l2-test-subdevs.cpp(313): fmt.code == 0 || fmt.code == ~0U
fail: v4l2-test-subdevs.cpp(369): checkMBusFrameFmt(node, s_fmt.format)
test Active VIDIOC_SUBDEV_G/S_FMT: FAIL
test Active VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
test VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: OK (Not Supported)

Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported) test VIDIOC_QUERYCTRL: OK (Not Supported)
test VIDIOC_G/S_CTRL: OK (Not Supported)
test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 0 Private Controls: 0

Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK (Not Supported) test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK (Not Supported)
test VIDIOC_TRY_FMT: OK (Not Supported)
test VIDIOC_S_FMT: OK (Not Supported)
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK (Not Supported)

Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK (Not Supported) test VIDIOC_EXPBUF: OK (Not Supported)

--------------------------------------------------------------------------------

Compliance test for device /dev/v4l-subdev2:

Media Driver Info:

        Driver name      : imx-media
        Model            : imx-media
        Serial           :
        Bus info         :
        Media version    : 4.17.0
        Hardware revision: 0x00000000 (0)
        Driver version   : 4.17.0

Interface Info:
ID : 0x0300001d
Type : V4L Sub-Device
Entity Info:

        ID               : 0x0000000e (14)
        Name             : imx7-mipi-csis.0
        Function         : Video Interface Bridge
        Pad 0x0100000f   : Sink
          Link 0x02000017: from remote pad 0x1000012 of entity 'ov2680 1-0036': Data, Enabled
        Pad 0x01000010   : Source
          Link 0x02000013: to remote pad 0x100000c of entity 'csi_mux': Data, Enabled

Required ioctls:
test MC information (see 'Media Driver Info' above): OK

Allow for multiple opens:
test second /dev/v4l-subdev2 open: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_LOG_STATUS: OK

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)

Sub-Device ioctls (Sink Pad 0):
test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK (Not Supported) test Try VIDIOC_SUBDEV_G/S_FMT: OK
test Try VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
test Active VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK (Not Supported) test Active VIDIOC_SUBDEV_G/S_FMT: OK
test Active VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
test VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: OK (Not Supported)

Sub-Device ioctls (Source Pad 1):
test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK (Not Supported) test Try VIDIOC_SUBDEV_G/S_FMT: OK
test Try VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
test Active VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK (Not Supported) test Active VIDIOC_SUBDEV_G/S_FMT: OK
test Active VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
test VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: OK (Not Supported)

Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported) test VIDIOC_QUERYCTRL: OK (Not Supported)
test VIDIOC_G/S_CTRL: OK (Not Supported)
test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 0 Private Controls: 0

Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK (Not Supported) test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK (Not Supported)
test VIDIOC_TRY_FMT: OK (Not Supported)
test VIDIOC_S_FMT: OK (Not Supported)
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK (Not Supported)

Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK (Not Supported) test VIDIOC_EXPBUF: OK (Not Supported)

--------------------------------------------------------------------------------

Compliance test for device /dev/v4l-subdev3:

Media Driver Info:

        Driver name      : imx-media
        Model            : imx-media
        Serial           :
        Bus info         :
        Media version    : 4.17.0
        Hardware revision: 0x00000000 (0)
        Driver version   : 4.17.0

Interface Info:
ID : 0x0300001f
Type : V4L Sub-Device
Entity Info:

        ID               : 0x00000011 (17)
        Name             : ov2680 1-0036
        Function         : Camera Sensor
        Pad 0x01000012   : Source
          Link 0x02000017: to remote pad 0x100000f of entity 'imx7-mipi-csis.0': Data, Enabled

Required ioctls:
test MC information (see 'Media Driver Info' above): OK

Allow for multiple opens:
test second /dev/v4l-subdev3 open: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)

Sub-Device ioctls (Source Pad 0):
fail: v4l2-test-subdevs.cpp(57): node->enum_frame_interval_pad >= 0
fail: v4l2-test-subdevs.cpp(183): ret && ret != ENOTTY
fail: v4l2-test-subdevs.cpp(248): ret && ret != ENOTTY
test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: FAIL test Try VIDIOC_SUBDEV_G/S_FMT: OK
test Try VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported) test Active VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK test Active VIDIOC_SUBDEV_G/S_FMT: OK
test Active VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported) test VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: OK

Control ioctls:

                info: checking v4l2_queryctrl of control 'User Controls' (0x00980001)
                info: checking v4l2_queryctrl of control 'Exposure' (0x00980911)
                info: checking v4l2_queryctrl of control 'Gain, Automatic' (0x00980912)
                info: checking v4l2_queryctrl of control 'Gain' (0x00980913)
                info: checking v4l2_queryctrl of control 'Horizontal Flip' (0x00980914)
                info: checking v4l2_queryctrl of control 'Vertical Flip' (0x00980915)
                info: checking v4l2_queryctrl of control 'Camera Controls' (0x009a0001)
                info: checking v4l2_queryctrl of control 'Auto Exposure' (0x009a0901)
                info: checking v4l2_queryctrl of control 'Image Processing Controls' (0x009f0001)
                info: checking v4l2_queryctrl of control 'Test Pattern' (0x009f0903)
                info: checking v4l2_queryctrl of control 'Exposure' (0x00980911)
                info: checking v4l2_queryctrl of control 'Gain, Automatic' (0x00980912)
                info: checking v4l2_queryctrl of control 'Gain' (0x00980913)
                info: checking v4l2_queryctrl of control 'Horizontal Flip' (0x00980914)
                info: checking v4l2_queryctrl of control 'Vertical Flip' (0x00980915)
        test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
        test VIDIOC_QUERYCTRL: OK
                info: checking control 'User Controls' (0x00980001)
                info: checking control 'Exposure' (0x00980911)
                info: checking control 'Gain, Automatic' (0x00980912)
                info: checking control 'Gain' (0x00980913)
                info: checking control 'Horizontal Flip' (0x00980914)
                info: checking control 'Vertical Flip' (0x00980915)
                info: checking control 'Camera Controls' (0x009a0001)
                info: checking control 'Auto Exposure' (0x009a0901)
                info: checking control 'Image Processing Controls' (0x009f0001)
                info: checking control 'Test Pattern' (0x009f0903)
        test VIDIOC_G/S_CTRL: OK
                info: checking extended control 'User Controls' (0x00980001)
                info: checking extended control 'Exposure' (0x00980911)
                info: checking extended control 'Gain, Automatic' (0x00980912)
                info: checking extended control 'Gain' (0x00980913)
                info: checking extended control 'Horizontal Flip' (0x00980914)
                info: checking extended control 'Vertical Flip' (0x00980915)
                info: checking extended control 'Camera Controls' (0x009a0001)
                info: checking extended control 'Auto Exposure' (0x009a0901)
                info: checking extended control 'Image Processing Controls' (0x009f0001)
                info: checking extended control 'Test Pattern' (0x009f0903)
        test VIDIOC_G/S/TRY_EXT_CTRLS: OK
                info: checking control event 'User Controls' (0x00980001)
                fail: v4l2-test-controls.cpp(796): subscribe event for control 'User Controls' failed
        test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
        test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
        Standard Controls: 10 Private Controls: 0

Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK (Not Supported) test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK (Not Supported)
test VIDIOC_TRY_FMT: OK (Not Supported)
test VIDIOC_S_FMT: OK (Not Supported)
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK (Not Supported)

Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK (Not Supported) test VIDIOC_EXPBUF: OK (Not Supported)

Total: 267, Succeeded: 257, Failed: 10, Warnings: 0

Rui Miguel Silva (15):
media: staging/imx: add support to media dev for no IPU systems
media: staging/imx7: add imx7 CSI subdev driver
clk: imx7d: fix mipi dphy div parent
clk: imx7d: reset parent for mipi csi root
media: staging/imx7: add MIPI CSI-2 receiver subdev for i.MX7
media: staging/imx: add imx7 capture subsystem
ARM: dts: increase default cma size to 40MB
media: dt-bindings: add bindings for i.MX7 media driver
ARM: dts: imx7s: add mipi phy power domain
ARM: dts: imx7s: add multiplexer controls
ARM: dts: imx7: Add video mux, csi and mipi_csi and connections
ARM: dts: imx7s: add capture subsystem
ARM: dts: imx7s-warp: add ov2680 sensor node
media: imx7.rst: add documentation for i.MX7 media driver
media: staging/imx: add i.MX7 entries to TODO file

 .../devicetree/bindings/media/imx7.txt        |  158 ++
 Documentation/media/v4l-drivers/imx7.rst      |  157 ++
 Documentation/media/v4l-drivers/index.rst     |    1 +
 arch/arm/boot/dts/imx7s-warp.dts              |   96 ++
 arch/arm/boot/dts/imx7s.dtsi                  |   61 +-
 drivers/clk/imx/clk-imx7d.c                   |    5 +-
 drivers/staging/media/imx/Kconfig             |    9 +-
 drivers/staging/media/imx/Makefile            |    3 +
 drivers/staging/media/imx/TODO                |    9 +
 drivers/staging/media/imx/imx-media-dev.c     |   22 +-
 .../staging/media/imx/imx-media-internal-sd.c |    3 +
 drivers/staging/media/imx/imx-media.h         |    3 +
 drivers/staging/media/imx/imx7-media-csi.c    | 1345 +++++++++++++++++
 drivers/staging/media/imx/imx7-mipi-csis.c    | 1149 ++++++++++++++
 14 files changed, 3013 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/imx7.txt
 create mode 100644 Documentation/media/v4l-drivers/imx7.rst
 create mode 100644 drivers/staging/media/imx/imx7-media-csi.c
 create mode 100644 drivers/staging/media/imx/imx7-mipi-csis.c
Signature · 1 line
2.17.0
#1 lore raw

PATCH v2 1/15 media: staging/imx: add support to media dev for no IPU systems

Some i.MX SoC do not have IPU, like the i.MX7, add to the the media device infrastructure support to be used in this type of systems that do not have internal subdevices besides the CSI.

---
 drivers/staging/media/imx/imx-media-dev.c      | 18 +++++++++++++-----
 .../staging/media/imx/imx-media-internal-sd.c  |  3 +++
 drivers/staging/media/imx/imx-media.h          |  3 +++
 3 files changed, 19 insertions(+), 5 deletions(-)
drivers/staging/media/imx/imx-media-dev.c +13 -5
index f67ec8e27093..c0f277adeebe 100644
@@ -92,6 +92,9 @@ static int imx_media_get_ipu(struct imx_media_dev *imxmd,
 	struct ipu_soc *ipu;
 	int ipu_id;
 
+	if (!imxmd->ipu_present)
+		return 0;
+
 	ipu = dev_get_drvdata(csi_sd->dev->parent);
 	if (!ipu) {
 		v4l2_err(&imxmd->v4l2_dev,
@@ -481,16 +484,21 @@ static int imx_media_probe(struct platform_device *pdev)
 		goto notifier_cleanup;
 	}
 
-	ret = imx_media_add_internal_subdevs(imxmd);
-	if (ret) {
-		v4l2_err(&imxmd->v4l2_dev,
-			 "add_internal_subdevs failed with %d\n", ret);
-		goto notifier_cleanup;
+	imxmd->ipu_present = true;
+
+	if (imxmd->ipu_present) {
+		ret = imx_media_add_internal_subdevs(imxmd);
+		if (ret) {
+			v4l2_err(&imxmd->v4l2_dev,
+				 "add_internal_subdevs failed with %d\n", ret);
+			goto notifier_cleanup;
+		}
 	}
 
 	/* no subdevs? just bail */
 	if (imxmd->notifier.num_subdevs == 0) {
 		ret = -ENODEV;
+		v4l2_err(&imxmd->v4l2_dev, "no subdevs\n");
 		goto notifier_cleanup;
 	}
 
drivers/staging/media/imx/imx-media-internal-sd.c +3 -0
index 0fdc45dbfb76..2bcdc232369a 100644
@@ -238,6 +238,9 @@ int imx_media_create_internal_links(struct imx_media_dev *imxmd,
 	struct media_pad *pad;
 	int i, j, ret;
 
+	if (!imxmd->ipu_present)
+		return 0;
+
 	intsd = find_intsd_by_grp_id(sd->grp_id);
 	if (!intsd)
 		return -ENODEV;
drivers/staging/media/imx/imx-media.h +3 -0
index 44532cd5b812..d40538ecf176 100644
@@ -147,6 +147,9 @@ struct imx_media_dev {
 
 	/* for async subdev registration */
 	struct v4l2_async_notifier notifier;
+
+	/* indicator to if the system has IPU */
+	bool ipu_present;
 };
 
 enum codespace_sel {
Signature · 1 line
2.17.0
#2 lore raw

PATCH v2 2/15 media: staging/imx7: add imx7 CSI subdev driver

In reply to Rui Miguel Silva

This add the media entity subdevice and control driver for the i.MX7 CMOS Sensor Interface.

---
 drivers/staging/media/imx/Kconfig          |    9 +-
 drivers/staging/media/imx/Makefile         |    2 +
 drivers/staging/media/imx/imx7-media-csi.c | 1345 ++++++++++++++++++++
 3 files changed, 1355 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/media/imx/imx7-media-csi.c
drivers/staging/media/imx/Kconfig +8 -1
index bfc17de56b17..40a11f988fc6 100644
@@ -11,7 +11,7 @@ config VIDEO_IMX_MEDIA
 	  driver for the i.MX5/6 SOC.
 
 if VIDEO_IMX_MEDIA
-menu "i.MX5/6 Media Sub devices"
+menu "i.MX5/6/7 Media Sub devices"
 
 config VIDEO_IMX_CSI
 	tristate "i.MX5/6 Camera Sensor Interface driver"
@@ -20,5 +20,12 @@ config VIDEO_IMX_CSI
 	---help---
 	  A video4linux camera sensor interface driver for i.MX5/6.
 
+config VIDEO_IMX7_CSI
+	tristate "i.MX7 Camera Sensor Interface driver"
+	depends on VIDEO_IMX_MEDIA && VIDEO_DEV && I2C
+	default y
+	---help---
+	  A video4linux camera sensor interface driver for i.MX7.
+
 endmenu
 endif
drivers/staging/media/imx/Makefile +2 -0
index 698a4210316e..771846717146 100644
@@ -11,3 +11,5 @@ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-ic.o
 
 obj-$(CONFIG_VIDEO_IMX_CSI) += imx-media-csi.o
 obj-$(CONFIG_VIDEO_IMX_CSI) += imx6-mipi-csi2.o
+
+obj-$(CONFIG_VIDEO_IMX7_CSI) += imx7-media-csi.o
drivers/staging/media/imx/imx7-media-csi.c new file +1345 -0

1,345 lines not on this page · raw message

Signature · 1 line
2.17.0
#3 lore raw

PATCH v2 3/15 clk: imx7d: fix mipi dphy div parent

In reply to Rui Miguel Silva

Fix the mipi dphy root divider to mipi_dphy_pre_div, this would remove a orphan clock and set the correct parent.

before:
cat clk_orphan_summary
enable prepare protect
clock count count count rate accuracy phase
----------------------------------------------------------------------------------------

 mipi_dphy_post_div                   1        1        0           0          0 0
    mipi_dphy_root_clk                1        1        0           0          0 0

cat clk_dump | grep mipi_dphy

mipi_dphy_post_div                    1        1        0           0          0 0
    mipi_dphy_root_clk                1        1        0           0          0 0

after:
cat clk_dump | grep mipi_dphy

   mipi_dphy_src                     1        1        0    24000000          0 0
       mipi_dphy_cg                  1        1        0    24000000          0 0
          mipi_dphy_pre_div          1        1        0    24000000          0 0
             mipi_dphy_post_div      1        1        0    24000000          0 0
                mipi_dphy_root_clk   1        1        0    24000000          0 0
---
 drivers/clk/imx/clk-imx7d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx7d.c +1 -1
index 975a20d3cc94..f7f4db2e6fa6 100644
@@ -729,7 +729,7 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
 	clks[IMX7D_LCDIF_PIXEL_ROOT_DIV] = imx_clk_divider2("lcdif_pixel_post_div", "lcdif_pixel_pre_div", base + 0xa300, 0, 6);
 	clks[IMX7D_MIPI_DSI_ROOT_DIV] = imx_clk_divider2("mipi_dsi_post_div", "mipi_dsi_pre_div", base + 0xa380, 0, 6);
 	clks[IMX7D_MIPI_CSI_ROOT_DIV] = imx_clk_divider2("mipi_csi_post_div", "mipi_csi_pre_div", base + 0xa400, 0, 6);
-	clks[IMX7D_MIPI_DPHY_ROOT_DIV] = imx_clk_divider2("mipi_dphy_post_div", "mipi_csi_dphy_div", base + 0xa480, 0, 6);
+	clks[IMX7D_MIPI_DPHY_ROOT_DIV] = imx_clk_divider2("mipi_dphy_post_div", "mipi_dphy_pre_div", base + 0xa480, 0, 6);
 	clks[IMX7D_SAI1_ROOT_DIV] = imx_clk_divider2("sai1_post_div", "sai1_pre_div", base + 0xa500, 0, 6);
 	clks[IMX7D_SAI2_ROOT_DIV] = imx_clk_divider2("sai2_post_div", "sai2_pre_div", base + 0xa580, 0, 6);
 	clks[IMX7D_SAI3_ROOT_DIV] = imx_clk_divider2("sai3_post_div", "sai3_pre_div", base + 0xa600, 0, 6);
Signature · 1 line
2.17.0
maintainer
#4 lore raw

Re: [PATCH v2 03/15] clk: imx7d: fix mipi dphy div parent

Quoting Rui Miguel Silva (2018-04-23 06:47:38)

Quoted 23 lines

Fix the mipi dphy root divider to mipi_dphy_pre_div, this would remove a orphan clock and set the correct parent.

before:
cat clk_orphan_summary
enable prepare protect
clock count count count rate accuracy phase
----------------------------------------------------------------------------------------

 mipi_dphy_post_div                   1        1        0           0          0 0
    mipi_dphy_root_clk                1        1        0           0          0 0

cat clk_dump | grep mipi_dphy

mipi_dphy_post_div                    1        1        0           0          0 0
    mipi_dphy_root_clk                1        1        0           0          0 0

after:
cat clk_dump | grep mipi_dphy

   mipi_dphy_src                     1        1        0    24000000          0 0
       mipi_dphy_cg                  1        1        0    24000000          0 0
          mipi_dphy_pre_div          1        1        0    24000000          0 0
             mipi_dphy_post_div      1        1        0    24000000          0 0
                mipi_dphy_root_clk   1        1        0    24000000          0 0
Quoted 4 lines

You have double signed-off-by here. Please resend.

Also, add a "Fixes:" tag so we know where to backport this to.

#5 lore raw

Re: [PATCH v2 03/15] clk: imx7d: fix mipi dphy div parent

In reply to Rui Miguel Silva

Anson,

Please have a look at this change.

Shawn

Quoted 47 lines · Rui Miguel Silva

Fix the mipi dphy root divider to mipi_dphy_pre_div, this would remove a orphan clock and set the correct parent.

before:
cat clk_orphan_summary
enable prepare protect
clock count count count rate accuracy phase
----------------------------------------------------------------------------------------

 mipi_dphy_post_div                   1        1        0           0          0 0
    mipi_dphy_root_clk                1        1        0           0          0 0

cat clk_dump | grep mipi_dphy

mipi_dphy_post_div                    1        1        0           0          0 0
    mipi_dphy_root_clk                1        1        0           0          0 0

after:
cat clk_dump | grep mipi_dphy

   mipi_dphy_src                     1        1        0    24000000          0 0
       mipi_dphy_cg                  1        1        0    24000000          0 0
          mipi_dphy_pre_div          1        1        0    24000000          0 0
             mipi_dphy_post_div      1        1        0    24000000          0 0
                mipi_dphy_root_clk   1        1        0    24000000          0 0
---
 drivers/clk/imx/clk-imx7d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx7d.c +1 -1
index 975a20d3cc94..f7f4db2e6fa6 100644
@@ -729,7 +729,7 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
 	clks[IMX7D_LCDIF_PIXEL_ROOT_DIV] = imx_clk_divider2("lcdif_pixel_post_div", "lcdif_pixel_pre_div", base + 0xa300, 0, 6);
 	clks[IMX7D_MIPI_DSI_ROOT_DIV] = imx_clk_divider2("mipi_dsi_post_div", "mipi_dsi_pre_div", base + 0xa380, 0, 6);
 	clks[IMX7D_MIPI_CSI_ROOT_DIV] = imx_clk_divider2("mipi_csi_post_div", "mipi_csi_pre_div", base + 0xa400, 0, 6);
-	clks[IMX7D_MIPI_DPHY_ROOT_DIV] = imx_clk_divider2("mipi_dphy_post_div", "mipi_csi_dphy_div", base + 0xa480, 0, 6);
+	clks[IMX7D_MIPI_DPHY_ROOT_DIV] = imx_clk_divider2("mipi_dphy_post_div", "mipi_dphy_pre_div", base + 0xa480, 0, 6);
 	clks[IMX7D_SAI1_ROOT_DIV] = imx_clk_divider2("sai1_post_div", "sai1_pre_div", base + 0xa500, 0, 6);
 	clks[IMX7D_SAI2_ROOT_DIV] = imx_clk_divider2("sai2_post_div", "sai2_pre_div", base + 0xa580, 0, 6);
 	clks[IMX7D_SAI3_ROOT_DIV] = imx_clk_divider2("sai3_post_div", "sai3_pre_div", base + 0xa600, 0, 6);
Signature · 1 line
2.17.0
Acked-by
#6 lore raw

RE: [PATCH v2 03/15] clk: imx7d: fix mipi dphy div parent

Quoted 14 lines

-----Original Message-----
From: Shawn Guo [mailto:[email protected]]
Sent: Thursday, May 3, 2018 9:08 AM
To: Rui Miguel Silva <[email protected]>; Anson Huang <[email protected]>
Cc: [email protected]; [email protected]; Steve Longerbeam <[email protected]>; Philipp Zabel <[email protected]>; Rob Herring <[email protected]>; [email protected]; [email protected]; Fabio Estevam <[email protected]>; [email protected]; Greg Kroah-Hartman <[email protected]>; Ryan Harkin <[email protected]>; [email protected]; dl-linux-imx <[email protected]>
Subject: Re: [PATCH v2 03/15] clk: imx7d: fix mipi dphy div parent

Quoted 34 lines

Anson,

Please have a look at this change.

Shawn

Quoted 27 lines · Rui Miguel Silva

Fix the mipi dphy root divider to mipi_dphy_pre_div, this would remove a orphan clock and set the correct parent.

before:
cat clk_orphan_summary
enable prepare protect
clock count count count rate accuracy phase
----------------------------------------------------------------------------------------

 mipi_dphy_post_div                   1        1        0           0          0 0
    mipi_dphy_root_clk                1        1        0           0          0 0

cat clk_dump | grep mipi_dphy

mipi_dphy_post_div                    1        1        0           0          0 0
    mipi_dphy_root_clk                1        1        0           0          0 0

after:
cat clk_dump | grep mipi_dphy

   mipi_dphy_src                     1        1        0    24000000          0 0
       mipi_dphy_cg                  1        1        0    24000000          0 0
          mipi_dphy_pre_div          1        1        0    24000000          0 0
             mipi_dphy_post_div      1        1        0    24000000          0 0
                mipi_dphy_root_clk   1        1        0    24000000          0 0

Two sign-off?

Otherwise, the patch looks ok to me.

Regards
Dong Aisheng

Quoted 34 lines

drivers/clk/imx/clk-imx7d.c static void __init imx7d_clocks_init(struct

Quoted 9 lines
---
 drivers/clk/imx/clk-imx7d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx7d.c +0 -0
index 975a20d3cc94..f7f4db2e6fa6 100644
@@ -729,7 +729,7 @@ static void __init imx7d_clocks_init(struct

device_node *ccm_node)

drivers/clk/imx/clk-imx7d.c static void __init imx7d_clocks_init(struct · line 729

Quoted 1 line
drivers/clk/imx/clk-imx7d.c +0 -0
 	clks[IMX7D_LCDIF_PIXEL_ROOT_DIV] =

imx_clk_divider2("lcdif_pixel_post_div", "lcdif_pixel_pre_div", base + 0xa300, 0, 6);

drivers/clk/imx/clk-imx7d.c static void __init imx7d_clocks_init(struct · line 730

Quoted 1 line
drivers/clk/imx/clk-imx7d.c +0 -0
 	clks[IMX7D_MIPI_DSI_ROOT_DIV] =

imx_clk_divider2("mipi_dsi_post_div", "mipi_dsi_pre_div", base + 0xa380, 0, 6);

drivers/clk/imx/clk-imx7d.c static void __init imx7d_clocks_init(struct · line 731

Quoted 1 line
drivers/clk/imx/clk-imx7d.c +0 -0
 	clks[IMX7D_MIPI_CSI_ROOT_DIV] =

imx_clk_divider2("mipi_csi_post_div", "mipi_csi_pre_div", base + 0xa400, 0, 6);

drivers/clk/imx/clk-imx7d.c static void __init imx7d_clocks_init(struct · line 732

Quoted 1 line
drivers/clk/imx/clk-imx7d.c +0 -1
-	clks[IMX7D_MIPI_DPHY_ROOT_DIV] =

imx_clk_divider2("mipi_dphy_post_div", "mipi_csi_dphy_div", base + 0xa480, 0, 6);

drivers/clk/imx/clk-imx7d.c static void __init imx7d_clocks_init(struct · line 735

Quoted 4 lines
drivers/clk/imx/clk-imx7d.c +3 -0
+	clks[IMX7D_MIPI_DPHY_ROOT_DIV] =
+imx_clk_divider2("mipi_dphy_post_div", "mipi_dphy_pre_div", base +
+0xa480, 0, 6);
 	clks[IMX7D_SAI1_ROOT_DIV] = imx_clk_divider2("sai1_post_div",

"sai1_pre_div", base + 0xa500, 0, 6);

Quoted 1 line

clks[IMX7D_SAI2_ROOT_DIV] = imx_clk_divider2("sai2_post_div",

"sai2_pre_div", base + 0xa580, 0, 6);

Quoted 5 lines

clks[IMX7D_SAI3_ROOT_DIV] = imx_clk_divider2("sai3_post_div",
"sai3_pre_div", base + 0xa600, 0, 6);
--
2.17.0

#7 lore raw

PATCH v2 4/15 clk: imx7d: reset parent for mipi csi root

In reply to Rui Miguel Silva

To guarantee that we do not get Overflow in image FIFO the outer bandwidth has to be faster than inputer bandwidth. For that it must be possible to set a faster frequency clock. So set new parent to sys_pfd3 clock for the mipi csi block.

---
 drivers/clk/imx/clk-imx7d.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/imx/clk-imx7d.c +3 -0
index f7f4db2e6fa6..9a1a18ceb132 100644
@@ -891,6 +891,9 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
 	clk_set_parent(clks[IMX7D_PLL_AUDIO_MAIN_BYPASS], clks[IMX7D_PLL_AUDIO_MAIN]);
 	clk_set_parent(clks[IMX7D_PLL_VIDEO_MAIN_BYPASS], clks[IMX7D_PLL_VIDEO_MAIN]);
 
+	clk_set_parent(clks[IMX7D_MIPI_CSI_ROOT_SRC],
+		       clks[IMX7D_PLL_SYS_PFD3_CLK]);
+
 	/* use old gpt clk setting, gpt1 root clk must be twice as gpt counter freq */
 	clk_set_parent(clks[IMX7D_GPT1_ROOT_SRC], clks[IMX7D_OSC_24M_CLK]);
 
Signature · 1 line
2.17.0
Acked-by on v2 4/15
#8 lore raw

Re: [PATCH v2 04/15] clk: imx7d: reset parent for mipi csi root

Quoted 16 lines · Rui Miguel Silva

To guarantee that we do not get Overflow in image FIFO the outer bandwidth has to be faster than inputer bandwidth. For that it must be possible to set a faster frequency clock. So set new parent to sys_pfd3 clock for the mipi csi block.

---
 drivers/clk/imx/clk-imx7d.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/imx/clk-imx7d.c +0 -0
index f7f4db2e6fa6..9a1a18ceb132 100644

drivers/clk/imx/clk-imx7d.c static void __init imx7d_clocks_init(struct device_node *ccm_node) · line 896

Quoted 6 lines
drivers/clk/imx/clk-imx7d.c +3 -0
@@ -891,6 +891,9 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
 	clk_set_parent(clks[IMX7D_PLL_AUDIO_MAIN_BYPASS], clks[IMX7D_PLL_AUDIO_MAIN]);
 	clk_set_parent(clks[IMX7D_PLL_VIDEO_MAIN_BYPASS], clks[IMX7D_PLL_VIDEO_MAIN]);
 
+	clk_set_parent(clks[IMX7D_MIPI_CSI_ROOT_SRC],
+		       clks[IMX7D_PLL_SYS_PFD3_CLK]);
+

For i.MX clock driver, we intentionally ignore line over 80 columns warning to make the file easier for read. So I would suggest you keep it on a single line to stay consistent with other clk_set_parent() calls.

Other than that,

Quoted 6 lines
drivers/clk/imx/clk-imx7d.c +0 -0
 	/* use old gpt clk setting, gpt1 root clk must be twice as gpt counter freq */
 	clk_set_parent(clks[IMX7D_GPT1_ROOT_SRC], clks[IMX7D_OSC_24M_CLK]);
 
Signature · 1 line
2.17.0
#9 lore raw

PATCH v2 5/15 media: staging/imx7: add MIPI CSI-2 receiver subdev for i.MX7

In reply to Rui Miguel Silva

Adds MIPI CSI-2 subdev for i.MX7 to connect with sensors with a MIPI CSI-2 interface.

---
 drivers/staging/media/imx/Makefile         |    1 +
 drivers/staging/media/imx/imx7-mipi-csis.c | 1149 ++++++++++++++++++++
 2 files changed, 1150 insertions(+)
 create mode 100644 drivers/staging/media/imx/imx7-mipi-csis.c
drivers/staging/media/imx/Makefile +1 -0
index 771846717146..c11d51259af1 100644
@@ -13,3 +13,4 @@ obj-$(CONFIG_VIDEO_IMX_CSI) += imx-media-csi.o
 obj-$(CONFIG_VIDEO_IMX_CSI) += imx6-mipi-csi2.o
 
 obj-$(CONFIG_VIDEO_IMX7_CSI) += imx7-media-csi.o
+obj-$(CONFIG_VIDEO_IMX7_CSI) += imx7-mipi-csis.o
drivers/staging/media/imx/imx7-mipi-csis.c new file +1149 -0

1,149 lines not on this page · raw message

Signature · 1 line
2.17.0
#10 lore raw

PATCH v2 6/15 media: staging/imx: add imx7 capture subsystem

In reply to Rui Miguel Silva

Add imx7 capture subsystem to imx-media core to allow the use some of the existing modules for i.MX5/6 with i.MX7 SoC.

Since i.MX7 does not have an IPU unset the ipu_present flag to differentiate some runtime behaviors.

---
 drivers/staging/media/imx/imx-media-dev.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/staging/media/imx/imx-media-dev.c +4 -0
index c0f277adeebe..be68235c4caa 100644
@@ -486,6 +486,9 @@ static int imx_media_probe(struct platform_device *pdev)
 
 	imxmd->ipu_present = true;
 
+	if (of_device_is_compatible(node, "fsl,imx7-capture-subsystem"))
+		imxmd->ipu_present = false;
+
 	if (imxmd->ipu_present) {
 		ret = imx_media_add_internal_subdevs(imxmd);
 		if (ret) {
@@ -543,6 +546,7 @@ static int imx_media_remove(struct platform_device *pdev)
 
 static const struct of_device_id imx_media_dt_ids[] = {
 	{ .compatible = "fsl,imx-capture-subsystem" },
+	{ .compatible = "fsl,imx7-capture-subsystem" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, imx_media_dt_ids);
Signature · 1 line
2.17.0
maintainer
#11 lore raw

Re: [PATCH v2 06/15] media: staging/imx: add imx7 capture subsystem

Quoted 16 lines · Rui Miguel Silva

Add imx7 capture subsystem to imx-media core to allow the use some of the existing modules for i.MX5/6 with i.MX7 SoC.

Since i.MX7 does not have an IPU unset the ipu_present flag to differentiate some runtime behaviors.

---
 drivers/staging/media/imx/imx-media-dev.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/staging/media/imx/imx-media-dev.c +0 -0
index c0f277adeebe..be68235c4caa 100644

drivers/staging/media/imx/imx-media-dev.c static int imx_media_probe(struct platform_device *pdev) · line 491

Quoted 6 lines
drivers/staging/media/imx/imx-media-dev.c +3 -0
@@ -486,6 +486,9 @@ static int imx_media_probe(struct platform_device *pdev)
 
 	imxmd->ipu_present = true;
 
+	if (of_device_is_compatible(node, "fsl,imx7-capture-subsystem"))
+		imxmd->ipu_present = false;
+

Is this something of_match_device should be used for?

drivers/staging/media/imx/imx-media-dev.c static int imx_media_remove(struct platform_device *pdev) · line 552

Quoted 11 lines
drivers/staging/media/imx/imx-media-dev.c +1 -0
 	if (imxmd->ipu_present) {
 		ret = imx_media_add_internal_subdevs(imxmd);
 		if (ret) {
@@ -543,6 +546,7 @@ static int imx_media_remove(struct platform_device *pdev)
 
 static const struct of_device_id imx_media_dt_ids[] = {
 	{ .compatible = "fsl,imx-capture-subsystem" },
+	{ .compatible = "fsl,imx7-capture-subsystem" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, imx_media_dt_ids);

regards
Philipp

#12 lore raw

Re: [PATCH v2 06/15] media: staging/imx: add imx7 capture subsystem

Hi Philipp,

Quoted 19 lines · Philipp Zabel
Quoted 18 lines · Rui Miguel Silva

Add imx7 capture subsystem to imx-media core to allow the use some of the existing modules for i.MX5/6 with i.MX7 SoC.

Since i.MX7 does not have an IPU unset the ipu_present flag to differentiate some runtime behaviors.

---
 drivers/staging/media/imx/imx-media-dev.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/staging/media/imx/imx-media-dev.c +0 -0
index c0f277adeebe..be68235c4caa 100644
@@ -486,6 +486,9 @@ static int imx_media_probe(struct 
 platform_device *pdev)
 
Quoted 8 lines

drivers/staging/media/imx/imx-media-dev.c static int imx_media_probe(struct platform_device *pdev) · line 491

Quoted 6 lines
drivers/staging/media/imx/imx-media-dev.c +3 -0
 	imxmd->ipu_present = true;
 
+	if (of_device_is_compatible(node, 
 "fsl,imx7-capture-subsystem"))
+		imxmd->ipu_present = false;
+

Is this something of_match_device should be used for?

Yeah, good point. I will develop your suggestion.

---
Cheers,
Rui

Quoted 20 lines
Quoted 12 lines
drivers/staging/media/imx/imx-media-dev.c +0 -0
 	if (imxmd->ipu_present) {
drivers/staging/media/imx/imx-media-dev.c +1 -0
 		ret = imx_media_add_internal_subdevs(imxmd);
 		if (ret) {
@@ -543,6 +546,7 @@ static int imx_media_remove(struct 
 platform_device *pdev)
 
 static const struct of_device_id imx_media_dt_ids[] = {
 	{ .compatible = "fsl,imx-capture-subsystem" },
+	{ .compatible = "fsl,imx7-capture-subsystem" },
 	{ /* sentinel */ }
 };
Quoted 1 line

MODULE_DEVICE_TABLE(of, imx_media_dt_ids);

regards
Philipp
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#13 lore raw

PATCH v2 7/15 ARM: dts: increase default cma size to 40MB

In reply to Rui Miguel Silva

To support camera in i.MX7 the cma heap is used to allocate frame buffers. The default size of CMA is 16MB which is not enough for higher resolutions (ex:
1600x1200).

So, increase the default CMA size to 40MB.

---
 arch/arm/boot/dts/imx7s.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/imx7s.dtsi +14 -0
index 4d42335c0dee..142ea709d296 100644
@@ -182,6 +182,20 @@
 			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		/* global autoconfigured region for contiguous allocations */
+		linux,cma {
+			compatible = "shared-dma-pool";
+			reusable;
+			size = <0x2800000>;
+			linux,cma-default;
+		};
+	};
+
 	soc {
 		#address-cells = <1>;
 		#size-cells = <1>;
Signature · 1 line
2.17.0
#14 lore raw

Re: [PATCH v2 07/15] ARM: dts: increase default cma size to 40MB

Quoted 7 lines · Rui Miguel Silva

To support camera in i.MX7 the cma heap is used to allocate frame buffers. The default size of CMA is 16MB which is not enough for higher resolutions (ex:
1600x1200).

So, increase the default CMA size to 40MB.

CMA size can be adjusted by kernel cmdline. I'm not sure it's necessary to make it fixed in DT.

Shawn

Quoted 32 lines
---
 arch/arm/boot/dts/imx7s.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/imx7s.dtsi +14 -0
index 4d42335c0dee..142ea709d296 100644
@@ -182,6 +182,20 @@
 			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		/* global autoconfigured region for contiguous allocations */
+		linux,cma {
+			compatible = "shared-dma-pool";
+			reusable;
+			size = <0x2800000>;
+			linux,cma-default;
+		};
+	};
+
 	soc {
 		#address-cells = <1>;
 		#size-cells = <1>;
Signature · 1 line
2.17.0
#15 lore raw

PATCH v2 8/15 media: dt-bindings: add bindings for i.MX7 media driver

In reply to Rui Miguel Silva

Add bindings documentation for i.MX7 media drivers.

---
 .../devicetree/bindings/media/imx7.txt        | 158 ++++++++++++++++++
 1 file changed, 158 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/imx7.txt
Documentation/devicetree/bindings/media/imx7.txt new file +158 -0
new file mode 100644
index 000000000000..7e058ea25102
@@ -0,0 +1,158 @@
+Freescale i.MX7 Media Video Device
+==================================
+
+Video Media Controller node
+---------------------------
+
+This is the media controller node for video capture support. It is a
+virtual device that lists the camera serial interface nodes that the
+media device will control.
+
+Required properties:
+- compatible : "fsl,imx7-capture-subsystem";
+- ports      : Should contain a list of phandles pointing to camera
+		sensor interface port of CSI
+
+example:
+
+capture-subsystem {
+	compatible = "fsl,imx7-capture-subsystem";
+	ports = <&csi>;
+};
+
+
+mipi_csi2 node
+--------------
+
+This is the device node for the MIPI CSI-2 receiver core in i.MX7 SoC. It is
+compatible with previous version of Samsung D-phy.
+
+Required properties:
+
+- compatible    : "fsl,imx7-mipi-csi2";
+- reg           : base address and length of the register set for the device;
+- interrupts    : should contain MIPI CSIS interrupt;
+- clocks        : list of clock specifiers, see
+        Documentation/devicetree/bindings/clock/clock-bindings.txt for details;
+- clock-names   : must contain "mipi" and "phy" entries, matching entries in the
+                  clock property;
+- power-domains : a phandle to the power domain, see
+          Documentation/devicetree/bindings/power/power_domain.txt for details.
+- reset-names   : should include following entry "mrst";
+- resets        : a list of phandle, should contain reset entry of
+                  reset-names;
+- phy-supply    : from the generic phy bindings, a phandle to a regulator that
+	          provides power to VBUS;
+- bus-width     : maximum number of data lanes supported (SoC specific);
+
+Optional properties:
+
+- clock-frequency : The IP's main (system bus) clock frequency in Hz, default
+		    value when this property is not specified is 166 MHz;
+
+port node
+---------
+
+- reg		  : (required) can take the values 0 or 1, where 0 is the
+                     related sink port and port 1 should be the source one;
+
+endpoint node
+-------------
+
+- data-lanes    : (required) an array specifying active physical MIPI-CSI2
+		    data input lanes and their mapping to logical lanes; the
+		    array's content is unused, only its length is meaningful;
+
+- csis-hs-settle : (optional) differential receiver (HS-RX) settle time;
+- csis-clk-settle : (optional) D-PHY control register;
+- csis-wclk     : CSI-2 wrapper clock selection. If this property is present
+		  external clock from CMU will be used, or the bus clock if
+		  if it's not specified.
+
+example:
+
+	mipi_csi: mipi-csi@30750000 {
+                clock-frequency = <166000000>;
+                status = "okay";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+		compatible = "fsl,imx7-mipi-csi2";
+		reg = <0x30750000 0x10000>;
+		interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&clks IMX7D_MIPI_CSI_ROOT_CLK>,
+				<&clks IMX7D_MIPI_DPHY_ROOT_CLK>;
+		clock-names = "mipi", "phy";
+		power-domains = <&pgc_mipi_phy>;
+		phy-supply = <&reg_1p0d>;
+		resets = <&src IMX7_RESET_MIPI_PHY_MRST>;
+		reset-names = "mrst";
+		bus-width = <4>;
+		status = "disabled";
+
+                port@0 {
+                        reg = <0>;
+
+                        mipi_from_sensor: endpoint {
+                                remote-endpoint = <&ov2680_to_mipi>;
+                                data-lanes = <1>;
+                                csis-hs-settle = <3>;
+                                csis-clk-settle = <0>;
+                                csis-wclk;
+                        };
+                };
+
+                port@1 {
+                        reg = <1>;
+
+                        mipi_vc0_to_csi_mux: endpoint {
+                                remote-endpoint = <&csi_mux_from_mipi_vc0>;
+                        };
+                };
+	};
+
+
+csi node
+--------
+
+This is device node for the CMOS Sensor Interface (CSI) which enables the chip
+to connect directly to external CMOS image sensors.
+
+Required properties:
+
+- compatible    : "fsl,imx7-csi";
+- reg           : base address and length of the register set for the device;
+- interrupts    : should contain CSI interrupt;
+- clocks        : list of clock specifiers, see
+        Documentation/devicetree/bindings/clock/clock-bindings.txt for details;
+- clock-names   : must contain "axi", "mclk" and "dcic" entries, matching
+                 entries in the clock property;
+
+port node
+---------
+
+- reg		  : (required) should be 0 for the sink port;
+
+example:
+
+		csi: csi@30710000 {
+                        #address-cells = <1>;
+                        #size-cells = <0>;
+
+			compatible = "fsl,imx7-csi";
+			reg = <0x30710000 0x10000>;
+			interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clks IMX7D_CLK_DUMMY>,
+					<&clks IMX7D_CSI_MCLK_ROOT_CLK>,
+					<&clks IMX7D_CLK_DUMMY>;
+			clock-names = "axi", "mclk", "dcic";
+			status = "disabled";
+
+                        port@0 {
+                                reg = <0>;
+
+                                csi_from_csi_mux: endpoint {
+                                        remote-endpoint = <&csi_mux_to_csi>;
+                                };
+                        };
+		};
Signature · 1 line
2.17.0
maintainer
#16 lore raw

Re: [PATCH v2 08/15] media: dt-bindings: add bindings for i.MX7 media driver

Quoted 24 lines · Rui Miguel Silva

Add bindings documentation for i.MX7 media drivers.

---
 .../devicetree/bindings/media/imx7.txt        | 158 ++++++++++++++++++
 1 file changed, 158 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/imx7.txt
Documentation/devicetree/bindings/media/imx7.txt new file +10 -0
new file mode 100644
index 000000000000..7e058ea25102
@@ -0,0 +1,158 @@
+Freescale i.MX7 Media Video Device
+==================================
+
+Video Media Controller node
+---------------------------
+
+This is the media controller node for video capture support. It is a
+virtual device that lists the camera serial interface nodes that the
+media device will control.
+

Documentation/devicetree/bindings/media/imx7.txt line 20

Quoted 10 lines
Documentation/devicetree/bindings/media/imx7.txt new file +10 -0
+Required properties:
+- compatible : "fsl,imx7-capture-subsystem";
+- ports      : Should contain a list of phandles pointing to camera
+		sensor interface port of CSI
+
+example:
+
+capture-subsystem {
+	compatible = "fsl,imx7-capture-subsystem";
+	ports = <&csi>;

Why do you need this node? Just have the driver match on the CSI node.

Documentation/devicetree/bindings/media/imx7.txt line 28

Quoted 8 lines
Documentation/devicetree/bindings/media/imx7.txt new file +8 -0
+};
+
+
+mipi_csi2 node
+--------------
+
+This is the device node for the MIPI CSI-2 receiver core in i.MX7 SoC. It is
+compatible with previous version of Samsung D-phy.

Compatible with Samsung?

Quoted 7 lines
Documentation/devicetree/bindings/media/imx7.txt new file +7 -0
+
+Required properties:
+
+- compatible    : "fsl,imx7-mipi-csi2";
+- reg           : base address and length of the register set for the device;
+- interrupts    : should contain MIPI CSIS interrupt;
+- clocks        : list of clock specifiers, see

Documentation/devicetree/bindings/media/imx7.txt line 45

Quoted 10 lines
Documentation/devicetree/bindings/media/imx7.txt new file +10 -0
+        Documentation/devicetree/bindings/clock/clock-bindings.txt for details;
+- clock-names   : must contain "mipi" and "phy" entries, matching entries in the
+                  clock property;
+- power-domains : a phandle to the power domain, see
+          Documentation/devicetree/bindings/power/power_domain.txt for details.
+- reset-names   : should include following entry "mrst";
+- resets        : a list of phandle, should contain reset entry of
+                  reset-names;
+- phy-supply    : from the generic phy bindings, a phandle to a regulator that
+	          provides power to VBUS;

VBUS? Copy-n-paste from USB something?

Documentation/devicetree/bindings/media/imx7.txt line 46

Quoted 1 line
Documentation/devicetree/bindings/media/imx7.txt new file +1 -0
+- bus-width     : maximum number of data lanes supported (SoC specific);

Don't we have a standard lanes property for CSI (or DSI)? bus-width is for parallel buses and goes in endpoint nodes. (But maybe it got used here too).

Quoted 8 lines
Documentation/devicetree/bindings/media/imx7.txt new file +8 -0
+
+Optional properties:
+
+- clock-frequency : The IP's main (system bus) clock frequency in Hz, default
+		    value when this property is not specified is 166 MHz;
+
+port node
+---------

Documentation/devicetree/bindings/media/imx7.txt line 64

Quoted 10 lines
Documentation/devicetree/bindings/media/imx7.txt new file +10 -0
+
+- reg		  : (required) can take the values 0 or 1, where 0 is the
+                     related sink port and port 1 should be the source one;
+
+endpoint node
+-------------
+
+- data-lanes    : (required) an array specifying active physical MIPI-CSI2
+		    data input lanes and their mapping to logical lanes; the
+		    array's content is unused, only its length is meaningful;

Ah yes, like this. :) So why do you need bus-width too?

Documentation/devicetree/bindings/media/imx7.txt line 66

Quoted 2 lines
Documentation/devicetree/bindings/media/imx7.txt new file +2 -0
+
+- csis-hs-settle : (optional) differential receiver (HS-RX) settle time;

units?

Documentation/devicetree/bindings/media/imx7.txt line 70

Quoted 4 lines
Documentation/devicetree/bindings/media/imx7.txt new file +4 -0
+- csis-clk-settle : (optional) D-PHY control register;
+- csis-wclk     : CSI-2 wrapper clock selection. If this property is present
+		  external clock from CMU will be used, or the bus clock if
+		  if it's not specified.

boolean?

These 3 need vendor properties.

Quoted 60 lines
Documentation/devicetree/bindings/media/imx7.txt new file +60 -0
+
+example:
+
+	mipi_csi: mipi-csi@30750000 {
+                clock-frequency = <166000000>;
+                status = "okay";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+		compatible = "fsl,imx7-mipi-csi2";
+		reg = <0x30750000 0x10000>;
+		interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&clks IMX7D_MIPI_CSI_ROOT_CLK>,
+				<&clks IMX7D_MIPI_DPHY_ROOT_CLK>;
+		clock-names = "mipi", "phy";
+		power-domains = <&pgc_mipi_phy>;
+		phy-supply = <&reg_1p0d>;
+		resets = <&src IMX7_RESET_MIPI_PHY_MRST>;
+		reset-names = "mrst";
+		bus-width = <4>;
+		status = "disabled";
+
+                port@0 {
+                        reg = <0>;
+
+                        mipi_from_sensor: endpoint {
+                                remote-endpoint = <&ov2680_to_mipi>;
+                                data-lanes = <1>;
+                                csis-hs-settle = <3>;
+                                csis-clk-settle = <0>;
+                                csis-wclk;
+                        };
+                };
+
+                port@1 {
+                        reg = <1>;
+
+                        mipi_vc0_to_csi_mux: endpoint {
+                                remote-endpoint = <&csi_mux_from_mipi_vc0>;
+                        };
+                };
+	};
+
+
+csi node
+--------
+
+This is device node for the CMOS Sensor Interface (CSI) which enables the chip
+to connect directly to external CMOS image sensors.
+
+Required properties:
+
+- compatible    : "fsl,imx7-csi";
+- reg           : base address and length of the register set for the device;
+- interrupts    : should contain CSI interrupt;
+- clocks        : list of clock specifiers, see
+        Documentation/devicetree/bindings/clock/clock-bindings.txt for details;
+- clock-names   : must contain "axi", "mclk" and "dcic" entries, matching
+                 entries in the clock property;
+

Documentation/devicetree/bindings/media/imx7.txt line 140

Quoted 10 lines
Documentation/devicetree/bindings/media/imx7.txt new file +10 -0
+port node
+---------
+
+- reg		  : (required) should be 0 for the sink port;
+
+example:
+
+		csi: csi@30710000 {
+                        #address-cells = <1>;
+                        #size-cells = <0>;

Something wrong with indentation here.

Documentation/devicetree/bindings/media/imx7.txt line 149

Quoted 9 lines
Documentation/devicetree/bindings/media/imx7.txt new file +9 -0
+
+			compatible = "fsl,imx7-csi";
+			reg = <0x30710000 0x10000>;
+			interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clks IMX7D_CLK_DUMMY>,
+					<&clks IMX7D_CSI_MCLK_ROOT_CLK>,
+					<&clks IMX7D_CLK_DUMMY>;
+			clock-names = "axi", "mclk", "dcic";
+			status = "disabled";

Don't show status in examples.

Documentation/devicetree/bindings/media/imx7.txt line 151

Quoted 2 lines
Documentation/devicetree/bindings/media/imx7.txt new file +2 -0
+
+                        port@0 {

And the indentation here...

Same issues in the 1st example, too.

Quoted 10 lines
Documentation/devicetree/bindings/media/imx7.txt new file +7 -0
+                                reg = <0>;
+
+                                csi_from_csi_mux: endpoint {
+                                        remote-endpoint = <&csi_mux_to_csi>;
+                                };
+                        };
+		};
Signature · 1 line
2.17.0
#17 lore raw

Re: [PATCH v2 08/15] media: dt-bindings: add bindings for i.MX7 media driver

Hi Rob,
Thanks for the review and sorry for the late reply. Meanwhile I have send v3 of this series with some of yours comments incorporated.

Quoted 34 lines · Rob Herring
Quoted 33 lines · Rui Miguel Silva

Add bindings documentation for i.MX7 media drivers.

---
 .../devicetree/bindings/media/imx7.txt        | 158 
 ++++++++++++++++++
 1 file changed, 158 insertions(+)
 create mode 100644 

Documentation/devicetree/bindings/media/imx7.txt

Documentation/devicetree/bindings/media/imx7.txt new file +7 -0
new file mode 100644
index 000000000000..7e058ea25102
@@ -0,0 +1,158 @@
+Freescale i.MX7 Media Video Device
+==================================
+
+Video Media Controller node
+---------------------------
+
+This is the media controller node for video capture support. 

It is a
+virtual device that lists the camera serial interface nodes that the

Documentation/devicetree/bindings/media/imx7.txt new file +5 -0
+media device will control.
+
+Required properties:
+- compatible : "fsl,imx7-capture-subsystem";
+- ports      : Should contain a list of phandles pointing to 

camera

Documentation/devicetree/bindings/media/imx7.txt new file +1 -0
+		sensor interface port of CSI
Quoted 8 lines

Documentation/devicetree/bindings/media/imx7.txt line 20

Quoted 6 lines
Documentation/devicetree/bindings/media/imx7.txt new file +6 -0
+
+example:
+
+capture-subsystem {
+	compatible = "fsl,imx7-capture-subsystem";
+	ports = <&csi>;

Why do you need this node? Just have the driver match on the CSI node.

This is for the parsing of the nodes done in imx media core, see also the imx.txt file.

Quoted 30 lines
Quoted 10 lines
Documentation/devicetree/bindings/media/imx7.txt new file +7 -0
+};
+
+
+mipi_csi2 node
+--------------
+
+This is the device node for the MIPI CSI-2 receiver core in 

i.MX7 SoC. It is
+compatible with previous version of Samsung D-phy.

Compatible with Samsung?

Quoted 17 lines
Documentation/devicetree/bindings/media/imx7.txt new file +5 -0
+
+Required properties:
+
+- compatible    : "fsl,imx7-mipi-csi2";
+- reg           : base address and length of the register set 

for the device;

+- interrupts    : should contain MIPI CSIS interrupt;
+- clocks        : list of clock specifiers, see

+
Documentation/devicetree/bindings/clock/clock-bindings.txt for details;
+- clock-names : must contain "mipi" and "phy" entries,
matching entries in the
+ clock property;
+- power-domains : a phandle to the power domain, see
+
Documentation/devicetree/bindings/power/power_domain.txt for details.
+- reset-names : should include following entry "mrst";

Quoted 8 lines

Documentation/devicetree/bindings/media/imx7.txt line 45

Quoted 6 lines

+- resets : a list of phandle, should contain reset
entry of
+ reset-names;
+- phy-supply : from the generic phy bindings, a phandle to
a regulator that

Documentation/devicetree/bindings/media/imx7.txt new file +1 -0
+	          provides power to VBUS;

VBUS? Copy-n-paste from USB something?

yeah, c-n-p error.

Quoted 25 lines
Quoted 3 lines

+- bus-width : maximum number of data lanes supported (SoC
specific);

Don't we have a standard lanes property for CSI (or DSI)? bus-width is for parallel buses and goes in endpoint nodes. (But maybe it got used here too).

Quoted 19 lines
Documentation/devicetree/bindings/media/imx7.txt new file +4 -0
+
+Optional properties:
+
+- clock-frequency : The IP's main (system bus) clock frequency 

in Hz, default

Documentation/devicetree/bindings/media/imx7.txt new file +1 -0
+		    value when this property is not specified is 

166 MHz;

Documentation/devicetree/bindings/media/imx7.txt new file +5 -0
+
+port node
+---------
+
+- reg		  : (required) can take the values 0 or 1, 

where 0 is the
+ related sink port and port 1 should be
the source one;

Documentation/devicetree/bindings/media/imx7.txt new file +4 -0
+
+endpoint node
+-------------
+
Quoted 8 lines
Quoted 6 lines

+- data-lanes : (required) an array specifying active
physical MIPI-CSI2

Documentation/devicetree/bindings/media/imx7.txt new file +1 -0
+		    data input lanes and their mapping to logical 

lanes; the

Documentation/devicetree/bindings/media/imx7.txt new file +1 -0
+		    array's content is unused, only its length is 

meaningful;

Ah yes, like this. :) So why do you need bus-width too?

To guarantee that the active lanes are not bigger that the ones supported in the specific SoC. So, the bus-width defines the lanes supported and this the active ones.

Quoted 7 lines
Quoted 4 lines

+
+- csis-hs-settle : (optional) differential receiver (HS-RX) settle time;

units?

Quoted 8 lines

Documentation/devicetree/bindings/media/imx7.txt line 70

Quoted 6 lines
+- csis-clk-settle : (optional) D-PHY control register;
+- csis-wclk     : CSI-2 wrapper clock selection. If this 

property is present

Documentation/devicetree/bindings/media/imx7.txt new file +1 -0
+		  external clock from CMU will be used, or the bus 

clock if

Documentation/devicetree/bindings/media/imx7.txt new file +1 -0
+		  if it's not specified.

boolean?

I dropped this in v3.

Quoted 2 lines

These 3 need vendor properties.

Sure, added in v3

Quoted 72 lines
Quoted 72 lines
Documentation/devicetree/bindings/media/imx7.txt new file +27 -0
+
+example:
+
+	mipi_csi: mipi-csi@30750000 {
+                clock-frequency = <166000000>;
+                status = "okay";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+		compatible = "fsl,imx7-mipi-csi2";
+		reg = <0x30750000 0x10000>;
+		interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&clks IMX7D_MIPI_CSI_ROOT_CLK>,
+				<&clks IMX7D_MIPI_DPHY_ROOT_CLK>;
+		clock-names = "mipi", "phy";
+		power-domains = <&pgc_mipi_phy>;
+		phy-supply = <&reg_1p0d>;
+		resets = <&src IMX7_RESET_MIPI_PHY_MRST>;
+		reset-names = "mrst";
+		bus-width = <4>;
+		status = "disabled";
+
+                port@0 {
+                        reg = <0>;
+
+                        mipi_from_sensor: endpoint {
+                                remote-endpoint = 

<&ov2680_to_mipi>;

Documentation/devicetree/bindings/media/imx7.txt new file +12 -0
+                                data-lanes = <1>;
+                                csis-hs-settle = <3>;
+                                csis-clk-settle = <0>;
+                                csis-wclk;
+                        };
+                };
+
+                port@1 {
+                        reg = <1>;
+
+                        mipi_vc0_to_csi_mux: endpoint {
+                                remote-endpoint = 

<&csi_mux_from_mipi_vc0>;

Documentation/devicetree/bindings/media/imx7.txt new file +9 -0
+                        };
+                };
+	};
+
+
+csi node
+--------
+
+This is device node for the CMOS Sensor Interface (CSI) which 

enables the chip

Documentation/devicetree/bindings/media/imx7.txt new file +6 -0
+to connect directly to external CMOS image sensors.
+
+Required properties:
+
+- compatible    : "fsl,imx7-csi";
+- reg           : base address and length of the register set 

for the device;

+- interrupts    : should contain CSI interrupt;
+- clocks        : list of clock specifiers, see

+
Documentation/devicetree/bindings/clock/clock-bindings.txt for details;
+- clock-names : must contain "axi", "mclk" and "dcic"
entries, matching

Documentation/devicetree/bindings/media/imx7.txt new file +6 -0
+                 entries in the clock property;
+
+port node
+---------
+
+- reg		  : (required) should be 0 for the sink 

port;

Quoted 8 lines

Documentation/devicetree/bindings/media/imx7.txt line 140

Quoted 6 lines
Documentation/devicetree/bindings/media/imx7.txt new file +6 -0
+
+example:
+
+		csi: csi@30710000 {
+                        #address-cells = <1>;
+                        #size-cells = <0>;

Something wrong with indentation here.

Fixed the indentation.

Quoted 14 lines

Documentation/devicetree/bindings/media/imx7.txt line 149

Quoted 12 lines
Documentation/devicetree/bindings/media/imx7.txt new file +4 -0
+
+			compatible = "fsl,imx7-csi";
+			reg = <0x30710000 0x10000>;
+			interrupts = <GIC_SPI 7 

IRQ_TYPE_LEVEL_HIGH>;

Documentation/devicetree/bindings/media/imx7.txt new file +2 -0
+			clocks = <&clks IMX7D_CLK_DUMMY>,
+					<&clks 

IMX7D_CSI_MCLK_ROOT_CLK>,

Documentation/devicetree/bindings/media/imx7.txt new file +3 -0
+					<&clks IMX7D_CLK_DUMMY>;
+			clock-names = "axi", "mclk", "dcic";
+			status = "disabled";

Don't show status in examples.

yeah, you are right. fixed.

Quoted 8 lines

Documentation/devicetree/bindings/media/imx7.txt

Quoted 3 lines
Documentation/devicetree/bindings/media/imx7.txt new file +2 -0
+
+                        port@0 {

And the indentation here...

Same issues in the 1st example, too.

ditto.

---
Cheers,
Rui

#18 lore raw

PATCH v2 9/15 ARM: dts: imx7s: add mipi phy power domain

In reply to Rui Miguel Silva

Add power domain index 0 related with mipi-phy to imx7s.

---
 arch/arm/boot/dts/imx7s.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/imx7s.dtsi +6 -0
index 142ea709d296..d913c3f9c284 100644
@@ -650,6 +650,12 @@
 					#address-cells = <1>;
 					#size-cells = <0>;
 
+					pgc_mipi_phy: pgc-power-domain@0 {
+						#power-domain-cells = <0>;
+						reg = <0>;
+						power-supply = <&reg_1p0d>;
+					};
+
 					pgc_pcie_phy: pgc-power-domain@1 {
 						#power-domain-cells = <0>;
 						reg = <1>;
Signature · 1 line
2.17.0
#19 lore raw

PATCH v2 10/15 ARM: dts: imx7s: add multiplexer controls

In reply to Rui Miguel Silva

The IOMUXC General Purpose Register has bitfield to control video bus multiplexer to control the CSI input between the MIPI-CSI2 and parallel interface. Add that register and mask.

---
 arch/arm/boot/dts/imx7s.dtsi | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx7s.dtsi +8 -1
index d913c3f9c284..3027d6a62021 100644
@@ -534,8 +534,15 @@
 
 			gpr: iomuxc-gpr@30340000 {
 				compatible = "fsl,imx7d-iomuxc-gpr",
-					"fsl,imx6q-iomuxc-gpr", "syscon";
+					"fsl,imx6q-iomuxc-gpr", "syscon", "simple-mfd";
 				reg = <0x30340000 0x10000>;
+
+				mux: mux-controller {
+					compatible = "mmio-mux";
+					#mux-control-cells = <1>;
+
+					mux-reg-masks = <0x14 0x00000010>;
+				};
 			};
 
 			ocotp: ocotp-ctrl@30350000 {
Signature · 1 line
2.17.0
#20 lore raw

Re: [PATCH v2 10/15] ARM: dts: imx7s: add multiplexer controls

Quoted 15 lines · Rui Miguel Silva

The IOMUXC General Purpose Register has bitfield to control video bus multiplexer to control the CSI input between the MIPI-CSI2 and parallel interface. Add that register and mask.

---
 arch/arm/boot/dts/imx7s.dtsi | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx7s.dtsi +0 -0
index d913c3f9c284..3027d6a62021 100644
@@ -534,8 +534,15 @@
 

arch/arm/boot/dts/imx7s.dtsi line 543

Quoted 10 lines
arch/arm/boot/dts/imx7s.dtsi +6 -1
 			gpr: iomuxc-gpr@30340000 {
 				compatible = "fsl,imx7d-iomuxc-gpr",
-					"fsl,imx6q-iomuxc-gpr", "syscon";
+					"fsl,imx6q-iomuxc-gpr", "syscon", "simple-mfd";
 				reg = <0x30340000 0x10000>;
+
+				mux: mux-controller {
+					compatible = "mmio-mux";
+					#mux-control-cells = <1>;
+

The newline in between property list is not really necessary.

Shawn

Quoted 8 lines
arch/arm/boot/dts/imx7s.dtsi +2 -0
+					mux-reg-masks = <0x14 0x00000010>;
+				};
 			};
 
 			ocotp: ocotp-ctrl@30350000 {
Signature · 1 line
2.17.0
#21 lore raw

PATCH v2 11/15 ARM: dts: imx7: Add video mux, csi and mipi_csi and connections

In reply to Rui Miguel Silva

This patch adds the device tree nodes for csi, video multiplexer and mipi-csi besides the graph connecting the necessary endpoints to make the media capture entities to work in imx7 Warp board.

Also add the pin control related with the mipi_csi in that board.

---
 arch/arm/boot/dts/imx7s-warp.dts | 80 ++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx7s.dtsi     | 27 +++++++++++
 2 files changed, 107 insertions(+)
arch/arm/boot/dts/imx7s-warp.dts +80 -0
index 8a30b148534d..91d06adf7c24 100644
@@ -310,6 +310,79 @@
 	status = "okay";
 };
 
+&gpr {
+	csi_mux {
+		compatible = "video-mux";
+		mux-controls = <&mux 0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port@0 {
+			reg = <0>;
+
+			csi_mux_from_parallel_sensor: endpoint {
+			};
+		};
+
+		port@1 {
+			reg = <1>;
+
+			csi_mux_from_mipi_vc0: endpoint {
+				remote-endpoint = <&mipi_vc0_to_csi_mux>;
+			};
+		};
+
+		port@2 {
+			reg = <2>;
+
+			csi_mux_to_csi: endpoint {
+				remote-endpoint = <&csi_from_csi_mux>;
+			};
+		};
+	};
+};
+
+&csi {
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	port@0 {
+		reg = <0>;
+
+		csi_from_csi_mux: endpoint {
+			remote-endpoint = <&csi_mux_to_csi>;
+		};
+	};
+};
+
+&mipi_csi {
+	clock-frequency = <166000000>;
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	port@0 {
+		reg = <0>;
+
+		mipi_from_sensor: endpoint {
+			remote-endpoint = <&ov2680_to_mipi>;
+			data-lanes = <1>;
+			csis-hs-settle = <3>;
+			csis-clk-settle = <0>;
+			csis-wclk;
+		};
+	};
+
+	port@1 {
+		reg = <1>;
+
+		mipi_vc0_to_csi_mux: endpoint {
+			remote-endpoint = <&csi_mux_from_mipi_vc0>;
+		};
+	};
+};
+
 &wdog1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_wdog>;
@@ -357,6 +430,13 @@
 		>;
 	};
 
+	pinctrl_mipi_csi: mipi_csi {
+		fsl,pins = <
+			MX7D_PAD_LPSR_GPIO1_IO03__GPIO1_IO3	0x14
+			MX7D_PAD_ENET1_RGMII_TD0__GPIO7_IO6	0x14
+		>;
+	};
+
 	pinctrl_sai1: sai1grp {
 		fsl,pins = <
 			MX7D_PAD_SAI1_RX_DATA__SAI1_RX_DATA0	0x1f
arch/arm/boot/dts/imx7s.dtsi +27 -0
index 3027d6a62021..6b49b73053f9 100644
@@ -46,6 +46,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/reset/imx7-reset.h>
 #include "imx7d-pinfunc.h"
 
 / {
@@ -753,6 +754,17 @@
 				status = "disabled";
 			};
 
+			csi: csi@30710000 {
+				compatible = "fsl,imx7-csi";
+				reg = <0x30710000 0x10000>;
+				interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks IMX7D_CLK_DUMMY>,
+						<&clks IMX7D_CSI_MCLK_ROOT_CLK>,
+						<&clks IMX7D_CLK_DUMMY>;
+				clock-names = "axi", "mclk", "dcic";
+				status = "disabled";
+			};
+
 			lcdif: lcdif@30730000 {
 				compatible = "fsl,imx7d-lcdif", "fsl,imx28-lcdif";
 				reg = <0x30730000 0x10000>;
@@ -762,6 +774,21 @@
 				clock-names = "pix", "axi";
 				status = "disabled";
 			};
+
+			mipi_csi: mipi-csi@30750000 {
+				compatible = "fsl,imx7-mipi-csi2";
+				reg = <0x30750000 0x10000>;
+				interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks IMX7D_MIPI_CSI_ROOT_CLK>,
+						<&clks IMX7D_MIPI_DPHY_ROOT_CLK>;
+				clock-names = "mipi", "phy";
+				power-domains = <&pgc_mipi_phy>;
+				phy-supply = <&reg_1p0d>;
+				resets = <&src IMX7_RESET_MIPI_PHY_MRST>;
+				reset-names = "mrst";
+				bus-width = <4>;
+				status = "disabled";
+			};
 		};
 
 		aips3: aips-bus@30800000 {
Signature · 1 line
2.17.0
maintainer
#22 lore raw

Re: [PATCH v2 11/15] ARM: dts: imx7: Add video mux, csi and mipi_csi and connections

Quoted 71 lines · Rui Miguel Silva

This patch adds the device tree nodes for csi, video multiplexer and mipi-csi besides the graph connecting the necessary endpoints to make the media capture entities to work in imx7 Warp board.

Also add the pin control related with the mipi_csi in that board.

---
 arch/arm/boot/dts/imx7s-warp.dts | 80 ++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx7s.dtsi     | 27 +++++++++++
 2 files changed, 107 insertions(+)
arch/arm/boot/dts/imx7s-warp.dts +51 -0
index 8a30b148534d..91d06adf7c24 100644
@@ -310,6 +310,79 @@
 	status = "okay";
 };
 
+&gpr {
+	csi_mux {
+		compatible = "video-mux";
+		mux-controls = <&mux 0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port@0 {
+			reg = <0>;
+
+			csi_mux_from_parallel_sensor: endpoint {
+			};
+		};
+
+		port@1 {
+			reg = <1>;
+
+			csi_mux_from_mipi_vc0: endpoint {
+				remote-endpoint = <&mipi_vc0_to_csi_mux>;
+			};
+		};
+
+		port@2 {
+			reg = <2>;
+
+			csi_mux_to_csi: endpoint {
+				remote-endpoint = <&csi_from_csi_mux>;
+			};
+		};
+	};
+};
+
+&csi {
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	port@0 {
+		reg = <0>;
+
+		csi_from_csi_mux: endpoint {
+			remote-endpoint = <&csi_mux_to_csi>;
+		};
+	};
+};
+
+&mipi_csi {
+	clock-frequency = <166000000>;
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;

arch/arm/boot/dts/imx7s-warp.dts line 373

Quoted 10 lines
arch/arm/boot/dts/imx7s-warp.dts +10 -0
+
+	port@0 {
+		reg = <0>;
+
+		mipi_from_sensor: endpoint {
+			remote-endpoint = <&ov2680_to_mipi>;
+			data-lanes = <1>;
+			csis-hs-settle = <3>;
+			csis-clk-settle = <0>;
+			csis-wclk;

Why is this an endpoint property? Under which condition would a board designer choose PCLK instead of WRAP_CLK as pixel clock source?

I'd naively assume that the driver should set this bit automatically whenever a "wrap" clock is provided via device tree.

Quoted 16 lines
arch/arm/boot/dts/imx7s-warp.dts +12 -0
+		};
+	};
+
+	port@1 {
+		reg = <1>;
+
+		mipi_vc0_to_csi_mux: endpoint {
+			remote-endpoint = <&csi_mux_from_mipi_vc0>;
+		};
+	};
+};
+
 &wdog1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_wdog>;

arch/arm/boot/dts/imx7s-warp.dts line 439

Quoted 10 lines
arch/arm/boot/dts/imx7s-warp.dts +7 -0
@@ -357,6 +430,13 @@
 		>;
 	};
 
+	pinctrl_mipi_csi: mipi_csi {
+		fsl,pins = <
+			MX7D_PAD_LPSR_GPIO1_IO03__GPIO1_IO3	0x14
+			MX7D_PAD_ENET1_RGMII_TD0__GPIO7_IO6	0x14
+		>;
+	};
+

Unrelated change?

Quoted 35 lines
arch/arm/boot/dts/imx7s-warp.dts +0 -0
 	pinctrl_sai1: sai1grp {
 		fsl,pins = <
 			MX7D_PAD_SAI1_RX_DATA__SAI1_RX_DATA0	0x1f
arch/arm/boot/dts/imx7s.dtsi +12 -0
index 3027d6a62021..6b49b73053f9 100644
@@ -46,6 +46,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/reset/imx7-reset.h>
 #include "imx7d-pinfunc.h"
 
 / {
@@ -753,6 +754,17 @@
 				status = "disabled";
 			};
 
+			csi: csi@30710000 {
+				compatible = "fsl,imx7-csi";
+				reg = <0x30710000 0x10000>;
+				interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks IMX7D_CLK_DUMMY>,
+						<&clks IMX7D_CSI_MCLK_ROOT_CLK>,
+						<&clks IMX7D_CLK_DUMMY>;
+				clock-names = "axi", "mclk", "dcic";
+				status = "disabled";
+			};
+
 			lcdif: lcdif@30730000 {
 				compatible = "fsl,imx7d-lcdif", "fsl,imx28-lcdif";
 				reg = <0x30730000 0x10000>;
@@ -762,6 +774,21 @@
 				clock-names = "pix", "axi";

arch/arm/boot/dts/imx7s.dtsi line 784

Quoted 10 lines
arch/arm/boot/dts/imx7s.dtsi +8 -0
 				status = "disabled";
 			};
+
+			mipi_csi: mipi-csi@30750000 {
+				compatible = "fsl,imx7-mipi-csi2";
+				reg = <0x30750000 0x10000>;
+				interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks IMX7D_MIPI_CSI_ROOT_CLK>,
+						<&clks IMX7D_MIPI_DPHY_ROOT_CLK>;
+				clock-names = "mipi", "phy";

The i.MX7Dual and i.MX7Solo reference manuals mention three clock inputs to the MIPI CSI: mipi_csi.ipg_clk_s, mipi_csi.I_PCLK, and mipi.csi.I_WRAP_CLK (all three gated by CCGR100).
The MIPI_CSI2 chapters mention I_PCLK and I_WRAP_CLK again. Shouldn't at least those two be used in place of just "mipi"?

arch/arm/boot/dts/imx7s.dtsi line 789

Quoted 5 lines
arch/arm/boot/dts/imx7s.dtsi +5 -0
+				power-domains = <&pgc_mipi_phy>;
+				phy-supply = <&reg_1p0d>;
+				resets = <&src IMX7_RESET_MIPI_PHY_MRST>;
+				reset-names = "mrst";
+				bus-width = <4>;

It looks to me like both i.MX7Dual and i.MX7Solo only have two data lanes connected.

arch/arm/boot/dts/imx7s.dtsi line 794

Quoted 5 lines
arch/arm/boot/dts/imx7s.dtsi +2 -0
+				status = "disabled";
+			};
 		};
 
 		aips3: aips-bus@30800000 {

regards
Philipp

#23 lore raw

Re: [PATCH v2 11/15] ARM: dts: imx7: Add video mux, csi and mipi_csi and connections

Hi Philipp,

Quoted 112 lines · Philipp Zabel
Quoted 74 lines · Rui Miguel Silva

This patch adds the device tree nodes for csi, video multiplexer and mipi-csi besides the graph connecting the necessary endpoints to make the media capture entities to work in imx7 Warp board.

Also add the pin control related with the mipi_csi in that board.

---
 arch/arm/boot/dts/imx7s-warp.dts | 80 
 ++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx7s.dtsi     | 27 +++++++++++
 2 files changed, 107 insertions(+)
arch/arm/boot/dts/imx7s-warp.dts +51 -0
index 8a30b148534d..91d06adf7c24 100644
@@ -310,6 +310,79 @@
 	status = "okay";
 };
 
+&gpr {
+	csi_mux {
+		compatible = "video-mux";
+		mux-controls = <&mux 0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port@0 {
+			reg = <0>;
+
+			csi_mux_from_parallel_sensor: endpoint {
+			};
+		};
+
+		port@1 {
+			reg = <1>;
+
+			csi_mux_from_mipi_vc0: endpoint {
+				remote-endpoint = 
 <&mipi_vc0_to_csi_mux>;
+			};
+		};
+
+		port@2 {
+			reg = <2>;
+
+			csi_mux_to_csi: endpoint {
+				remote-endpoint = 
 <&csi_from_csi_mux>;
+			};
+		};
+	};
+};
+
+&csi {
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	port@0 {
+		reg = <0>;
+
+		csi_from_csi_mux: endpoint {
+			remote-endpoint = <&csi_mux_to_csi>;
+		};
+	};
+};
+
+&mipi_csi {
+	clock-frequency = <166000000>;
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;

arch/arm/boot/dts/imx7s-warp.dts line 375

Quoted 10 lines
arch/arm/boot/dts/imx7s-warp.dts +10 -0
+
+	port@0 {
+		reg = <0>;
+
+		mipi_from_sensor: endpoint {
+			remote-endpoint = <&ov2680_to_mipi>;
+			data-lanes = <1>;
+			csis-hs-settle = <3>;
+			csis-clk-settle = <0>;
+			csis-wclk;

Why is this an endpoint property? Under which condition would a board designer choose PCLK instead of WRAP_CLK as pixel clock source?

I'd naively assume that the driver should set this bit automatically whenever a "wrap" clock is provided via device tree.

Quoted 20 lines
arch/arm/boot/dts/imx7s-warp.dts +12 -0
+		};
+	};
+
+	port@1 {
+		reg = <1>;
+
+		mipi_vc0_to_csi_mux: endpoint {
+			remote-endpoint = 
 <&csi_mux_from_mipi_vc0>;
+		};
+	};
+};
+

&wdog1 {

arch/arm/boot/dts/imx7s-warp.dts +0 -0
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_wdog>;
@@ -357,6 +430,13 @@
 		>;
 	};
 
Quoted 11 lines

arch/arm/boot/dts/imx7s-warp.dts line 439

Quoted 9 lines
arch/arm/boot/dts/imx7s-warp.dts +3 -0
+	pinctrl_mipi_csi: mipi_csi {
+		fsl,pins = <
+			MX7D_PAD_LPSR_GPIO1_IO03__GPIO1_IO3 

0x14

arch/arm/boot/dts/imx7s-warp.dts +1 -0
+			MX7D_PAD_ENET1_RGMII_TD0__GPIO7_IO6 

0x14

arch/arm/boot/dts/imx7s-warp.dts +3 -0
+		>;
+	};
+

Unrelated change?

Yes, I will split this.

Quoted 53 lines
Quoted 53 lines
arch/arm/boot/dts/imx7s-warp.dts +0 -0
 	pinctrl_sai1: sai1grp {
 		fsl,pins = <
 			MX7D_PAD_SAI1_RX_DATA__SAI1_RX_DATA0 
 0x1f
arch/arm/boot/dts/imx7s.dtsi +9 -0
index 3027d6a62021..6b49b73053f9 100644
@@ -46,6 +46,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/reset/imx7-reset.h>
 #include "imx7d-pinfunc.h"
 
 / {
@@ -753,6 +754,17 @@
 				status = "disabled";
 			};
 
+			csi: csi@30710000 {
+				compatible = "fsl,imx7-csi";
+				reg = <0x30710000 0x10000>;
+				interrupts = <GIC_SPI 7 
 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks IMX7D_CLK_DUMMY>,
+						<&clks 
 IMX7D_CSI_MCLK_ROOT_CLK>,
+						<&clks 
 IMX7D_CLK_DUMMY>;
+				clock-names = "axi", "mclk", 

"dcic";

arch/arm/boot/dts/imx7s.dtsi +10 -0
+				status = "disabled";
+			};
+
 			lcdif: lcdif@30730000 {
 				compatible = "fsl,imx7d-lcdif", 
 "fsl,imx28-lcdif";
 				reg = <0x30730000 0x10000>;
@@ -762,6 +774,21 @@
 				clock-names = "pix", "axi";
 				status = "disabled";
 			};
+
+			mipi_csi: mipi-csi@30750000 {
+				compatible = "fsl,imx7-mipi-csi2";
+				reg = <0x30750000 0x10000>;
+				interrupts = <GIC_SPI 25 
 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks 
 IMX7D_MIPI_CSI_ROOT_CLK>,
+						<&clks 
Quoted 8 lines

arch/arm/boot/dts/imx7s.dtsi line 787

Quoted 2 lines
arch/arm/boot/dts/imx7s.dtsi +1 -0
 IMX7D_MIPI_DPHY_ROOT_CLK>;
+				clock-names = "mipi", "phy";

The i.MX7Dual and i.MX7Solo reference manuals mention three clock inputs to the MIPI CSI: mipi_csi.ipg_clk_s, mipi_csi.I_PCLK, and mipi.csi.I_WRAP_CLK (all three gated by CCGR100).
The MIPI_CSI2 chapters mention I_PCLK and I_WRAP_CLK again. Shouldn't at least those two be used in place of just "mipi"?

Make sense, It wwill be in v3.

Thanks,
---
Cheers,
Rui

Quoted 19 lines

arch/arm/boot/dts/imx7s.dtsi line 789

Quoted 7 lines
arch/arm/boot/dts/imx7s.dtsi +3 -0
+				power-domains = <&pgc_mipi_phy>;
+				phy-supply = <&reg_1p0d>;
+				resets = <&src 

IMX7_RESET_MIPI_PHY_MRST>;

arch/arm/boot/dts/imx7s.dtsi +2 -0
+				reset-names = "mrst";
+				bus-width = <4>;

It looks to me like both i.MX7Dual and i.MX7Solo only have two data lanes connected.

arch/arm/boot/dts/imx7s.dtsi line 794

Quoted 5 lines
arch/arm/boot/dts/imx7s.dtsi +2 -0
+				status = "disabled";
+			};
 		};
 
 		aips3: aips-bus@30800000 {

regards
Philipp

#24 lore raw

PATCH v2 12/15 ARM: dts: imx7s: add capture subsystem

In reply to Rui Miguel Silva

Add media capture subsystem device to i.MX7 definitions.

---
 arch/arm/boot/dts/imx7s.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/imx7s.dtsi +5 -0
index 6b49b73053f9..333d9fe6b989 100644
@@ -1189,4 +1189,9 @@
 			assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_500M_CLK>;
 		};
 	};
+
+	capture-subsystem {
+		compatible = "fsl,imx7-capture-subsystem";
+		ports = <&csi>;
+	};
 };
Signature · 1 line
2.17.0
#25 lore raw

PATCH v2 13/15 ARM: dts: imx7s-warp: add ov2680 sensor node

In reply to Rui Miguel Silva

Warp7 comes with a Omnivision OV2680 sensor, add the node here to make complete the camera data path for this system.

---
 arch/arm/boot/dts/imx7s-warp.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm/boot/dts/imx7s-warp.dts +16 -0
index 91d06adf7c24..d80e9af768b9 100644
@@ -218,6 +218,22 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_i2c2>;
 	status = "okay";
+
+	ov2680: camera@36 {
+		compatible = "ovti,ov2680";
+		reg = <0x36>;
+		clocks = <&osc>;
+		clock-names = "xvclk";
+		powerdown-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
+
+		port {
+			ov2680_to_mipi: endpoint {
+				remote-endpoint = <&mipi_from_sensor>;
+				clock-lanes = <0>;
+				data-lanes = <1>;
+			};
+		};
+	};
 };
 
 &i2c4 {
Signature · 1 line
2.17.0
#26 lore raw

PATCH v2 14/15 media: imx7.rst: add documentation for i.MX7 media driver

In reply to Rui Miguel Silva

Add rst document to describe the i.MX7 media driver and also a working example from the Warp7 board usage with a OV2680 sensor.

---
 Documentation/media/v4l-drivers/imx7.rst  | 157 ++++++++++++++++++++++
 Documentation/media/v4l-drivers/index.rst |   1 +
 2 files changed, 158 insertions(+)
 create mode 100644 Documentation/media/v4l-drivers/imx7.rst
Documentation/media/v4l-drivers/imx7.rst new file +157 -0
new file mode 100644
index 000000000000..64b97b442277
@@ -0,0 +1,157 @@
+i.MX7 Video Capture Driver
+==========================
+
+Introduction
+------------
+
+The i.MX7 contrary to the i.MX5/6 family does not contain an Image Processing
+Unit (IPU), because of that the capabilities to perform operations or
+manipulation of the capture frames is less feature rich.
+
+For image capture the i.MX7 have three units:
+- CMOS Sensor Interface (CSI)
+- Video Multiplexer
+- MIPI CSI-2 Receiver
+
+::
+                                           |\
+   MIPI Camera Input ---> MIPI CSI-2 --- > | \
+                                           |  \
+                                           | M |
+                                           | U | ------>  CSI ---> Capture
+                                           | X |
+                                           |  /
+   Parallel Camera Input ----------------> | /
+                                           |/
+
+For additional information, please refer to the latest versions of the i.MX7
+reference manual [#f1]_.
+
+Entities
+--------
+
+imx7-mipi-csi2
+--------------
+
+This is the MIPI CSI-2 recevier entity. It has one sink pad to receive the pixel
+data from MIPI CSI-2 camera sensor. It has one source pad, corresponding to the
+virtual channel 0. This module is compliant to previous version of Samsung
+D-phy, and support two D-PHY Rx Data lanes.
+
+csi_mux
+-------
+
+This is the video multiplexer. It has two sink pads to select from either camera
+sensors with a parallel interface or from MIPI CSI-2 virtual channel 0.  It has
+a single source pad that routes to the CSI.
+
+csi
+---
+
+The CSI enables the chip to connect directly to external CMOS image sensor. CSI
+can interfaces directly with Parallel and MIPI CSI-2 buses. It has 256 x 64 FIFO
+to store received image pixel data and embedded DMA controllers to transfer data
+from the FIFO through AHB bus.
+
+This entity has one sink pad that receive from the csi_mux entity and a single
+source pad that route video frames directly to memory buffers, this pad is
+routed to a capture device node.
+
+Usage Notes
+-----------
+
+To aid in configuration and for backward compatibility with V4L2 applications
+that access controls only from video device nodes, the capture device interfaces
+inherit controls from the active entities in the current pipeline, so controls
+can be accessed either directly from the subdev or from the active capture
+device interface. For example, the sensor controls are available either from the
+sensor subdevs or from the active capture device.
+
+Warp7 with OV2680
+-----------------
+
+On this platform an OV2680 MIPI CSI-2 module is connected to the internal MIPI
+CSI-2 receiver. The following example configures a video capture pipeline with
+an output of 800x600, and BGGR 10 bit bayer format:
+
+.. code-block:: none
+   # Setup links
+   media-ctl -l "'ov2680 1-0036':0 -> 'imx7-mipi-csis.0':0[1]"
+   media-ctl -l "'imx7-mipi-csis.0':1 -> 'csi_mux':1[1]"
+   media-ctl -l "'csi_mux':2 -> 'csi':0[1]"
+   media-ctl -l "'csi':1 -> 'csi capture':0[1]"
+
+   # Configure pads for pipeline
+   media-ctl -V "'ov2680 1-0036':0 [fmt:SBGGR10_1X10/800x600 field:none]"
+   media-ctl -V "'csi_mux':1 [fmt:SBGGR10_1X10/800x600 field:none]"
+   media-ctl -V "'csi_mux':2 [fmt:SBGGR10_1X10/800x600 field:none]"
+   media-ctl -V "'imx7-mipi-csis.0':0 [fmt:SBGGR10_1X10/800x600 field:none]"
+   media-ctl -V "'csi':0 [fmt:SBGGR10_1X10/800x600 field:none]"
+
+After this streaming can start, the v4l2-ctl tool can be used to select any of
+the resolutions supported by the sensor.
+
+.. code-block:: none
+    root@imx7s-warp:~# media-ctl -p
+    Media controller API version 4.17.0
+
+    Media device information
+    ------------------------
+    driver          imx-media
+    model           imx-media
+    serial
+    bus info
+    hw revision     0x0
+    driver version  4.17.0
+
+    Device topology
+    - entity 1: csi (2 pads, 2 links)
+		type V4L2 subdev subtype Unknown flags 0
+		device node name /dev/v4l-subdev0
+	    pad0: Sink
+		    [fmt:SBGGR10_1X10/800x600 field:none]
+		    <- "csi_mux":2 [ENABLED]
+	    pad1: Source
+		    [fmt:SBGGR10_1X10/800x600 field:none]
+		    -> "csi capture":0 [ENABLED]
+
+    - entity 4: csi capture (1 pad, 1 link)
+		type Node subtype V4L flags 0
+		device node name /dev/video0
+	    pad0: Sink
+		    <- "csi":1 [ENABLED]
+
+    - entity 10: csi_mux (3 pads, 2 links)
+		type V4L2 subdev subtype Unknown flags 0
+		device node name /dev/v4l-subdev1
+	    pad0: Sink
+		    [fmt:unknown/0x0]
+	    pad1: Sink
+		    [fmt:unknown/800x600 field:none]
+		    <- "imx7-mipi-csis.0":1 [ENABLED]
+	    pad2: Source
+		    [fmt:unknown/800x600 field:none]
+		    -> "csi":0 [ENABLED]
+
+    - entity 14: imx7-mipi-csis.0 (2 pads, 2 links)
+		type V4L2 subdev subtype Unknown flags 0
+		device node name /dev/v4l-subdev2
+	    pad0: Sink
+		    [fmt:SBGGR10_1X10/800x600 field:none]
+		    <- "ov2680 1-0036":0 [ENABLED]
+	    pad1: Source
+		    [fmt:SBGGR10_1X10/800x600 field:none]
+		    -> "csi_mux":1 [ENABLED]
+
+    - entity 17: ov2680 1-0036 (1 pad, 1 link)
+		type V4L2 subdev subtype Sensor flags 0
+		device node name /dev/v4l-subdev3
+	    pad0: Source
+		    [fmt:SBGGR10_1X10/800x600 field:none]
+		    -> "imx7-mipi-csis.0":0 [ENABLED]
+
+
+References
+----------
+
+.. [#f1] https://www.nxp.com/docs/en/reference-manual/IMX7SRM.pdf
Documentation/media/v4l-drivers/index.rst +1 -0
index 679238e786a7..693295bbc53f 100644
@@ -44,6 +44,7 @@ For more details see the file COPYING in the source distribution of Linux.
 	davinci-vpbe
 	fimc
 	imx
+	imx7
 	ivtv
 	max2175
 	meye
Signature · 1 line
2.17.0
#27 lore raw

PATCH v2 15/15 media: staging/imx: add i.MX7 entries to TODO file

In reply to Rui Miguel Silva

Add some i.MX7 related entries to TODO file.

---
 drivers/staging/media/imx/TODO | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/staging/media/imx/TODO +9 -0
index aeeb15494a49..6f29b5ca5324 100644
@@ -45,3 +45,12 @@
 
      Which means a port must not contain mixed-use endpoints, they
      must all refer to media links between V4L2 subdevices.
+
+- i.MX7: all of the above, since it uses the imx media core
+
+- i.MX7: use Frame Interval Monitor
+
+- i.MX7: runtime testing with parallel sensor, links setup and streaming
+
+- i.MX7: runtime testing with different formats, for the time only 10-bit bayer
+  is tested
Signature · 1 line
2.17.0