Lines Matching refs:DeviceInfo
88 u32 skip_bytes = DeviceInfo.wSpareSkipBytes;
93 flag_bytes = DeviceInfo.wNumPageSpareFlag;
106 DeviceInfo.wPagesPerBlock - page , 1);
281 DeviceInfo.wECCBytesPerSector = 4;
282 DeviceInfo.wECCBytesPerSector *= DeviceInfo.wDevicesConnected;
283 DeviceInfo.wNumPageSpareFlag =
284 DeviceInfo.wPageSpareSize -
285 DeviceInfo.wPageDataSize /
286 (ECC_SECTOR_SIZE * DeviceInfo.wDevicesConnected) *
287 DeviceInfo.wECCBytesPerSector
288 - DeviceInfo.wSpareSkipBytes;
290 DeviceInfo.wECCBytesPerSector =
293 if ((DeviceInfo.wECCBytesPerSector) % 2 == 0)
294 DeviceInfo.wECCBytesPerSector += 2;
296 DeviceInfo.wECCBytesPerSector += 1;
298 DeviceInfo.wECCBytesPerSector *= DeviceInfo.wDevicesConnected;
299 DeviceInfo.wNumPageSpareFlag = DeviceInfo.wPageSpareSize -
300 DeviceInfo.wPageDataSize /
301 (ECC_SECTOR_SIZE * DeviceInfo.wDevicesConnected) *
302 DeviceInfo.wECCBytesPerSector
303 - DeviceInfo.wSpareSkipBytes;
361 DeviceInfo.wONFIDevFeatures =
363 DeviceInfo.wONFIOptCommands =
365 DeviceInfo.wONFITimingMode =
367 DeviceInfo.wONFIPgmCacheTimingMode =
377 DeviceInfo.wTotalBlocks = n_of_luns * blockperlun;
398 DeviceInfo.MLCDevice = id & 0x0C;
442 DeviceInfo.wTotalBlocks = (u32)GLOB_u64_Div(capacity, blk_size);
473 DeviceInfo.wTotalBlocks = GLOB_HWCTL_DEFAULT_BLKS;
477 DeviceInfo.wTotalBlocks = 1 << ioread8(scratch_reg);
478 if (DeviceInfo.wTotalBlocks < 512)
479 DeviceInfo.wTotalBlocks = GLOB_HWCTL_DEFAULT_BLKS;
489 switch (DeviceInfo.wDeviceID) {
505 DeviceInfo.MLCDevice = 1;
511 DeviceInfo.wDeviceID);
518 DeviceInfo.wTotalBlocks = GLOB_HWCTL_DEFAULT_BLKS;
522 DeviceInfo.wTotalBlocks = 1 << ioread8(scratch_reg);
523 if (DeviceInfo.wTotalBlocks < 512)
524 DeviceInfo.wTotalBlocks = GLOB_HWCTL_DEFAULT_BLKS;
563 DeviceInfo.wSpectraStartBlock =
566 DeviceInfo.wTotalBlocks)
571 DeviceInfo.wSpectraEndBlock =
574 DeviceInfo.wTotalBlocks)
579 DeviceInfo.wTotalBlocks *= totalUsedBanks;
581 if (DeviceInfo.wSpectraEndBlock >=
582 DeviceInfo.wTotalBlocks) {
583 DeviceInfo.wSpectraEndBlock =
584 DeviceInfo.wTotalBlocks - 1;
587 DeviceInfo.wDataBlockNum =
588 DeviceInfo.wSpectraEndBlock -
589 DeviceInfo.wSpectraStartBlock + 1;
591 DeviceInfo.wTotalBlocks *= totalUsedBanks;
592 DeviceInfo.wSpectraStartBlock = SPECTRA_START_BLOCK;
593 DeviceInfo.wSpectraEndBlock =
594 DeviceInfo.wTotalBlocks - 1;
595 DeviceInfo.wDataBlockNum =
596 DeviceInfo.wSpectraEndBlock -
597 DeviceInfo.wSpectraStartBlock + 1;
600 DeviceInfo.wTotalBlocks *= totalUsedBanks;
601 DeviceInfo.wSpectraStartBlock = SPECTRA_START_BLOCK;
602 DeviceInfo.wSpectraEndBlock = DeviceInfo.wTotalBlocks - 1;
603 DeviceInfo.wDataBlockNum =
604 DeviceInfo.wSpectraEndBlock -
605 DeviceInfo.wSpectraStartBlock + 1;
611 nand_dbg_print(NAND_DBG_DEBUG, "DeviceInfo:\n");
613 DeviceInfo.wDeviceMaker);
615 DeviceInfo.wDeviceID);
617 DeviceInfo.wDeviceType);
619 DeviceInfo.wSpectraStartBlock);
621 DeviceInfo.wSpectraEndBlock);
623 DeviceInfo.wTotalBlocks);
625 DeviceInfo.wPagesPerBlock);
627 DeviceInfo.wPageSize);
629 DeviceInfo.wPageDataSize);
631 DeviceInfo.wPageSpareSize);
633 DeviceInfo.wNumPageSpareFlag);
635 DeviceInfo.wECCBytesPerSector);
637 DeviceInfo.wBlockSize);
639 DeviceInfo.wBlockDataSize);
641 DeviceInfo.wDataBlockNum);
643 DeviceInfo.bPlaneNum);
645 DeviceInfo.wDeviceMainAreaSize);
647 DeviceInfo.wDeviceSpareAreaSize);
649 DeviceInfo.wDevicesConnected);
651 DeviceInfo.wDeviceWidth);
653 DeviceInfo.wHWRevision);
655 DeviceInfo.wHWFeatures);
657 DeviceInfo.wONFIDevFeatures);
659 DeviceInfo.wONFIOptCommands);
661 DeviceInfo.wONFITimingMode);
663 DeviceInfo.wONFIPgmCacheTimingMode);
665 DeviceInfo.MLCDevice ? "Yes" : "No");
667 DeviceInfo.wSpareSkipBytes);
669 DeviceInfo.nBitsInPageNumber);
671 DeviceInfo.nBitsInPageDataSize);
673 DeviceInfo.nBitsInBlockDataSize);
686 DeviceInfo.wDeviceMaker = ioread32(FlashReg + MANUFACTURER_ID);
687 DeviceInfo.wDeviceID = ioread32(FlashReg + DEVICE_ID);
688 DeviceInfo.MLCDevice = ioread32(FlashReg + DEVICE_PARAM_0) & 0x0c;
694 } else if (DeviceInfo.wDeviceMaker == 0xEC) { /* Samsung NAND */
696 } else if (DeviceInfo.wDeviceMaker == 0x98) { /* Toshiba NAND */
698 } else if (DeviceInfo.wDeviceMaker == 0xAD) { /* Hynix NAND */
701 DeviceInfo.wTotalBlocks = GLOB_HWCTL_DEFAULT_BLKS;
716 DeviceInfo.wHWRevision = ioread32(FlashReg + REVISION);
717 DeviceInfo.wHWFeatures = ioread32(FlashReg + FEATURES);
719 DeviceInfo.wDeviceMainAreaSize =
721 DeviceInfo.wDeviceSpareAreaSize =
724 DeviceInfo.wPageDataSize =
734 DeviceInfo.wPageSpareSize =
737 DeviceInfo.wPagesPerBlock = ioread32(FlashReg + PAGES_PER_BLOCK);
739 DeviceInfo.wPageSize =
740 DeviceInfo.wPageDataSize + DeviceInfo.wPageSpareSize;
741 DeviceInfo.wBlockSize =
742 DeviceInfo.wPageSize * DeviceInfo.wPagesPerBlock;
743 DeviceInfo.wBlockDataSize =
744 DeviceInfo.wPagesPerBlock * DeviceInfo.wPageDataSize;
746 DeviceInfo.wDeviceWidth = ioread32(FlashReg + DEVICE_WIDTH);
747 DeviceInfo.wDeviceType =
750 DeviceInfo.wDevicesConnected = ioread32(FlashReg + DEVICES_CONNECTED);
752 DeviceInfo.wSpareSkipBytes =
754 DeviceInfo.wDevicesConnected;
756 DeviceInfo.nBitsInPageNumber =
757 (u8)GLOB_Calc_Used_Bits(DeviceInfo.wPagesPerBlock);
758 DeviceInfo.nBitsInPageDataSize =
759 (u8)GLOB_Calc_Used_Bits(DeviceInfo.wPageDataSize);
760 DeviceInfo.nBitsInBlockDataSize =
761 (u8)GLOB_Calc_Used_Bits(DeviceInfo.wBlockDataSize);
773 DeviceInfo.bPlaneNum = no_of_planes + 1;
797 end_addr = ((u64)DeviceInfo.wBlockSize *
798 (DeviceInfo.wTotalBlocks - 1)) >>
799 DeviceInfo.nBitsInPageDataSize;
830 flash_add = (u64)(block % (DeviceInfo.wTotalBlocks / totalUsedBanks))
831 * DeviceInfo.wBlockDataSize;
833 flash_bank = block / (DeviceInfo.wTotalBlocks / totalUsedBanks);
835 if (block >= DeviceInfo.wTotalBlocks)
845 (flash_add >> DeviceInfo.nBitsInPageDataSize)), 1);
867 if (block >= DeviceInfo.wTotalBlocks)
870 if (page + page_count > DeviceInfo.wPagesPerBlock)
882 u32 PageSpareSize = DeviceInfo.wPageSpareSize;
883 u32 spareFlagBytes = DeviceInfo.wNumPageSpareFlag;
890 if (block >= DeviceInfo.wTotalBlocks) {
895 if (page >= DeviceInfo.wPagesPerBlock) {
905 flash_add = (u64)(block % (DeviceInfo.wTotalBlocks / totalUsedBanks))
906 * DeviceInfo.wBlockDataSize +
907 (u64)page * DeviceInfo.wPageDataSize;
909 flash_bank = block / (DeviceInfo.wTotalBlocks / totalUsedBanks);
917 (flash_add >> DeviceInfo.nBitsInPageDataSize)),
920 (flash_add >> DeviceInfo.nBitsInPageDataSize)),
927 (flash_add >> DeviceInfo.nBitsInPageDataSize)),
948 (flash_add >> DeviceInfo.nBitsInPageDataSize)), 0x42);
974 (flash_add >> DeviceInfo.nBitsInPageDataSize)),
995 for (i = 0; i < DeviceInfo.wPageDataSize; i++) {
1000 for (j = i; j < DeviceInfo.wPageDataSize; j++) {
1029 ecc_sect_size = ECC_SECTOR_SIZE * (DeviceInfo.wDevicesConnected);
1074 DeviceInfo.wPageDataSize +
1077 DeviceInfo.wDevicesConnected +
1107 flash_add = (u64)(block % (DeviceInfo.wTotalBlocks / totalUsedBanks))
1108 * DeviceInfo.wBlockDataSize +
1109 (u64)page * DeviceInfo.wPageDataSize;
1110 flash_bank = block / (DeviceInfo.wTotalBlocks / totalUsedBanks);
1131 read_data_l += DeviceInfo.wPageDataSize *
1219 flash_add = (u64)(block % (DeviceInfo.wTotalBlocks / totalUsedBanks))
1220 *DeviceInfo.wBlockDataSize +
1221 (u64)page * DeviceInfo.wPageDataSize;
1223 flash_bank = block / (DeviceInfo.wTotalBlocks / totalUsedBanks);
1237 (flash_add >> DeviceInfo.nBitsInPageDataSize)), 0x42);
1319 flash_add = (u64)(block % (DeviceInfo.wTotalBlocks / totalUsedBanks))
1320 * DeviceInfo.wBlockDataSize +
1321 (u64)page * DeviceInfo.wPageDataSize;
1322 flash_bank = block / (DeviceInfo.wTotalBlocks / totalUsedBanks);
1343 read_data_l += DeviceInfo.wPageDataSize *
1398 const u32 spareFlagBytes = DeviceInfo.wNumPageSpareFlag;
1399 const u32 PageSpareSize = DeviceInfo.wPageSpareSize;
1410 const u32 spareFlagBytes = DeviceInfo.wNumPageSpareFlag;
1411 const u32 PageSpareSize = DeviceInfo.wPageSpareSize;
1422 const u32 PageSize = DeviceInfo.wPageSize;
1423 const u32 PageDataSize = DeviceInfo.wPageDataSize;
1424 const u32 eccBytes = DeviceInfo.wECCBytesPerSector;
1425 const u32 spareSkipBytes = DeviceInfo.wSpareSkipBytes;
1426 const u32 spareFlagBytes = DeviceInfo.wNumPageSpareFlag;
1431 eccSectorSize = ECC_SECTOR_SIZE * (DeviceInfo.wDevicesConnected);
1435 j = (DeviceInfo.wPageDataSize / eccSectorSize);
1458 const u32 PageSize = DeviceInfo.wPageSize;
1459 const u32 PageDataSize = DeviceInfo.wPageDataSize;
1460 const u32 eccBytes = DeviceInfo.wECCBytesPerSector;
1461 const u32 spareSkipBytes = DeviceInfo.wSpareSkipBytes;
1462 const u32 spareFlagBytes = DeviceInfo.wNumPageSpareFlag;
1467 eccSectorSize = ECC_SECTOR_SIZE * (DeviceInfo.wDevicesConnected);
1478 j < DeviceInfo.wPageDataSize / eccSectorSize;
1514 flash_add = (u64)(block % (DeviceInfo.wTotalBlocks / totalUsedBanks))
1515 * DeviceInfo.wBlockDataSize +
1516 (u64)page * DeviceInfo.wPageDataSize;
1518 flash_bank = block / (DeviceInfo.wTotalBlocks / totalUsedBanks);
1532 (flash_add >> DeviceInfo.nBitsInPageDataSize)), 0x42);
1620 flash_add = (u64)(block % (DeviceInfo.wTotalBlocks / totalUsedBanks))
1621 *DeviceInfo.wBlockDataSize +
1622 (u64)page * DeviceInfo.wPageDataSize;
1624 flash_bank = block / (DeviceInfo.wTotalBlocks / totalUsedBanks);
1644 (flash_add >> DeviceInfo.nBitsInPageDataSize)), 0x42);
1689 flash_add = (u64)(block % (DeviceInfo.wTotalBlocks / totalUsedBanks))
1690 * DeviceInfo.wBlockDataSize +
1691 (u64)page * DeviceInfo.wPageDataSize;
1693 flash_bank = block / (DeviceInfo.wTotalBlocks / totalUsedBanks);
1715 write_data_l += DeviceInfo.wPageDataSize *
1790 u32 PageSize = DeviceInfo.wPageSize;
1791 u32 PageDataSize = DeviceInfo.wPageDataSize;
1792 u32 eccBytes = DeviceInfo.wECCBytesPerSector;
1793 u32 spareFlagBytes = DeviceInfo.wNumPageSpareFlag;
1794 u32 spareSkipBytes = DeviceInfo.wSpareSkipBytes;
1806 eccSectorSize = ECC_SECTOR_SIZE * (DeviceInfo.wDevicesConnected);
1810 flash_bank = block / (DeviceInfo.wTotalBlocks / totalUsedBanks);
1819 (DeviceInfo.wTotalBlocks / totalUsedBanks)) *
1820 DeviceInfo.wBlockDataSize +
1821 (u64)page * DeviceInfo.wPageDataSize;
1828 DeviceInfo.nBitsInPageDataSize)),
1834 DeviceInfo.wPageDataSize / eccSectorSize;
1908 u32 PageSize = DeviceInfo.wPageSize;
1909 u32 PageDataSize = DeviceInfo.wPageDataSize;
1910 u32 PageSpareSize = DeviceInfo.wPageSpareSize;
1911 u32 eccBytes = DeviceInfo.wECCBytesPerSector;
1912 u32 spareFlagBytes = DeviceInfo.wNumPageSpareFlag;
1913 u32 spareSkipBytes = DeviceInfo.wSpareSkipBytes;
1925 eccSectorSize = ECC_SECTOR_SIZE * (DeviceInfo.wDevicesConnected);
1929 flash_bank = block / (DeviceInfo.wTotalBlocks / totalUsedBanks);
1941 (DeviceInfo.wTotalBlocks / totalUsedBanks))
1942 * DeviceInfo.wBlockDataSize +
1943 (u64)page * DeviceInfo.wPageDataSize;
1946 (flash_add >> DeviceInfo.nBitsInPageDataSize)),
1949 (flash_add >> DeviceInfo.nBitsInPageDataSize)),
1958 DeviceInfo.nBitsInPageDataSize)),
1972 j < DeviceInfo.wPageDataSize / eccSectorSize;
2044 (flash_add >> DeviceInfo.nBitsInPageDataSize)), 0x42);
2072 flash_add = (u64)(block % (DeviceInfo.wTotalBlocks / totalUsedBanks))
2073 * DeviceInfo.wBlockDataSize +
2074 (u64)page * DeviceInfo.wPageDataSize;
2076 flash_bank = block / (DeviceInfo.wTotalBlocks / totalUsedBanks);
2096 (flash_add >> DeviceInfo.nBitsInPageDataSize)), 0x42);
2141 flash_add = (u64)(block % (DeviceInfo.wTotalBlocks / totalUsedBanks))
2142 * DeviceInfo.wBlockDataSize +
2143 (u64)page * DeviceInfo.wPageDataSize;
2145 flash_bank = block / (DeviceInfo.wTotalBlocks / totalUsedBanks);
2160 (flash_add >> DeviceInfo.nBitsInPageDataSize)), 0x42);