• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7800-V1.0.2.28/target/linux/generic/files/crypto/ocf/kirkwood/mvHal/mv_hal/sflash/

Lines Matching defs:pFlinfo

203 static MV_STATUS    mvWriteEnable   (MV_SFLASH_INFO * pFlinfo);
204 static MV_STATUS mvStatusRegGet (MV_SFLASH_INFO * pFlinfo, MV_U8 * pStatReg);
205 static MV_STATUS mvStatusRegSet (MV_SFLASH_INFO * pFlinfo, MV_U8 sr);
206 static MV_STATUS mvWaitOnWipClear(MV_SFLASH_INFO * pFlinfo);
207 static MV_STATUS mvSFlashPageWr (MV_SFLASH_INFO * pFlinfo, MV_U32 offset, \
209 static MV_STATUS mvSFlashWithDefaultsIdGet (MV_SFLASH_INFO * pFlinfo, \
219 static MV_STATUS mvWriteEnable(MV_SFLASH_INFO * pFlinfo)
224 cmd[0] = sflash[pFlinfo->index].opcdWREN;
236 static MV_STATUS mvStatusRegGet(MV_SFLASH_INFO * pFlinfo, MV_U8 * pStatReg)
245 cmd[0] = sflash[pFlinfo->index].opcdRDSR;
263 static MV_STATUS mvWaitOnWipClear(MV_SFLASH_INFO * pFlinfo)
271 if ((ret = mvStatusRegGet(pFlinfo, &stat)) != MV_OK)
291 static MV_STATUS mvWaitOnChipEraseDone(MV_SFLASH_INFO * pFlinfo)
299 if ((ret = mvStatusRegGet(pFlinfo, &stat)) != MV_OK)
317 static MV_STATUS mvStatusRegSet(MV_SFLASH_INFO * pFlinfo, MV_U8 sr)
324 if ((ret = mvWriteEnable(pFlinfo)) != MV_OK)
328 cmd[0] = sflash[pFlinfo->index].opcdWRSR;
334 if ((ret = mvWaitOnWipClear(pFlinfo)) != MV_OK)
350 static MV_STATUS mvSFlashPageWr (MV_SFLASH_INFO * pFlinfo, MV_U32 offset,
358 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
365 if (((offset & (sflash[pFlinfo->index].pageSize - 1)) + buffSize) >
366 sflash[pFlinfo->index].pageSize)
373 if ((ret = mvWriteEnable(pFlinfo)) != MV_OK)
376 cmd[0] = sflash[pFlinfo->index].opcdPP;
384 if ((ret = mvWaitOnWipClear(pFlinfo)) != MV_OK)
399 static MV_STATUS mvSFlashWithDefaultsIdGet (MV_SFLASH_INFO * pFlinfo, MV_U8* manId, MV_U16* devId)
432 * pFlinfo: pointer to the Flash information structure
433 * pFlinfo->baseAddr: base address in fast mode.
434 * pFlinfo->index: Index of the flash in the sflash tabel. If the SPI
440 * pFlinfo: pointer to the Flash information structure after detection
441 * pFlinfo->manufacturerId: Manufacturer ID
442 * pFlinfo->deviceId: Device ID
443 * pFlinfo->sectorSize: size of the sector (all sectors are the same).
444 * pFlinfo->sectorNumber: number of sectors.
445 * pFlinfo->pageSize: size of the page.
446 * pFlinfo->index: Index of the detected flash in the sflash tabel
453 MV_STATUS mvSFlashInit (MV_SFLASH_INFO * pFlinfo)
462 if (pFlinfo == NULL)
476 if ((ret = mvSFlashIdGet(pFlinfo, &manf, &dev)) != MV_OK)
487 pFlinfo->manufacturerId = manf;
488 pFlinfo->deviceId = dev;
489 pFlinfo->index = indx;
501 pFlinfo->sectorSize = sflash[pFlinfo->index].sectorSize;
502 pFlinfo->sectorNumber = sflash[pFlinfo->index].sectorNumber;
503 pFlinfo->pageSize = sflash[pFlinfo->index].pageSize;
506 if ((ret = mvSpiBaudRateSet(sflash[pFlinfo->index].spiMaxFreq)) != MV_OK)
513 if ((ret = mvSFlashStatRegLock(pFlinfo, MV_TRUE)) != MV_OK)
526 * pFlinfo: pointer to the Flash information structure
537 MV_STATUS mvSFlashSectorErase (MV_SFLASH_INFO * pFlinfo, MV_U32 secNumber)
542 MV_U32 secAddr = (secNumber * pFlinfo->sectorSize);
545 MV_U32 * pW = (MV_U32*) (secAddr + pFlinfo->baseAddr);
547 MV_U32 wordsPerSector = (pFlinfo->sectorSize / sizeof(MV_U32));
551 if (pFlinfo == NULL)
558 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
565 if (secNumber >= pFlinfo->sectorNumber)
589 cmd[0] = sflash[pFlinfo->index].opcdSE;
595 if ((ret = mvWriteEnable(pFlinfo)) != MV_OK)
601 if ((ret = mvWaitOnWipClear(pFlinfo)) != MV_OK)
614 * pFlinfo: pointer to the Flash information structure
624 MV_STATUS mvSFlashChipErase (MV_SFLASH_INFO * pFlinfo)
631 if (pFlinfo == NULL)
638 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
644 cmd[0] = sflash[pFlinfo->index].opcdBE;
647 if ((ret = mvWriteEnable(pFlinfo)) != MV_OK)
653 if ((ret = mvWaitOnChipEraseDone(pFlinfo)) != MV_OK)
666 * pFlinfo: pointer to the Flash information structure
679 MV_STATUS mvSFlashBlockRd (MV_SFLASH_INFO * pFlinfo, MV_U32 offset,
686 if ((pFlinfo == NULL) || (pReadBuff == NULL))
693 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
699 cmd[0] = sflash[pFlinfo->index].opcdREAD;
714 * pFlinfo: pointer to the Flash information structure
727 MV_STATUS mvSFlashFastBlockRd (MV_SFLASH_INFO * pFlinfo, MV_U32 offset,
734 if ((pFlinfo == NULL) || (pReadBuff == NULL))
741 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
748 mvOsPrintf("Setting freq to %d.\n",sflash[pFlinfo->index].spiMaxFastFreq);
749 if ((ret = mvSpiBaudRateSet(sflash[pFlinfo->index].spiMaxFastFreq)) != MV_OK)
755 cmd[0] = sflash[pFlinfo->index].opcdFSTRD;
762 sflash[pFlinfo->index].spiFastRdDummyBytes);
765 if ((ret = mvSpiBaudRateSet(sflash[pFlinfo->index].spiMaxFreq)) != MV_OK)
783 * pFlinfo: pointer to the Flash information structure
796 MV_STATUS mvSFlashBlockWr (MV_SFLASH_INFO * pFlinfo, MV_U32 offset,
814 if (pFlinfo == NULL)
821 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
828 if ((offset + buffSize) > mvSFlashSizeGet(pFlinfo))
841 if ((ret = mvSFlashPageWr(pFlinfo, writeOffset, pWriteBuff, preAllSz)) != MV_OK)
851 while (data2write >= sflash[pFlinfo->index].pageSize)
853 if ((ret = mvSFlashPageWr(pFlinfo, writeOffset, pWriteBuff, sflash[pFlinfo->index].pageSize)) != MV_OK)
857 writeOffset += sflash[pFlinfo->index].pageSize;
858 data2write -= sflash[pFlinfo->index].pageSize;
859 pWriteBuff += sflash[pFlinfo->index].pageSize;
865 if ((ret = mvSFlashPageWr(pFlinfo, writeOffset, pWriteBuff, data2write)) != MV_OK)
884 * pFlinfo: pointer to the Flash information structure
897 MV_STATUS mvSFlashIdGet (MV_SFLASH_INFO * pFlinfo, MV_U8* pManId, MV_U16* pDevId)
906 if ((pFlinfo == NULL) || (pManId == NULL) || (pDevId == NULL))
912 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
913 return mvSFlashWithDefaultsIdGet(pFlinfo, pManId, pDevId);
915 cmd[0] = sflash[pFlinfo->index].opcdRDID;
935 * pFlinfo: pointer to the Flash information structure
946 MV_STATUS mvSFlashWpRegionSet (MV_SFLASH_INFO * pFlinfo, MV_SFLASH_WP_REGION wpRegion)
951 if (pFlinfo == NULL)
958 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
965 if (pFlinfo->manufacturerId == MV_M25PXXX_ST_MANF_ID)
1011 else if (pFlinfo->manufacturerId == MV_MXIC_MANF_ID)
1057 else if (pFlinfo->manufacturerId == MV_SPANSION_MANF_ID)
1112 return mvStatusRegSet(pFlinfo, wpMask);
1122 * pFlinfo: pointer to the Flash information structure
1133 MV_STATUS mvSFlashWpRegionGet (MV_SFLASH_INFO * pFlinfo, MV_SFLASH_WP_REGION * pWpRegion)
1139 if ((pFlinfo == NULL) || (pWpRegion == NULL))
1146 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
1152 if ((ret = mvStatusRegGet(pFlinfo, &reg)) != MV_OK)
1156 if (pFlinfo->manufacturerId == MV_M25PXXX_ST_MANF_ID)
1198 else if (pFlinfo->manufacturerId == MV_MXIC_MANF_ID)
1244 else if (pFlinfo->manufacturerId == MV_SPANSION_MANF_ID)
1305 * pFlinfo: pointer to the Flash information structure
1316 MV_STATUS mvSFlashStatRegLock (MV_SFLASH_INFO * pFlinfo, MV_BOOL srLock)
1322 if (pFlinfo == NULL)
1329 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
1335 if ((ret = mvStatusRegGet(pFlinfo, &reg)) != MV_OK)
1343 return mvStatusRegSet(pFlinfo, reg);
1354 * pFlinfo: pointer to the Flash information structure
1364 MV_U32 mvSFlashSizeGet (MV_SFLASH_INFO * pFlinfo)
1367 if (pFlinfo == NULL)
1373 return (pFlinfo->sectorSize * pFlinfo->sectorNumber);
1383 * pFlinfo: pointer to the Flash information structure
1393 MV_STATUS mvSFlashPowerSaveEnter(MV_SFLASH_INFO * pFlinfo)
1400 if (pFlinfo == NULL)
1407 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
1414 if (sflash[pFlinfo->index].opcdPwrSave == MV_SFLASH_NO_SPECIFIC_OPCD)
1420 cmd[0] = sflash[pFlinfo->index].opcdPwrSave;
1436 * pFlinfo: pointer to the Flash information structure
1446 MV_STATUS mvSFlashPowerSaveExit (MV_SFLASH_INFO * pFlinfo)
1453 if (pFlinfo == NULL)
1460 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
1467 if (sflash[pFlinfo->index].opcdRES == MV_SFLASH_NO_SPECIFIC_OPCD)
1473 cmd[0] = sflash[pFlinfo->index].opcdRES;
1492 * pFlinfo: pointer to the Flash information structure
1502 const MV_8 * mvSFlashModelGet (MV_SFLASH_INFO * pFlinfo)
1507 if (pFlinfo == NULL)
1514 if (pFlinfo->index >= MV_ARRAY_SIZE(sflash))
1520 return sflash[pFlinfo->index].deviceModel;