Lines Matching refs:spifl
52 static int spiflash_read(hndsflash_t *spifl, uint offset, uint len, const uchar *buf);
53 static int spiflash_write(hndsflash_t *spifl, uint offset, uint len, const uchar *buf);
54 static int spiflash_erase(hndsflash_t *spifl, uint offset);
55 static int spiflash_poll(hndsflash_t *spifl, uint offset);
56 static int spiflash_commit(hndsflash_t *spifl, uint offset, uint len, const uchar *buf);
334 spiflash_set_4byte_mode(hndsflash_t *spifl, int enable)
336 osl_t *osh = si_osh(spifl->sih);
337 qspiregs_t *qspi = (qspiregs_t *)spifl->core;
344 if (spifl->vendor_id == SPANPART)
429 bspi_sector_erase(hndsflash_t *spifl, qspiregs_t *qspi, unsigned int offset)
431 si_t *sih = spifl->sih;
440 switch (spifl->type) {
447 if (spifl->vendor_id == SPANPART && (spifl->device_id & 0xff) >= 0x19)
448 cmd[idx++] = (spifl->blocksize < (64 * 1024)) ?
451 cmd[idx++] = (spifl->blocksize < (64 * 1024)) ? SPI_SSE_CMD : SPI_SE_CMD;
452 if (spifl->size > 0x1000000) {
505 bspi2_st_page_program(hndsflash_t *spifl, qspiregs_t *qspi, unsigned int offset,
508 si_t *sih = spifl->sih;
526 if (spifl->vendor_id == SPANPART && (spifl->device_id & 0xff) >= 0x19)
530 if (spifl->size > 0x1000000) {
588 bspi2_at_page_program(osl_t *osh, qspiregs_t *qspi, hndsflash_t *spifl, unsigned int offset,
597 mask = spifl->blocksize - 1;
602 if (byte || (len < spifl->blocksize)) {
669 static int bspi_poll(hndsflash_t *spifl, qspiregs_t *qspi, unsigned int offset)
671 si_t *sih = spifl->sih;
681 switch (spifl->device_id & 0x00ff)
969 spiflash_read(hndsflash_t *spifl, uint offset, uint len, const uchar *buf)
971 si_t *sih = spifl->sih;
972 qspiregs_t *qspi = (qspiregs_t *)spifl->core;
984 if ((offset + len) > spifl->size)
994 from = (uint8 *)((void *)spifl->base + offset);
1024 spiflash_write(hndsflash_t *spifl, uint offset, uint length, const uchar *buffer)
1026 si_t *sih = spifl->sih;
1027 qspiregs_t *qspi = (qspiregs_t *)spifl->core;
1041 if ((offset + length) > spifl->size)
1046 switch (spifl->type) {
1062 if (!bspi2_st_page_program(spifl, qspi, offset + i, &temp[0],
1069 if (spifl->poll && !bspi_poll(spifl, qspi, offset + i)) {
1094 if (!bspi2_at_page_program(osh, qspi, spifl, offset + i, &temp[0],
1113 spiflash_erase(hndsflash_t *spifl, uint offset)
1115 si_t *sih = spifl->sih;
1116 qspiregs_t *qspi = (qspiregs_t *)spifl->core;
1124 if (offset >= spifl->size)
1129 if (bspi_sector_erase(spifl, qspi, offset))
1130 erase_size = spifl->blocksize;
1142 spiflash_poll(hndsflash_t *spifl, uint offset)
1145 si_t *sih = spifl->sih;
1146 qspiregs_t *qspi = (qspiregs_t *)spifl->core;
1153 if (offset >= spifl->size)
1158 switch (spifl->type) {
1163 if (!bspi_poll(spifl, qspi, offset)) {
1183 spiflash_commit(hndsflash_t *spifl, uint offset, uint len, const uchar *buf)
1185 si_t *sih = spifl->sih;
1200 if ((offset + len) > spifl->size)
1203 blocksize = spifl->blocksize;
1232 copied = spiflash_read(spifl, blk_offset, blk_len,
1245 if ((ret = spiflash_erase(spifl, (uint)cur_offset)) < 0)
1257 if ((bytes = spiflash_write(spifl,