video: xylonfb: Add missing header

It should be the part of patch
"Merge tag 'v3.9' into master-next"
(sha1: 79a6cbd54869ed374f0d4ac6f2627c399b9eb34e)

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>
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>
arm: Generate proper load section addresses

Moving to multiplatform caused that LOAD session
were wrongly generated for our images.
simpleImage is currently used by Qemu.

Wrong - before this patch:
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x008000 0xc0008000 0xc0008000 0x4fffe8 0x507fe8 RWE 0x8000
  LOAD           0x507fe8 0xc050ffe8 0xc050ffe8 0x8b130 0xb5a88 RWE 0x8000
  NOTE           0x52c2ac 0xc05342ac 0xc05342ac 0x00024 0x00024 R E 0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4

Correct - after this patch:
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x008000 0xc0008000 0x00008000 0x4fffe8 0x507fe8 RWE 0x8000
  LOAD           0x507fe8 0xc050ffe8 0x0050ffe8 0x8b130 0xb5a88 RWE 0x8000
  NOTE           0x52c2ac 0xc05342ac 0x005342ac 0x00024 0x00024 R E 0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arm: zynq: slcr: Fix array size

An array holding status bits was defined too small. This is fixed by
removing the static array size with a compile time calculation.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynq: Add support for zynq_cpu_kill function

Use simple hook to slcr to stop cpu.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
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>
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>
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>
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>
misc: si570: Fix compiler warning

Fix potentially uninitialized variable.

Signed-off-by: Davor Joja <davorjoja@logicbricks.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
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>
char: devcfg: Remove de-documented user-mode feature

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>
arm: zynq: remove Makefile.boot

Since we have converted zynq to multiplatform build,
Makefile.boot is not used anyway. Remove it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
ARM: zynq: use generic cpu idle function for wfi

use cpu_do_idle for entering the wfi mode.

Signed-off-by: Sanjay Singh Rawat <sanjay.rawat@linaro.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arm: dt: zed: fixing xadc register area

Removed the extra zero in the register area size.

Signed-off-by: Veena Kumar <veena.kumar@xilinx.com>
Reviewed-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
microblaze: Reversed logic in futex cmpxchg

futex_atomic_cmpxchg_inatomic exchanged if the values were
unequal rather than equal. This caused incorrect behavior
of robust futexes.

Signed-off-by: Kirk Meyer <kirk.meyer@sencore.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
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>
zynq: Fix smp code not to rewrite code when starting address is 0x0

This is used by remoteproc.
Revert "ll_temac: Fix some compatibility things to get it work on 3.3"

This reverts commit 898b18df67b7f20238e9c189f4d40c6f13188d29.

This problem is not with ll_temac driver anymore.
Synchronize it with mainline code.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
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>