zynqQSPI启动配置
配置主要是官方zedboard进行配置,便于开发的目的,fpga的bit的文件和BOOT.bin分开 使用QSPI需要进行分区设置/* * QSPI 256Mbit(32MByte) flash mapping * * start end size name * --------------------------------------- * 0x0000000 - 0x0100000 0x100000 boot.bin(1MB) * 0x0100000 - 0x0700000 0x600000 uImage(6MB) * 0x0700000 - 0x0720000 0x020000 devicetree(128KB) * 0x0720000 - 0x0D00000 0x5E0000 ramdisk(5.875MB) * 0x0D00000 - 0x1500000 0x800000 bitstream(8MB) * 0x1500000 - 0x2000000 0x6C0000 data(6.75MB) */修改kernel->arch/arm/boot/dts/zynq-zed.dtsmemory { device_type = "memory"; reg = <0x0 0x1c000000>; }; chosen { bootargs = "console=ttyPS0,115200 root=/dev/mmcblk0p1 rw earlyprintk rootfstype=ext3 rootwait devtmpfs.mount=0"; /*bootargs = "console=ttyPS0,115200 root=/dev/ram rw initrd=0x800000,8M earlyprintk rootwait devtmpfs.mount=1";*/ /*bootargs = "console=ttyPS0,115200 root=/dev/ram rw earlyprintk";*/ linux,stdout-path = &uart1; stdout-path = &uart1; }; &qspi { status = "okay"; is-dual = <0>; num-cs = <1>; xlnx,fb-clk = <0x1>; xlnx,qspi-mode = <0x0>; flash@0 { /*compatible = "n25q128a11";*/ compatible = "s25fl256s1"; reg = <0x0>; spi-tx-bus-width = <1>; spi-rx-bus-width = <4>; spi-max-frequency = <50000000>; #address-cells = <1>; #size-cells = <1>; partition@qspi-fsbl-uboot { label = "qspi-fsbl-uboot"; reg = <0x0 0x100000>; }; partition@qspi-linux { label = "qspi-linux"; reg = <0x100000 0x600000>; }; partition@qspi-device-tree { label = "qspi-device-tree"; reg = <0x700000 0x20000>; }; partition@qspi-rootfs { label = "qspi-rootfs"; reg = <0x720000 0x5E0000>; }; partition@qspi-bitstream { label = "qspi-bitstream"; reg = <0xD00000 0x800000>; }; partition@qspi-data { label = "data"; reg = <0x1500000 0xB00000>; }; }; }; 修改uboot->arch/arm/dts/zynq-zed.dtsmemory { device_type = "memory"; reg = <0x0 0x1c000000>; }; &qspi { u-boot,dm-pre-reloc; status = "okay"; is-dual = <0>; num-cs = <1>; flash@0 { compatible = "s25fl256s1"; reg = <0x0>; spi-tx-bus-width = <1>; spi-rx-bus-width = <4>; spi-max-frequency = <50000000>; #address-cells = <1>; #size-cells = <1>; partition@qspi-fsbl-uboot { label = "qspi-fsbl-uboot"; reg = <0x0 0x100000>; }; partition@qspi-linux { label = "qspi-linux"; reg = <0x100000 0x600000>; }; partition@qspi-device-tree { label = "qspi-device-tree"; reg = <0x700000 0x20000>; }; partition@qspi-rootfs { label = "qspi-rootfs"; reg = <0x720000 0x5E0000>; }; partition@qspi-bitstream { label = "qspi-bitstream"; reg = <0xD00000 0x800000>; }; partition@qspi-data { label = "data"; reg = <0x1500000 0xB00000>; }; }; };include/configs/zynq-common.h"loadbit_addr=0x200000 " "qspiboot=echo Copying Linux from QSPI flash... && " "sf probe 0 && " "sf read ${loadbit_addr} 0xd00000 0x800000 && " "fpga loadb 0 ${loadbit_addr} 0x800000 && " "sf read ${kernel_load_address} 0x100000 ${kernel_size} && " "sf read ${devicetree_load_address} 0x700000 ${devicetree_size} && " "echo Runing Kernel... && " "bootm ${kernel_load_address} - ${devicetree_load_address} "
sf具体用法 - SPI flash sub-system Usage: sf probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus and chip select sf read addr offset len - read `len" bytes starting at `offset" to memory at `addr" sf write addr offset len - write `len" bytes from memory at `addr" to flash at `offset" sf erase offset [+]len - erase `len" bytes from `offset" `+len" round up `len" to block size sf update addr offset len - erase and write `len" bytes from memory at `addr" to flash at `offset"
sf probe 0 50000000 配置SPI 50M速率TF卡uEnv.txtbootargs=console=ttyPS0,115200 root=/dev/mmcblk0p1 rw earlyprintk rootfstype=ext3 rootwait