Lines Matching defs:doc
85 #define DoC_is_MillenniumPlus(doc) ((doc)->ChipID == DOC_ChipID_DocMilPlus16 || (doc)->ChipID == DOC_ChipID_DocMilPlus32)
86 #define DoC_is_Millennium(doc) ((doc)->ChipID == DOC_ChipID_DocMil)
87 #define DoC_is_2000(doc) ((doc)->ChipID == DOC_ChipID_Doc2k)
223 static void DoC_Delay(struct doc_priv *doc, unsigned short cycles)
229 if (DoC_is_Millennium(doc))
230 dummy = ReadDOC(doc->virtadr, NOP);
231 else if (DoC_is_MillenniumPlus(doc))
232 dummy = ReadDOC(doc->virtadr, Mplus_NOP);
234 dummy = ReadDOC(doc->virtadr, DOCStatus);
242 static int _DoC_WaitReady(struct doc_priv *doc)
244 void __iomem *docptr = doc->virtadr;
250 if (DoC_is_MillenniumPlus(doc)) {
273 static inline int DoC_WaitReady(struct doc_priv *doc)
275 void __iomem *docptr = doc->virtadr;
278 if (DoC_is_MillenniumPlus(doc)) {
279 DoC_Delay(doc, 4);
283 ret = _DoC_WaitReady(doc);
285 DoC_Delay(doc, 4);
289 ret = _DoC_WaitReady(doc);
290 DoC_Delay(doc, 2);
301 struct doc_priv *doc = this->priv;
302 void __iomem *docptr = doc->virtadr;
313 struct doc_priv *doc = this->priv;
314 void __iomem *docptr = doc->virtadr;
318 DoC_Delay(doc, 2);
328 struct doc_priv *doc = this->priv;
329 void __iomem *docptr = doc->virtadr;
345 struct doc_priv *doc = this->priv;
346 void __iomem *docptr = doc->virtadr;
360 struct doc_priv *doc = this->priv;
361 void __iomem *docptr = doc->virtadr;
381 struct doc_priv *doc = this->priv;
382 void __iomem *docptr = doc->virtadr;
394 struct doc_priv *doc = this->priv;
411 if (doc->ChipID == DOC_ChipID_Doc2k && try_dword && !nr) {
417 void __iomem *docptr = doc->virtadr;
440 struct doc_priv *doc = this->priv;
445 doc->chips_per_floor = 4;
455 doc->chips_per_floor = i;
461 struct doc_priv *doc = this->priv;
465 DoC_WaitReady(doc);
467 DoC_WaitReady(doc);
476 struct doc_priv *doc = this->priv;
477 void __iomem *docptr = doc->virtadr;
487 struct doc_priv *doc = this->priv;
488 void __iomem *docptr = doc->virtadr;
492 DoC_Delay(doc, 2);
501 struct doc_priv *doc = this->priv;
502 void __iomem *docptr = doc->virtadr;
514 struct doc_priv *doc = this->priv;
515 void __iomem *docptr = doc->virtadr;
531 struct doc_priv *doc = this->priv;
532 void __iomem *docptr = doc->virtadr;
551 struct doc_priv *doc = this->priv;
552 void __iomem *docptr = doc->virtadr;
566 struct doc_priv *doc = this->priv;
567 void __iomem *docptr = doc->virtadr;
584 struct doc_priv *doc = this->priv;
585 void __iomem *docptr = doc->virtadr;
615 struct doc_priv *doc = this->priv;
616 void __iomem *docptr = doc->virtadr;
642 struct doc_priv *doc = this->priv;
643 void __iomem *docptr = doc->virtadr;
655 floor = chip / doc->chips_per_floor;
656 chip -= (floor * doc->chips_per_floor);
662 doc->curchip = chip;
663 doc->curfloor = floor;
669 struct doc_priv *doc = this->priv;
670 void __iomem *docptr = doc->virtadr;
679 floor = chip / doc->chips_per_floor;
680 chip -= (floor * doc->chips_per_floor);
690 doc->curchip = chip;
691 doc->curfloor = floor;
700 struct doc_priv *doc = this->priv;
701 void __iomem *docptr = doc->virtadr;
704 doc->CDSNControl &= ~CDSN_CTRL_MSK;
705 doc->CDSNControl |= ctrl & CDSN_CTRL_MSK;
707 printk("hwcontrol(%d): %02x\n", cmd, doc->CDSNControl);
708 WriteDOC(doc->CDSNControl, docptr, CDSNControl);
710 DoC_Delay(doc, 4);
713 if (DoC_is_2000(doc))
723 struct doc_priv *doc = this->priv;
724 void __iomem *docptr = doc->virtadr;
828 struct doc_priv *doc = this->priv;
829 void __iomem *docptr = doc->virtadr;
831 if (DoC_is_MillenniumPlus(doc)) {
833 DoC_Delay(doc, 4);
844 DoC_Delay(doc, 4);
851 DoC_Delay(doc, 2);
868 struct doc_priv *doc = this->priv;
869 void __iomem *docptr = doc->virtadr;
887 struct doc_priv *doc = this->priv;
888 void __iomem *docptr = doc->virtadr;
907 struct doc_priv *doc = this->priv;
908 void __iomem *docptr = doc->virtadr;
913 if (DoC_is_2000(doc)) {
914 WriteDOC(doc->CDSNControl & ~CDSN_CTRL_FLASH_IO, docptr, CDSNControl);
918 WriteDOC(doc->CDSNControl, docptr, CDSNControl);
919 } else if (DoC_is_MillenniumPlus(doc)) {
930 if (DoC_is_MillenniumPlus(doc))
937 if (DoC_is_MillenniumPlus(doc))
949 struct doc_priv *doc = this->priv;
950 void __iomem *docptr = doc->virtadr;
956 if (DoC_is_2000(doc)) {
960 } else if (DoC_is_MillenniumPlus(doc)) {
973 if (DoC_is_MillenniumPlus(doc))
1011 if (DoC_is_MillenniumPlus(doc))
1049 struct doc_priv *doc = this->priv;
1064 if (doc->mh0_page == -1) {
1065 doc->mh0_page = offs >> this->page_shift;
1070 doc->mh1_page = offs >> this->page_shift;
1073 if (doc->mh0_page == -1) {
1079 offs = doc->mh0_page << this->page_shift;
1092 struct doc_priv *doc = this->priv;
1160 offs = max(doc->mh0_page, doc->mh1_page);
1195 struct doc_priv *doc = this->priv;
1217 doc->mh1_page = doc->mh0_page + (4096 >> this->page_shift);
1253 blocks = doc->chips_per_floor << (this->chip_shift - this->phys_erase_shift);
1316 struct doc_priv *doc = this->priv;
1329 this->bbt_td->pages[0] = doc->mh0_page + 1;
1330 if (doc->mh1_page != -1) {
1335 this->bbt_md->pages[0] = doc->mh1_page + 1;
1356 struct doc_priv *doc = this->priv;
1359 if (this->numchips > doc->chips_per_floor) {
1364 if (DoC_is_MillenniumPlus(doc)) {
1414 struct doc_priv *doc = this->priv;
1422 doc->CDSNControl = CDSN_CTRL_FLASH_IO | CDSN_CTRL_ECC_IO;
1425 return (4 * doc->chips_per_floor);
1431 struct doc_priv *doc = this->priv;
1438 ReadDOC(doc->virtadr, ChipID);
1439 ReadDOC(doc->virtadr, ChipID);
1440 ReadDOC(doc->virtadr, ChipID);
1441 if (ReadDOC(doc->virtadr, ChipID) != DOC_ChipID_DocMil) {
1449 return (4 * doc->chips_per_floor);
1452 doc->chips_per_floor = 1;
1462 struct doc_priv *doc = this->priv;
1474 doc->chips_per_floor = 1;
1485 struct doc_priv *doc;
1573 for (mtd = doclist; mtd; mtd = doc->nextdoc) {
1577 doc = nand->priv;
1583 oldval = ReadDOC(doc->virtadr, Mplus_AliasResolution);
1586 oldval = ReadDOC(doc->virtadr, AliasResolution);
1593 oldval = ReadDOC(doc->virtadr, Mplus_AliasResolution);
1597 oldval = ReadDOC(doc->virtadr, AliasResolution);
1602 printk(KERN_DEBUG "Found alias of DOC at 0x%lx to 0x%lx\n", doc->physadr, physadr);
1619 doc = (struct doc_priv *) (nand + 1);
1620 nand->bbt_td = (struct nand_bbt_descr *) (doc + 1);
1626 nand->priv = doc;
1642 doc->physadr = physadr;
1643 doc->virtadr = virtadr;
1644 doc->ChipID = ChipID;
1645 doc->curfloor = -1;
1646 doc->curchip = -1;
1647 doc->mh0_page = -1;
1648 doc->mh1_page = -1;
1649 doc->nextdoc = doclist;
1687 struct doc_priv *doc;
1691 doc = nand->priv;
1693 nextmtd = doc->nextdoc;
1695 iounmap(doc->virtadr);