diskonchip.c (7e534323c416216e8ac45b5633fb0a5e5137e5b5) | diskonchip.c (c0739d85723a381302907f9613392d7ac8515176) |
---|---|
1/* 2 * (C) 2003 Red Hat, Inc. 3 * (C) 2004 Dan Brown <dan_brown@ieee.org> 4 * (C) 2004 Kalev Lember <kalev@smartlink.ee> 5 * 6 * Author: David Woodhouse <dwmw2@infradead.org> 7 * Additional Diskonchip 2000 and Millennium support by Dan Brown <dan_brown@ieee.org> 8 * Diskonchip Millennium Plus support by Kalev Lember <kalev@smartlink.ee> --- 276 unchanged lines hidden (view full) --- 285 DoC_Delay(doc, 2); 286 } 287 288 if (debug) 289 printk("DoC_WaitReady OK\n"); 290 return ret; 291} 292 | 1/* 2 * (C) 2003 Red Hat, Inc. 3 * (C) 2004 Dan Brown <dan_brown@ieee.org> 4 * (C) 2004 Kalev Lember <kalev@smartlink.ee> 5 * 6 * Author: David Woodhouse <dwmw2@infradead.org> 7 * Additional Diskonchip 2000 and Millennium support by Dan Brown <dan_brown@ieee.org> 8 * Diskonchip Millennium Plus support by Kalev Lember <kalev@smartlink.ee> --- 276 unchanged lines hidden (view full) --- 285 DoC_Delay(doc, 2); 286 } 287 288 if (debug) 289 printk("DoC_WaitReady OK\n"); 290 return ret; 291} 292 |
293static void doc2000_write_byte(struct mtd_info *mtd, u_char datum) | 293static void doc2000_write_byte(struct nand_chip *this, u_char datum) |
294{ | 294{ |
295 struct nand_chip *this = mtd_to_nand(mtd); | |
296 struct doc_priv *doc = nand_get_controller_data(this); 297 void __iomem *docptr = doc->virtadr; 298 299 if (debug) 300 printk("write_byte %02x\n", datum); 301 WriteDOC(datum, docptr, CDSNSlowIO); 302 WriteDOC(datum, docptr, 2k_CDSN_IO); 303} --- 7 unchanged lines hidden (view full) --- 311 ReadDOC(docptr, CDSNSlowIO); 312 DoC_Delay(doc, 2); 313 ret = ReadDOC(docptr, 2k_CDSN_IO); 314 if (debug) 315 printk("read_byte returns %02x\n", ret); 316 return ret; 317} 318 | 295 struct doc_priv *doc = nand_get_controller_data(this); 296 void __iomem *docptr = doc->virtadr; 297 298 if (debug) 299 printk("write_byte %02x\n", datum); 300 WriteDOC(datum, docptr, CDSNSlowIO); 301 WriteDOC(datum, docptr, 2k_CDSN_IO); 302} --- 7 unchanged lines hidden (view full) --- 310 ReadDOC(docptr, CDSNSlowIO); 311 DoC_Delay(doc, 2); 312 ret = ReadDOC(docptr, 2k_CDSN_IO); 313 if (debug) 314 printk("read_byte returns %02x\n", ret); 315 return ret; 316} 317 |
319static void doc2000_writebuf(struct mtd_info *mtd, const u_char *buf, int len) | 318static void doc2000_writebuf(struct nand_chip *this, const u_char *buf, 319 int len) |
320{ | 320{ |
321 struct nand_chip *this = mtd_to_nand(mtd); | |
322 struct doc_priv *doc = nand_get_controller_data(this); 323 void __iomem *docptr = doc->virtadr; 324 int i; 325 if (debug) 326 printk("writebuf of %d bytes: ", len); 327 for (i = 0; i < len; i++) { 328 WriteDOC_(buf[i], docptr, DoC_2k_CDSN_IO + i); 329 if (debug && i < 16) --- 113 unchanged lines hidden (view full) --- 443 DoC_WaitReady(doc); 444 nand_status_op(this, NULL); 445 DoC_WaitReady(doc); 446 status = (int)this->read_byte(this); 447 448 return status; 449} 450 | 321 struct doc_priv *doc = nand_get_controller_data(this); 322 void __iomem *docptr = doc->virtadr; 323 int i; 324 if (debug) 325 printk("writebuf of %d bytes: ", len); 326 for (i = 0; i < len; i++) { 327 WriteDOC_(buf[i], docptr, DoC_2k_CDSN_IO + i); 328 if (debug && i < 16) --- 113 unchanged lines hidden (view full) --- 442 DoC_WaitReady(doc); 443 nand_status_op(this, NULL); 444 DoC_WaitReady(doc); 445 status = (int)this->read_byte(this); 446 447 return status; 448} 449 |
451static void doc2001_write_byte(struct mtd_info *mtd, u_char datum) | 450static void doc2001_write_byte(struct nand_chip *this, u_char datum) |
452{ | 451{ |
453 struct nand_chip *this = mtd_to_nand(mtd); | |
454 struct doc_priv *doc = nand_get_controller_data(this); 455 void __iomem *docptr = doc->virtadr; 456 457 WriteDOC(datum, docptr, CDSNSlowIO); 458 WriteDOC(datum, docptr, Mil_CDSN_IO); 459 WriteDOC(datum, docptr, WritePipeTerm); 460} 461 --- 5 unchanged lines hidden (view full) --- 467 //ReadDOC(docptr, CDSNSlowIO); 468 /* 11.4.5 -- delay twice to allow extended length cycle */ 469 DoC_Delay(doc, 2); 470 ReadDOC(docptr, ReadPipeInit); 471 //return ReadDOC(docptr, Mil_CDSN_IO); 472 return ReadDOC(docptr, LastDataRead); 473} 474 | 452 struct doc_priv *doc = nand_get_controller_data(this); 453 void __iomem *docptr = doc->virtadr; 454 455 WriteDOC(datum, docptr, CDSNSlowIO); 456 WriteDOC(datum, docptr, Mil_CDSN_IO); 457 WriteDOC(datum, docptr, WritePipeTerm); 458} 459 --- 5 unchanged lines hidden (view full) --- 465 //ReadDOC(docptr, CDSNSlowIO); 466 /* 11.4.5 -- delay twice to allow extended length cycle */ 467 DoC_Delay(doc, 2); 468 ReadDOC(docptr, ReadPipeInit); 469 //return ReadDOC(docptr, Mil_CDSN_IO); 470 return ReadDOC(docptr, LastDataRead); 471} 472 |
475static void doc2001_writebuf(struct mtd_info *mtd, const u_char *buf, int len) | 473static void doc2001_writebuf(struct nand_chip *this, const u_char *buf, int len) |
476{ | 474{ |
477 struct nand_chip *this = mtd_to_nand(mtd); | |
478 struct doc_priv *doc = nand_get_controller_data(this); 479 void __iomem *docptr = doc->virtadr; 480 int i; 481 482 for (i = 0; i < len; i++) 483 WriteDOC_(buf[i], docptr, DoC_Mil_CDSN_IO + i); 484 /* Terminate write pipeline */ 485 WriteDOC(0x00, docptr, WritePipeTerm); --- 24 unchanged lines hidden (view full) --- 510 ReadDOC(docptr, Mplus_ReadPipeInit); 511 ReadDOC(docptr, Mplus_ReadPipeInit); 512 ret = ReadDOC(docptr, Mplus_LastDataRead); 513 if (debug) 514 printk("read_byte returns %02x\n", ret); 515 return ret; 516} 517 | 475 struct doc_priv *doc = nand_get_controller_data(this); 476 void __iomem *docptr = doc->virtadr; 477 int i; 478 479 for (i = 0; i < len; i++) 480 WriteDOC_(buf[i], docptr, DoC_Mil_CDSN_IO + i); 481 /* Terminate write pipeline */ 482 WriteDOC(0x00, docptr, WritePipeTerm); --- 24 unchanged lines hidden (view full) --- 507 ReadDOC(docptr, Mplus_ReadPipeInit); 508 ReadDOC(docptr, Mplus_ReadPipeInit); 509 ret = ReadDOC(docptr, Mplus_LastDataRead); 510 if (debug) 511 printk("read_byte returns %02x\n", ret); 512 return ret; 513} 514 |
518static void doc2001plus_writebuf(struct mtd_info *mtd, const u_char *buf, int len) | 515static void doc2001plus_writebuf(struct nand_chip *this, const u_char *buf, int len) |
519{ | 516{ |
520 struct nand_chip *this = mtd_to_nand(mtd); | |
521 struct doc_priv *doc = nand_get_controller_data(this); 522 void __iomem *docptr = doc->virtadr; 523 int i; 524 525 if (debug) 526 printk("writebuf of %d bytes: ", len); 527 for (i = 0; i < len; i++) { 528 WriteDOC_(buf[i], docptr, DoC_Mil_CDSN_IO + i); --- 104 unchanged lines hidden (view full) --- 633 if (debug) 634 printk("hwcontrol(%d): %02x\n", cmd, doc->CDSNControl); 635 WriteDOC(doc->CDSNControl, docptr, CDSNControl); 636 /* 11.4.3 -- 4 NOPs after CSDNControl write */ 637 DoC_Delay(doc, 4); 638 } 639 if (cmd != NAND_CMD_NONE) { 640 if (DoC_is_2000(doc)) | 517 struct doc_priv *doc = nand_get_controller_data(this); 518 void __iomem *docptr = doc->virtadr; 519 int i; 520 521 if (debug) 522 printk("writebuf of %d bytes: ", len); 523 for (i = 0; i < len; i++) { 524 WriteDOC_(buf[i], docptr, DoC_Mil_CDSN_IO + i); --- 104 unchanged lines hidden (view full) --- 629 if (debug) 630 printk("hwcontrol(%d): %02x\n", cmd, doc->CDSNControl); 631 WriteDOC(doc->CDSNControl, docptr, CDSNControl); 632 /* 11.4.3 -- 4 NOPs after CSDNControl write */ 633 DoC_Delay(doc, 4); 634 } 635 if (cmd != NAND_CMD_NONE) { 636 if (DoC_is_2000(doc)) |
641 doc2000_write_byte(mtd, cmd); | 637 doc2000_write_byte(this, cmd); |
642 else | 638 else |
643 doc2001_write_byte(mtd, cmd); | 639 doc2001_write_byte(this, cmd); |
644 } 645} 646 647static void doc2001plus_command(struct mtd_info *mtd, unsigned command, int column, int page_addr) 648{ 649 struct nand_chip *this = mtd_to_nand(mtd); 650 struct doc_priv *doc = nand_get_controller_data(this); 651 void __iomem *docptr = doc->virtadr; --- 1046 unchanged lines hidden --- | 640 } 641} 642 643static void doc2001plus_command(struct mtd_info *mtd, unsigned command, int column, int page_addr) 644{ 645 struct nand_chip *this = mtd_to_nand(mtd); 646 struct doc_priv *doc = nand_get_controller_data(this); 647 void __iomem *docptr = doc->virtadr; --- 1046 unchanged lines hidden --- |