Ralf Ramsauer [Mon, 17 Oct 2016 13:59:56 +0000 (15:59 +0200)]
spi: mark device nodes only in case of successful instantiation
Instantiated SPI device nodes are marked with OF_POPULATE. This was
introduced in bd6c164. On unloading, loaded device nodes will of course
be unmarked. The problem are nodes that fail during initialisation: If a
node fails, it won't be unloaded and hence not be unmarked.
If a SPI driver module is unloaded and reloaded, it will skip nodes that
failed before.
Skip device nodes that are already populated and mark them only in case
of success.
Note that the same issue exists for I2C.
Fixes: bd6c164 ("spi: Mark instantiated device nodes with OF_POPULATE") Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
arm64: zynqmp: remove smmu info from lpd dma channels
ARM Linux SMMU implementation supports only 16 context banks.
To have SMMU support for all relevant peripherals, smmu information in
lpd dma channels are commented by default. Users can add back by
uncommenting the smmu info.
Signed-off-by: Naga Sureshkumar Relli <nagasure@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
dwc3: Fix the logic used to get data from parent node
At present when two usb nodes are enabled, incorrect simple data is
getting fetched from parent node. Because of this kernel panic was
getting triggered when more than one usb nodes are enabled.
This patch fixes the logic used to get simple data from parent node.
Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Arvind Yadav [Tue, 20 Jun 2017 05:34:26 +0000 (11:04 +0530)]
watchdog: cadence_wdt: make of_device_ids const.
of_device_ids are not supposed to change at runtime. All functions
working with of_device_ids provided by <linux/of.h> work with const
of_device_ids. So mark the non-const structs as const.
File size before:
text data bss dec hex filename
1962 612 4 2578 a12 drivers/watchdog/cadence_wdt.o
File size after constify cdns_wdt_of_match:
text data bss dec hex filename
2378 196 4 2578 a12 drivers/watchdog/cadence_wdt.o
This patch modifies the registers as per latest UHD-SDI register spec
finalized for 2017.3.
Due to the registers and bit changes,
there are some masks needs to be added/modified too.
Also the error status bits are converted to interrupts,
hence updating the handler too accordingly.
Currently driver is allocating a descriptor at the
beginning of the prep_sg(), after that checking for length
of the descriptor it may set to NULL.
In this case we should either free the allocated descriptor
or allocate descriptor after checking for the size of the
descriptor, instead of allocating the descriptor at the
beginning of the prep_sg().
This patch fixes this issue.
Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Hyun Kwon [Tue, 1 Aug 2017 17:07:25 +0000 (10:07 -0700)]
Revert "drm: xilinx: crtc: Add crtc set config helper"
This reverts commit 589d1b61a232
("drm: xilinx: crtc: Add crtc set config helper").
This patch results in the fbconsole looking strange. For example,
if fbconsole is set to 1080p, while modeset changes to 4k, it ends up
with 2 fbconsole next to each other.
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> CC: Preetesh Parekh <preetesh.parekh@xilinx.com> CC: Christian Kohn <christian.kohn@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Hyun Kwon [Wed, 2 Aug 2017 01:32:48 +0000 (18:32 -0700)]
drm: xilinx: plane: commit for each plane update
The dma descriptor should be updated for every plane update
request. Call the plane commit to schedule the descriptor
with the latest framebuffer information.
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 27 Jul 2017 13:32:26 +0000 (15:32 +0200)]
soc: zynqmp: Extract firmware part from PM
The purpose of this patch is to separate code used by drivers for
communication with firmware and power management functions.
New Kconfig option is added for enabling ZYNQMP_PM to enable power
management only. Low level wiring is enabled when SOC_XILINX_ZYNQMP is
enabled.
There is only one difference in behavior which is that pm platform
driver is asking for pm_api_version again and not reading this value
from low level driver.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: dp_sub: Use static for internal variables
Fixing the warning,
drivers/gpu/drm/xilinx/xilinx_drm_dp_sub.c:379:30: warning: symbol 'dp_sub_debugfs' was not declared. Should it be static?
drivers/gpu/drm/xilinx/xilinx_drm_dp_sub.c:540:38: warning: symbol 'dp_sub_debugfs_reqs' was not declared. Should it be static?
CC drivers/gpu/drm/xilinx/xilinx_drm_dp_sub.o
drm: xilinx: dsi: Don't check unsigned with negative
Fixing the warning,
drivers/gpu/drm/xilinx/xilinx_drm_dsi.c: In function ‘xilinx_dsi_parse_dt’:
drivers/gpu/drm/xilinx/xilinx_drm_dsi.c:677:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
(datatype < MIPI_DSI_FMT_RGB888)) {
This patch modifies driver to avoid setting SD0_OTAPDLYENA and
SD01_OTAPDLYENA bits. This bits have impact on functionality of RTL due
to one issue in RTL where SD0_OTAPDLYENA (Bit 6) has been wrongly
connected to both SD0 and SD1 instance. This makes the
SD1_OTAPDLYENA(bit 22) redundant. These signals are where else on the
design so there is really no need to set these bits.
Signed-off-by: Manish Narani <mnarani@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
The current resolver format is way too cryptic and its fail to
fix the local_fixups created by the latest dtc compiler.
this patch fix the local fixups based on the information exists in
devicetree ovelay file generated by the latest dtc compiler 1.4.4.
Signed-off-by: Nava kishore Manne <navam@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arm64: config: xilinx: zynqmp: Increase CMA to 256M
About 100 Mbytes are required with 4K desktop environment:
(6 4K framebuffers: 2 for fbdev, 4 for Xorg). The Xorg sometimes
fails to allocate framebuffers from 128M CMA memory, since the CMA
is shared with other drivers too. Thus increase CMA size to 256M
to have enough memory, especially for video applications.
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
remoteproc: zynqmp_r5: fix how to get power domain id
Previous, it always gets the device node parent handle which
contain the power domain id of the first one in the srams list.
This patch is to get the device node parent handler properly.
Signed-off-by: Wendy Liang <jliang@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
net: ethernet: xilinx: Fix race in the random queue selection
In Axi Ethernet MCDMA configuration with the existing
driver we are hard coding max 16 queues for num_queues
private structure variable it should be user configuriable.
dwc3: Add support for removing vbus when suspended
During suspend, dwc3 host puts the device into U3 state and disables the
clocks. During resume, dwc3 host drives LFPS.polling to detect the
connected usb device and most of the usb devices detect LFPS.polling signal
and drives LFPS.U3 exit signal and gets detected by the dwc3 host. But very
few usb devices during resume doesn't drive u3 exit signalling even after
seeing LFPS.polling signal on the link and wait for the host to initiate an
u3 exit(Currently the USB stack doesn't drive U3 exit during resume from
suspened). These kind of devices doesn't even respond to warm reset
signalling sent by the host. Since these usb devices doesn't respond to
polling or warm reset, host controller doesn't generate USB detect event
after resume from suspend until manual disconnect.
To aviod the above said issue, during suspend we need to ask ULPI phy to
stop driving of VBUS and restore VBUS during resume. Doing so, will make
usb device to enter into RX Detect state and start LFPS.polling after
restoring LFPS.polling signal and thus generating detect event on the host
side.
This patch does the above said with a check to ensure that VBUS is not
disabled for the usb devices that are remote wakeup capable.
Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
min() function requires same type of variables in argument,
due to different type of argument on different architecure
(32bit/64bit), warning was thrown. Addressed warning by this
patch.
Signed-off-by: Tejas Upadhyay <tejasu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
media: xilinx: Ensure Video Framebuffer selected by Kconfig
The Xilinx Video Linux driver is a client of the Video Framebuffer DMA
driver. Because the Framebuffer driver exports symbols used by this driver,
it is important that both are built in the same manner: as modules or
as statically included drivers.
Signed-off-by: Jeffrey Mouroux <jmouroux@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: Ensure Video Framebuffer selected by Kconfig
The Xilinx DRM driver is a client of the Video Framebuffer DMA driver.
Because the Framebuffer driver exports symbols used by this driver, it
is important that both are built in the same manner: as modules or
as statically included drivers.
Signed-off-by: Jeffrey Mouroux <jmouroux@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
dma: xilinx: Ensure custom framebuffer dma interface builds as module
The Video Framebuffer DMA driver has a custom client interface. It
is built properly when the driver is configured to be built statically
but not when built as a module.
Signed-off-by: Jeffrey Mouroux <jmouroux@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
dts: zynqmp: Add maximum-speed property to dwc3 node
Add maximum-speed property to dwc3 node of zcu102 dts
This property needs to defined as per latest USB DM
patches. This fixes the issue of usb on zcu102
board.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
The pixel clock doesn't have to be enabled in probe. Enable
the clock upon DPMS on request. The clock needs to be enabled
first to make sure that CCF disables the clock as CCF skips
the disable request for already disabled clock.
And the clock enable flag was always set to true upon DPMA on.
Fix it to be set to false when the clk_prepare_enable() fails.
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
net: ethernet: xilinx: Fix race condition in the tx path
In the _xmit driver is checking for the buffer descriptor
availabilty, If the buffer descriptors are not available
it is stopping all the device queues,
It should stop only that particular queue as
other queues still may have free buffer descriptors
for servicing the data.
dwc3: Add support for clock disabling during suspend
In dwc3 usb controller, when remote wakeup feature is enabled and
the controller is in U3 state (suspended), it requires suspend_clk
to be active to detect wakeup signalling driven on the link.
For all other cases usb clocks can be disabled once the controller
enters U3 state.
This patch adds the logic for disabling usb clocks when remote
wakeup feature is not enabled.
Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
sdhci: add support for switching to UHS-I modes on ZynqMP Platform
This patch adds support for switching to UHS-I modes on ZynqMP platform.
There is one issue with the ZynqMP ZCU102 where it is not able to power
cycle the SD card. Due to this once the card is initialized in UHS-I
mode it cannot be reinitialized in UHS-I mode again. So to solve this
issue there are some of the checks are made in place to ensure that the
card operates in UHS-I mode even on reinitialization. This will enable
the SD host controller to run SD at 200MHz in linux if it was running at
200MHz in U-boot.
Signed-off-by: Manish Narani <mnarani@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynqmp: devicetree: Remove no-1-8-v property to add UHS-I support for SD
This patch removes the property 'no-1-8-v' to add support for Running SD
in UHS-I mode. This will enable SD to operate at 1.8V and maximum of
200MHz frequency if the SD card supports the same.
Signed-off-by: Manish Narani <mnarani@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynqmp: sdhci: set host quirk2 for no 1.8V support for 1.0 silicon
This patch sets host quirk2 bit field for No 1.8V supported in case of
1.0 silicon. The 1.0 silicon doesn't have support for UHS-I modes. This
property will ensure the SD runs on High Speed mode.
Signed-off-by: Manish Narani <mnarani@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Kyle Roeschley [Mon, 31 Oct 2016 16:26:17 +0000 (11:26 -0500)]
ARM: zynq: Reserve correct amount of non-DMA RAM
On Zynq, we haven't been reserving the correct amount of DMA-incapable
RAM to keep DMA away from it (per the Zynq TRM Section 4.1, it should be
the first 512k). In older kernels, this was masked by the
memblock_reserve call in arm_memblock_init(). Now, reserve the correct
amount excplicitly rather than relying on swapper_pg_dir, which is an
address and not a size anyway.
Fixes: 46f5b96 ("ARM: zynq: Reserve not DMAable space in front of the
kernel")
Michal Simek [Thu, 20 Jul 2017 08:58:50 +0000 (10:58 +0200)]
arm64: zynqmp: Move dts zcu102 to zcu102-revA
Not using board revision is causing confusion about which board is
supported and tested. Mark dts files exactly with board revision which
was tested. When new board revision arives it can be symlink if SW view is
the same. Also add -revX suffix to compatible string because user space
tools are parsing this string and can change behavior depends of board
revision.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 20 Jul 2017 08:53:15 +0000 (10:53 +0200)]
arm64: zynqmp: Label zcu106 with board revision
Not using board revision is causing confusion about which board is
supported and tested. Mark dts files exactly with board revision which was
tested. When new board revision arives it can be symlink if SW view is
the same. Also add -revX suffix to compatible string because user space
tools are parsing this string and can change behavior depends of board
revision.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Wed, 19 Jul 2017 07:44:33 +0000 (09:44 +0200)]
arm64: zynqmp: Add gpio line names to zcu100 revB and revC
Add gpio line names for fixed PS part. This can be reused by new
libgpiod library (https://github.com/brgl/libgpiod).
Examples are also available at tools/gpio.
EMIO gpio PL part needs to be generated to cover current HW design.
By purpose there is MIO/EMIO separation for easier EMIO description.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
iio: adc: xilinx-ams: reset [ps|pl]-sysmon before channel config
The documentation for PS and PL System Monitor Programming Model
specifies that in order to change which channel to monitor, the SYSMON
must be put in a soft reset. This is done by modifying its
sequence_mode to default.
This fixes in_voltage15_vccbram_raw always reading 0.
watchdog: cadence_wdt: Fix issue with timeout-sec dt property
Unable to change timeout value via DT because watchdog_init_timeout()
code which reads from DT is not called at all. Because
watchdog_init_timeout() gives the priority for the module parameter value.
If the value is not valid then only it will read from the Device tree.
But currenly in the driver module parameter default value is fixed to 10s
means watchdog_init_timeout() always use the module parameter timeout
value. It will always ignore the timeout-sec dt property value.
This patch fix this issue.
Signed-off-by: Nava kishore Manne <navam@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
remoteproc: zynqmp_r5: allow use r5 rproc without IPI
This modification is to allow the ZynqMP RPU remoteproc
to be used without IPI as user can use the remoteproc
to just load firmware but no communication with the remote.
Signed-off-by: Wendy Liang <jliang@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
media: xilinx: dma: Enable use of Framebuffer Write IP in V4L2 Driver
The Xilinx Video Framebuffer driver is video 'format aware' and
requires clients to pass video format information as part of DMA
programming. As the DMA Engine interface does not support passing
this information, a configuration object is passed through the
dma channel's private data to the Framebuffer Driver with this
information.
drm: xilinx: Enable use of Framebuffer Read IP in Xilinx DRM Driver
Xilinx Video Framebuffer read is a 'format aware' DMA device. It
requires knowledge of the video memory format to be explicitly
programmed by DMA clients. This change enables this data to be
passed via the dma channel private data pointer as there is no
standard DMA Engine interface for passing this information.
The Video Framebuffer IP is available in two forms: read or write.
This driver supports either form of the IP.
Each IP is a single channel DMA but which is video format aware
supporting video data that arranged in memory as packed or semi-planar data.
This driver introduces support for these IP and integrates with the
DMA Engine framework.
Signed-off-by: Radhey Pandey <radheys@xilinx.com> Signed-off-by: John Nichols <jnichol@xilinx.com> Signed-off-by: Jeffrey Mouroux <jmouroux@xilinx.com> Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Tue, 18 Jul 2017 13:06:01 +0000 (15:06 +0200)]
pinctrl: zynqmp: Change macros name to reflect actual mA setting
DT should use these DRIVE_STRENGTH macro but all others are simply using
value. Setting up macros as values in mA to avoid issues where users
write values directly without macros.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>