Suresh Gupta [Fri, 5 Oct 2018 14:12:52 +0000 (19:42 +0530)]
v4l: xilinx-multi-scaler: Add support for VIDIOC_CREATE_BUFS for Dmabuf io_mode
Gstremer V4L2transform Plugin calls VIDIOC_CREATE_BUFS ioctl
for Dmabuf io_mode followed by VIDIOC_EXPBUF which is used
to export previously created buffer as a DMABUF file.
But VIDIOC_EXPBUF is available only for V4L2_MEMORY_MMAP buffers.
So, enabling VB2_MMAP flags while creating the m2m_buffer queues.
This patch is removing ULITE_NR_PORTS macro which limits number of
ports which can be used. Every instance is registering own struct
uart_driver with minor number which corresponds to alias ID (or 0 now).
and with 1 uart port. The same alias ID is saved to
tty_driver->name_base which is key field for creating ttyULX name.
Because name_base and minor number are setup already there is no need to
setup any port->line number because 0 is the right value.
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
serial-uartlite: Change logic how console_port is setup
Change logic how console_port is setup by using CON_ENABLED flag
instead of index. There will be unique uart_console
structure that's why code can't use id for console_port
assignment.
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
serial-uartlite: define console when CONFIG_SERIAL_UARTLITE_CONSOLE is defined
Define console when CONFIG_SERIAL_UARTLITE_CONSOLE is defined.
The patch removes this warning:
drivers/tty/serial/uartlite.c:64:26: warning: ‘console_port’ defined but
not used [-Wunused-variable]
static struct uart_port *console_port;
^~~~~~~~~~~~
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
serial-uartlite: Do not use static struct uart_driver out of probe()
ulite_uart_suspend()/resume() and remove() are using static reference
to struct uart_driver. Assign this referece to private data structure
as preparation step for dynamic struct uart_driver allocation.
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
staging: xroeframer: IRQ allocation change in probe()
As the IRQ is not yet fully implemented in the hardware, the probe will
return 0 instead of propagating the error returned by attempting to
allocate the IRQ. A TODO to fix that once it's finalised in the hardware
design has been added along with the change.
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Changing the variable that stores the IPv4 destination and source
addresses in IPv4 "show" sysfs entries (sysfs_xroe_framer_ipv4.c) from
variable to fixed length (as it will always be exactly 4 numbers,
barring errors which are already handled and returned to the user).
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
ASoC: xlnx: support multiple sampling rates for I2S
This adds support for I2S playback and capture at various
sampling rates. Various rates can result in different period bytes,
but should be divisible by 64(considering 2 channels).
Added that constraint.
Signed-off-by: Maruthi Srinivas Bayyavarapu <maruthi.srinivas.bayyavarapu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Added clocks. s_axi_lite_aclk will be used and enabled/disabled in
audio formatter driver. aud_mclk will be used in PL sound card driver
to dynamically change the mclk connected to various audio interfaces.
This change adds audio use case at different sampling rates.
Signed-off-by: Maruthi Srinivas Bayyavarapu <maruthi.srinivas.bayyavarapu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Vishal Sagar [Mon, 1 Oct 2018 18:39:57 +0000 (00:09 +0530)]
drm: xlnx: mixer: Fix switching to 4K after 1080p
This patch fixes the issue of switching to higher resolution like 4K
once the primary layer has been set to a lower resolution like 1080p.
This is done by disabling the need to check frame parameters like width,
height if the plane to be set is the primary plane.
staging: xroeframer: fixing stats device size in ioctl address range check
Fixing using RADIO_CTRL_SIZE instead of STATS_SIZE, as well as not subtracting
STATS_BASE from the passed offset in stats_ioctl() in xroe_framer.c.
As it is now, it can (and will) result in R/W request in unmapped memory.
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Dhaval Shah [Mon, 1 Oct 2018 16:27:49 +0000 (09:27 -0700)]
soc: xilinx: vcu: Update vcu init/reset sequence
Updated vcu init/reset sequence as per design changes.
If VCU reset GPIO is available then do assert and de-assert it before
enabling/disabling gasket isolation.
This GPIO is added because gasket isolation will be removed during startup
that requires access to SLCR register space. Post startup, the ownership of
the register interface lies with logiCORE IP
Signed-off-by: Dhaval Shah <dhaval.shah@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Vishal Sagar [Mon, 1 Oct 2018 07:34:11 +0000 (13:04 +0530)]
v4l: xilinx: xcsi2rxss: Add VCX support
Add support for VCX in driver. When VCX is enabled in IP, xlnx,en-vcx
optional dt property must be present in dt node. When VCX is enabled
then maximum number of Virtual channels is 16 otherwise it is 4 as
earlier. This adds a new VCX Frame error bit in the Interrupt Status
Register and Interrupt Enable Register at offset 30. When a frame sync
or level interrupt occurs on virtual channels 4 through 15, this bit is
set and the corresponding error bit is set in a new status register at
offset 0x34. New Image Information registers have been added for these
new virtual channels. The error counts for these are also maintained in
a separate structure vcx_events.
Vishal Sagar [Mon, 1 Oct 2018 07:34:10 +0000 (13:04 +0530)]
dt-bindings: csi2rxss: Enable VCX support
A new optional dt bool property xlnx,en-vcx is now added to the dt node
of the MIPI CSI2 Rx Subsystem. When this is enabled, the maximum number
of virtual channels is 16 else 4.
Derek Kiernan [Mon, 1 Oct 2018 14:48:23 +0000 (15:48 +0100)]
misc: xilinx-sdfec: Update config from hardware
Updates the config from sdfec hardware registers for order, bypass,
interrupt configuration and if the device has been started. These
values can be set in the hardware design when the PL initializes the
device and after a sdfec has been reset.
The updated configuration includes a Code Write Protect value which
replaces wr_protect usage.
There is random kernel paging request failure with imx274 driver.
Enabling KASAN shows stack-out-of-bounds around the register read code.
Analyzing the code further it is found that the memory allocated is
of type u8 whereas the regmap_read expects unsigned int.
This could possibly be trying to write beyond the memory allocated.
Changed the u8 arrays to unsigned int and don't see the paging request
failure anymore.
Signed-off-by: Subhransu S. Prusty <subhransu.sekhar.prusty@xilinx.com> Signed-off-by: Vishal Sagar <vishal.sagar@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Committing sysfs_xroe_framer_udp.c, which creates the "udp" sysfs
directory under "xroe" and contains the UDP related entries for
controlling the framer, such as the source and destination ports.
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arm64: zynqmp: Fix binding of hclk clock (gem nodes)
This patch is required to fix binding of gem interface clocks to
system-level clock IDs that have changed. The gem0 clock IDs are now:
1) Clock ID 45 represents GEM0_TX clock
2) Clock ID 49 represents GEM0_RX clock
3) Clock ID 104 represents GEM0_REF clock
Clock IDs for other gems changed similarly, e.g. for i in {1, 2, 3}
GEMi_TX = GEM0_TX + i, etc. Other clock IDs have not changed.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com> Acked-by: Will Wong <willw@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
dt-bindings: clock: Fix documentation for Xilinx ZynqMP clock driver
Documentation is fixed to reflect recent changes in clock tree:
- Clock ID definitions have changed for gem-related clock IDs
- New clock IDs are defined to distinguish external (E)MIO sources
for gem Tx and Rx clocks
- New clock ID is defined for acpu full clock
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com> Acked-by: Will Wong <willw@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
xilinx: v4l: m2m: Terminate the dma engine before releasing buffers
- When the process involving mem2mem driver was stopped abruptly,
buffers were being returned to videobuf while dmaengines were still
active causing a kernel panic.
- So now we terminate the dmaengines before returning buffers to videobuf.
- This fixes a hang on control-c for below transcode pipeline involving
mem2mem driver where FBread->FBwrite block is managed by mem2mem driver.
- Use more specific mplane macro V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE for checking
the source vb2 buffer queue type as it's type is set as mplane during
queue initialization.
This patch fixes the below gcc warning
drivers/mtd/nand/pl35x_nand.c: In function ‘pl35x_nand_read_page_swecc’:
drivers/mtd/nand/pl35x_nand.c:816:6: warning: variable ‘ret’ set but not
used [-Wunused-but-set-variable]
u32 ret;
^~~
Signed-off-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
When an ECC multi-bit error occurs a corresponding ECC event is also
raised. This correction ensures that the multi-bit error and
corresponding event are clear together. This ensures that the event is
not interpreted as a single-bit error.
Committing sysfs_xroe_framer_ipv6.c, which creates the "ipv6" sysfs
directory under "xroe" and contains the IPv6 related entries for
controlling the framer, such as source and destination addresses,
traffic class, hop limit etc.
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
ASoC: xlnx: Reset S2MM for next channel status update
For the same input stream, after the end of audio capture usecase,
unless S2MM path is reset, next audio capture usecase will not get channel
status update. Added S2MM reset during close callback.
This add AES channel status parsing logic, which provides audio
stream parameter information like channel count, bit depth, sampling
rate. User provided capture parameters will be compared against parsed
parameters to have proper audio capture.
ASoC: xlnx: Move audio interface node names to driver data
Audio interface node names are now required in hw_params() callback,
as AES channel status parsing will be done based on node names (hdmi/sdi).
So, moved them accordingly.
AES parsing logic will be moved to audio formatter driver.
Removed the same from sdi audio driver. Now, instead of waiting
for channel status update (which gives AES bytes for parsing), Rx
startup callback waits for sample rate update status which conveys
valid stream received on SDI extract block.
Extend the interrupts monitored by the driver to include ECC PL
initialization interrupts. Update state to PL_RECONFIGURE if a
multi-bit error is detected in this range.
These interrupts are used only when the SD-FEC block is configured and
have coefficients initialized by the Programmable Logic. If an ECC PL
initialization multi-bit error is detected, the PL must be
re-configured to reload the coefficients.
v4l: xilinx-vpss-scaler: Add check for max width and height
Patch adds support to get maximum width and height from dt property.
If the parameters are not present then the IP sets the max size of
8192x4320. It then uses this value to clamp width and height instead of
fixed default value while setting format.
It also corrects the minimum width and height parameters.
v4l: xilinx-vpss-csc: Add check for max width and height
Patch adds support to get maximum width and height from dt property.
If the parameters are not present then the IP sets the max size of
8192x4320. It then uses this value to clamp width and height instead
of fixed default value while setting format.
It also corrects the minimum width and height parameters.
v4l: xilinx-gamma: Add check for max width and height
Patch adds support to get maximum width and height from device tree
property. If the parameters are not present then the IP sets the
maximum size of 8192x4320. It then uses this value to clamp width
and height instead of fixed max value while setting format.
It also corrects the minimum width and height parameters.
v4l: xilinx-demosaic: Add check for max width and height
Patch adds support to get maximum width and height from device tree
property. If the parameters are not present then the IP sets the
maximum size of 8192x4320. It then uses this value to clamp width
and height instead of fixed default value while setting format.
It also corrects the minimum width and height parameters.
v4l: xilinx: tpg: Add check for max width and height
Patch adds support to get maximum width and height from dt property. If
parameters are not present then the driver sets the max size to
10328x7760. These values are used to clamp width and height while setting
format.
dma: xilinx: Add check for max width and height in Framebuffer Read/Write
Patch adds support to get maximum width and height from device tree
property. If the parameters are not present then the IP sets the
maximum size of 8192x4320. The driver checks the requested width and
height parameters while allocating a dma descriptor with max supported
values.
Andrew Worsley [Thu, 27 Sep 2018 07:06:02 +0000 (12:36 +0530)]
mtd: nand: pl35x: Add ECC checking for ondie nand flash
Check status of the operation and increment the correctable or
uncorrectable error counters which is critical for UBI layer to greatly
improve handling of the errors. In particular it used to trigger migrating
the data to safely off before scrubbing the failing Erase Blocks. Even
uncorrectable errors may often be handled by UBI if it is in a
non-critical page such as Erase Counter header.
Signed-off-by: Andrew Worsley <amworsley@gmail.com> Reviewed-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Andrew Worsley [Thu, 27 Sep 2018 07:06:01 +0000 (12:36 +0530)]
mtd: nand: pl35x: Implement De-select in Chip Select which saves power
nand_select_chip when called with negative chip no.
means we have finished operations on the chip
so we can deselect it. This allows the chip to
enter a lower power state.
Signed-off-by: Andrew Worsley <amworsley@gmail.com> Reviewed-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: fb: Modify check to ensure correctness of flags
This patch also modifies the validation of framebuffer flags in DRM
core framework. This is to ensure that application is setting the
right framebuffer flags.
v4l: dma: Use media graph traversal to stream on/off subdevs
This patch uses media framework specific implementation to parse
all the subdevs in the graph in order to stream on/off.
Depth first search algorithm is employed to traverse the nodes
and leaf node of the graph will stream on/off first and so on.
Case 1:
cam -> mipi -> scaler -> dma
The order of stream on is cam, mipi and scaler.
The order of stream off is cam, mipi and scaler.
Case 2:
cam | | dma
mipi
cam2 | | dma2
The order of stream on is cam, mipi and cam2.
Case 3 (mem2mem):
dma -> scaler -> colconv -> dma2
The order of stream on is colconv, scaler. In mem2mem graph will
traverse same subdevs twice but won't stream-on if it is already
streaming.
Sakari Ailus [Fri, 23 Feb 2018 09:50:14 +0000 (04:50 -0500)]
media: v4l: common: Add a function to obtain best size from a list
Add a function (as well as a helper macro) to obtain the best size in a
list of device specific sizes. This helps writing drivers as well as
aligns interface behaviour across drivers.
The struct in which this information is contained in is typically specific
to the driver, therefore the existing function v4l2_find_nearest_format()
does not address the need.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Sam Bobrowicz <sam@elite-embedded.com>
Hans Verkuil [Fri, 29 Jun 2018 10:12:43 +0000 (06:12 -0400)]
media: v4l2-ctrls.c: fix broken auto cluster handling
When you switch from auto to manual mode for an auto-cluster (e.g.
autogain+gain controls), then the current HW value has to be copied
to the current control value. However, has_changed was never set to
true, so new_to_cur didn't actually copy this value.
Mode setting depends on last mode set, in particular
because of exposure calculation when downscale mode
change between subsampling and scaling.
At stream on the last mode was wrongly set to current mode,
so no change was detected and exposure calculation
was not made, fix this.
media: ov5640: fix auto controls values when switching to manual mode
When switching from auto to manual mode, V4L2 core is calling
g_volatile_ctrl() in manual mode in order to get the manual initial value.
Remove the manual mode check/return to not break this behaviour.
media: ov5640: fix wrong binning value in exposure calculation
ov5640_set_mode_exposure_calc() is checking binning value but
binning value read is buggy, fix this.
Rename ov5640_binning_on() to ov5640_get_binning() as per other
similar functions.
Symptom was black image when capturing HD or 5Mp picture
due to manual exposure set to 1 while it was intended to
set autoexposure to "manual", fix this.
Fixes: bf4a4b518c20 ("media: ov5640: Don't force the auto exposure state at start time"). Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Sam Bobrowicz <sam@elite-embedded.com>
As of: commit 476dec012f4c ("media: ov5640: Add horizontal and vertical
totals") the timings parameters gets programmed separately from the
static register values array.
When changing capture mode, the vertical and horizontal totals gets
inspected by the set_mode_exposure_calc() functions, and only later
programmed with the new values. This means exposure, light banding
filter and shutter gain are calculated using the previous timings, and
are thus not correct.
Fix this by programming timings right after the static register value
table has been sent to the sensor in the ov5640_load_regs() function.
Fixes: 476dec012f4c ("media: ov5640: Add horizontal and vertical totals") Tested-by: Steve Longerbeam <slongerbeam@gmail.com> # i.MX6q SabreSD, CSI-2 Tested-by: Loic Poulain <loic.poulain@linaro.org> # Dragonboard-410c, CSI-2 Signed-off-by: Samuel Bobrowicz <sam@elite-embedded.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Sam Bobrowicz <sam@elite-embedded.com>
Rework the MIPI interface startup sequence with the following changes:
- Remove MIPI bus initialization from the initial settings blob
- At set_power(1) time power up MIPI Tx/Rx and set data and clock lanes in
LP11 during 'sleep' and 'idle' with MIPI clock in non-continuous mode.
- At s_stream time enable/disable the MIPI interface output.
- Restore default settings at set_power(0) time.
Before this commit the sensor MIPI interface was initialized with settings
that require a start/stop sequence at power-up time in order to force lanes
into LP11 state, as they were initialized in LP00 when in 'sleep mode',
which is assumed to be the sensor manual definition for the D-PHY defined
stop mode.
The stream start/stop was performed by enabling disabling clock gating,
and had the side effect to change the lanes sleep mode configuration when
stream was stopped.
Clock gating/ungating:
- ret = ov5640_mod_reg(sensor, OV5640_REG_MIPI_CTRL00, BIT(5),
- on ? 0 : BIT(5));
- if (ret)
Set lanes in LP11 when in 'sleep mode':
- ret = ov5640_write_reg(sensor, OV5640_REG_PAD_OUTPUT00,
- on ? 0x00 : 0x70);
This commit fixes an issue reported by Jagan Teki on i.MX6 platforms that
prevents the host interface from powering up correctly:
https://lkml.org/lkml/2018/6/1/38
It also improves MIPI capture operations stability on my testing platform
where MIPI capture often failed and returned all-purple frames.
Fixes: f22996db44e2 ("media: ov5640: add support of DVP parallel interface") Tested-by: Steve Longerbeam <slongerbeam@gmail.com> (i.MX6q SabreSD, CSI-2) Tested-by: Loic Poulain <loic.poulain@linaro.org> (Dragonboard-410c, CSI-2) Reported-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Sam Bobrowicz <sam@elite-embedded.com>
Hugues Fruchet [Thu, 16 Aug 2018 09:46:53 +0000 (05:46 -0400)]
media: ov5640: fix mode change regression
fixes: 6949d864776e ("media: ov5640: do not change mode if format or frame interval is unchanged").
Symptom was fuzzy image because of JPEG default format
not being changed according to new format selected, fix this.
Init sequence initialises format to YUV422 UYVY but
sensor->fmt initial value was set to JPEG, fix this.
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Sam Bobrowicz <sam@elite-embedded.com>