Rajan Vaja [Thu, 8 Mar 2018 14:15:00 +0000 (06:15 -0800)]
clk: clk-fixed-factor: Use new macro CLK_OF_DECLARE_DRIVER
Fixed factor clock has two initialization at of_clk_init()
time and also during platform driver probe. So declare the
fixed factor clock with CLK_OF_DECLARE_DRIVER instead of
CLK_OF_DECLARE.
Signed-off-by: Rajan Vaja <rajanv@xilinx.com> Suggested-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Kieran Bingham [Wed, 7 Mar 2018 21:13:29 +0000 (13:13 -0800)]
uvcvideo: Prevent new URBs being processed at stream stop
With asynchronous handling of the URBs from the USB Complete handler, we
get a continual stream of packets being received while we are attempting
to shutdown the stream.
Packets that have already been received and processed are on a
work-queue, but during stream shutdown the URBs that those packets
belong to are killed and free'd.
To prevent this race from causing invalid memory accesses, prevent new
URBs from being processed when uvc_stop_streaming() is called by
introducing a new flag "UVC_QUEUE_STOPPING" into the queue, and checking
this when processing the URB to be queued.
With this, we can flush the work queue, and commence a normal pipe
shutdown. Work tasks that are already queued are processed, but the URBs
are prevented from being re-submitted to the USB stack.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Christian Kohn <christian.kohn@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michael Gill [Fri, 9 Mar 2018 02:40:11 +0000 (18:40 -0800)]
staging: apf: Add synchronization for DMA-BUF add/remove
DMA-BUF attachment in the APF driver lacked appropriate locking
guarantees. This patch adds those protections to allow for
concurrent attach/detach calls.
Signed-off-by: Michael Gill <gill@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
(again, manually post-processed to retain some comments)a
Picked change for macb driver only.
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Harini Katakam <harinik@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Alexey Dobriyan [Thu, 8 Mar 2018 12:45:57 +0000 (18:15 +0530)]
lib/vsprintf.c: remove %Z support
Now that %z is standartised in C99 there is no reason to support %Z.
Unlike %L it doesn't even make format strings smaller.
Use BUILD_BUG_ON in a couple ATM drivers.
In case anyone didn't notice lib/vsprintf.o is about half of SLUB which
is in my opinion is quite an achievement. Hopefully this patch inspires
someone else to trim vsprintf.c more.
vishnuvardhan [Thu, 8 Mar 2018 12:45:56 +0000 (18:15 +0530)]
net: macb: Adding Support for Jumbo Frames up to 10240 Bytes in SAMA5D3
As per the SAMA5D3 device specification it supports Jumbo frames.
But the suggested flag and length of bytes it supports was not updated
in this driver config_structure.
The maximum jumbo frames the device supports :
10240 bytes as per the device spec.
While changing the MTU value greater than 1500, it threw error:
sudo ifconfig eth1 mtu 9000
SIOCSIFMTU: Invalid argument
Add this support to driver so that it works as expected and designed.
Signed-off-by: vishnuvardhan <vardhanraj4143@gmail.com>
[nicolas.ferre@microchip.com: modify slightly commit msg] Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Eric Dumazet [Thu, 8 Mar 2018 12:45:55 +0000 (18:15 +0530)]
drivers: net: generalize napi_complete_done()
napi_complete_done() allows to opt-in for gro_flush_timeout,
added back in linux-3.19, commit 3b47d30396ba
("net: gro: add a per device gro flush timer")
This allows for more efficient GRO aggregation without
sacrifying latencies.
Picked up change for macb driver only.
Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Harini Katakam <harinik@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Cyrille Pitchen [Thu, 8 Mar 2018 12:45:54 +0000 (18:15 +0530)]
net: macb: fix the RX queue reset in macb_rx()
On macb only (not gem), when a RX queue corruption was detected from
macb_rx(), the RX queue was reset: during this process the RX ring
buffer descriptor was initialized by macb_init_rx_ring() but we forgot
to also set bp->rx_tail to 0.
Indeed, when processing the received frames, bp->rx_tail provides the
macb driver with the index in the RX ring buffer of the next buffer to
process. So when the whole ring buffer is reset we must also reset
bp->rx_tail so the driver is synchronized again with the hardware.
Since macb_init_rx_ring() is called from many locations, currently from
macb_rx() and macb_init_rings(), we'd rather add the "bp->rx_tail = 0;"
line inside macb_init_rx_ring() than add the very same line after each
call of this function.
Without this fix, the rx queue is not reset properly to recover from
queue corruption and connection drop may occur.
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Fixes: 9ba723b081a2 ("net: macb: remove BUG_ON() and reset the queue to handle RX errors") Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Tobias Klauser [Thu, 8 Mar 2018 12:45:53 +0000 (18:15 +0530)]
net: macb: Use net_device_stats from struct net_device
Instead of using a private copy of struct net_device_stats in struct
macb, use stats from struct net_device.
Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Zach Brown [Thu, 8 Mar 2018 12:45:51 +0000 (18:15 +0530)]
net: macb: Add ethtool get_ringparam and set_ringparam functionality
Some applications want to tune the size of the macb rx/tx ring buffers.
The ethtool set_ringparam function is the standard way of doing it.
Signed-off-by: Zach Brown <zach.brown@ni.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Rafal Ozieblo [Thu, 8 Mar 2018 12:45:50 +0000 (18:15 +0530)]
cadence: Add LSO support.
New Cadence GEM hardware support Large Segment Offload (LSO):
TCP segmentation offload (TSO) as well as UDP fragmentation
offload (UFO). Support for those features was added to the driver.
Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
dmaengine: xilinx: dma: Program hardware supported buffer length
AXI-DMA IP supports configurable (c_sg_length_width) buffer length
register width, hence read buffer length (xlnx,sg-length-width) DT
property and ensure that driver doesn't program buffer length
exceeding the supported limit. For VDMA and CDMA there is no change.
Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Buffer length is an optional DMA node property. DMA driver will
uses this property to ensure that programmed DMA length doesn't
exceed IP supported buffer length(c_sg_length_width).
Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Rajan Vaja [Thu, 8 Mar 2018 06:00:25 +0000 (22:00 -0800)]
dt-bindings: clock: zynqmp: Correct clock names
Some clocks names were intentionally kept incorrect to
match with Linux clock names for backward compatibility.
As now, clock is complete new driver, this is not required
so use proper names for the clocks.
Signed-off-by: Rajan Vaja <rajanv@xilinx.com> Acked-by: Jolly Shah <jollys@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: dwc3: otg: don't clear event buffers when changing to Host mode from Device mode
Clearing event buffers when changing from Device mode -> Host mode
may require allocating event buffers again during role swap from
Host mode -> Device mode. Changing the event buffers at runtime are
not triggering events in device mode and also the role swap can happen
at any time. So, better not to clear the event buffers during role
swap instead reuse the previously allocated event buffers.
This patch does the same.
Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
In current implementation there is a bug where min_bpl value
is not satisfying dma alignment. This patch will fix the issue
by aligning the value properly.
Jeffrey Mouroux [Wed, 7 Mar 2018 01:49:39 +0000 (17:49 -0800)]
media: v4l2-core: Update V4L2 framework with new fourcc codes
New fourcc codes have been added to support additional video
memory layout supported by Xilinx Video IP. These have been
added to the V4L2 framework with this patch.
Harini Katakam [Tue, 6 Mar 2018 08:40:44 +0000 (14:10 +0530)]
net: macb: Remove unnecessary DBW read back from NWCFG
The data bus width field is already set based on MAC capability
using macb_dbw function. Remove this unnecessary read back of that
field which might interfere with the correct implementation.
Signed-off-by: Harini Katakam <harinik@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Harini Katakam [Tue, 6 Mar 2018 08:40:41 +0000 (14:10 +0530)]
net: macb: Add phy suspend and resume
Add phy suspend and resume in macb suspend/resume paths because this
will put the phy in a clean power down state and bring it back up
during resume. Without this, the link will not come back up properly
and communication will be erratic/packets will be lost.
This is generic and is applicable to all PHYs.
Signed-off-by: Harini Katakam <harinik@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Harini Katakam [Mon, 5 Mar 2018 13:54:36 +0000 (19:24 +0530)]
net: xilinx: axiethernet: Add USXGMII support
This patch adds support for USXGMII IP in axiethernet driver.
This IP has a MAC similar to 10G/25G IP and supports USXGMII phy protocol.
USXGMII phy supports speeds from 10Mbps to 10Gbps. Only one phy speed
can be advertised at a time and this choice is obtained from the user
via a devicetree property. This patch was tested at 1G and 2.5G speeds.
Since the MAC functionality is similar to 10G/25G, the same mac type is
used in the config structure. USXGMII IP requires a GT reset and this is
added to axienet_device_reset with a check based on mac type.
net: emaclite: Use __func__ instead of hardcoded name
Switch hardcoded function name with a reference to __func__ making
the code more maintainable. Address below checkpatch warning:
WARNING: Prefer using '"%s...", __func__' to using 'xemaclite_mdio_read',
this function's name, in a string
+ "xemaclite_mdio_read(phy_id=%i, reg=%x) == %x\n",
WARNING: Prefer using '"%s...", __func__' to using 'xemaclite_mdio_write',
this function's name, in a string
+ "xemaclite_mdio_write(phy_id=%i, reg=%x, val=%x)\n"
Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
XHCI controller may not properly send LFPS.U3_EXIT signalling after
resuming from suspend(D3->D0). To avoid this, lets wait for atleast
1ms after updating the PORTSC_30.PLS to enter U0 from U3. This patch
does the same.
Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
vdmatest: xilinx: Fix VDMA hang reported in certain resolutions
Avoid enabling circular_park mode for S2MM as it might happen that engine
continuously circles through frame buffers w/o being programmed and lead
to an undesired hang. In loopback it is recommended to use same park mode
configuration for both channels.
Saurabh Sengar [Thu, 1 Mar 2018 09:02:02 +0000 (14:32 +0530)]
drm: xlnx: mixer: Adding mixer 3.0 IP support
Adding mixer 3.0 IP support, this adds one extra overlay layer
ie 8th layer.
Also the logo enable bit is moved to 15th from 8, as 8th bit is
now for 8th newly added layer
fpga: zynqmp: sync driver with xilfpga library enhancements
From 4.0 xilfpga library version onwards it's not required
to strip the Headers for Both Secure and Non-Secure
Bitstream Images created by bootgen.The entry point
interface inside the xilfpga library is changed as follows.
u32 XFpga_PL_BitSream_Load (UINTPTR WrAddr,
UINTPTR KeyAddr, u32 flags);
So the user need not to pass the Size and IV info to the FW.
The FW will collect those parameters from the Image Headers.
Old bootgen command:
bootgen -image bistream.bif -arch ZynqMP -process_bitstream bin
(stripping the Headers).
New bootgen command(2018.1 bootgen):
bootgen -image bitstream.bif -arch zynqmp -o Bitstream.bin
(Without stripping the Headers).
These xilfpga changes are included in PMUFW 1.0 which is required for
running the kernel anyway.
Signed-off-by: Nava kishore Manne <navam@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Jeffrey Mouroux [Fri, 23 Feb 2018 19:15:11 +0000 (11:15 -0800)]
dma: xilinx: Update Framebuffer Driver with support for new 8-bit/10-bit formats
New DRM and V4L2 fourcc codes have been added to the driver
table. Some of these codes are novel and not yet fully
reviewed nor accepted by the respective communities.
Rohit Athavale [Fri, 23 Feb 2018 19:15:09 +0000 (11:15 -0800)]
v4l: xilinx-vpss-csc: Support for any-to-any color space converison
With this commit the driver supports RGB, YUV 444, YUV 422 and
YUV 420 media bus formats. This commit also updates the VPSS CSC
color controls for any-to-any conversion. VPSS CSC requires
coefficients to be brought into an RGB style of coefficients
before color controls can be applied and thus shadow coefficients
are used to track the color controls.
This commit extracts the color depth information from the
DT and uses it configuring the clip max and contrast. This
commit also allows the user to specify 8-bit or 10-bit color
depth via the DT.
Rohit Athavale [Fri, 23 Feb 2018 19:15:03 +0000 (11:15 -0800)]
v4l: xilinx-demosaic: Remove Output Video format register
Remove the redundant register for output video format as the Video
Sensor Demosaic IP can only support output video with RGB format.
Also some typos in logging messages are fixed in this commit.
Rajan Vaja [Wed, 28 Feb 2018 18:38:01 +0000 (10:38 -0800)]
firmware: zynqmp: Add sysfs to set shutdown scope
The Linux shutdown functionality implemented via PSCI system_off does
not include an option to set a scope, i.e. which parts of the system to
shut down.
This patch creates sysfs that allows to set the shutdown scope for the
next shutdown request. When the next shutdown is performed, the platform
specific portion of PSCI-system_off can use the chosen shutdown scope.
Signed-off-by: Rajan Vaja <rajanv@xilinx.com> Signed-off-by: Stefan Krsmanovic <stefan.krsmanovic@aggios.com> Acked-by: Will Wong <willw@xilinx.com> Acked-by: Jolly Shah <jollys@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Rajan Vaja [Sat, 24 Feb 2018 14:02:53 +0000 (06:02 -0800)]
clk: zynqmp: Allow zero divisor value
Zero divider is valid and default for some of ZynqMP
clocks. Allow zero divisor when CLK_DIVIDER_ALLOW_ZERO
for the clock is set.
Signed-off-by: Rajan Vaja <rajanv@xilinx.com> Acked-by: Jolly Shah <jollys@xilinx.com> Reviewed-by: Shubhrajyoti Datta <shubhraj@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
v4l: xilinx: dma: Add scaling and padding factor functions
scaling_factor function returns multiplying factor to calculate
bytes per component based on color format.
For eg. scaling factor of YUV420 8 bit format is 1
so multiplying factor is 1 (8/8)
scaling factor of YUV420 10 bit format is 1.25 (10/8)
padding_factor function returns multiplying factor to calculate
actual width of video according to color format.
For eg. padding factor of YUV420 8 bit format: 8 bits per 1 component
no padding bits here, so multiplying factor is 1
padding factor of YUV422 10 bit format: 32 bits per 3 components
each component is 10 bit and the factor is 32/30
Devarsh Thakkar [Tue, 27 Feb 2018 23:34:55 +0000 (15:34 -0800)]
v4l: xilinx: dma: Fix v4l2 enumeration callback for multiplanar
This fixes issues with v4l2 enumeration callback with multiplanar
formats due to which supported multiplanar formats were not getting
enumerated when using VIDEO_ENUM_FMT ioctl.
The intention of existing implementation for multiplanar formats was
to save in array and return the subset of all the v4l2 formats
supported by attached dma device and the supported media bus format
and also cache the supported media bus format so that for future calls
if same media bus format is called then the v4l2 pixel formats can be
directly returned from the entries saved in the array.
This is acheived now with below changes :
a. Use V4L2 subdev helper functions to query supported media bus
format code.
b. Cache the media bus format also for the condition when it is empty
along with whenever new media bus format is detected.
c. Fix NULL pointer deference error by dynamically allocating
memory for poss_v4l2_fmts.
The current v4l driver supports single plane formats. This patch
will add support to handle multi-planar formats. Updated driver
capabilities to multi-planar, where it can handle both single and
multi-planar formats
Jeffrey Mouroux [Tue, 27 Feb 2018 23:34:52 +0000 (15:34 -0800)]
uapi: media: New fourcc codes needed by Xilinx Video IP
The Xilinx Video Framebuffer DMA IP supports video memory formats
that are not represented in the current V4L2 fourcc library. This
patch adds those missing fourcc codes. This includes both new
8-bit and 10-bit pixel formats.
Rohit Athavale [Tue, 27 Feb 2018 23:34:50 +0000 (15:34 -0800)]
media-bus: uapi: Add YCrCb 420 media bus format
This commit adds a YUV 420 media bus format. Currently, one
doesn't exist. VYYUYY8_1X24 does not describe the way the pixels are
sent over the bus, but is an approximation.
Rohit Athavale [Tue, 27 Feb 2018 23:34:49 +0000 (15:34 -0800)]
media: Add new dt-bindings/vf_codes for supported formats
This commit adds new entries to the exisiting vf_codes that are used
to describe the media bus formats in the DT bindings. The newly added
8-bit and 10-bit color depth related formats will need these updates.
Saurabh Sengar [Tue, 27 Feb 2018 06:06:46 +0000 (11:36 +0530)]
drm: xlnx: pl_disp: Adding semi planar support
Adding semi planar color format support in pl_disp for color aware dma.
Framebuffer driver requires chroma buffer address for semi-planar color
format. As we dont have any separate API call in dmaengine for passing
chroma buffer, we calculate the offset from chroma buffer to luma buffer
and pass it in src_icg along with xt. In framebuffer driver chroma buffer
is calculated based on this offset from luma buffer address.
Rajan Vaja [Mon, 26 Feb 2018 10:19:26 +0000 (02:19 -0800)]
clk: zynqmp: Fix reserved parent comparision
When there is any reserved parent in between parents,
firmware sends DUMMY_PARENT(-2). As all other parent
IDs are unsigned, this needs to be type casted to
unsigned before comparison.
Signed-off-by: Rajan Vaja <rajanv@xilinx.com> Reviewed-by: Shubhrajyoti Datta <shubhraj@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This pincontrol binding ("zynqmp-pm") has been replaced
with new binding ("zynqmp-power"). So remove deperecated
binding. Driver would give an error message in case old
binding is used.
Signed-off-by: Rajan Vaja <rajanv@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>