To elaborate a little bit:
1. OV5640 has an internal JPEG encoder and it can output the data over DVP/MIPI in different ways (see attachment). Some modes output a fixed size frame with "emulated" lines, others output a single line, and depending on the mode the frame can be padded with dummy data to make it appear fixed size.
2. Looking at IMX6ULLRM, it seems that the End of Frame Interrupt can only be generated based on the pixel/byte count:

Based on this, I think the only way to receive JPEG data from the sensor is to use one of the "emulated" modes where the sensor sends something that looks like a normal, fixed-size frame (RGB888 or Bayer), and then unpack the data in software? Am I correct? Can I program the emulated frame size on the sensor, and then set the same frame size on the CPU?
Another reason I asked is because I would appreciate code examples - looking at the kernel sources (mxc_v4l2_capture.c from Variscite sources) it seems that the MXC V4L2 driver doesn't support JPEG natively, so I suspect some custom driver work might be needed?
static inline int valid_mode(u32 palette)
{
return ((palette == V4L2_PIX_FMT_RGB565) ||
(palette == V4L2_PIX_FMT_BGR24) ||
(palette == V4L2_PIX_FMT_RGB24) ||
(palette == V4L2_PIX_FMT_BGR32) ||
(palette == V4L2_PIX_FMT_RGB32) ||
(palette == V4L2_PIX_FMT_YUV422P) ||
(palette == V4L2_PIX_FMT_UYVY) ||
(palette == V4L2_PIX_FMT_YUYV) ||
(palette == V4L2_PIX_FMT_YUV420) ||
(palette == V4L2_PIX_FMT_YVU420) ||
(palette == V4L2_PIX_FMT_NV12));
}
Notably missing from the list is V4L2_PIX_FMT_JPEG.