Example: PHY Read/Write Operation
1. Check to see that no MDIO operation is in progress. Read until
gem.net_status[man_done] = 1.
2. Write data to the PHY maintenance register (gem.phy_management). This
initiates the
shift operation over MDIO.
3. Wait for completion of operation. Read until gem.net_status[man_done]
= 1.
4. Read data bits for a read operation.
The PHY register data is available in gem.phy_management
[phy_write_read_data].
remoteproc: zynqmp_r5: Allow multiple pd_ids for single mem pool
When remoteproc in lockstep mode, the TCM memories are viewed
as contiguous. And thus, there should be just a single memory
pool for the 4 TCMs. However, each TCM has its own power domain
ID.
Here is the representation of RPU lockstep TCM in device tree:
r5_tcm: tcm@ffe00000 {
compatible = "mmio-sram";
reg = <0 0xFFE00000 0x0 0x40000>;
pd-handle = <&pd_tcm_0_a
&pd_tcm_0_b
&pd_tcm_1_a
&pd_tcm_1_b>;
};
This patch is to allow a single firmware memory to have multiple
power domain ids.
Signed-off-by: Wendy Liang <jliang@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michael Gill [Mon, 10 Apr 2017 18:14:39 +0000 (11:14 -0700)]
staging: apf: Adding fix to get correct dma_ops
Arm64 in 17.1 defaults to dummy-ops unless a node is created
off of a device tree note. We instances DMA nodes dynamically,
which requires us to make the necessary calls to get the correct
dma_ops manually.
Signed-off-by: Michael Gill <gill@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
The phy needs to be initialized / released accordingly when DP goes
into suspend / resume. Add functions for phy initializeiont / release,
and those functions can be shared with probe / remove sequence.
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: dp: Initialize the DP aux in a separate function
The same initialization needs to be called for suspend / resume.
Factor the function for the aux initialization, then the function
can be used for suspend / resume.
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Filip Drazic [Wed, 15 Mar 2017 10:43:10 +0000 (11:43 +0100)]
arm64: zynqmp: pm: Notify PM firmware that initialization is completed
PM firmware requires notification when power management is enabled and
when the initialization is completed in order to finalize
system initialization (e.g. power down slaves that will not be used).
Implement PM_INIT_FINALIZE PM API, which is used to inform the PM
firmware that the initialization is completed. This call is made only
if CONFIG_PM is enabled in late_initcall_sync phase of the boot procedure.
Signed-off-by: Filip Drazic <filip.drazic@aggios.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This patch adds xilinx uart loopback support by modifying the
cdns_uart_set_mctrl function to handle the switch to loopback mode.
After this patch, the loopback mode can be enabled/disabled by
setting/clearing the TIOCM_LOOP modem bit via TIOCMBIS/TIOCMBIC
ioctls respectively.
Signed-off-by: Nava kishore Manne <navam@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Hyun Kwon [Wed, 29 Mar 2017 20:32:18 +0000 (13:32 -0700)]
drm: xilinx: dp: Add a module param for aux timeout
From testing with multiple monitors, the timeout value varies.
The spec describes the 25 msec, but some monitor requires a few
seconds wait time. So, the default timeout is set to 50 msec,
but make it configurable so that the value can be tuned.
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Hyun Kwon [Wed, 29 Mar 2017 20:32:17 +0000 (13:32 -0700)]
drm: xilinx: dp: Retry the aux transaction when it fails
Retry the aux transaction up to 128 times. Per spec, it needs to
try at least 3 times, but there's some monitor (Viewsonic VX2880ml)
which requires 64 retries. Try up to 128 times to be safe.
Other monitors are more likely to succeed for the first try, so this
patch doesn't hurt other monitors.
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Hyun Kwon [Wed, 29 Mar 2017 17:29:41 +0000 (10:29 -0700)]
drm: xilinx: drv: Don't suspend if console_suspend_enabled is false
When console_suspend_enabled is false, user expects to see the logs
through the display even the system goes into suspend. Thus, check
the console_suspend_enabled flag before going into suspend.
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Manish Narani [Tue, 28 Mar 2017 10:31:52 +0000 (16:01 +0530)]
usb: dwc3: core: Enable CCI support in dwc3 core driver
This patch adds CCI support in DWC3 driver when CCI is enabled in the
design. There are couple of registers which need to be modified for
making CCI enabled transfers in USB. This patch add the support for
the same.
Signed-off-by: Manish Narani <mnarani@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Manish Narani [Tue, 28 Mar 2017 10:31:51 +0000 (16:01 +0530)]
usb: dwc3: of-simple: Enable CCI support in dwc3 driver
This patch adds CCI support in DWC3 driver when CCI is enabled in the
design. There are couple of registers which need to be modified for
making CCI enabled transfers in USB. This patch add the support for the
same.
Signed-off-by: Manish Narani <mnarani@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Manish Narani [Mon, 27 Mar 2017 12:17:00 +0000 (17:47 +0530)]
zynqmp: devicetree: Enabled CCI support for USB
This patch adds CCI support for USB when CCI is enabled in design.
This patch also adds 'reg' property for Xilinx USB 3.0 IP. The 'reg'
property is added in order to modify a register in that to enable
coherency in Hardware.
Signed-off-by: Manish Narani <mnarani@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: gadget: f_hid: fix: Move IN request allocation to set_alt()
Since commit: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()")
we cannot allocate any requests in bind() as we check if we should
align request buffer based on endpoint descriptor which is assigned
in set_alt().
Allocating request in bind() function causes a NULL pointer
dereference.
This commit moves allocation of IN request from bind() to set_alt()
to prevent this issue.
Fixes: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()") Cc: stable@vger.kernel.org Tested-by: David Lechner <david@lechnology.com> Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
As IN request has to be allocated in set_alt() and released in
disable() we cannot use mutex to protect it as we cannot sleep
in those funcitons. Let's replace this mutex with a spinlock.
Cc: stable@vger.kernel.org Tested-by: David Lechner <david@lechnology.com> Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
usb: gadget: f_hid: fix: Prevent accessing released memory
When we unlock our spinlock to copy data to user we may get
disabled by USB host and free the whole list of completed out
requests including the one from which we are copying the data
to user memory.
To prevent from this let's remove our working element from
the list and place it back only if there is sth left when we
finish with it.
Fixes: 99c515005857 ("usb: gadget: hidg: register OUT INT endpoint for SET_REPORT") Cc: stable@vger.kernel.org Tested-by: David Lechner <david@lechnology.com> Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Requests for out endpoint are allocated in bind() function
but never released.
This commit ensures that all pending requests are released
when we disable out endpoint.
Fixes: 99c515005857 ("usb: gadget: hidg: register OUT INT endpoint for SET_REPORT") Cc: stable@vger.kernel.org Tested-by: David Lechner <david@lechnology.com> Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
David Lechner [Mon, 2 Jan 2017 23:28:39 +0000 (17:28 -0600)]
usb: gadget: Fix copy/pasted error message
This fixes an error message that was probably copied and pasted. The same
message is used for both the in and out endpoints, so it makes it impossible
to know which one actually failed because both cases say "IN".
Make the out endpoint error message say "OUT".
Signed-off-by: David Lechner <david@lechnology.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Warn on multiuser only when changing rates.
This helps remove the warn in cases where the
dp driver is not there and vpll is used for other
stuff.
Expectation is that DP is using VPLL. Checking generic case where DP
uses different PLL requires additional fix. But as of now recomendation
is to use VPLL for DP.
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Borsodi Petr [Tue, 21 Mar 2017 13:01:47 +0000 (14:01 +0100)]
gpio: zynq: Wakeup gpio controller when it is used as IRQ controller
There is a problem with GPIO driver when used as IRQ controller.
It is not working because the module is sleeping (clock is disabled).
The patch enables clocks when IP is used as IRQ controller.
Signed-off-by: Borsodi Petr <Petr.Borsodi@i.cz> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Manish Narani [Thu, 23 Mar 2017 10:26:13 +0000 (15:56 +0530)]
usb: xhci: Set XHCI Light Reset for DWC3_OTG mode
This Patch corrects the XHCI reset for OTG mode. The host cannot
have Hard Reset while in OTG mode because that will affect the
OTG peripheral mode event buffers and it will not function.
The macro for OTG is USB_DWC3_OTG not USB_DWC3_DUAL_ROLE. This patch
corrects the same.
Signed-off-by: Manish Narani <mnarani@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Hyun Kwon [Thu, 23 Mar 2017 01:07:34 +0000 (18:07 -0700)]
drm: xilinx: drv: Unset set_busid callback
The DRM framework sets the busid by itself when the set_busid
callback is not set by the driver. Applications can use
the busid to differentiate when there are multiple instances,
thus don't register the set_busid callback.
serial: xuartps: Enable clocks in the pm disable case also
When Power management is disabled then the clocks are not getting
enabled. This patch enables it for the !PM case also.
While at it also pm_runtime_set_active is called before
calling pm_runtime_enable.
fixes: 870d6d6 "serial: xilinx_uartps: Add pm runtime support"
Reported-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Chirag Parekh [Wed, 22 Mar 2017 06:33:58 +0000 (23:33 -0700)]
pinctrl: zynqmp: Fix code and documentation warnings
This patch fixes following warnings:
checkpatch.pl
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'.
kernel-doc
warning: No description found for parameter 'ngroups'.
warning: No description found for parameter 'iouaddr'.
warning: Excess struct/union/enum/typedef member 'ngroupos'
description in 'zynqmp_pinctrl'.
Signed-off-by: Chirag Parekh <chirag.parekh@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: host: xhci: Correct the log for enabling stream support in XHCI
HCCPARAMS1 register store the Maximum Primary Stream Array(MAXPSASIZE)
variable which is set to non-zero value if BULK streams are supported
by our USB controller. This variable is checked by xhci-plat.c file
for enabling bulk stream support. Since the logic for checking stream
is wrongly placed, software doesn't enable bulk streaming support even
after hardware has support for BULK streams.
This patch corrects the check for enabling Bulk stream support.
This patch is based on 'commit 5de4e1ea9a73 ("usb: host: xhci: plat:
check hcc_params after add hcd")' from torvalds/linux github repository
Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
During edac device allocation edac_device_alloc_ctl_info() needs edac
device index to register. but here we are passing 0 as device index.
and if some other edac device controller is already using that 0 index,
then device allocation will fail.
So instead of hardcoding device index use edac_device_alloc_index().
this will return next available device index.
Signed-off-by: Naga Sureshkumar Relli <nagasure@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers: ata: Correct the AXI bus configuration for SATA ports
Previously PAXIC register was programmed before configuring PCFG
register. PCFG should be programmed with the address of the port
for which PAXIC should be configured for.
This was not happening before, so only one port PAXIC was written
correctly and the other port was having wrong value.
This patch moves the PXAIC register write after configuring PCFG,
doing so will correct the axi bus settings for sata port0 & port1.
Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers: ata: Add CCI support for SATA if CCI is enabled
This patch adds support for CCI in SATA controller if CCI is
enabled in design. This patch will add CCI settings for SATA
if "dma-coherent" dts property is added.
Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
serial: xuartps: Fix the early_console junk character issue
In the early_console_setup is trying to access the unregister clock value,
so we are receiving some garbage clk value bacause of this wrong clk value
the early_console_setup is fail to set the required console baud rate.
This path fix this issue.
Signed-off-by: Nava kishore Manne <navam@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
dma: zynqmp_dma: Fix warning variable 'val' set but not used
This patch fixes the below warning
drivers/dma/xilinx/zynqmp_dma.c: In function 'zynqmp_dma_handle_ovfl_int':
drivers/dma/xilinx/zynqmp_dma.c:522:6: warning: variable 'val' set but not used [-Wunused-but-set-variable]
Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers: dwc3: Correct the logic for GFLADJ adjustment
This patch corrects the logic used for adjusting GFLADJ register
Currently during phy initialization, USB core reset is happening.
Because of reset USB GFLADJ register is getting restored to default
values. This patch updates the GFADJ[21:8] & GFLADJ[5:0] bits if
they are not equal to the requested value from dts.
This patch also removes the WARN_ONCE messages that occur if the
previous register value matches to the current value requested.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Dhaval Shah [Fri, 10 Mar 2017 12:09:57 +0000 (04:09 -0800)]
misc: vcu: updated error handling.
pll_ref clocksource can be a fixed or si570_1 type.
If there is a fixed clock in the pll_ref, we cann't set the
clock in that pll_ref clock source. In this case, we should
bypass the error with the warning only. this will work for
any kind of pll_ref clocksource.
Signed-off-by: Dhaval Shah <dshah@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
We would know how many scratch buffers to allocate in core_init. So,
move scratch buffer allocation in core_init. Keep a check to avoid
re-allocation when core_init is called after probe.
Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Fri, 10 Mar 2017 09:56:36 +0000 (10:56 +0100)]
dma: zynqmp_dma: Fix kernel-doc format
Fix
drivers/dma/xilinx/zynqmp_dma.c:556: info: Scanning doc for
zynqmp_dma_device_config
drivers/dma/xilinx/zynqmp_dma.c:562: warning: No description found for
return value of 'zynqmp_dma_device_config'
drivers/dma/xilinx/zynqmp_dma.c:653: info: Scanning doc for
zynqmp_dma_free_descriptors
drivers/dma/xilinx/zynqmp_dma.c:657: warning: No description found for
parameter 'chan'
drivers/dma/xilinx/zynqmp_dma.c:657: warning: Excess function parameter
'dchan' description in 'zynqmp_dma_free_descriptors'
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Fri, 10 Mar 2017 09:25:45 +0000 (10:25 +0100)]
drm: xilinx: dp_sub: Remove unused variable
Warning log:
drivers/gpu/drm/xilinx/xilinx_drm_dp_sub.c: In function
'xilinx_drm_dp_sub_layer_set_fmt':
drivers/gpu/drm/xilinx/xilinx_drm_dp_sub.c:1202:7: warning: variable
'vid' set but not used [-Wunused-but-set-variable]
bool vid;
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Will Wong [Thu, 9 Mar 2017 18:07:46 +0000 (10:07 -0800)]
arm64: zynqmp: Add access to global general storage registers
This provides the proper interface for user applications to access
the PMU Global General Storage registers 0 to 3, and the PMU Persistent
Global General Storage registers 0 to 3. These registers are commonly
used to track the number of normal and unexpected reboots, system up
times, etc. Until now, these registers can only be accessed through
the debugfs. It is desirable to provide a more proper interface for
them.
For example:
To read from persistent global general storage register 0:
cat /sys/devices/platform/firmware/pggs0
To write 1 byte to persistent global general storage register 0:
echo 0x000000FF 0x000000AB > /sys/devices/platform/firmware/pggs0
Signed-off-by: Will Wong <willw@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Soren Brinkmann [Fri, 10 Mar 2017 00:32:37 +0000 (16:32 -0800)]
ARM64: zynqmp: pm: Fix memory leak
There is a memory leak issue in the PM driver.
The function processing user input uses strsep on a kzalloc'd memory
pointer and later kfrees the same pointer.
Since every strsep call modifies the string pointer, it eventually
points to NULL, thereby passing a NULL pointer to kfree, thus causing a
leak.
The solution is to copy the address of kzalloc'd memory in another
pointer, and kfree this instead.
Hyun Kwon [Thu, 9 Mar 2017 16:51:53 +0000 (08:51 -0800)]
drm: xilinx: dp_sub: Clear the audio reset
The audio soft reset register is non-reset flop, and it doesn't get
reset to the default value. So the register needs to be probrammed
explicitly to be specific value. Otherwise, the value varies between
parts, which was resulting in audio not working on specific parts.
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Fri, 10 Mar 2017 09:11:16 +0000 (10:11 +0100)]
net: cadence: macb: Fix kernel-doc format
Warnings:
drivers/net/ethernet/cadence/macb.c:268: info: Scanning doc for
drivers/net/ethernet/cadence/macb.c:274: warning: No description found
for parameter 'clk'
drivers/net/ethernet/cadence/macb.c:274: warning: No description found
for parameter 'speed'
drivers/net/ethernet/cadence/macb.c:274: warning: No description found
for parameter 'dev'
Signed-off-by: Michal Simek <michal.simek@xilinx.com>