Lines Matching refs:this

413 static void DoC_ScanChips(struct DiskOnChip *this)  in DoC_ScanChips()  argument
420 this->numchips = 0; in DoC_ScanChips()
421 this->mfr = 0; in DoC_ScanChips()
422 this->id = 0; in DoC_ScanChips()
424 if (DoC_is_Millennium(this)) in DoC_ScanChips()
433 ret = DoC_IdentChip(this, floor, chip); in DoC_ScanChips()
436 this->numchips++; in DoC_ScanChips()
442 if (!this->numchips) { in DoC_ScanChips()
448 this->chips = kmalloc(sizeof(struct Nand) * this->numchips, GFP_KERNEL); in DoC_ScanChips()
449 if (!this->chips) { in DoC_ScanChips()
460 this->chips[ret].floor = floor; in DoC_ScanChips()
461 this->chips[ret].chip = chip; in DoC_ScanChips()
462 this->chips[ret].curadr = 0; in DoC_ScanChips()
463 this->chips[ret].curmode = 0x50; in DoC_ScanChips()
469 this->totlen = this->numchips * (1 << this->chipshift); in DoC_ScanChips()
472 this->numchips, this->totlen >> 20); in DoC_ScanChips()
516 struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv; in DoC2k_init() local
525 if (DoC2k_is_alias(old, this)) { in DoC2k_init()
528 this->physadr); in DoC2k_init()
529 iounmap((void *) this->virtadr); in DoC2k_init()
540 switch (this->ChipID) { in DoC2k_init()
543 this->ioreg = DoC_2k_CDSN_IO; in DoC2k_init()
547 this->ioreg = DoC_Mil_CDSN_IO; in DoC2k_init()
552 this->physadr); in DoC2k_init()
572 this->totlen = 0; in DoC2k_init()
573 this->numchips = 0; in DoC2k_init()
575 this->curfloor = -1; in DoC2k_init()
576 this->curchip = -1; in DoC2k_init()
577 init_MUTEX(&this->lock); in DoC2k_init()
580 DoC_ScanChips(this); in DoC2k_init()
582 if (!this->totlen) { in DoC2k_init()
584 iounmap((void *) this->virtadr); in DoC2k_init()
586 this->nextdoc = doc2klist; in DoC2k_init()
588 mtd->size = this->totlen; in DoC2k_init()
589 mtd->erasesize = this->erasesize; in DoC2k_init()
605 struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv; in doc_read_ecc() local
612 docptr = this->virtadr; in doc_read_ecc()
615 if (from >= this->totlen) in doc_read_ecc()
618 down(&this->lock); in doc_read_ecc()
634 mychip = &this->chips[from >> (this->chipshift)]; in doc_read_ecc()
636 if (this->curfloor != mychip->floor) { in doc_read_ecc()
637 DoC_SelectFloor(this, mychip->floor); in doc_read_ecc()
638 DoC_SelectChip(this, mychip->chip); in doc_read_ecc()
639 } else if (this->curchip != mychip->chip) { in doc_read_ecc()
640 DoC_SelectChip(this, mychip->chip); in doc_read_ecc()
643 this->curfloor = mychip->floor; in doc_read_ecc()
644 this->curchip = mychip->chip; in doc_read_ecc()
646 DoC_Command(this, in doc_read_ecc()
647 (!this->page256 in doc_read_ecc()
650 DoC_Address(this, ADDR_COLUMN_PAGE, from, CDSN_CTRL_WP, in doc_read_ecc()
664 if (this->page256 && from + len > (from | 0xff) + 1) { in doc_read_ecc()
666 DoC_ReadBuf(this, buf, len256); in doc_read_ecc()
668 DoC_Command(this, NAND_CMD_READ0, CDSN_CTRL_WP); in doc_read_ecc()
669 DoC_Address(this, ADDR_COLUMN_PAGE, from + len256, in doc_read_ecc()
673 DoC_ReadBuf(this, &buf[len256], len - len256); in doc_read_ecc()
682 DoC_ReadBuf(this, eccbuf, 6); in doc_read_ecc()
685 if (DoC_is_Millennium(this)) { in doc_read_ecc()
735 DoC_WaitReady(this); in doc_read_ecc()
738 up(&this->lock); in doc_read_ecc()
754 struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv; in doc_write_ecc() local
761 docptr = this->virtadr; in doc_write_ecc()
764 if (to >= this->totlen) in doc_write_ecc()
767 down(&this->lock); in doc_write_ecc()
782 mychip = &this->chips[to >> (this->chipshift)]; in doc_write_ecc()
784 if (this->curfloor != mychip->floor) { in doc_write_ecc()
785 DoC_SelectFloor(this, mychip->floor); in doc_write_ecc()
786 DoC_SelectChip(this, mychip->chip); in doc_write_ecc()
787 } else if (this->curchip != mychip->chip) { in doc_write_ecc()
788 DoC_SelectChip(this, mychip->chip); in doc_write_ecc()
791 this->curfloor = mychip->floor; in doc_write_ecc()
792 this->curchip = mychip->chip; in doc_write_ecc()
795 DoC_Command(this, NAND_CMD_RESET, CDSN_CTRL_WP); in doc_write_ecc()
796 DoC_Command(this, in doc_write_ecc()
797 (!this->page256 in doc_write_ecc()
801 DoC_Command(this, NAND_CMD_SEQIN, 0); in doc_write_ecc()
802 DoC_Address(this, ADDR_COLUMN_PAGE, to, 0, CDSN_CTRL_ECC_IO); in doc_write_ecc()
815 if (this->page256 && to + len > (to | 0xff) + 1) { in doc_write_ecc()
817 DoC_WriteBuf(this, buf, len256); in doc_write_ecc()
819 DoC_Command(this, NAND_CMD_PAGEPROG, 0); in doc_write_ecc()
821 DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP); in doc_write_ecc()
825 DoC_Delay(this, 2); in doc_write_ecc()
827 if (ReadDOC_(docptr, this->ioreg) & 1) { in doc_write_ecc()
831 up(&this->lock); in doc_write_ecc()
835 DoC_Command(this, NAND_CMD_SEQIN, 0); in doc_write_ecc()
836 DoC_Address(this, ADDR_COLUMN_PAGE, to + len256, 0, in doc_write_ecc()
840 DoC_WriteBuf(this, &buf[len256], len - len256); in doc_write_ecc()
846 if (DoC_is_Millennium(this)) { in doc_write_ecc()
851 WriteDOC_(0, docptr, this->ioreg); in doc_write_ecc()
852 WriteDOC_(0, docptr, this->ioreg); in doc_write_ecc()
853 WriteDOC_(0, docptr, this->ioreg); in doc_write_ecc()
872 DoC_Command(this, NAND_CMD_PAGEPROG, 0); in doc_write_ecc()
874 DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP); in doc_write_ecc()
878 DoC_Delay(this, 2); in doc_write_ecc()
880 if (ReadDOC_(docptr, this->ioreg) & 1) { in doc_write_ecc()
884 up(&this->lock); in doc_write_ecc()
904 up(&this->lock); in doc_write_ecc()
907 up(&this->lock); in doc_write_ecc()
914 struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv; in doc_read_oob() local
919 down(&this->lock); in doc_read_oob()
921 docptr = this->virtadr; in doc_read_oob()
923 mychip = &this->chips[ofs >> this->chipshift]; in doc_read_oob()
925 if (this->curfloor != mychip->floor) { in doc_read_oob()
926 DoC_SelectFloor(this, mychip->floor); in doc_read_oob()
927 DoC_SelectChip(this, mychip->chip); in doc_read_oob()
928 } else if (this->curchip != mychip->chip) { in doc_read_oob()
929 DoC_SelectChip(this, mychip->chip); in doc_read_oob()
931 this->curfloor = mychip->floor; in doc_read_oob()
932 this->curchip = mychip->chip; in doc_read_oob()
936 if (this->page256) { in doc_read_oob()
943 DoC_Command(this, NAND_CMD_READOOB, CDSN_CTRL_WP); in doc_read_oob()
944 DoC_Address(this, ADDR_COLUMN_PAGE, ofs, CDSN_CTRL_WP, 0); in doc_read_oob()
949 if (this->page256 && ofs + len > (ofs | 0x7) + 1) { in doc_read_oob()
951 DoC_ReadBuf(this, buf, len256); in doc_read_oob()
953 DoC_Command(this, NAND_CMD_READOOB, CDSN_CTRL_WP); in doc_read_oob()
954 DoC_Address(this, ADDR_COLUMN_PAGE, ofs & (~0x1ff), in doc_read_oob()
958 DoC_ReadBuf(this, &buf[len256], len - len256); in doc_read_oob()
965 ret = DoC_WaitReady(this); in doc_read_oob()
967 up(&this->lock); in doc_read_oob()
975 struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv; in doc_write_oob_nolock() local
977 unsigned long docptr = this->virtadr; in doc_write_oob_nolock()
978 struct Nand *mychip = &this->chips[ofs >> this->chipshift]; in doc_write_oob_nolock()
985 if (this->curfloor != mychip->floor) { in doc_write_oob_nolock()
986 DoC_SelectFloor(this, mychip->floor); in doc_write_oob_nolock()
987 DoC_SelectChip(this, mychip->chip); in doc_write_oob_nolock()
988 } else if (this->curchip != mychip->chip) { in doc_write_oob_nolock()
989 DoC_SelectChip(this, mychip->chip); in doc_write_oob_nolock()
991 this->curfloor = mychip->floor; in doc_write_oob_nolock()
992 this->curchip = mychip->chip; in doc_write_oob_nolock()
999 DoC_Command(this, NAND_CMD_RESET, CDSN_CTRL_WP); in doc_write_oob_nolock()
1002 DoC_Command(this, NAND_CMD_READOOB, CDSN_CTRL_WP); in doc_write_oob_nolock()
1006 if (this->page256) { in doc_write_oob_nolock()
1014 DoC_Command(this, NAND_CMD_SEQIN, 0); in doc_write_oob_nolock()
1015 DoC_Address(this, ADDR_COLUMN_PAGE, ofs, 0, 0); in doc_write_oob_nolock()
1020 if (this->page256 && ofs + len > (ofs | 0x7) + 1) { in doc_write_oob_nolock()
1022 DoC_WriteBuf(this, buf, len256); in doc_write_oob_nolock()
1024 DoC_Command(this, NAND_CMD_PAGEPROG, 0); in doc_write_oob_nolock()
1025 DoC_Command(this, NAND_CMD_STATUS, 0); in doc_write_oob_nolock()
1029 DoC_Delay(this, 2); in doc_write_oob_nolock()
1031 if (ReadDOC_(docptr, this->ioreg) & 1) { in doc_write_oob_nolock()
1037 DoC_Command(this, NAND_CMD_SEQIN, 0); in doc_write_oob_nolock()
1038 DoC_Address(this, ADDR_COLUMN_PAGE, ofs & (~0x1ff), 0, 0); in doc_write_oob_nolock()
1041 DoC_WriteBuf(this, &buf[len256], len - len256); in doc_write_oob_nolock()
1043 DoC_Command(this, NAND_CMD_PAGEPROG, 0); in doc_write_oob_nolock()
1044 DoC_Command(this, NAND_CMD_STATUS, 0); in doc_write_oob_nolock()
1048 DoC_Delay(this, 2); in doc_write_oob_nolock()
1050 if (ReadDOC_(docptr, this->ioreg) & 1) { in doc_write_oob_nolock()
1065 struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv; in doc_write_oob() local
1068 down(&this->lock); in doc_write_oob()
1071 up(&this->lock); in doc_write_oob()
1077 struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv; in doc_erase() local
1084 down(&this->lock); in doc_erase()
1087 up(&this->lock); in doc_erase()
1093 docptr = this->virtadr; in doc_erase()
1097 mychip = &this->chips[ofs >> this->chipshift]; in doc_erase()
1099 if (this->curfloor != mychip->floor) { in doc_erase()
1100 DoC_SelectFloor(this, mychip->floor); in doc_erase()
1101 DoC_SelectChip(this, mychip->chip); in doc_erase()
1102 } else if (this->curchip != mychip->chip) { in doc_erase()
1103 DoC_SelectChip(this, mychip->chip); in doc_erase()
1105 this->curfloor = mychip->floor; in doc_erase()
1106 this->curchip = mychip->chip; in doc_erase()
1108 DoC_Command(this, NAND_CMD_ERASE1, 0); in doc_erase()
1109 DoC_Address(this, ADDR_PAGE, ofs, 0, 0); in doc_erase()
1110 DoC_Command(this, NAND_CMD_ERASE2, 0); in doc_erase()
1112 DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP); in doc_erase()
1115 DoC_Delay(this, 2); in doc_erase()
1117 if (ReadDOC_(docptr, this->ioreg) & 1) { in doc_erase()
1132 up(&this->lock); in doc_erase()
1152 struct DiskOnChip *this; in cleanup_doc2000() local
1155 this = (struct DiskOnChip *) mtd->priv; in cleanup_doc2000()
1156 doc2klist = this->nextdoc; in cleanup_doc2000()
1160 iounmap((void *) this->virtadr); in cleanup_doc2000()
1161 kfree(this->chips); in cleanup_doc2000()