zynq7000序列Linux系统中烧写QspiFlash中启动程序的一种方法

黑金zynq7100模块采用2片QspiFLash并联 + eMMC的存储方案;qspiflash储存boot.bin,eMMC存储linux系统;

在应用升级系统的关键步骤是要实现: 在Linux系统中升级qspiFlash中的boot.bin;

本文简介工作中使用的方法。

开发环境:

VMware15  +  ubuntu16.04.5  +  petalinux2017.4工具;

Vivado2017.4 + SDK2017.4 ;

linux-xlnx-xilinx-v2017.4内核;

 

设备树配置如下:

qspi: spi@e000d000 {

clock-names = "ref_clk", "pclk";

clocks = <&clkc 10>, <&clkc 43>;

compatible = "xlnx,zynq-qspi-1.0";

interrupt-parent = <&intc>;

interrupts = <0 19 4>;

reg = <0xe000d000 0x1000>;

#address-cells = <1>;

#size-cells = <0>;

status = "okay";

/*  xlnx,qspi-mode = <0x0>;  0 if single, 1 if parallel and 2 if stacked. */

is-dual = <0x1>;          /* Set if parallel. Reset if single or stacked. */

num-cs = <0x1>;

spi-rx-bus-width = <0x8>;    

spi-tx-bus-width = <0x8>;

 

flash0: flash@0 {

compatible = "n25q512a", "micron,m25p80";

reg = <0x0>;

#address-cells = <1>;

#size-cells = <1>;

spi-max-frequency = <50000000>;

partition@0x00000000 {

label = "boot";

reg = <0x0 0x500000>;

};

partition@0x00500000 {

label = "bootenv";

reg = <0x500000 0x20000>;

};

partition@0x00520000 {

label = "kernel";

reg = <0x520000 0xa80000>;

};

partition@0x00fa0000 {

label = "spare";

reg = <0xfa0000 0x0>;

};

};

};

kernel配置如下:        

增加mtd驱动对qspi_flash分区支持;

    Device Drivers > Memory Technology Device (MTD) support > Self-contained MTD device drivers

       <*> Support most SPI Flash chips (AT26DF, M25P, W25X, ...)

 

根文件系统配置如下:

增加 mtd-until工具包

 

应用程序:

linux系统启动后 cat  /proc/mtd 正确结果如下:

 

烧写boot.bin到qspiflash中的方法如下:

flash_erase     /dev/mtd0  0  0              #//   擦出boot分区中的程序

flashcp  -v  BOOT.bin   /dev/mtd0      #// 将boot.bin文件写入boot分区;

 

结果:

该方法在公司的产品中成功使用!

 

 

  • 1
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值