• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/src/shared/

Lines Matching refs:qspi

57 static int spiflash_open(si_t *sih, qspiregs_t *qspi);
61 mspi_disable_bspi(osl_t *osh, qspiregs_t *qspi)
69 lval = R_REG(osh, &qspi->bspi_mast_n_boot_ctrl);
74 lval = R_REG(osh, &qspi->bspi_busy_status);
76 W_REG(osh, &qspi->bspi_mast_n_boot_ctrl, 0x1);
86 mspi_enable_bspi(osl_t *osh, qspiregs_t *qspi)
93 lval = R_REG(osh, &qspi->bspi_mast_n_boot_ctrl);
97 W_REG(osh, &qspi->bspi_mast_n_boot_ctrl, 0x0);
104 mspi_wait(osl_t *osh, qspiregs_t *qspi, unsigned int timeout_ms)
113 lval = R_REG(osh, &qspi->mspi_spcr2);
120 lval = R_REG(osh, &qspi->mspi_mspi_status);
130 W_REG(osh, &qspi->mspi_mspi_status, 0);
139 mspi_writeread(osl_t *osh, qspiregs_t *qspi, unsigned char *w_buf,
149 W_REG(osh, &qspi->mspi_txram[i * 2], (unsigned int)w_buf[i]);
155 W_REG(osh, &qspi->mspi_cdram[i], lval);
161 W_REG(osh, &qspi->mspi_cdram[len - 1], lval);
164 W_REG(osh, &qspi->mspi_newqp, 0);
165 W_REG(osh, &qspi->mspi_endqp, len - 1);
168 lval = R_REG(osh, &qspi->mspi_spcr2);
170 W_REG(osh, &qspi->mspi_spcr2, lval);
173 if (mspi_wait(osh, qspi, MSPI_CALC_TIMEOUT(len, MAX_SPI_BAUD)) != 0)
176 W_REG(osh, &qspi->mspi_write_lock, 0);
180 r_buf[i-write_len] = (unsigned char)R_REG(osh, &qspi->mspi_rxram[1 + (i * 2)]);
187 mspi_writeread_continue(osl_t *osh, qspiregs_t *qspi, unsigned char *w_buf,
196 W_REG(osh, &qspi->mspi_txram[i * 2], (unsigned int)w_buf[i]);
200 W_REG(osh, &qspi->mspi_cdram[i], lval);
204 W_REG(osh, &qspi->mspi_newqp, 0);
205 W_REG(osh, &qspi->mspi_endqp, len - 1);
207 W_REG(osh, &qspi->mspi_write_lock, 1);
210 lval = R_REG(osh, &qspi->mspi_spcr2);
212 W_REG(osh, &qspi->mspi_spcr2, lval);
215 if (mspi_wait(osh, qspi, MSPI_CALC_TIMEOUT(len, MAX_SPI_BAUD)) != 0)
219 r_buf[i-write_len] = (unsigned char)R_REG(osh, &qspi->mspi_rxram[1 + (i * 2)]);
337 qspiregs_t *qspi = (qspiregs_t *)spifl->core;
341 mspi_disable_bspi(osh, qspi);
343 mspi_writeread(osh, qspi, cmd, 1, NULL, 0);
348 mspi_writeread(osh, qspi, cmd, 1, NULL, 0);
350 mspi_writeread(osh, qspi, cmd, 1, NULL, 0);
354 OR_REG(osh, &qspi->bspi_bits_per_phase, BSPI_BITS_PER_PHASE_ADDR_MARK);
357 AND_REG(osh, &qspi->bspi_bits_per_phase, ~BSPI_BITS_PER_PHASE_ADDR_MARK);
361 mspi_enable_bspi(osh, qspi);
373 mspi_read_id(osl_t *osh, qspiregs_t *qspi)
383 if (mspi_writeread(osh, qspi, cmd, 4, data, 2)) {
391 if (mspi_writeread(osh, qspi, cmd, 1, data, 2)) {
399 if (mspi_writeread(osh, qspi, cmd, 1, data, 3)) {
419 if (mspi_writeread(osh, qspi, cmd, 4, data, 2)) {
429 bspi_sector_erase(hndsflash_t *spifl, qspiregs_t *qspi, unsigned int offset)
443 if ((result = mspi_writeread(osh, qspi, cmd, 1, NULL, 0)) != 1)
458 if ((result = mspi_writeread(osh, qspi, cmd, idx, NULL, 0)) != 1)
464 if ((result = mspi_writeread(osh, qspi, cmd, 1, &data, 1)) != 1)
473 result = mspi_writeread(osh, qspi, cmd, 1, NULL, 0);
482 if ((result = mspi_writeread(osh, qspi, cmd, 4, NULL, 0)) != 1)
488 if ((result = mspi_writeread(osh, qspi, cmd, 1, &data, 1)) != 1)
497 result = mspi_writeread(osh, qspi, cmd, 1, NULL, 0);
505 bspi2_st_page_program(hndsflash_t *spifl, qspiregs_t *qspi, unsigned int offset,
522 if ((result = mspi_writeread(osh, qspi, cmd, 1, NULL, 0)) != 1)
561 if ((result = mspi_writeread_continue(osh, qspi, cmd + i, 16, NULL, 0)) != 1)
568 if ((result = mspi_writeread(osh, qspi, cmd+i, len_total, NULL, 0)) != 1)
574 if ((result = mspi_writeread(osh, qspi, cmd, 1, &data, 1)) != 1)
580 if ((result = mspi_writeread(osh, qspi, cmd, 1, NULL, 0)) != 1)
588 bspi2_at_page_program(osl_t *osh, qspiregs_t *qspi, hndsflash_t *spifl, unsigned int offset,
608 if ((result = mspi_writeread(osh, qspi, cmd, 4, NULL, 0)) != 1)
613 if ((result = mspi_writeread(osh, qspi, cmd, 1, &data, 1)) != 1)
647 if ((result = mspi_writeread_continue(osh, qspi, cmd + i, 16, NULL, 0)) != 1)
654 if ((result = mspi_writeread(osh, qspi, cmd+i, len_total, NULL, 0)) != 1)
663 result = mspi_writeread(osh, qspi, cmd, 4, NULL, 0);
669 static int bspi_poll(hndsflash_t *spifl, qspiregs_t *qspi, unsigned int offset)
686 if ((result = mspi_writeread(osh, qspi, cmd, 1, &data, 1)) != 1) {
703 qspiregs_t *qspi;
716 if ((qspi = (qspiregs_t *)si_setcore(sih, NS_QSPI_CORE_ID, 0)) == NULL)
726 spiflash.core = (void *)qspi;
732 spiflash.device_id = device_id = mspi_read_id(osh, qspi);
882 spiflash_open(sih, qspi);
944 spiflash_open(si_t *sih, qspiregs_t *qspi)
954 W_REG(osh, &qspi->mspi_spcr0_lsb, lval);
955 lval = R_REG(osh, &qspi->mspi_spcr0_msb);
959 W_REG(osh, &qspi->mspi_spcr0_msb, lval);
962 W_REG(osh, &qspi->mspi_spcr1_msb, 128);
972 qspiregs_t *qspi = (qspiregs_t *)spifl->core;
997 mspi_enable_bspi(osh, qspi);
1027 qspiregs_t *qspi = (qspiregs_t *)spifl->core;
1044 mspi_disable_bspi(osh, qspi);
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],
1105 mspi_enable_bspi(osh, qspi);
1116 qspiregs_t *qspi = (qspiregs_t *)spifl->core;
1127 mspi_disable_bspi(osh, qspi);
1129 if (bspi_sector_erase(spifl, qspi, offset))
1132 mspi_enable_bspi(osh, qspi);
1146 qspiregs_t *qspi = (qspiregs_t *)spifl->core;
1156 mspi_disable_bspi(osh, qspi);
1163 if (!bspi_poll(spifl, qspi, offset)) {
1173 mspi_enable_bspi(osh, qspi);