usb: xusbps-dr-of: Fix probe function

There is no reason to call of_match_device inside OF
driver because probe function is called when
compatible strings are matched.
Also copying empty xusbps_pdata is quite weird
that's why I have removed it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: xilinx: Enable ULPI phy detection for usb

Detect usb ulpi phys and set it up in pdata for others usb drivers.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: xilinx: Fix ZED_USB_OTG option

Do not select option if USB_SUPPORT is enabled because
this option depends on it.
Add dependency on XUSBPS_OTG.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: otg: usbps_otg: Automatically setup VBUS

This is zedboard requirement to get otg-host to work.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: ehci-xilinx-usbps: Fix reboot issue in OTG mode via ehci_shutdown

This patch fix the problem with gadget modules
(CONFIG_USB_ZERO=m for example) because root_hub is not initialized
before OTG driver is notified about it. When it is notified
this code in "xilinx_usbps_otg.c" is causing the problem.
because wants to read root_hub structures.

if (otg->otg->host->root_hub) {
      udev_otg = otg->otg->host->root_hub->children[otg_port-1];
}

This patch fix the origin patch
"usb: ehci-xilinx-usbps: Fix reboot issue in OTG mode"
(sha1: 8ec927ba65b0ab037de51921baa5868e57b1ceab)

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
xilinx_axienet: Handle 0 packet receive gracefully

The AXI-DMA rx-delay interrupt can sometimes be triggered when there are 0
outstanding packets received. This is due to the fact that the receive function
will greedily consume as many packets as possible on interrupt. So if two
packets (with a very particular timing) arrive in succession they will each
cause the rx-delay interrupt, but the first interrupt will consume both packets.
This means the second interrupt is a 0 packet receive.

This is mostly OK, except that the tail pointer register is updated
unconditionally on receive. Currently the tail pointer is always set to the
current bd-ring descriptor under the assumption that the hardware has moved onto
the next descriptor. What this means for length 0 recv is the current descriptor
that the hardware is potentially yet to use will be marked as the tail. This
causes the hardware to think its run out of descriptors deadlocking the whole rx
path.

Fixed by updating the tail pointer to the most recent successfully consumed
descriptor.

Reported-by: Wendy Liang <wendy.liang@xilinx.com>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Tested-by: Jason Wu <huanyu@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
xilinx_axienet: Service completion interrupts ASAP

The packet completion interrupts for TX and RX should be serviced before
the packets are consumed. This ensures against the degenerate case when a
new completion interrupt is raised after the handler has exited but before
the interrupts are cleared. In this case its possible for the ISR to clear
an unhandled interrupt (leading to potential deadlock).

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Tested-by: Jason Wu <huanyu@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
mtd: xilinx_nandps: Remove __devinitconst from xnandps_commands

The array is used by a non-(dev)init function and thus must not
be declared __devinitconst.
Fixes a section mismatch warning.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: John Linn <john.linn@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
arm: zynq: udpate device tree flash partitions

The u-boot was changed and now Linux device tree
flash partitions are being cleaned up to allow
for a bitstream to be up high in flash.

Signed-off-by: John Linn <john.linn@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
xilinx-usbps: Initialize ehci hcd before using it

In ehci_xusbps_setup ehci_halt is called before ehci_init. This means that the
initial ehci_halt call is working on a not completely initialized ehci hcd
struct, which might cause undefined behavior. So make sure to call ehci_init
before calling ehci_halt.

This fixes also the following lockdep warning:

	INFO: trying to register non-static key.
	the code is fine but needs lockdep annotation.
	turning off the locking correctness validator.
	[<c001355c>] (unwind_backtrace+0x0/0xe0) from [<c005c6c0>] (__lock_acquire+0x1ac/0x19c0)
	[<c005c6c0>] (__lock_acquire+0x1ac/0x19c0) from [<c005e394>] (lock_acquire+0x60/0x74)
	[<c005e394>] (lock_acquire+0x60/0x74) from [<c034843c>] (_raw_spin_lock_irq+0x50/0x60)
	[<c034843c>] (_raw_spin_lock_irq+0x50/0x60) from [<c02202e8>] (ehci_halt+0x14/0xd8)
	[<c02202e8>] (ehci_halt+0x14/0xd8) from [<c022532c>] (ehci_xusbps_setup+0x58/0x41c)
	[<c022532c>] (ehci_xusbps_setup+0x58/0x41c) from [<c020f828>] (usb_add_hcd+0x194/0x5c0)
	[<c020f828>] (usb_add_hcd+0x194/0x5c0) from [<c0223e28>] (ehci_xusbps_drv_probe+0x158/0x1e0)
	[<c0223e28>] (ehci_xusbps_drv_probe+0x158/0x1e0) from [<c01c84dc>] (platform_drv_probe+0x14/0x18)
	...

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
net: ethernet: xilinx: Do not show LL_TEMAC phy options if isn't selected

Show phy options when it is required. Make no sense to show
it for AXI.

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

Enable options around PCI and USB.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
xilinx_emacps: Release lock on IRQ_NONE return

There is an unlikely early return path from the interrupt service that was
returning without releasing the global lock. If this return path is taken
the driver will crash as soon as any other activity tries to take the global
lock. Resolved by releasing the lock.

This is a regression introduced by 4a135db6d2d8c101221f32c2453562adf84ae06d

Reported-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Tested-by: Wendy Liang <wendy.liang@xilinx.com>
xilinx_emacps: Dont poll interrupts

Don't loop the interrupt service logic in the ISR. Currently it polls for
subsequent interrupts after servicing the first. This is not an error, but is
non-ideal for two reasons:

Firstly, there was a condition where the higher levels of interrupt control
could requeue the ISR while it was still acting. The first invocation would
then service the new interrupt and the second ISR invocation would be a NOP.

Secondly, there is no bound on the length of time the driver spends in ISR
context. ISRs ideally have a deterministic duration.

Fixed by just unlooping. Each ISR is now a oneshot. Interrupts that re-trigger
during servicing are handled by a subsequent incovation of the ISR.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Tested-by: Wendy Liang <wendy.liang@xilinx.com>
zynq: Update defconfig

Add a local version to indicate a Xilinx kernel.

Signed-off-by: John Linn <john.linn@xilinx.com>
Revert "xilinx_emacps: Dont poll interrupts"

This reverts commit 8c5e47575ddd6cb91851490fead2fde50fd61dcf.

Let's keep this patch for the next release when
we exactly know performance impacts.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: John Linn <john.linn@xilinx.com>
zynq/microblaze: pcie: Modified to support PCIe node ranges property

There is a change in ranges property of PCIe node in device-tree, for which the driver needs support. This commit fix this.

Signed-off-by: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Merge branch 'master' of git://git.xilinx.com/linux-xlnx into xcomm_zynq

Conflicts:
	drivers/usb/host/ehci.h
Move virtual mappings into vmalloc space

fixes the folowing kernel messages at startup:
BUG: mapping for 0xf8f00000 at 0xfe00c000 out of vmalloc space
BUG: mapping for 0xe0001000 at 0xfe001000 out of vmalloc space
BUG: mapping for 0xffff1000 at 0xfe200000 out of vmalloc space

vmalloc space defaults to "0xee000000 - 0xfd000000"
spi-xilinx-qps: Use initcall

This allows a root filesystem to be present in the internal flash.
Otherwise, ubifs driver will start before the mtd devices exist,
which results in the root fs failing to mount.