petalinux: Add all synchronized platforms

This is simple version of all petalinux platform.
Difference between generic xilinx boards is
only in better configuration. Both use the same
board files.

Signed-off-by: Michal Simek <monstr@monstr.eu>
petalinux-auto-board.h.template: include per platform configuration

allows user to include their custom configuration even after the platform
switch.

Signed-off-by: Jason Wu <huanyu@xilinx.com>
microblaze: Fix reset function

Remove CONFIG_SYS_RESET_ADDRESS macro.
It was there from historical point of view
when soft reset was just jump to u-boot text start
(not used right now).

Signed-off-by: Michal Simek <monstr@monstr.eu>
microblaze: Disable all cpu features before reset

Fix microblaze soft reset function and disable
all cpu features. Especially disable caches because
IRQs were off by disable_interrupts().

Reported-by: John Williams <john.williams@xilinx.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
Do not hang if the kernel image is legacy image

U-boot should not hang because it fails to create FDT nor any of
the following tag is defined:
 CONFIG_SETUP_MEMORY_TAGS
 CONFIG_CMDLINE_TAG
 CONFIG_INITRD_TAG
 CONFIG_SERIAL_TAG
 CONFIG_REVISION_TAG

Signed-off-by: Wendy Liang <jliang@xilinx.com>
Tested-by: Michal Simek <monstr@monstr.eu>
microblaze: Add muldi3.c which contains routines for _muldi3

Referenced arch/blackfin/lib/muldi3.c and the linux kernel.
Resolves issue seen when building u-boot for HW_MUL=0;

PLATFORM_CPPFLAGS += -mxl-soft-mul
PLATFORM_CPPFLAGS += -mno-xl-multiply-high

which resulted in error while linking to libgcc.a without mul hw (bs / m);

libgcc.a(_muldi3.o): In function `__muldi3':
.... src/gcc-4.6.2/libgcc/libgcc2.c:550: undefined reference to `_GLOBAL_OFFSET_TABLE_'

This link failure would not occur if we used gcc instead of ld directly, as
gcc will correctly use the crt's to resolve this link.

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
mtd: cfi_flash: Revert Xilinx specific hack

Revert the hack to force the write buffer size to 256 bits. The
hack breaks any flash devices that have a write buffer that is not
256bits (e.g. JS28F256P30T95, on the ML507).

Signed-off-by: Jason Wu <huanyu@xilinx.com>
Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
spi: xilinx_spi: Perform software reset during slave setup

to make sure it is in the clear state.

Signed-off-by: Jason Wu <huanyu@xilinx.com>
configs: auto-board template: remove unnecessary #ifdef checking

Signed-off-by: Jason Wu <huanyu@xilinx.com>
zynq: nand: Fix SET_FEATURES issue for OnDie ECC NAND

Use writeb in place of write_buf to set features used to
enable OnDie ECC.

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
block: systemace: Fix incorrect ace_write for width 16

Current implementation works fine for bus width = 16 bits because we
never get into "if" branch.

If one sets width to 8 bits there will be 2 consequent data accesses
write:
1. Correct data access for 8-bit bus
2. Unconditional (and in this case incorrect) data access as if data bus
is 16-bit wide

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynq_gem: Fix incorrect clearing of RX_STATUS

The RX_STATUS register was being cleared after servicing the underlying event.
This is incorrect as if another packet is received after the service routine
(Xgmac_process_rx()) returns, then the frame-received flag for the new packet
will be cleared. U-boot will then completely miss the new packet even though
the hardware has sucessfully received it.

Fixed by clearing the RX_STATUS register immediately after polling.

Reported-by: Jason Wu <huanyu@xilinx.com>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
zynq_gem: Cleanup debug messages

A couple of printfs intended for debugging were commented out. debug()ified
them. Move the one about packet RX to a more appropriate location. Previously
it would only trigger once in the case where multiple packets were received
in quick succession. Now it will trigger once for every packet.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Merge branch 'xilinx/master-next' into petalinux/master-next

Change MMC configuration and using new gem driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
sf: Do not use SZ_16M for Microblaze

Microblaze doesn't define asm/sizes.h that's why SZ_16M
can't be used. Use direct value instead.

This should be the part of this patch.
"sf: Add bank address access support"
(sha1: 5b00fc8b7fbf422bdc18de2bfa414db38026094f)

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
petalinux: Enable fpga command for zynq

fpga command provides an option to configure
programmable logic on zynq.
Enabling this option adds +3kB.

Usage:
tftp 10000000 fpga.bin
fpga info 0
fpga load 0 10000000 ${filesize}

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Revert "mtd: spi_flash: Warn user with 3 byte addressing limitations"

This reverts commit eef1451bb3cb039f62b018a5daf9cdbc4ef56f22.

Now the current implementation in spi_flash.c is able to access the
flash from greater than 16MiB in 3-byte addressing.

This should be the part of this patch:
"sf: Add bank address access support"
(sha1: 5b00fc8b7fbf422bdc18de2bfa414db38026094f)

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
microblaze: Remove custom fsl command

This command was used for microblaze fsl but it has never been
used and properly tested.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynq_common: Ensure that commands won't be run partially

Ensure that if one command fails when others won't be
executed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynq_common: Define CONFIG_ENV_IS_NOWHERE

CONFIG_ENV_IS_NOWHERE needs to be defined when CONFIG_SYS_NO_FLASH is
set. Otherwise compilation error will occur when try to compile a
system without a flash.

Signed-off-by: Jason Wu <huanyu@xilinx.com>