U-Boot SPI Driver
U-boot Configuration
For Zynq
CONFIG_SPL_SPI_LOAD=y
CONFIG_SPI_FLASH=yFor Zynqmp
CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI_SUPPORT=y
CONFIG_SPI=y
Device tree
For Zynq
spi0: spi@e0006000 {
compatible = "xlnx,zynq-spi-r1p6";
reg = <0xe0006000 0x1000>;
status = "okay";
interrupt-parent = <&intc>;
interrupts = <0 26 4>;
clocks = <&clkc 25>, <&clkc 34>;
clock-names = "ref_clk", "pclk";
#address-cells = <1>;
#size-cells = <0>;
};
spi1: spi@e0007000 {
compatible = "xlnx,zynq-spi-r1p6";
reg = <0xe0007000 0x1000>;
status = "okay";
interrupt-parent = <&intc>;
interrupts = <0 49 4>;
clocks = <&clkc 26>, <&clkc 35>;
clock-names = "ref_clk", "pclk";
#address-cells = <1>;
#size-cells = <0>;
};
For Zynqmp
spi0: spi@ff040000 {
compatible = "cdns,spi-r1p6";
status = "okay";
interrupt-parent = <&gic>;
interrupts = <0 19 4>;
reg = <0x0 0xff040000 0x0 0x1000>;
clock-names = "ref_clk", "pclk";
#address-cells = <1>;
#size-cells = <0>;
power-domains = <&zynqmp_firmware PD_SPI_0>;
};
spi1: spi@ff050000 {
compatible = "cdns,spi-r1p6";
status = "okay";
interrupt-parent = <&gic>;
interrupts = <0 20 4>;
reg = <0x0 0xff050000 0x0 0x1000>;
clock-names = "ref_clk", "pclk";
#address-cells = <1>;
#size-cells = <0>;
power-domains = <&zynqmp_firmware PD_SPI_1>;
};Test Procedure
Zynq> sf probe
SF: Deteced s25fl064l with page size 256 Bytes, erase size 64 KiB, total 8 MiB
Zynq> sf erase 0 100000
SF: 1048576 bytes @ 0x0 Erased: OK
Zynq> mw.b 100000 ff 100000
Zynq> sf write 100000 0 100000
device 0 offset 0x0, size 0x100000
SF: 1048576 bytes @ 0x0 Written: OK
Zynq> sf read 200000 0 100000
device 0 offset 0x0, size 0x100000
SF: 1048576 bytes @ 0x0 Read: OK
Zynq> cmp.b 100000 200000 100000
Total of 1048576 byte(s) were the same