[U-Boot] [U-Boot, v2, 1/2] spi: zynqmp_qspi: Add support for ZynqMP qspi drivers
Liam Beguin
liambeguin at gmail.com
Fri Jan 26 05:09:05 UTC 2018
Hi Siva,
Sorry for the very late reply!
> -----Original Message-----
> From: Siva Durga Prasad Paladugu [mailto:siva.durga.paladugu at xilinx.com]
> Sent: Thursday, January 04, 2018 1:08 PM
> To: u-boot at lists.denx.de
> Cc: jagannadh.teki at gmail.com; Siva Durga Prasad Paladugu
> <sivadur at xilinx.com>
> Subject: [PATCH v2 1/2] spi: zynqmp_qspi: Add support for ZynqMP qspi
> driver
>
> This patch adds qspi driver support for ZynqMP SoC. This driver is
> responsible for communicating with qspi flash devices.
The Technical Reference Manual of the ZynqMP talks about the LQSPI and
the GQSPI. Based on the #defines, I'm guessing this is for the GQSPI
but should we be more explicit about it?
>
> Signed-off-by: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
> ---
> Changes from v1:
> - Rebased on top of latest master
> - Moved macro definitions to .h file as per comment
> - Fixed magic values with macros as per comment
> ---
> arch/arm/cpu/armv8/zynqmp/Kconfig | 7 +
> arch/arm/include/asm/arch-zynqmp/zynqmp_qspi.h | 154 ++++++
> drivers/spi/Makefile | 1 +
> drivers/spi/zynqmp_qspi.c | 678
> +++++++++++++++++++++++++
> 4 files changed, 840 insertions(+)
> create mode 100644 arch/arm/include/asm/arch-zynqmp/zynqmp_qspi.h
> create mode 100644 drivers/spi/zynqmp_qspi.c
I tried building on top of master and running it on a zcu102 (Rev-B)
board but I can't get anything newer than v2017.11 to work.
I get this failure (unrelated to this series):
In: serial at ff000000
Out: serial at ff000000
Err: serial at ff000000
initcall sequence 000000007ff8dee8 failed at call 0000000008002c7c
(err=-22)
### ERROR ### Please RESET the board ###
After looking arround a little, it seems it may be because of my FSBL.
Since I can't get another FSBL for now, I rebased the series on top of
v2017.11 and it seems to be working well except for the erase
operation in a certain range of flash addresses.
The same operations (in that range) in Linux seem to be working.
I'm guessing this is due to something else, maybe in the spi_flash
driver.
Here is the test I used:
ZynqMP> sf probe
SF: Detected n25q512a with page size 256 Bytes, erase size 4 KiB,
total 64 MiB
ZynqMP> mw.w 0x100 0x00 0x100
ZynqMP> md.w 0x100
00000100: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000110: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000120: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000130: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000140: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000150: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000160: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000170: 0000 0000 0000 0000 0000 0000 0000 0000 ................
ZynqMP> sf read 0x100 0x00 0x100
device 0 offset 0x0, size 0x100
SF: 256 bytes @ 0x0 Read: OK
ZynqMP> md.w 0x100
00000100: 1234 1234 abcd abcd abcd abcd abcd abcd 4.4.............
00000110: abcd abcd abcd abcd abcd abcd abcd abcd ................
00000120: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000130: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000140: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000150: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000160: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000170: ffff ffff ffff ffff ffff ffff ffff ffff ................
ZynqMP> mw.w 0x100 0xbeee 0x10
ZynqMP> md.w 0x100
00000100: beee beee beee beee beee beee beee beee ................
00000110: beee beee beee beee beee beee beee beee ................
00000120: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000130: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000140: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000150: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000160: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000170: ffff ffff ffff ffff ffff ffff ffff ffff ................
ZynqMP> sf update 0x100 0x00 0x100
device 0 offset 0x0, size 0x100
256 bytes written, 0 bytes skipped in 0.70s, speed 3591 B/s
ZynqMP> mw.w 0x100 0x00 0x100
ZynqMP> md.w 0x100
00000100: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000110: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000120: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000130: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000140: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000150: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000160: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000170: 0000 0000 0000 0000 0000 0000 0000 0000 ................
ZynqMP> sf read 0x100 0x00 0x100
device 0 offset 0x0, size 0x100
SF: 256 bytes @ 0x0 Read: OK
ZynqMP> md.w 0x100
00000100: beee beee beee beee beee beee beee beee ................
00000110: beee beee beee beee beee beee beee beee ................
00000120: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000130: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000140: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000150: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000160: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000170: ffff ffff ffff ffff ffff ffff ffff ffff ................
Here is a case where it failed:
ZynqMP> mw.w 100 abcd 10 ; md.w 100 10
00000100: abcd abcd abcd abcd abcd abcd abcd abcd ................
00000110: abcd abcd abcd abcd abcd abcd abcd abcd ................
ZynqMP> sf update 100 100 10
device 0 offset 0x100, size 0x10
SPI flash failed in erase step
ZynqMP> mw.w 100 00 100 ; sf read 100 100 10 ; md.w 100 10
device 0 offset 0x100, size 0x10
SF: 16 bytes @ 0x100 Read: OK
00000100: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000110: 0000 0000 0000 0000 0000 0000 0000 0000 ................
I hope this helps!
Thanks,
Liam Beguin
Xiphos Systems Corp.
http://xiphos.ca
More information about the U-Boot
mailing list