]> rtime.felk.cvut.cz Git - zynq/linux.git/log
zynq/linux.git
5 years agov4l: xilinx: scd: Request IRQ after completing initialization
Laurent Pinchart [Wed, 3 Apr 2019 20:01:52 +0000 (13:01 -0700)]
v4l: xilinx: scd: Request IRQ after completing initialization

IRQs can be triggered as soon as they're requested. To ensure a valid
state in the IRQ handler, make sure to request the IRQ after
initializing all components.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Store channel registers address in iomem field
Laurent Pinchart [Wed, 3 Apr 2019 20:01:51 +0000 (13:01 -0700)]
v4l: xilinx: scd: Store channel registers address in iomem field

Store the channel registers address instead of the base offset in the
iomem field of the channel structures. This allows accessing the channel
registers without having to compute the offset each time.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Allocate pads array statically
Laurent Pinchart [Wed, 3 Apr 2019 20:01:50 +0000 (13:01 -0700)]
v4l: xilinx: scd: Allocate pads array statically

Allocating the pads array dynamically doesn't save much memory, if at
all, due to the extra data needed to track the devm allocation, compared
to embedding an array of two pads in the xscd_device structure. Replace
the dynamic allocation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Refactor the xscd_device structure
Laurent Pinchart [Wed, 3 Apr 2019 20:01:49 +0000 (13:01 -0700)]
v4l: xilinx: scd: Refactor the xscd_device structure

Reorder fields to group them by category (system resources,
configuration V4L2 channels, DMA channels), squash the xscd_shared_data
structure with xscd_device and remove duplicated fields.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Compile all SCD source files in a single module
Laurent Pinchart [Wed, 3 Apr 2019 20:01:48 +0000 (13:01 -0700)]
v4l: xilinx: scd: Compile all SCD source files in a single module

The files xilinx-scenechange.c, xilinx-scenechange-dma.c and
xilinx-scenechange-channel.c are part of the same driver. Compile them
as a single module.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Merge the main and DMA IRQ handlers
Laurent Pinchart [Wed, 3 Apr 2019 20:01:47 +0000 (13:01 -0700)]
v4l: xilinx: scd: Merge the main and DMA IRQ handlers

Both the main SCD driver and the DMA support code register an IRQ
handler, for the same IRQ. This is unnecessary, we can just call the DMA
IRQ handling function from the main IRQ handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Cleanup the DMA engine at remove() time
Laurent Pinchart [Thu, 4 Apr 2019 11:32:54 +0000 (14:32 +0300)]
v4l: xilinx: scd: Cleanup the DMA engine at remove() time

The resources allocated by the xscd_dma_init() function are never
released. Add a new xscd_dma_cleanup() function to handle the cleanup
and call it at driver remove() time.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Merge the DMA support in the main SCD driver
Laurent Pinchart [Wed, 3 Apr 2019 20:01:46 +0000 (13:01 -0700)]
v4l: xilinx: scd: Merge the DMA support in the main SCD driver

There's no need to create a separate platform_driver and platform_device
for the DMA support. Merge the xscd_dma_device structure into the
xscd_device. This allows removing duplicating fields, as well as
unneeded code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Merge the main and V4L2 IRQ handlers
Laurent Pinchart [Wed, 3 Apr 2019 20:01:45 +0000 (13:01 -0700)]
v4l: xilinx: scd: Merge the main and V4L2 IRQ handlers

Both the main SCD driver and the V4L2 support code register an IRQ
handler, for the same IRQ. This is unnecessary, we can just call the
V4L2 IRQ handling function from the main IRQ handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Merge the V4L2 support in the main SCD driver
Laurent Pinchart [Wed, 3 Apr 2019 20:01:44 +0000 (13:01 -0700)]
v4l: xilinx: scd: Merge the V4L2 support in the main SCD driver

There's no need to create a separate platform_driver and platform_device
for the V4L2 support. Call the xilinx-scenechange-channel initialization
function directly from the main driver. This allows removing duplicating
fields, as well as unneeded code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Reorder structure definitions
Laurent Pinchart [Wed, 3 Apr 2019 20:01:43 +0000 (13:01 -0700)]
v4l: xilinx: scd: Reorder structure definitions

This will make it easier to refactor them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Make local functions static
Laurent Pinchart [Wed, 3 Apr 2019 20:01:42 +0000 (13:01 -0700)]
v4l: xilinx: scd: Make local functions static

Several of the xscd_dma_* functions are only used in their compilation
unit. Make them static and remove their declaration from the common
header.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Consolidate structure definitions
Laurent Pinchart [Wed, 3 Apr 2019 20:01:41 +0000 (13:01 -0700)]
v4l: xilinx: scd: Consolidate structure definitions

Move all driver data structures to the xilinx-scenechange.h header. Turn
the cast macros into static inline function and rename them all to
to_<struct name> for consistency.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Consolidate register definitions
Laurent Pinchart [Wed, 3 Apr 2019 20:01:40 +0000 (13:01 -0700)]
v4l: xilinx: scd: Consolidate register definitions

Move all macros defining register offsets and bits to the
xilinx-scenechange.h header, shared between the three source files that
deal with the SCD.

Rename the XSCD_COLOR_FMT_* macros to XSCD_VID_FMT_*, in order to match
the correspongin register name.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: vipp: Support entity matching on DT subnodes
Laurent Pinchart [Wed, 3 Apr 2019 20:01:39 +0000 (13:01 -0700)]
v4l: xilinx: vipp: Support entity matching on DT subnodes

When the video IP pipeline is parsed in DT, the composite device stores
all entities found in the graph, along with their corresponding DT node.
Later on the DT nodes pointers are used to locate the corresponding V4L2
subdevs by matching them against subdev->dev->of_node.

This mechanism works fine for devices that register a single subdev. For
devices that register multiple subdevs, subdev->dev->of_node points to
the DT node of the device, while the entities parsed from the pipeline
point to child nodes of the device DT node.

The v4l2_subdev structure has a fwnode field that is set to point to the
fwnode corresponding to the device DT node. Drivers that register
multiple subdevs must set the fwnode field manually to the associated
child node of the device DT node. We can thus fix this issue by locating
V4L2 subdevs for an entity based on the subdev fwnode instead of the
dev->of_node.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agofpga: zynqmp-fpga: Fix broken secure bitstream loading use cases
Nava kishore Manne [Wed, 3 Apr 2019 08:01:11 +0000 (13:31 +0530)]
fpga: zynqmp-fpga: Fix broken secure bitstream loading use cases

Device-tree overlay flow the below secure use cases got
broken with 4.19
-Encrypted Bitstream loading
-Authenticated Bitstream loading.
-Authenticated and Encrypted Bitstream loading.

Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoASoC: xlnx: change HDMI audio mclk
Maruthi Srinivas Bayyavarapu [Mon, 1 Apr 2019 17:50:07 +0000 (10:50 -0700)]
ASoC: xlnx: change HDMI audio mclk

audio mclk depends on the ACR IP being used. Multiplier value is changed
in updated version of ACR IP. Updated the same in driver.

Signed-off-by: Maruthi Srinivas Bayyavarapu <maruthi.srinivas.bayyavarapu@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: sdirxss: Fix the media bus formats to 10bpc type
Vishal Sagar [Tue, 2 Apr 2019 10:13:08 +0000 (03:13 -0700)]
v4l: xilinx: sdirxss: Fix the media bus formats to 10bpc type

With commit id 563e888fca45a978e4c29b2f5ec5a8a95af60e68, xyavta now
fails to start stream as the media bus format requested is
MEDIA_BUS_FMT_UYVY10_1x20 but the SDI Rx subdev returned media bus
format is MEDIA_BUS_FMT_UYVY8_1x16.

Fix this by updating the driver for correct media bus formats for YUV
422 and 420 10bpc i.e. MEDIA_BUS_FMT_UYVY10_1X20 and
MEDIA_BUS_FMT_VYYUYY10_4X20.

Signed-off-by: Vishal Sagar <vishal.sagar@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agodt-bindings: power: Add versal power domain bindings
Rajan Vaja [Tue, 2 Apr 2019 17:12:50 +0000 (10:12 -0700)]
dt-bindings: power: Add versal power domain bindings

Define Versal power domain value macros for RTC and ADMA.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agov4l: xilinx: tpg: Dynamically modify TPG output format
Vishal Sagar [Fri, 29 Mar 2019 06:23:20 +0000 (23:23 -0700)]
v4l: xilinx: tpg: Dynamically modify TPG output format

The TPG output format was fixed based on the device tree. This patch now
allows the TPG output format to be configured at runtime. This is valid
only for the HLS version of TPG.

Signed-off-by: Vishal Sagar <vishal.sagar@xilinx.com>
Tested-by: Rohan Dhaval Parikh <rohanp@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agousb: dwc3: Coding style syncs with mainline
Anurag Kumar Vulisha [Wed, 3 Apr 2019 08:00:42 +0000 (08:00 +0000)]
usb: dwc3: Coding style syncs with mainline

The patch fixes trivial code changes in the dwc3 driver done in
mainline.

Signed-off-by: Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoreset: reset-zynqmp: Defer probe if firmware is not ready
Michal Simek [Mon, 1 Apr 2019 10:33:48 +0000 (12:33 +0200)]
reset: reset-zynqmp: Defer probe if firmware is not ready

This patch is the part of mainline patch:
"drivers: Defer probe if firmware is not ready"
https://lkml.org/lkml/2019/3/4/1027

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoRevert "spi: Increase the spi time out"
Michal Simek [Mon, 1 Apr 2019 10:38:01 +0000 (12:38 +0200)]
Revert "spi: Increase the spi time out"

This reverts commit 4b988333b9f18aa128b8441dcc02c889c8f123fc.
This patch is not needed for regular platforms what's why revert it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agodt-bindings: remoteproc: zynqmp-r5: correct dts example
Wendy Liang [Fri, 29 Mar 2019 16:45:29 +0000 (09:45 -0700)]
dt-bindings: remoteproc: zynqmp-r5: correct dts example

* Correct ZynqMP r5 remoteproc device node example bindings to
remove the old sram, power domain nodes, and add new reserved memory
nodes.
* Fix the remoteproc device node compatible string to match the driver
* Use the mailbox to match the OpenAMP usecase

Signed-off-by: Wendy Liang <wendy.liang@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoarm64: config: Sync location of XILINX_AFI_FPGA in defconfig
Michal Simek [Sun, 31 Mar 2019 07:57:21 +0000 (09:57 +0200)]
arm64: config: Sync location of XILINX_AFI_FPGA in defconfig

Trivial patch.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoreset: zynqmp: Removed ZYNQMP_RESET_CONTROLLER config entry
Sai Krishna Potthuri [Sat, 30 Mar 2019 18:16:32 +0000 (23:46 +0530)]
reset: zynqmp: Removed ZYNQMP_RESET_CONTROLLER config entry

This patch removes config entry for ZYNQMP_RESET_CONTROLLER since
below commit updates makefile to build zynqmp reset driver for
ZYNQMP platform.

'19325a233ba7 ("reset: reset-zynqmp: Makefile update")'

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoarm64: config: Removed CONFIG_ZYNQMP_RESET_CONTROLLER entry
Sai Krishna Potthuri [Sat, 30 Mar 2019 18:16:33 +0000 (23:46 +0530)]
arm64: config: Removed CONFIG_ZYNQMP_RESET_CONTROLLER entry

This patch removes CONFIG_ZYNQMP_RESET_CONTROLLER entry from
xilinx_zynqmp_defconfig file since zynqmp reset driver will
build for ZYNQMP platform by default.

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoreset: reset-zynqmp: Removed license text
Sai Krishna Potthuri [Sat, 30 Mar 2019 18:16:31 +0000 (23:46 +0530)]
reset: reset-zynqmp: Removed license text

This patch removes license text and sync year with mainline.

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agonet: xilinx: axiethernet: Fix crash in ifconfig down
Radhey Shyam Pandey [Fri, 29 Mar 2019 12:07:41 +0000 (17:37 +0530)]
net: xilinx: axiethernet: Fix crash in ifconfig down

In axidma(allow un-aligned transfers) designs, axienet_dma_q structure
tx_bufs pointer is not explicitly initialized to NULL so freeing it in
.ndo_stop may result in a kernel crash. To fix it allocate axienet_dma_q
structure memory using kzalloc. This fixes below crash in vcu118 design.

root@xilinx-vcu118-2019_1:~# ifconfig eth0 down
Oops: kernel access of bad area, sig: 11
CPU: 0 PID: 390 Comm: ifconfig Not tainted 4.19.0 #47
 Registers dump: mode=AEBEBBD0
 r1=00000001, r2=00000000, r3=00000694, r4=00000000
 r5=C05A1000, r6=00400000, r7=5A5A5A5A, r8=5A5A5A5A
 r9=00000000, r10=C05BE118, r11=00000000, r12=00000040
 r13=00000000, r14=C008F920, r15=C030A178, r16=00000000
 r17=C0006A88, r18=FFFFFFCF, r19=5A5A5A5A, r20=48296FF4
 r21=48115B20, r22=5A9A5A5A, r23=EE84120C, r24=EE84120C
 r25=00000001, r26=00000000, r27=EE9B8900, r28=EEB11000
 r29=00000000, r30=00000001, r31=EEB7F800, rPC=C0006A88
 msr=800046A6, ear=00000694, esr=000008B2, fsr=00000000
Segmentation fault

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Acked-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agogpio: zynq: Disable the irq if it is not a wakeup source
Shubhrajyoti Datta [Fri, 29 Mar 2019 06:34:46 +0000 (12:04 +0530)]
gpio: zynq: Disable the irq if it is not a wakeup source

If gpio is not set to wake disable the interrupt. ATF set all slaves with
enabled interrupts as wakeup sources and if gpio is used in r5 then it
wakes up linux.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agonet: can: xilinx_can: Fix the data updation logic for CANFD FD frames
Appana Durga Kedareswara rao [Sat, 30 Mar 2019 08:20:11 +0000 (13:50 +0530)]
net: can: xilinx_can: Fix the data updation logic for CANFD FD frames

commit fc8c67368936 ("net: can: xilinx_can: Add support for CANFD
 FD frames") is writing data to a wrong offset for FD frames.

This patch fixes this issue.

Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Reviewed-by: Shubhrajyoti Datta <Shubhrajyoti.datta@xilinx.com>
Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agonet: can: xilinx_can: Fix FSR register handling in the rx path
Appana Durga Kedareswara rao [Sat, 30 Mar 2019 08:20:10 +0000 (13:50 +0530)]
net: can: xilinx_can: Fix FSR register handling in the rx path

After commit fc8c67368936 ("net: can: xilinx_can: Add support for
 CANFD FD frames") driver is updating the FSR IRI index multiple
times(i.e in xcanfd_rx() and xcan_rx_fifo_get_next_frame()),
It should be updated once per rx packet this patch fixes this issue,
also this patch removes the unnecessary fsr register checks in
xcanfd_rx() API.

Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Reviewed-by: Shubhrajyoti Datta <Shubhrajyoti.datta@xilinx.com>
Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agodrm: xlnx: zynqmp_disp: Skip the modeset for same fb
Hyun Kwon [Fri, 29 Mar 2019 05:22:00 +0000 (22:22 -0700)]
drm: xlnx: zynqmp_disp: Skip the modeset for same fb

Since the async update creates a separate atomic mode set, there can be
back to back atomic modeset with same fb. If the mode set is applied
twice, it ends up submitting 2 dma transactions, and it results in
jitter. This fixes it by adding the check in plane atomic update,
and using plane mode set in async update.

Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
Tested-by: Preetesh Parekh <preetesh.parekh@xilinx.com>
5 years agov4l: xilinx: m2m: Use crop parameters set on output port
Satish Kumar Nagireddy [Thu, 28 Mar 2019 23:29:50 +0000 (16:29 -0700)]
v4l: xilinx: m2m: Use crop parameters set on output port

This patch uses the crop rectangle parameters set on output port,
and prepare the dma descriptor accordingly.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: m2m: Add S_SELECTION and G_SELECTION ioctls
Satish Kumar Nagireddy [Thu, 28 Mar 2019 23:29:49 +0000 (16:29 -0700)]
v4l: xilinx: m2m: Add S_SELECTION and G_SELECTION ioctls

This patch implements S_SELECTION and G_SELECTION ioctls in driver. This
enables applications to pass crop rectangle parameters to driver.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agov4l: xilinx: scd: Use correct threshold value
Satish Kumar Nagireddy [Thu, 28 Mar 2019 01:03:31 +0000 (18:03 -0700)]
v4l: xilinx: scd: Use correct threshold value

The driver is using threshold value as 1 and it is 0.5 according to the
specification. This patch uses the right threshold value.

Reference (page 21):
https://www.xilinx.com/support/documentation/ip_documentation/v_scenechange/v1_0/pg322-v-scenechange-detect.pdf

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
5 years agoclk: zynqmp: Warn user if clock user are more than allowed
Rajan Vaja [Fri, 29 Mar 2019 05:46:49 +0000 (22:46 -0700)]
clk: zynqmp: Warn user if clock user are more than allowed

Warn user if clock is used by more than allowed devices.
This check is done by firmware and returns respective
error code. Upon receiving error code for excessive user,
warn user for the same.

This change is done to restrict VPLL use count. It is
assumed that VPLL is used by one user only.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agomtd: devices: m25p80: sync driver with mainline v4.19
Naga Sureshkumar Relli [Fri, 29 Mar 2019 09:15:14 +0000 (14:45 +0530)]
mtd: devices: m25p80: sync driver with mainline v4.19

This patch syncs the driver with mainline 4.19 m25p80.c.
Below is the commit from mainline
9882b53 mtd: m25p80: Use SPI_MEM_OP_NO_DUMMY instead of
     SPI_MEM_OP_DUMMY(0, x)

Signed-off-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agostaging: fclk: Add sysfs entry for set_rate
Shubhrajyoti Datta [Tue, 12 Mar 2019 09:32:12 +0000 (15:02 +0530)]
staging: fclk: Add sysfs entry for set_rate

This is a temporary hack for setting the rate.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoreset: reset-zynqmp: License fix and copyright update
Sai Krishna Potthuri [Fri, 29 Mar 2019 08:30:38 +0000 (14:00 +0530)]
reset: reset-zynqmp: License fix and copyright update

This patch updates the copyright year and license fix for
zynqmp reset driver.

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoreset: reset-zynqmp: Makefile update
Sai Krishna Potthuri [Fri, 29 Mar 2019 08:30:37 +0000 (14:00 +0530)]
reset: reset-zynqmp: Makefile update

This patch updates makefile to build zynqmp reset driver for
ZYNQMP platform irrespective of reset driver selection.

62f0d7d reset: reset-zynqmp: Adding support for Xilinx zynqmp reset controller.

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoreset: reset-zynqmp: Move eemi_ops inside zynqmp_reset_data struct
Sai Krishna Potthuri [Fri, 29 Mar 2019 08:30:36 +0000 (14:00 +0530)]
reset: reset-zynqmp: Move eemi_ops inside zynqmp_reset_data struct

This patch move eemi_ops into priv struct zynqmp_reset_data.
Updated all the functions to get the priv struct and use the eemi_ops
structure present inside priv struct.

62f0d7d reset: reset-zynqmp: Adding support for Xilinx zynqmp reset controller.

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoreset: reset-zynqmp: Sync Reset Id macro with Mainline
Sai Krishna Potthuri [Fri, 29 Mar 2019 08:30:35 +0000 (14:00 +0530)]
reset: reset-zynqmp: Sync Reset Id macro with Mainline

Reset Start and End Macro values are updated as part of below
commit Id.
bc3843d firmware: xilinx: Add reset API's
Hence updated the driver in using the start and end macro values.

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoserial: uartlite: fix null dereference on probe error path
Alexandru Ardelean [Thu, 28 Mar 2019 12:25:36 +0000 (14:25 +0200)]
serial: uartlite: fix null dereference on probe error path

The `pdata->ulite_uart_driver` is assigned last in the probe function. So,
when un-registering the serial device on the error path this causes a
null dereference and a crash.

This fixes that by passing the initialized `ulite_uart_driver` pointer.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoclk: zynqmp: Fix divider calculation
Rajan Vaja [Thu, 28 Mar 2019 13:05:56 +0000 (06:05 -0700)]
clk: zynqmp: Fix divider calculation

Linux doesn't know maximum value of divisor that it can support.
zynqmp_clk_divider_round_rate() returns actual divider value
after calculating from parent rate and desired rate, even though
that rate is not supported by single divider of hardware. It is
also possible that such divisor value can be achieved through 2
different dividers. As, Linux tries to set such divisor value(out
of range) in single divider set divider is getting failed.

Fix the same by computing best possible combination of two
divisors which provides more accurate clock rate.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Reviewed-by: Shubhrajyoti Datta <Shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofpga: versal-fpga: Add versal fpga manager driver
Appana Durga Kedareswara rao [Tue, 26 Mar 2019 09:36:55 +0000 (15:06 +0530)]
fpga: versal-fpga: Add versal fpga manager driver

This patch adds driver for versal fpga manager.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agodt-bindings: fpga: Add binding doc for versal fpga manager
Appana Durga Kedareswara rao [Tue, 26 Mar 2019 09:36:54 +0000 (15:06 +0530)]
dt-bindings: fpga: Add binding doc for versal fpga manager

This patch adds binding doc for versal fpga manager driver.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofpga: fpga-mgr: Add debugfs entry for loading fpga image from user space
Appana Durga Kedareswara rao [Tue, 26 Mar 2019 09:36:53 +0000 (15:06 +0530)]
fpga: fpga-mgr: Add debugfs entry for loading fpga image from user space

This patch adds an debugfs entry to load fpga image from user
provided address pointer and size.

--> Usage:
   debugfs_fd = open("/sys/kernel/debug/fpga/fpga0/load", O_WRONLY);
   write(debugfs_fd, Image_pointer, Image_size);

(OR)

   dd bs=26M if=/mnt/top.bin of=/sys/kernel/debug/fpga/fpga0/load

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agodrivers: firmware: Add Pdi load API support
Jolly Shah [Fri, 22 Mar 2019 14:21:35 +0000 (07:21 -0700)]
drivers: firmware: Add Pdi load API support

This patch adds load pdi api support to enable pdi/partial loading from
linux. Programmable Device Image (PDI) is combination of headers, images
and bitstream files to be loaded. Partial PDI is partial set of image/
images to be loaded.

Signed-off-by: Jolly Shah <jolly.shah@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agozynqmp-secure: Fix for crash seen with secure image loading
Kalyani Akula [Wed, 27 Mar 2019 07:38:11 +0000 (13:08 +0530)]
zynqmp-secure: Fix for crash seen with secure image loading

This patch resolves the crash/backtrace seen with secure load.
arch_setup_dma_ops is not setting coherent mask due to which
we see a warning (added recently in dma_mapping.h) and backtrace
along with it.

So, instead of using arch_setup_dma_ops we used of_dma_configure.

Signed-off-by: Kalyani Akula <kalyani.akula@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofirmware: zynqmp-secure: Correct error handling for secure_load
Kalyani Akula [Wed, 27 Mar 2019 07:38:10 +0000 (13:08 +0530)]
firmware: zynqmp-secure: Correct error handling for secure_load

This patch modifies the secure_load call according to the new
prototype in zynqmp.c

Signed-off-by: Kalyani Akula <kalyani.akula@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofirmware: zynqmp: Modify zynqmp_pm_secure_load to return only dst.
Kalyani Akula [Wed, 27 Mar 2019 07:38:09 +0000 (13:08 +0530)]
firmware: zynqmp: Modify zynqmp_pm_secure_load to return only dst.

This extra parameter added earlier to know proper error code
from the SMC, but earlier change broken backward compatibility.
So, handling the same in PMU by displaying proper error code
using PmErr.

Signed-off-by: Kalyani Akula <kalyani.akula@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agommc: core: use mrq->sbc when sending CMD23 for RPMB
Wolfram Sang [Thu, 28 Mar 2019 12:35:08 +0000 (18:05 +0530)]
mmc: core: use mrq->sbc when sending CMD23 for RPMB

When sending out CMD23 in the blk preparation, the comment there
rightfully says:

 * However, it is not sufficient to just send CMD23,
 * and avoid the final CMD12, as on an error condition
 * CMD12 (stop) needs to be sent anyway. This, coupled
 * with Auto-CMD23 enhancements provided by some
 * hosts, means that the complexity of dealing
 * with this is best left to the host. If CMD23 is
 * supported by card and host, we'll fill sbc in and let
 * the host deal with handling it correctly.

Let's do this behaviour for RPMB as well, and not send CMD23
independently. Otherwise IP cores (like Renesas SDHI) may timeout
because of automatic CMD23/CMD12 handling.

Reported-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Clément Péron <peron.clem@gmail.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoMAINTAINERS: Added fragment for xilinx axi spi driver
Sai Krishna Potthuri [Wed, 27 Mar 2019 09:25:04 +0000 (14:55 +0530)]
MAINTAINERS: Added fragment for xilinx axi spi driver

Added fragment for xilinx AXI SPI driver.

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Acked-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agospi: spi-xilinx: Added workaround when startup block is enabled
Sai Krishna Potthuri [Wed, 27 Mar 2019 09:25:03 +0000 (14:55 +0530)]
spi: spi-xilinx: Added workaround when startup block is enabled

In AXI SPI when the startup block is enabled in the hardware
STARTUP block don't provide clock as soon as SPI provides command,
first command fails. So to overcome this issue added a workaround
to perform a dummy Read Id if startup block is enabled in the
hardware.

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Acked-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agodt-bindings: Added optional property xlnx,startup-block
Sai Krishna Potthuri [Wed, 27 Mar 2019 09:25:02 +0000 (14:55 +0530)]
dt-bindings: Added optional property xlnx,startup-block

This patch adds optional property xlnx,startup-block
to indicate STARTUP block enable or disable.

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Acked-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agohwmon: pmbus: Add DT wiring for ti,tps544b25
Michal Simek [Mon, 4 Mar 2019 12:51:05 +0000 (13:51 +0100)]
hwmon: pmbus: Add DT wiring for ti,tps544b25

This should be enough for DT wiring to get generic functionality.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agonet: phy: dp83867: Add support for 6-wire mode in SGMII configuration
Radhey Shyam Pandey [Tue, 26 Mar 2019 14:01:32 +0000 (19:31 +0530)]
net: phy: dp83867: Add support for 6-wire mode in SGMII configuration

SGMII interface is capable of working as a 4-wire or 6-wire SGMII
interface. Default is 4-wire mode. Read DT "ti,6-wire-mode" property
to program SGMIICTL1[SGMII_TYPE] 6-wire mode.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Reviewed-by: Harini Katakam <harini.katakam@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agodt-bindings: phy: dp83867: Add documentation for SGMII 6-wire mode
Radhey Shyam Pandey [Tue, 26 Mar 2019 14:01:31 +0000 (19:31 +0530)]
dt-bindings: phy: dp83867: Add documentation for SGMII 6-wire mode

Add documentation for optional "ti,6-wire-mode" property which can be
used to program SGMII 6-wire mode configuration.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Reviewed-by: Harini Katakam <harini.katakam@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agov4l: xilinx: scd: Enable 10 bit formats support for memory based IP
Satish Kumar Nagireddy [Tue, 26 Mar 2019 18:26:32 +0000 (11:26 -0700)]
v4l: xilinx: scd: Enable 10 bit formats support for memory based IP

This patch enables 10bit format support in driver. This will configure
the 8bit or 10bit video format in IP based on media bus format set by
the application.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agov4l: xilinx: vpss-csc: Use 10bit media bus codes
Satish Kumar Nagireddy [Tue, 26 Mar 2019 18:26:31 +0000 (11:26 -0700)]
v4l: xilinx: vpss-csc: Use 10bit media bus codes

This patch enables driver to use new YUV 10bit media bus codes.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agov4l: xilinx: tpg: Use 10bit media bus codes
Satish Kumar Nagireddy [Tue, 26 Mar 2019 18:26:30 +0000 (11:26 -0700)]
v4l: xilinx: tpg: Use 10bit media bus codes

This patch enables driver to use new YUV 10bit media bus codes.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agov4l: xilinx: vpss-scaler: Use 10bit media bus codes
Satish Kumar Nagireddy [Tue, 26 Mar 2019 18:26:29 +0000 (11:26 -0700)]
v4l: xilinx: vpss-scaler: Use 10bit media bus codes

This patch enables driver to use new YUV 10bit media bus codes.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agov4l: xilinx: vip: Use correct media bus code for RGB 10bit format
Satish Kumar Nagireddy [Tue, 26 Mar 2019 18:26:28 +0000 (11:26 -0700)]
v4l: xilinx: vip: Use correct media bus code for RGB 10bit format

This patch uses the correct media bus code for RGB 10bit pixel format.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofirmware: xilinx: use only 4 words in return payload
Rajan Vaja [Wed, 27 Mar 2019 13:45:10 +0000 (06:45 -0700)]
firmware: xilinx: use only 4 words in return payload

Firmware supports only 4 words in return payload. So use
only 4 words from payload data.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofirmware: zynqmp: Remove double empty line
Michal Simek [Wed, 27 Mar 2019 13:19:40 +0000 (14:19 +0100)]
firmware: zynqmp: Remove double empty line

Trivial change found by mainline sync.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofirmware: zynqmp: Fix enum value usage
Michal Simek [Wed, 27 Mar 2019 11:58:17 +0000 (12:58 +0100)]
firmware: zynqmp: Fix enum value usage

This way it would not then indicate that START is
actual reset line.

Reported-by: Vesa Jaaskelainen <dachaac@gmail.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofirmware: zynqmp: Remove unused enum values
Michal Simek [Wed, 27 Mar 2019 11:53:03 +0000 (12:53 +0100)]
firmware: zynqmp: Remove unused enum values

They are not used anywhere in the code that's why remove them.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofirmware: zynqmp: Sync location with mainline
Michal Simek [Wed, 27 Mar 2019 11:33:15 +0000 (12:33 +0100)]
firmware: zynqmp: Sync location with mainline

Trivial change.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofirmware: zynqmp: Sync location of get_chipid
Michal Simek [Wed, 27 Mar 2019 09:07:57 +0000 (10:07 +0100)]
firmware: zynqmp: Sync location of get_chipid

Sync with mainline.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agomtd: devices: m25p80: Sync driver with mainline
Michal Simek [Wed, 27 Mar 2019 08:19:23 +0000 (09:19 +0100)]
mtd: devices: m25p80: Sync driver with mainline

Just coding style changes.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agomedia: uvcvideo: Sync with mainline
Michal Simek [Wed, 27 Mar 2019 08:01:24 +0000 (09:01 +0100)]
media: uvcvideo: Sync with mainline

Trivial patch.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agousb: dwc3: Remove unused dwc3_set_phydata() function
Michal Simek [Wed, 27 Mar 2019 06:33:39 +0000 (07:33 +0100)]
usb: dwc3: Remove unused dwc3_set_phydata() function

There is no reason to keep this in our tree if it is unused.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoarm64: zynqmp: Update Micrel PHY details on zc1275 and zc1285
Harini Katakam [Sat, 23 Mar 2019 07:12:31 +0000 (12:42 +0530)]
arm64: zynqmp: Update Micrel PHY details on zc1275 and zc1285

The FMC card AES-FMC-NETW1-G is the necessary to support ethernet
on zc1275 and zc1285 boards. No previous PHYs/FMCs will be supported
on this HW. So update the phy address to 1 and necessary skew values.

Also remove PL IP related nodes and parameters that DTG generates.

Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoarm64: zynqmp: Modify the ethernet node for zc1285 revA
Venkatesh Yadav Abbarapu [Fri, 22 Mar 2019 04:02:49 +0000 (09:32 +0530)]
arm64: zynqmp: Modify the ethernet node for zc1285 revA

Removing the gmiitorgmii node, as this is generated by the
DTG.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoarm64: zynqmp: Add support for zc1285
Michal Simek [Tue, 5 Mar 2019 14:14:43 +0000 (15:14 +0100)]
arm64: zynqmp: Add support for zc1285

zc1285 is the same as zc1275 but it is using Avnet FMC
http://www.ultrazed.org/product/network-fmc-module

Unfortunatelly not everything is connected now that's why this is only
describing system which Xilinx is using.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agonet: deprecate eth_change_mtu, remove usage
Jarod Wilson [Sat, 23 Mar 2019 10:26:07 +0000 (15:56 +0530)]
net: deprecate eth_change_mtu, remove usage

With centralized MTU checking, there's nothing productive done by
eth_change_mtu that isn't already done in dev_set_mtu, so mark it as
deprecated and remove all usage of it in the kernel. All callers have been
audited for calls to alloc_etherdev* or ether_setup directly, which means
they all have a valid dev->min_mtu and dev->max_mtu. Now eth_change_mtu
prints out a netdev_warn about being deprecated, for the benefit of
out-of-tree drivers that might be utilizing it.

Of note, dvb_net.c actually had dev->mtu = 4096, while using
eth_change_mtu, meaning that if you ever tried changing it's mtu, you
couldn't set it above 1500 anymore. It's now getting dev->max_mtu also set
to 4096 to remedy that.

v2: fix up lantiq_etop, missed breakage due to drive not compiling on x86

CC: netdev@vger.kernel.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agonet: macb: Sync macb_config usage with mainline
Harini Katakam [Sat, 23 Mar 2019 10:26:06 +0000 (15:56 +0530)]
net: macb: Sync macb_config usage with mainline

Sync macb_config default init and clk_init with mainline.

Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agonet: ethernet: macb: use phydev from struct net_device
Philippe Reynes [Sat, 23 Mar 2019 10:26:05 +0000 (15:56 +0530)]
net: ethernet: macb: use phydev from struct net_device

The private structure contain a pointer to phydev, but the structure
net_device already contain such pointer. So we can remove the pointer
phydev in the private structure, and update the driver to use the
one contained in struct net_device.

Rebased on xilinx tree.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Harini Katakam <harini.katakam@xilix.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agodmaengine: xilinx_dma: Remove axidma multichannel mode support
Radhey Shyam Pandey [Fri, 22 Mar 2019 16:25:41 +0000 (21:55 +0530)]
dmaengine: xilinx_dma: Remove axidma multichannel mode support

The AXI DMA multichannel support is deprecated in the IP and it is no
longer actively supported. For multichannel support, refer to the AXI
multichannel direct memory access IP product guide(PG228). So it is
decided to remove it's complete support from the driver. Just to
highlight that this patch intentionally breaks backward compatibility.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Acked-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agodt-bindings: dmaengine: xilinx_dma: Remove axidma multichannel support
Radhey Shyam Pandey [Fri, 22 Mar 2019 16:25:40 +0000 (21:55 +0530)]
dt-bindings: dmaengine: xilinx_dma: Remove axidma multichannel support

The AXI DMA multichannel support is deprecated in the IP and it is no
longer actively supported. For multichannel support, refer to the AXI
multichannel direct memory access IP product guide(PG228). So it is
decided to remove it's complete support from the driver. Inline with
it remove axidma multichannel optional properties i.e xlnx,mcdma and
dma-channels from the binding description. Just to highlight that this
patch intentionally breaks backward compatibility.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Acked-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agomtd: devices: m25p80: update the driver
Naga Sureshkumar Relli [Sat, 23 Mar 2019 06:17:04 +0000 (11:47 +0530)]
mtd: devices: m25p80: update the driver

There are changes between xilinx 4.19 kernel m25p80.c and mainline
4.19 kernel m25p80.c. This was happened due to merge. so update the
drver. This update includes below commits from mainline

00a5762 mtd: m25p80: Remove unneeded m25p->command field
4a3e85f mtd: devices: m25p80: Make sure the buffer passed in op is DMA-able
138f5dc mtd: m25p80: add support of SPI 1-2-2 and 1-4-4 protocols
b02b17f mtd: m25p80: Call spi_mem_get_name() to let controller set a
     custom name
1e07392 mtd: devices: m25p80: Use spi_mem_set_drvdata() instead of
      spi_set_drvdata()

Signed-off-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agov4l: xilinx: vip: Add scaling and padding factor for XY10
Satish Kumar Nagireddy [Fri, 22 Mar 2019 22:05:14 +0000 (15:05 -0700)]
v4l: xilinx: vip: Add scaling and padding factor for XY10

This patch adds scaling and padding factors for stride calculation
of XY10 pixel format.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agov4l: xilinx: vip: Add YUV 10bit media bus formats
Satish Kumar Nagireddy [Fri, 22 Mar 2019 22:05:13 +0000 (15:05 -0700)]
v4l: xilinx: vip: Add YUV 10bit media bus formats

This patch introduces separate media bus formats for each 10bit pixel
formats. This way v4l2 subdev applications can differentiate between
8bit and 10bit formats.

YUV420 10bit -> MEDIA_BUS_FMT_VYYUYY10_4X20
YUV422 10bit -> MEDIA_BUS_FMT_UYVY10_1X20
YUV444 10bit -> MEDIA_BUS_FMT_VUY10_1X30

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agomedia: v4l: Add YUV 10bit media bus format
Satish Kumar Nagireddy [Fri, 22 Mar 2019 22:05:12 +0000 (15:05 -0700)]
media: v4l: Add YUV 10bit media bus format

This patch adds new media bus formats for YUV420 10bit and YUV444 10bit.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agov4l: xilinx: scd: Fix video format configuration for YUV420
Satish Kumar Nagireddy [Mon, 18 Mar 2019 18:35:55 +0000 (11:35 -0700)]
v4l: xilinx: scd: Fix video format configuration for YUV420

In the current implementation streaming based driver, the video format
value for YUV420 is programmed wrongly. This patch programs it correctly
according to PG322.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Vishal Sagar <vishal.sagar@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agomtd: rawnand: arasan: Add support for writes with out WAITRDY instruction
Naga Sureshkumar Relli [Fri, 22 Mar 2019 10:45:33 +0000 (16:15 +0530)]
mtd: rawnand: arasan: Add support for writes with out WAITRDY instruction

Some of the nand write patterns executes with out WAITRDY instruction.
This is found when running mtd_nandbiterrs test.

Signed-off-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agonet: can: xilinx_can: fix chip_start failure with invalid bus
Appana Durga Kedareswara rao [Fri, 22 Mar 2019 12:47:30 +0000 (18:17 +0530)]
net: can: xilinx_can: fix chip_start failure with invalid bus

Currently the xilinx_can xcan_chip_start() function, called from
.ndo_open() and via CAN_MODE_START (bus-off restart), waits for the SR
register to show the wanted operating state, with a 1 sec timeout.

However, that register bit will only be set once the HW has observed 11
consecutive recessive bits (BusIdle) on the bus.

If the bus will not see the 11 bits (e.g. it is stuck dominant), the
function will timeout and return an error.
If this was done as part of a scheduled restart from bus-off, the
interface will stay in bus-off state forever even if the bus recovers
later.
If this was done during interface .ndo_open(), the interface will stay
down.

According to M_CAN and FLEXCAN documentation they also wait for 11
consecutive recessive bits, but their drivers do not seem to wait for
that.

To make the behavior consistent, modify xilinx_can to also not wait for
the synchronization to complete.

The only way for users to know for sure that the bus has been joined
successfully is to see successfully received or transmitted frames. That
does not seem optimal, but it is consistent with other drivers and we
should have a properly working restart-ms with xilinx_can.

Tested on ZynqMP with Xilinx CAN-FD 2.0.

Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Acked-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agonet: xilinx: axiethernet: Fix axiethernet register description
Radhey Shyam Pandey [Wed, 20 Mar 2019 10:13:29 +0000 (15:43 +0530)]
net: xilinx: axiethernet: Fix axiethernet register description

Rename axiethernet register description to be inline with product guide
register names. It also corrects TEMAC interrupt controller offsets and
removes obsolete registers and bitmasks. There is no major functional
impact since the modified offsets are only used in ethtool get_regs and
not in any programming sequence.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoremoteproc: zynqmp_r5: allow kick not to pass message
Wendy Liang [Tue, 19 Mar 2019 12:01:26 +0000 (05:01 -0700)]
remoteproc: zynqmp_r5: allow kick not to pass message

Allow remoteproc kick not to write to IPI buffer. As remotperoc has
sysfs API to allow userspace to kick r5, it is possible to just raise
interrupt but not write data. Otherwise, it will take more time
to kick remoteproc, as it will need to copy the data to the IPI
buffer.

Signed-off-by: Wendy Liang <wendy.liang@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agospi: Increase the spi time out
Naga Sureshkumar Relli [Thu, 21 Mar 2019 07:24:18 +0000 (12:54 +0530)]
spi: Increase the spi time out

SPI subsystem default time out tolerance for a transfer to be complete
is 100ms. This works well on ZynqMP and Zynq platforms because on these
hardwares QSPI and SPI runs at 100MHz. But on versal emulation platform,
QSPI and SPI runs at 25MHz and core runs at 2.16MHz.
so the wait time should be increased to accommodate that clock, when
using DMA or IO. Otherwise we will get transfer time outs. Hence
increase the transfer time out tolerance.
Based on various testings this tolerance is increased from 200 to 1000.

Signed-off-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agomtd: rawnand: Apply nand_reset() only to TOSHIBA parts
Naga Sureshkumar Relli [Fri, 22 Mar 2019 05:39:21 +0000 (11:09 +0530)]
mtd: rawnand: Apply nand_reset() only to TOSHIBA parts

While writing oob, flash chips like TOSHIBA will clear the whole data
page, if there is no nand_reset(). So limit this reset only to these
parts.
We can still go without checking the jedec_id, but arasan_nand driver
does not support setup_data_interface() hook to initialize the flash
timings during reset. arasan_nand driver is not supporting this hook
because the NAND subsystem is not supporting NVDDR modes. so by adding
this check we can support SDR, NVDDR modes in arasan.
And to support this jedec id check, added new jedec_id variable to
struct onfi_params. This is needed until NAND subsystem supports NVDDR
modes.

Signed-off-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agonet: macb: Add NULL check for PCLK and HCLK
Harini Katakam [Fri, 22 Mar 2019 05:20:00 +0000 (10:50 +0530)]
net: macb: Add NULL check for PCLK and HCLK

Both PCLK and HCLK are "required" clocks according to macb devicetree
documentation. There is a chance that devm_clk_get doesn't return a
negative error but just a NULL clock structure instead. In such a case
the driver proceeds as usual and uses pclk value 0 to calculate MDC
divisor which is incorrect. Hence fix the same in clock initialization.

Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoarm64: dts: zynqmp: Add missing interrupt-names property for dwc3_1 node
Anurag Kumar Vulisha [Tue, 19 Mar 2019 16:03:33 +0000 (16:03 +0000)]
arm64: dts: zynqmp: Add missing interrupt-names property for dwc3_1 node

This patch adds the missing "interrupt-names" property into
dwc3_1 node

Signed-off-by: Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agonet: can: xilinx_can: Fix incorrect assignment of bittiming_const for canfd
Appana Durga Kedareswara rao [Tue, 19 Mar 2019 08:58:26 +0000 (14:28 +0530)]
net: can: xilinx_can: Fix incorrect assignment of bittiming_const for canfd

commit 9e5f1b2 ("can: xilinx_can: add support for Xilinx CAN FD core")
had wrong assignment of bittiming_const for axi canfd, It should point to
xcan_bittiming_const_canfd structure instead of xcan_bittiming_const_can.

This patch fixes this issue.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Reviewed-by: Shubhrajyoti Datta <Shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofirmware: xilinx: Sync positions with mainline
Michal Simek [Wed, 20 Mar 2019 14:04:10 +0000 (15:04 +0100)]
firmware: xilinx: Sync positions with mainline

For easier comparison sync possition of zynqmp_pm_get_chipid and
zynqmp_pm_request_ack.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofirmware: xilinx: Sync kernel-doc format with mainline
Michal Simek [Thu, 21 Mar 2019 15:10:09 +0000 (16:10 +0100)]
firmware: xilinx: Sync kernel-doc format with mainline

Adding () is permitted now in kernel-doc format. Sync it with driver
version what it is in mainline.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agofirmware: xilinx: Remove additional empty line
Michal Simek [Thu, 21 Mar 2019 15:10:05 +0000 (16:10 +0100)]
firmware: xilinx: Remove additional empty line

Trivial fix.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoxilinx: soc: Remove unused power.h
Michal Simek [Thu, 21 Mar 2019 15:10:00 +0000 (16:10 +0100)]
xilinx: soc: Remove unused power.h

There is no code which includes this file.
Both macros are alread available here:
include/linux/firmware/xlnx-zynqmp.h

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agodt-bindings: nand: Remove duplicated dt binding for arasan_nfc
Michal Simek [Thu, 21 Mar 2019 15:09:56 +0000 (16:09 +0100)]
dt-bindings: nand: Remove duplicated dt binding for arasan_nfc

Documentation/devicetree/bindings/mtd/arasan_nand.txt

Signed-off-by: Michal Simek <michal.simek@xilinx.com>