Masahiro Yamada [Mon, 20 May 2013 21:08:08 +0000 (21:08 +0000)]
cmd_mem: fix cp command
The "cp" command has not worked since
commit 0628ab8ec59834f98ede267edd21ddb8ba0bb57b,
because of the following lines, which set the destination
and the source to the same address.
mmc: sdhci: Enable 8-bit bus width only for 3.0 spec onwards
CAP register don't have any information for 8-bit buswidth support
on 2.0 sdhci spec, only from 3.0 onwards bit[18] got this information.
Due to this misassignment in sdhci, mmc is setting 8-bit buswidth using
mmc_set_bus_width even if controller doesn't support.
Below change has code information.
"mmc: Properly determine maximum supported bus width"
(sha1: 7798f6dbd5e1a3030ed81a81da5dfb57c3307cac)
Bug log: <mmc plus and emmc cards)
-------
zynq-uboot> mmcinfo
Error detected in status(0x208100)!
Device: zynq_sdhci
Manufacturer ID: fe
.....
So enable 8-bit support only for 3.0 spec using CAP and for below 3.0
assign mmc->host_caps = MMC_MODE_8BIT on respective platform driver
if host have a support.
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
For reading upper qspi in dual stacked mode, the remain_len logic
should have a bank_sel based on the total size of the flash, not
with half of total size.
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Removed spi_flash_bank() unify logic code, and place into
to a respective flash ops routines. So-that it makes some
more clearity on the code logic in early support.
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Use proper name for the driver before we go to mainline.
- XQSPIPS -> ZYNQ_QSPI
- NORM_READ -> NR
- FAST_READ -> FR
- DUAL_READ -> DR
- QUAD_READ -> QR
- ERASE_SUS -> ES
- ERASE_RES -> ER
- xqspips -> zynq_qspi
- zynq_spi_slave -> zynq_qspi_slave
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Flag status register polling is required for micron 512Mb flash
devices onwards, for performing erase/program operations.
Like polling for WIP(Write-In-Progress) bit n read status register,
spi_flash_cmd_wait_ready will poll for PEC(Program-Erase-Control)
bit in flag status register.
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
There is no other call other than spi_flash_cmd_wait_ready(),
hence removed spi_flash_cmd_poll_bit and use the poll status code
spi_flash_cmd_wait_ready() itself.
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
spi: zynq: Use divide by 8 baud rate for qspi dual stacked connection
Currently the qspi dual stacked support is available on afx boards,
there is a board hardware bug, that the controller will works on
divide by 8. hence changed the master mode baud rate divisor to /8
incase of dual stacked mode qspi.
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
sf: Update the qspi dual stacked flash access logic
Updated the xilinx qspi dual stacked flash access.
Now the two memories were linearly accessable without
need a user interaction for selecting chip select.
Below are the changes for dual stacked to work:
- mtd layer -> nr_sectors/nr_blocks*2, update the U_PAGE flag
when memory change happen.
- driver -> on LQSPI_CFG, Enable TWO_MEM[BIT:30] on LQSPI_CFG
Enable U_PAGE[BIT:28] if U_PAGE flag set - upper memory
Disable U_PAGE[BIT:28] if U_PAGE flag unset - lower memory
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
sf: Update the qspi dual parallel flash access logic
Updated the xilinx qspi dual parallel flash access support
to use 3-byte addressing instead of 4-byte addressing used
from the mtd flash layer.
Instead of sending 4-byte addressing from mtd layer and
then the controller will again divide the offset addr by 2 and
convert the 4-byte address into 3-byte address, With this
new logic the mtd will serve the offset as offset by 2 and
send the 3-byte addressing to controller driver, as the
driver is configured as separate bus with two mem the
controller internal hardware algorithm will take care the
dual parallel functionality.
Below are the changes for dual parallel to work:
- mtd layer -> addr/2, page_size*2, nr_sectors/nr_blocks*2
- driver -> enable SEP_BUS[BIT:29],TWO_MEM[BIT:30] on LQSPI_CFG
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
zynq_qspips:Break infinite loop after 1000 status read after trying to set qbit
Currently, u-boot end up in infinite loop when the status reg of the SPI flash
is not 0 after it tries to set the quad bit. If quad bit setting fails, u-boot
hangs because of this infinite loop.
We introduce a counter. If the status register value is still not 0 after 1000
runs, it break the loop.
Michal Simek [Mon, 6 May 2013 04:11:58 +0000 (04:11 +0000)]
patman: Do not hardcode python path
Patman requires python 2.7.4 to run but it doesn't
need to be placed in /usr/bin/python.
Use env to ensure that the interpreter used is
the first one on environment's $PATH on system
with several versions of Python installed.
Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@ti.com> Acked-by: Simon Glass <sjg@chromium.org>
Michal Simek [Fri, 26 Apr 2013 11:12:07 +0000 (13:12 +0200)]
cmd: fpga: Move fpga_loadbitstream to fpga.c
In bitstream decoding you can directly check device
which you want to load and in fpga.c are fpga_validate
and fpga_dev_info functions which should be used for it.
Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@ti.com>
which fix enabling gem driver when baseaddr is specified.
Address of the first gem must be hardcoded because
include hardware.h is not possible because contains
C code.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
petalinux-arm-auto.h assignment is useless.
Do not assing XILINX_PS7_QSPI_FLASH_BASEADDR to XILINX_SPI_FLASH_BASEADDR
because below it is check by if defined().
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Remove ARM eabi exception handling tables (for frame unwinding).
AFAICT, u-boot stubs away the frame unwiding routines, so the tables will
more or less just consume space. It should be OK to remove them.
Comment from Albert:
By default the *exidx* sections are between rodata and data, so
removing them causes many apparent changes at the binary level.
However, builds of zynq based on ARM master with the patch above vs
master with a patch mapping *exidx* sections after BSS gives identical
binaries. Thus the RFC has no functional effect.
Also, ARM EHABI states that [exception] Tables are not required for ABI
compliance at the C/Assembler level but are required for C++.
So as long as we don't put any C++ code in U-Boot (a prospect that I
don't see happening any time soon), this RFC is safe and either is a
no-op or removes useless bytes from the binary.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Wed, 24 Apr 2013 08:01:20 +0000 (10:01 +0200)]
gpio: Add support for microblaze xilinx GPIO
Microblaze uses gpio which is connected to the system reset.
Currently gpio subsystem wasn't used for it.
Add gpio driver and change Microblaze reset logic to be done
via gpio subsystem.
There are various configurations which Microblaze can have
that's why gpio_alloc/gpio_alloc_dual(for dual channel)
function has been introduced and gpio can be allocated
dynamically.
Adding several gpios IP is also possible and supported.
For listing gpio configuration please use "gpio status" command
This patch also remove one compilation warning:
microblaze-generic.c: In function 'do_reset':
microblaze-generic.c:38:47: warning: operation on '*1073741824u'
may be undefined [-Wsequence-point]
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is not required as max_write_size is initalized to 0
in spi_alloc_slave().
This change is not required as equivalent functionality was
introduced by below commit.
"spi: zynq: Use spi_alloc_slave() in each SPI driver"
(sha1: 00e98f66ab2dd60738b657ff645cbcb9477f2037)
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Michal Simek [Wed, 1 May 2013 09:31:07 +0000 (11:31 +0200)]
fpga: zynq: Add support for loading bitstream
Devcfg device requires to load bitstream in binary format.
But u-boot also has an option for loading bitstream in bit
format. Let's handle both cases by zynqpl driver.
Also add suport for loading partial bitstreams.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
sf: Update the qspi dual parallel flash access logic
Updated the xilinx qspi dual parallel flash access support
to use 3-byte addressing instead of 4-byte addressing used
from the mtd flash layer.
Instead of sending 4-byte addressing from mtd layer and
then the controller will again divide the offset addr by 2 and
convert the 4-byte address into 3-byte address, With this
new logic the mtd will serve the offset as offset by 2 and
send the 3-byte addressing to controller driver, as the
driver is configured as separate bus with two mem the
controller internal hardware algorithm will take care the
dual parallel functionality.
Below are the changes for dual parallel to work:
- mtd layer -> addr/2, page_size*2, nr_sectors/nr_blocks*2
- driver -> enable SEP_BUS[BIT:29],TWO_MEM[BIT:30] on LQSPI_CFG
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
sf: Update spi_flash framework to handle all sizes of flashes
Updated the spi_flash framework to handle all sizes of flashes.
As most of the flashes introduces a bank/extended address registers
for accessing the flashes in 16Mbytes of banks if the flash size
is > 16Mbytes, this new scheme will add the bank selection feature
for performaing write/read/erase operations on all flashes.
u-boot.bin size:
- before 262192bytes
- after 262080bytes
sf speed(65536 bytes wr):
- before 1.528s, speed 43890 B/s
- after 1.533s, speed 43776 B/s
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 25 Apr 2013 14:14:18 +0000 (16:14 +0200)]
petalinux: Use directly xilinx platforms
Currently all of these platforms are symlinks to xilinx
boards which is breaking out of tree compilation.
Keep symlinks but setup board files directly to proper
folder solves this problem.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Jason Wu [Fri, 12 Apr 2013 00:54:45 +0000 (10:54 +1000)]
template:/petalinux-auto-board.h: Remove 0x in front of ${filesize}
The 0x is not required tread as hex value. However, this is required
for Zynq sd_update_boot because the filesize return by fat load is
in hex size but with 0x prefix. This will cause sf error due to
the file size is 0x0xABCD not 0xABCD.