admin管理员组

文章数量:1402948

I use winbond W25Q02JV nor flash with Xilinx Zynq7000 SoC. This W25Q02JV has four dies (memoy banks) of 64Mb on chip - totally 256MB. I split the flash memory into mtd partitions:

  • mtd0 for uboot bootloader
  • mtd1 for environment
  • mtd2 for Linux+rootfs
  • mtd3 - ubifs partition for any data

mtd0+mtd1 has size of 1MB mtd2 is 10MB mtd3 takes up all the remaining memory (256-11=245)

After programming flash U-boot and Linux successfully starts. Linux detects flash correctly (ids, size, addr mode and etc.) But then I trying to erase and format mtd3 to ubifs I loose U-boot and Linux. It looks like during flash erasing spi-nor driver doesn't switch between dies (banks) and it erases the first bank.

Details

  • Linux 6.6.40
  • my dts:
&qspi {
    u-boot,dm-pre-reloc;
    status = "okay";
    is-dual = <0>;
    num-cs = <1>;
    flash@0 {
        compatible = "jedec,spi-nor", "winbond,w25q02jv";
        reg = <0x0>;
        spi-tx-bus-width = <1>;
        spi-rx-bus-width = <4>;
        spi-max-frequency = <50000000>;
        spi-nor,addr-mode = <4>;
        #address-cells = <1>;
        #size-cells = <1>;
        partition@0 {
            label = "qspi-fsbl-uboot";
            reg = <0x0 0xE0000>;
        };
        partition@E0000 {
            label = "uboot-env";
            reg = <0xE0000 0x20000>;
        };
        partition@100000 {
            label = "linux-with-rootfs";
            reg = <0x100000 0xA00000>;
        };
        partition@B00000 {
            label = "any-data";
            reg = <0xB00000 0xF500000>;
        };
    };
};
  • To erase mtd3
flash_eraseall /dev/mtd3

Any suggestions - how it can be fixed?
or where can i look for a solution to the problem?

本文标签: flashwinbond W25Q02JV problem can39t use whole memory capacity of nor flashi n linuxStack Overflow