Lines Matching refs:spiflash
46 static hndsflash_t spiflash;
719 if (!firsttime && spiflash.size != 0)
720 return &spiflash;
724 bzero(&spiflash, sizeof(spiflash));
725 spiflash.sih = sih;
726 spiflash.core = (void *)qspi;
727 spiflash.read = spiflash_read;
728 spiflash.write = spiflash_write;
729 spiflash.erase = spiflash_erase;
730 spiflash.commit = spiflash_commit;
732 spiflash.device_id = device_id = mspi_read_id(osh, qspi);
733 spiflash.vendor_id = vendor_id = (device_id >> 8);
749 spiflash.type = QSPIFLASH_ST;
750 spiflash.blocksize = 64 * 1024;
755 spiflash.numblocks = 4;
759 spiflash.numblocks = 8;
762 spiflash.numblocks = 16;
766 spiflash.numblocks = 32;
770 spiflash.numblocks = 64;
774 spiflash.numblocks = 128;
779 spiflash.numblocks = 256;
782 spiflash.numblocks = 512;
785 spiflash.numblocks = 1024;
787 spiflash.poll = spiflash_poll;
794 spiflash.type = QSPIFLASH_ST;
795 spiflash.blocksize = 4 * 1024;
799 spiflash.numblocks = 16;
803 spiflash.numblocks = 16;
807 spiflash.numblocks = 32;
811 spiflash.numblocks = 32;
815 spiflash.numblocks = 64;
819 spiflash.numblocks = 64;
823 spiflash.numblocks = 128;
827 spiflash.numblocks = 128;
831 spiflash.numblocks = 128;
835 spiflash.numblocks = 256;
839 spiflash.numblocks = 256;
843 spiflash.numblocks = 512;
847 spiflash.numblocks = 1024;
851 spiflash.numblocks = 2048;
859 spiflash.type = QSPIFLASH_AT;
862 spiflash.numblocks = 2;
863 spiflash.blocksize = 32 * 1024;
867 spiflash.numblocks = 4;
868 spiflash.blocksize = 64 * 1024;
876 spiflash.numblocks = 0;
884 spiflash.size = spiflash.blocksize * spiflash.numblocks;
907 if (force_3byte_mode && (spiflash.size > SI_FLASH_WINDOW)) {
909 (spiflash.size >> 20), (SI_FLASH_WINDOW >> 20),
911 spiflash.size = SI_FLASH_WINDOW;
912 } else if (spiflash.size > SI_NS_FLASH_WINDOW) {
914 (spiflash.size >> 20), (SI_NS_FLASH_WINDOW >> 20),
916 spiflash.size = SI_NS_FLASH_WINDOW;
919 spiflash.phybase = SI_NS_NORFLASH;
920 if (spiflash.size)
921 spiflash.base = (uint32)REG_MAP(SI_NS_NORFLASH, spiflash.size);
924 if (spiflash.size == 0)
928 if (spiflash.size > 0x1000000) {
929 spiflash_set_4byte_mode(&spiflash, 1);
931 spiflash_set_4byte_mode(&spiflash, 0);
934 name, spiflash.numblocks, spiflash.blocksize / 1024,
935 spiflash.size / (1024 * 1024));
940 return spiflash.size ? &spiflash : NULL;