Suneel Garapati [Tue, 18 Jun 2013 09:30:07 +0000 (15:00 +0530)]
mtd: m25p80: xilinx: Force 3 byte addressing for zynq qspi for large flash size
Hack the addr width to 3 in case of large size flash connected to
zynq qspi controller and force this only if the connected spi controller
is zynq ps qspi.
Signed-off-by: Suneel Garapati <suneel.garapati@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Suneel Garapati [Thu, 30 May 2013 21:11:26 +0000 (02:41 +0530)]
mtd: m25p80: Add support to program bank or extended address register
Added opcode to program extended address register. Added function
write_ear to program bank or extended address register. Added curbank
member to m25p structure.
This needs discussion on mainline and will be re-visited
later.
Signed-off-by: Suneel Garapati <suneel.garapati@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Suneel Garapati [Thu, 30 May 2013 20:30:48 +0000 (02:00 +0530)]
mtd: m25p80: Add check on flag status register for Micron flash devices
In wait_till_ready, after poll on status register, if check_fsr is set
poll on flag status register to check no program/erase operation
is in execution. check_fsr is set only if E_FSR flag is added to
flash entry in flash_info structure.
This needs discussion on mainline and will be re-visited
later.
Signed-off-by: Suneel Garapati <suneel.garapati@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Suneel Garapati [Thu, 30 May 2013 11:44:39 +0000 (17:14 +0530)]
spi: xilinx-qps: Modify the tx logic to use txd1/2/3
Tx logic is modified to utilize TxD1/2/3 registers and few
other constraints.
Transmit length is split into multiples of 4 bytes and the
remainder is transmitted using TxD1/2/3. Also, a transmit on
TxD1/2/3 needs a check for Tx empty before using TXD0 and
vice versa. Towards this requirement, tx_fill_fifo is updated
to fill only if tx length is greater than 4 bytes. For any length
the remainder bytes is first pushed to TxD1/2/3 and enables
interrupts to wait for tx empty interrupt and transfer the remaining
in interrupt routine.
Signed-off-by: Suneel Garapati <suneel.garapati@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Suneel Garapati [Thu, 30 May 2013 10:47:06 +0000 (16:17 +0530)]
spi: xilinx-qps: Added macros for bank instructions and lqspi
Opcode definitions for Bank instructions of Spansion and Micron.
Opcode definition for Flag status register read and added these
opcodes to Instruction format table.
Macro for linear qspi config register upper page bit mask.
Signed-off-by: Suneel Garapati <suneel.garapati@xilinx.com> Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Soren Brinkmann [Wed, 29 May 2013 18:20:47 +0000 (11:20 -0700)]
net: xemacps: Disable clocks only once
When the driver is removed clocks may be disabled due to runtime PM. If
this happens, remove() must not disable the clocks again. Therefore,
check the runtime PM status in remove() and take the appropriate action.
Soren Brinkmann [Fri, 14 Jun 2013 18:54:17 +0000 (11:54 -0700)]
clk: zynq: pll: Fix wait for PLL lock
The condition for waiting for the PLL lock when enabling the PLL was
inversed, waiting for a non-locked PLL.
Invert the condition when waiting for the PLL lock, so we actually wait
for a locked PLL.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Mon, 3 Jun 2013 11:54:47 +0000 (13:54 +0200)]
GPIO: xilinx: Use __raw_readl/__raw_writel IO functions
This driver can be used on Xilinx ARM Zynq platform
where in_be32/out_be32 functions are not implemented.
Use __raw_readl/__raw_writel functions which are
implemented on Microblaze and PowerPC.
For ARM readl/writel functions are used instead.
The correct way how to implement this is to detect
endians directly on IP. But for the gpio case
without interrupt connected(it means without
interrupt logic) there are just 2 registers
data and tristate where auto detection can't be done.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Until recently uio_get_minor() returned 0 for success and
a negative value on failure. This became non-negative for suceess and
negative for failure. Restore the original return value spec so that we can
successfully initialize UIO devices with a non-zero minor device
number.
AXI PCIe driver has been changed to use dynamic irq allocation
in below commit
"zynq: pcie: Removed static irq allocation"
(sha1: 0bec56c81b8c4968eab33416b9e214a90e2f3241)
Signed-off-by: Srikanth Thokala <sthokal@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Modules shouldn't use of_irq_count() but better to use
driver resources which are already initialized.
Both remoteproc drivers have been fixed that's why
we can revert this patch.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Fri, 31 May 2013 14:05:38 +0000 (16:05 +0200)]
remoteproc: Do not use of_irq_count in xilinx drivers
Driver resources are already filled and driver can use them.
The reason is that of_irq_count() is not exported
for modules in the mainline.
The next patch which revert this patch which we have in our tree.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
In xemacps_probe(), do not set NETIF_F_FRAGLIST in ndev->features, only
NETIF_F_SG. xemacps_start_xmit() handles skb_shinfo(skb)->nr_frags, but
not skb_shinfo(skb)->frag_list.
Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Thomas Betker [Sat, 11 May 2013 09:10:45 +0000 (11:10 +0200)]
xilinx_emacps: Fix deadlock in xemacps_reinit_for_txtimeout()
In xemacps_reinit_for_txtimeout(), do not hold tx_lock when calling
tasklet_disable(). If xemacps_tx_poll() starts to run between acquiring
tx_lock and tasklet_disable(), we are caught in a deadlock because
tasklet_disable() waits until xemacps_tx_poll() has finished.
Also use netif_wake_queue() instead of netif_start_queue(), and don't
forget to update ndev->trans_start.
Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Thomas Betker [Sat, 11 May 2013 09:10:44 +0000 (11:10 +0200)]
xilinx_emacps: Restart transmission in xemacps_tx_poll().
In xemacps_tx_poll(), restart transmission if there are still buffers
in the BD list [and at least one packet was transmitted]. It is
possible that transmission has stopped due to an error, and we don't
want to wait for the next xemacps_start_xmit().
Also, use netif_wake_queue() instead of netif_start_queue() so that
__netif_schedule() is invoked.
Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Thomas Betker [Sat, 11 May 2013 09:10:42 +0000 (11:10 +0200)]
xilinx_emacps: Check hwcnt in xemacps_tx_poll()
In xemacps_tx_poll(), loop only while bdcount < SEND_BD_CNT - freecnt
(formerly known as hwcnt). Otherwise, we may loop through the whole Tx
BD list since "free" BDs always have the USED bit set. This should not
result in an error since no LAST bit is found, but it eats up time.
This issue was introduced by the commit "xilinx_emacps: Optimize the BD
handling logic" on Jan 21, 2013.
Note that there is no corresponding issue for the Rx BD list because
its freecnt is 0.
Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Thomas Betker [Sat, 11 May 2013 09:10:41 +0000 (11:10 +0200)]
xilinx_emacps: Don't check TXSR_TXCOMPL in xemacps_tx_poll()
It doesn't really make sense to stop in xemacps_tx_poll() when
TXSR_TXCOMPL is not set. The logic works the other way round: When a
buffer becomes ready after reading TXSR, there is no reason why we
shouldn't process it. This is similar to xemacps_rx_poll() where
RXSR_FRAMERX isn't checked either.
We do stop when no buffers are available, though. In this case, skip
netif_start_queue() because nothing has changed.
Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Thomas Betker [Sat, 11 May 2013 09:10:40 +0000 (11:10 +0200)]
xilinx_emacps: Handle NAPI "rotten packets"
When xemacps_rx_poll() has processed the Rx BD ring until it is empty,
another packet may come in before we have unmasked the Rx interrupts.
No interrupt is signalled for it, and it is left to rot in the BD ring
until the next packet is received.
This is what NAPI calls a "rotting packet", and it actually seems to
occur quite often in heavy traffic (about 30 times per second),
sometimes leading to Rx stalls.
The solution is standard: Check the Rx BD ring again after unmasking
the Rx interrupts, and reschedule NAPI (and remask the interrupts) when
a new packet is detected.
Note that we no longer need an inner loop around xemacps_rx(); the
latter returns when the BD list is empty or the budget is reached, so
we are usually done. [Previously, xemacps_rx() would also return when
XEMACPS_RECV_BD_CNT was reached, so we had to loop over it.]
Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Thomas Betker [Sat, 11 May 2013 09:10:39 +0000 (11:10 +0200)]
xilinx_emacps: Fix skb allocation in xemacps_rx()
In xemacps_rx(), allocate the new skb before handling the old one. If
netdev_alloc_skb() fails, we don't want the Rx BD list to get stuck in
an inconsistent state; instead, we try again with the next interrupt.
We also return numbdfree now when skb allocation fails, not 0.
Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Thomas Betker [Sat, 11 May 2013 09:10:38 +0000 (11:10 +0200)]
xilinx_emacps: Fix panic in xemacps_mii_probe()
The code checks phydev only when phy_node != NULL, resulting in a
panic when phy_node == NULL (because phydev == NULL). We now check
phydev also when phy_node == NULL, generating an error message.
This issue was introduced by the commit "xilinx_emacps: Add support for
EMIO" on Apr 03, 2013.
Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Thomas Betker [Sat, 11 May 2013 09:10:37 +0000 (11:10 +0200)]
xilinx_emacps: Fix xemacps_read() and xemacps_write()
The 'base' argument in xemacps_read() and xemacps_write() must be cast
to 'void *' before adding 'reg', not afterwards. Otherwise, pointer
arithmetic will do the wrong thing if, e.g., 'base' is a 'u32 *'.
This issue was introduced by the commit "xilinx_emacps: Remove sparse
errors" on Jan 21, 2013.
Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
net: xilinx_emacps: Don't disconnect phy in remove
The phy is always connected in xemacps_open() so it should only
disconnect it in its cleanup counterpart xemapcs_close(). Remove
the extraneous phy_disconnect() in xemacps_remove accordingly.
Reported-by: Davor Joja <davorjoja@logicbricks.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Device-tree BSP generates port-number which is used
for setup proper device ID that's why we don't need
to care about positions in aliases node.
Both are synchronized by device-tree BSP.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Fri, 17 May 2013 11:33:35 +0000 (13:33 +0200)]
watchdog: xilinx: Remove SETTIMEOUT
Based on my upstream discussion this feature
shouldn't be implemented for this watchdog
because there is no option to set up timeout.
Every application has to check return value
that this feature is not implemented.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 30 May 2013 13:10:52 +0000 (15:10 +0200)]
microblaze: Fix sparse warnings
arch/microblaze/include/asm/uaccess.h:101:3:
warning: cast removes address space of expression
arch/microblaze/include/asm/uaccess.h:107:2:
warning: cast removes address space of expression
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Fri, 24 May 2013 15:07:34 +0000 (17:07 +0200)]
remoteproc: zynq: Do not deallocate already allocated IPI
This causes issue when for example remoteproc wants to use
system IPI which is already allocated which end up
that the driver clears system IPI mapping.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This bit has become un-documented, as it is a bootrom only feature.
It is marked as "do no modify", so the driver should only set it as
part of a read-modify-write process.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Rob Armstrong JR [Fri, 24 May 2013 00:15:52 +0000 (02:15 +0200)]
char: xdevcfg: Ensure PCAP loopback is disabled
Some versions of the Zynq first stage boot loader enable PCAP loopback
during boot regardless of whether or not the boot image includes PL
configuration. This behavior only appears in certain boot modes (notably
QSPI boot). Attempting to configure the PL with the loopback bit set
will result in timeouts and will prevent successful configuration.
In order to avoid this problem, and to avoid dependency on the version
of the FSBL used to boot the system, ensure that the loopback enable bit
is cleared when loading the driver.
Signed-off-by: Rob Armstrong <ra@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Soren Brinkmann [Fri, 17 May 2013 16:47:45 +0000 (09:47 -0700)]
char: xdevcfg: Allow userspace fclk controls
In order to have simple control over the FPGA clocks, controls can be
exported to userspace through sysfs.
The files 'fclk_export' and 'fclk_unexport' are created under the devcfg
device node in sysfs. Reading those files returns the valid values to
write to the corresponding file.
Writing a valid value to 'fclk_export' exports clock controls for the
chosen clock in the 'fclk' subdirectory. Similarly, writing a valid
value to 'fclk_unexport' reverts the export.
Currently the CCF API functions 'clk_enable'/'clk_disable',
'clk_round_rate' and 'clk_set_rate' are exported (clk_(un)prepare is
implicitly done during (un-)export).
enable:
Writing non-zero to this file enables the clock. Writing zero disables it.
round_rate:
Writing a frequency in Hz to it sets the frequency to be rounded.
Reading the file prints the set frequency and the rounded frequency.
set_rate:
Reading this file returns the current clock frequency. Writing sets a
new frequency.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Wed, 22 May 2013 08:11:52 +0000 (10:11 +0200)]
zynq: SMP crashkernel support
Add hook to arm crashkernel to support crashkernel on smp systems
where it is necessary to disable nonboot cpus.
Based on Stephen Warren's patch:
"ARM: call disable_nonboot_cpus() from machine_shutdown()"
https://patchwork.kernel.org/patch/1925071/
which is already applied too.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Stephen Warren [Wed, 2 Jan 2013 21:07:41 +0000 (21:07 +0000)]
ARM: call disable_nonboot_cpus() from machine_shutdown()
On Tegra at least, this change allows kexec to work with SMP enabled.
Without this, machine_shutdown() simply puts all CPUs into a loop. If
the code of that loop is over-written, the CPUs may hang or crash (which
I do observe in practice), or cause the kexec'd kernel not to be able to
initialize them.
This fix has the added benefit that the kexec always happens on the boot
CPU, and thus kexec mirrors the initial kernel boot as much as possible.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Wed, 22 May 2013 08:10:54 +0000 (10:10 +0200)]
net: emacps: Move request_irq to the end of probe function
Move request_irq function to the end of emacps probe
because when system crashes there could be unhadled
interrupts when crashkernel come again and after
request_irq driver starts to handle it but not all
things are initialized yet.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 23 May 2013 06:04:09 +0000 (08:04 +0200)]
microblaze: Use proper casting for inb/inw/inl in io.h
We are going to move to asm-generic/io.h but
let's fix compilation warnings first for 3.10.
Warning message:
arch/microblaze/include/asm/io.h:126:26: warning: cast to
pointer from integer of different size [-Wint-to-pointer-cast]
#define inb(port) readb((u8 *)((port)))
...
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
The patch fix compilation errors:
drivers/video/xylon/xylonfb/of/../core/../misc/xylonfb-adv7511.c:220:1:
error: unknown type name 'irqreturn_t'
drivers/video/xylon/xylonfb/of/../core/../misc/xylonfb-adv7511.c:228:9:
error: 'IRQ_HANDLED' undeclared (first use in this function)
...
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Rob Armstrong JR [Mon, 20 May 2013 17:30:23 +0000 (19:30 +0200)]
arm: zynq defconfig: Remove input event debugging
In the general Zynq defconfig input device event debugging
is enabled, which fills the log buffer with evbug messages
when using a keyboard or mouse. These messages aren't useful
unless actively debugging input devices and can obscure
more relevant log messages, so disable them by default.
Signed-off-by: Rob Armstrong <ra@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Soren Brinkmann [Fri, 17 May 2013 16:39:29 +0000 (09:39 -0700)]
arm: zynq: pm: Fix compilation error
The variable 'scu_base' had been renamed to 'zynq_scu_base'. pm.c has
not been updated accordingly. Fixing this with a simple search and
replace:
s/scu_base/zynq_scu_base
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Srikanth Thokala [Tue, 14 May 2013 11:54:50 +0000 (17:24 +0530)]
net: ethernet: axienet: Handle jumbo frames for lesser frame sizes
In the current implementation, jumbo frames are supported only
for the frame sizes > 16K. This patch corrects this logic to
handle jumbo frames for lesser frame sizes (< 16K) ensuring jumbo frame
MTU is within the limit of max frame size configured in the h/w
design.
Signed-off-by: Srikanth Thokala <sthokal@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>