• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/mtd/devices/

Lines Matching refs:this

46  * this:
419 static void DoC_ScanChips(struct DiskOnChip *this, int maxchips)
425 this->numchips = 0;
426 this->mfr = 0;
427 this->id = 0;
435 ret = DoC_IdentChip(this, floor, chip);
438 this->numchips++;
444 if (!this->numchips) {
450 this->chips = kmalloc(sizeof(struct Nand) * this->numchips, GFP_KERNEL);
451 if (!this->chips) {
462 this->chips[ret].floor = floor;
463 this->chips[ret].chip = chip;
464 this->chips[ret].curadr = 0;
465 this->chips[ret].curmode = 0x50;
471 this->totlen = this->numchips * (1 << this->chipshift);
474 this->numchips, this->totlen >> 20);
483 /* Use the alias resolution register which was set aside for this
486 * the other. It's unclear if this register is usuable in the
508 * which will bump the use count of this module. */
511 struct DiskOnChip *this = mtd->priv;
521 if (DoC2k_is_alias(old, this)) {
524 this->physadr);
525 iounmap(this->virtadr);
536 switch (this->ChipID) {
539 this->ioreg = DoC_Mil_CDSN_IO;
541 this->ChipID = DOC_ChipID_DocMil;
546 this->ioreg = DoC_2k_CDSN_IO;
551 this->ioreg = DoC_Mil_CDSN_IO;
555 printk("Unknown ChipID 0x%02x\n", this->ChipID);
557 iounmap(this->virtadr);
562 this->physadr);
580 this->totlen = 0;
581 this->numchips = 0;
583 this->curfloor = -1;
584 this->curchip = -1;
585 mutex_init(&this->lock);
588 DoC_ScanChips(this, maxchips);
590 if (!this->totlen) {
592 iounmap(this->virtadr);
594 this->nextdoc = doc2klist;
596 mtd->size = this->totlen;
597 mtd->erasesize = this->erasesize;
607 struct DiskOnChip *this = mtd->priv;
608 void __iomem *docptr = this->virtadr;
616 if (from >= this->totlen)
619 mutex_lock(&this->lock);
639 mychip = &this->chips[from >> (this->chipshift)];
641 if (this->curfloor != mychip->floor) {
642 DoC_SelectFloor(this, mychip->floor);
643 DoC_SelectChip(this, mychip->chip);
644 } else if (this->curchip != mychip->chip) {
645 DoC_SelectChip(this, mychip->chip);
648 this->curfloor = mychip->floor;
649 this->curchip = mychip->chip;
651 DoC_Command(this,
652 (!this->page256
655 DoC_Address(this, ADDR_COLUMN_PAGE, from, CDSN_CTRL_WP,
663 if (this->page256 && from + len > (from | 0xff) + 1) {
665 DoC_ReadBuf(this, buf, len256);
667 DoC_Command(this, NAND_CMD_READ0, CDSN_CTRL_WP);
668 DoC_Address(this, ADDR_COLUMN_PAGE, from + len256,
672 DoC_ReadBuf(this, &buf[len256], len - len256);
678 /* Note: this will work even with 2M x 8bit devices as */
680 DoC_ReadBuf(this, eccbuf, 6);
683 if (DoC_is_Millennium(this)) {
714 read. Not that this can be told to
735 DoC_WaitReady(this);
743 mutex_unlock(&this->lock);
751 struct DiskOnChip *this = mtd->priv;
753 void __iomem *docptr = this->virtadr;
762 if (to >= this->totlen)
765 mutex_lock(&this->lock);
786 mychip = &this->chips[to >> (this->chipshift)];
788 if (this->curfloor != mychip->floor) {
789 DoC_SelectFloor(this, mychip->floor);
790 DoC_SelectChip(this, mychip->chip);
791 } else if (this->curchip != mychip->chip) {
792 DoC_SelectChip(this, mychip->chip);
795 this->curfloor = mychip->floor;
796 this->curchip = mychip->chip;
799 DoC_Command(this, NAND_CMD_RESET, CDSN_CTRL_WP);
800 DoC_Command(this,
801 (!this->page256
805 DoC_Command(this, NAND_CMD_SEQIN, 0);
806 DoC_Address(this, ADDR_COLUMN_PAGE, to, 0, CDSN_CTRL_ECC_IO);
813 if (this->page256 && to + len > (to | 0xff) + 1) {
815 DoC_WriteBuf(this, buf, len256);
817 DoC_Command(this, NAND_CMD_PAGEPROG, 0);
819 DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP);
823 DoC_Delay(this, 2);
825 if (ReadDOC_(docptr, this->ioreg) & 1) {
829 mutex_unlock(&this->lock);
833 DoC_Command(this, NAND_CMD_SEQIN, 0);
834 DoC_Address(this, ADDR_COLUMN_PAGE, to + len256, 0,
838 DoC_WriteBuf(this, &buf[len256], len - len256);
842 if (DoC_is_Millennium(this)) {
847 WriteDOC_(0, docptr, this->ioreg);
848 WriteDOC_(0, docptr, this->ioreg);
849 WriteDOC_(0, docptr, this->ioreg);
869 DoC_Command(this, NAND_CMD_PAGEPROG, 0);
871 DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP);
874 if (DoC_is_Millennium(this)) {
879 DoC_Delay(this, 2);
880 status = ReadDOC_(docptr, this->ioreg);
887 mutex_unlock(&this->lock);
908 mutex_unlock(&this->lock);
918 mutex_unlock(&this->lock);
925 struct DiskOnChip *this = mtd->priv;
935 mutex_lock(&this->lock);
937 mychip = &this->chips[ofs >> this->chipshift];
939 if (this->curfloor != mychip->floor) {
940 DoC_SelectFloor(this, mychip->floor);
941 DoC_SelectChip(this, mychip->chip);
942 } else if (this->curchip != mychip->chip) {
943 DoC_SelectChip(this, mychip->chip);
945 this->curfloor = mychip->floor;
946 this->curchip = mychip->chip;
950 if (this->page256) {
957 DoC_Command(this, NAND_CMD_READOOB, CDSN_CTRL_WP);
958 DoC_Address(this, ADDR_COLUMN_PAGE, ofs, CDSN_CTRL_WP, 0);
963 if (this->page256 && ofs + len > (ofs | 0x7) + 1) {
965 DoC_ReadBuf(this, buf, len256);
967 DoC_Command(this, NAND_CMD_READOOB, CDSN_CTRL_WP);
968 DoC_Address(this, ADDR_COLUMN_PAGE, ofs & (~0x1ff),
972 DoC_ReadBuf(this, &buf[len256], len - len256);
979 ret = DoC_WaitReady(this);
981 mutex_unlock(&this->lock);
989 struct DiskOnChip *this = mtd->priv;
991 void __iomem *docptr = this->virtadr;
992 struct Nand *mychip = &this->chips[ofs >> this->chipshift];
1000 if (this->curfloor != mychip->floor) {
1001 DoC_SelectFloor(this, mychip->floor);
1002 DoC_SelectChip(this, mychip->chip);
1003 } else if (this->curchip != mychip->chip) {
1004 DoC_SelectChip(this, mychip->chip);
1006 this->curfloor = mychip->floor;
1007 this->curchip = mychip->chip;
1014 DoC_Command(this, NAND_CMD_RESET, CDSN_CTRL_WP);
1017 DoC_Command(this, NAND_CMD_READOOB, CDSN_CTRL_WP);
1021 if (this->page256) {
1029 DoC_Command(this, NAND_CMD_SEQIN, 0);
1030 DoC_Address(this, ADDR_COLUMN_PAGE, ofs, 0, 0);
1035 if (this->page256 && ofs + len > (ofs | 0x7) + 1) {
1037 DoC_WriteBuf(this, buf, len256);
1039 DoC_Command(this, NAND_CMD_PAGEPROG, 0);
1040 DoC_Command(this, NAND_CMD_STATUS, 0);
1043 if (DoC_is_Millennium(this)) {
1048 DoC_Delay(this, 2);
1049 status = ReadDOC_(docptr, this->ioreg);
1058 DoC_Command(this, NAND_CMD_SEQIN, 0);
1059 DoC_Address(this, ADDR_COLUMN_PAGE, ofs & (~0x1ff), 0, 0);
1062 DoC_WriteBuf(this, &buf[len256], len - len256);
1064 DoC_Command(this, NAND_CMD_PAGEPROG, 0);
1065 DoC_Command(this, NAND_CMD_STATUS, 0);
1068 if (DoC_is_Millennium(this)) {
1073 DoC_Delay(this, 2);
1074 status = ReadDOC_(docptr, this->ioreg);
1092 struct DiskOnChip *this = mtd->priv;
1097 mutex_lock(&this->lock);
1101 mutex_unlock(&this->lock);
1107 struct DiskOnChip *this = mtd->priv;
1111 void __iomem *docptr = this->virtadr;
1115 mutex_lock(&this->lock);
1118 mutex_unlock(&this->lock);
1125 mychip = &this->chips[ofs >> this->chipshift];
1127 if (this->curfloor != mychip->floor) {
1128 DoC_SelectFloor(this, mychip->floor);
1129 DoC_SelectChip(this, mychip->chip);
1130 } else if (this->curchip != mychip->chip) {
1131 DoC_SelectChip(this, mychip->chip);
1133 this->curfloor = mychip->floor;
1134 this->curchip = mychip->chip;
1136 DoC_Command(this, NAND_CMD_ERASE1, 0);
1137 DoC_Address(this, ADDR_PAGE, ofs, 0, 0);
1138 DoC_Command(this, NAND_CMD_ERASE2, 0);
1140 DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP);
1142 if (DoC_is_Millennium(this)) {
1147 DoC_Delay(this, 2);
1148 status = ReadDOC_(docptr, this->ioreg);
1165 mutex_unlock(&this->lock);
1179 struct DiskOnChip *this;
1182 this = mtd->priv;
1183 doc2klist = this->nextdoc;
1187 iounmap(this->virtadr);
1188 kfree(this->chips);