Searched refs:docptr (Results 1 - 2 of 2) sorted by relevance

/linux-4.1.27/drivers/mtd/nand/
H A Ddocg4.c237 static inline void write_nop(void __iomem *docptr) write_nop() argument
239 writew(0, docptr + DOC_NOP); write_nop()
274 void __iomem *docptr = doc->virtadr; poll_status() local
279 flash_status = readw(docptr + DOC_FLASHCONTROL); poll_status()
284 flash_status = readb(docptr + DOC_FLASHCONTROL); poll_status()
323 void __iomem *docptr = doc->virtadr; docg4_select_chip() local
333 writew(0, docptr + DOC_DEVICESELECT); docg4_select_chip()
342 void __iomem *docptr = doc->virtadr; reset() local
345 docptr + DOC_ASICMODE); reset()
347 docptr + DOC_ASICMODECONFIRM); reset()
348 write_nop(docptr); reset()
351 docptr + DOC_ASICMODE); reset()
353 docptr + DOC_ASICMODECONFIRM); reset()
355 writew(DOC_ECCCONF1_ECC_ENABLE, docptr + DOC_ECCCONF1); reset()
360 static void read_hw_ecc(void __iomem *docptr, uint8_t *ecc_buf) read_hw_ecc() argument
366 ecc_buf[i] = readb(docptr + DOC_BCH_SYNDROM(i)); read_hw_ecc()
367 ecc_buf[i] = readb(docptr + DOC_BCH_SYNDROM(i)); read_hw_ecc()
380 void __iomem *docptr = doc->virtadr; correct_data() local
385 read_hw_ecc(docptr, doc->ecc_buf); /* read 7 hw-generated ecc bytes */ correct_data()
503 void __iomem *docptr = doc->virtadr; write_addr() local
504 writeb(docg4_addr & 0xff, docptr + DOC_FLASHADDRESS); write_addr()
506 writeb(docg4_addr & 0xff, docptr + DOC_FLASHADDRESS); write_addr()
508 writeb(docg4_addr & 0xff, docptr + DOC_FLASHADDRESS); write_addr()
510 writeb(docg4_addr & 0xff, docptr + DOC_FLASHADDRESS); write_addr()
520 void __iomem *docptr = doc->virtadr; read_progstatus() local
523 uint16_t status1 = readw(docptr + DOC_IOSPACE_DATA); read_progstatus()
524 uint16_t status2 = readw(docptr + DOC_IOSPACE_DATA); read_progstatus()
525 uint16_t status3 = readw(docptr + DOCG4_MYSTERY_REG); read_progstatus()
550 void __iomem *docptr = doc->virtadr; pageprog() local
555 writew(DOCG4_SEQ_PAGEPROG, docptr + DOC_FLASHSEQUENCE); pageprog()
556 writew(DOC_CMD_PROG_CYCLE2, docptr + DOC_FLASHCOMMAND); pageprog()
557 write_nop(docptr); pageprog()
558 write_nop(docptr); pageprog()
563 writew(DOCG4_SEQ_FLUSH, docptr + DOC_FLASHSEQUENCE); pageprog()
564 writew(DOCG4_CMD_FLUSH, docptr + DOC_FLASHCOMMAND); pageprog()
565 writew(DOC_ECCCONF0_READ_MODE | 4, docptr + DOC_ECCCONF0); pageprog()
566 write_nop(docptr); pageprog()
567 write_nop(docptr); pageprog()
568 write_nop(docptr); pageprog()
569 write_nop(docptr); pageprog()
570 write_nop(docptr); pageprog()
573 writew(0, docptr + DOC_DATAEND); pageprog()
574 write_nop(docptr); pageprog()
576 write_nop(docptr); pageprog()
587 void __iomem *docptr = doc->virtadr; sequence_reset() local
589 writew(DOC_CTRL_UNKNOWN | DOC_CTRL_CE, docptr + DOC_FLASHCONTROL); sequence_reset()
590 writew(DOC_SEQ_RESET, docptr + DOC_FLASHSEQUENCE); sequence_reset()
591 writew(DOC_CMD_RESET, docptr + DOC_FLASHCOMMAND); sequence_reset()
592 write_nop(docptr); sequence_reset()
593 write_nop(docptr); sequence_reset()
595 write_nop(docptr); sequence_reset()
604 void __iomem *docptr = doc->virtadr; read_page_prologue() local
611 writew(DOCG4_SEQ_PAGE_READ, docptr + DOC_FLASHSEQUENCE); read_page_prologue()
612 writew(DOCG4_CMD_PAGE_READ, docptr + DOC_FLASHCOMMAND); read_page_prologue()
613 write_nop(docptr); read_page_prologue()
617 write_nop(docptr); read_page_prologue()
618 writew(DOCG4_CMD_READ2, docptr + DOC_FLASHCOMMAND); read_page_prologue()
619 write_nop(docptr); read_page_prologue()
620 write_nop(docptr); read_page_prologue()
631 void __iomem *docptr = doc->virtadr; write_page_prologue() local
638 writew(DOCG4_SEQ_SETMODE, docptr + DOC_FLASHSEQUENCE); write_page_prologue()
639 writew(DOCG4_CMD_FAST_MODE, docptr + DOC_FLASHCOMMAND); write_page_prologue()
640 writew(DOC_CMD_RELIABLE_MODE, docptr + DOC_FLASHCOMMAND); write_page_prologue()
641 write_nop(docptr); write_page_prologue()
644 writew(DOCG4_SEQ_PAGEWRITE, docptr + DOC_FLASHSEQUENCE); write_page_prologue()
645 writew(DOCG4_CMD_PAGEWRITE, docptr + DOC_FLASHCOMMAND); write_page_prologue()
646 write_nop(docptr); write_page_prologue()
648 write_nop(docptr); write_page_prologue()
649 write_nop(docptr); write_page_prologue()
760 void __iomem *docptr = doc->virtadr; read_page() local
770 docptr + DOC_ECCCONF0); read_page()
771 write_nop(docptr); read_page()
772 write_nop(docptr); read_page()
773 write_nop(docptr); read_page()
774 write_nop(docptr); read_page()
775 write_nop(docptr); read_page()
778 status = readw(docptr + DOC_IOSPACE_DATA); read_page()
782 writew(0, docptr + DOC_DATAEND); read_page()
796 *buf16 = readw(docptr + DOCG4_MYSTERY_REG); read_page()
798 write_nop(docptr); read_page()
803 edc_err = readw(docptr + DOC_ECCCONF1); read_page()
804 edc_err = readw(docptr + DOC_ECCCONF1); read_page()
817 writew(0, docptr + DOC_DATAEND); read_page()
840 void __iomem *docptr = doc->virtadr; docg4_read_oob() local
847 writew(DOC_ECCCONF0_READ_MODE | DOCG4_OOB_SIZE, docptr + DOC_ECCCONF0); docg4_read_oob()
848 write_nop(docptr); docg4_read_oob()
849 write_nop(docptr); docg4_read_oob()
850 write_nop(docptr); docg4_read_oob()
851 write_nop(docptr); docg4_read_oob()
852 write_nop(docptr); docg4_read_oob()
855 status = readw(docptr + DOC_IOSPACE_DATA); docg4_read_oob()
866 write_nop(docptr); docg4_read_oob()
867 write_nop(docptr); docg4_read_oob()
868 write_nop(docptr); docg4_read_oob()
869 writew(0, docptr + DOC_DATAEND); docg4_read_oob()
870 write_nop(docptr); docg4_read_oob()
879 void __iomem *docptr = doc->virtadr; docg4_erase_block() local
886 writew(DOCG4_SEQ_BLOCKERASE, docptr + DOC_FLASHSEQUENCE); docg4_erase_block()
887 writew(DOC_CMD_PROG_BLOCK_ADDR, docptr + DOC_FLASHCOMMAND); docg4_erase_block()
888 write_nop(docptr); docg4_erase_block()
892 writeb(g4_page & 0xff, docptr + DOC_FLASHADDRESS); docg4_erase_block()
894 writeb(g4_page & 0xff, docptr + DOC_FLASHADDRESS); docg4_erase_block()
895 write_nop(docptr); docg4_erase_block()
898 writew(DOC_CMD_ERASECYCLE2, docptr + DOC_FLASHCOMMAND); docg4_erase_block()
899 write_nop(docptr); docg4_erase_block()
900 write_nop(docptr); docg4_erase_block()
904 writew(DOCG4_SEQ_FLUSH, docptr + DOC_FLASHSEQUENCE); docg4_erase_block()
905 writew(DOCG4_CMD_FLUSH, docptr + DOC_FLASHCOMMAND); docg4_erase_block()
906 writew(DOC_ECCCONF0_READ_MODE | 4, docptr + DOC_ECCCONF0); docg4_erase_block()
907 write_nop(docptr); docg4_erase_block()
908 write_nop(docptr); docg4_erase_block()
909 write_nop(docptr); docg4_erase_block()
910 write_nop(docptr); docg4_erase_block()
911 write_nop(docptr); docg4_erase_block()
915 writew(0, docptr + DOC_DATAEND); docg4_erase_block()
916 write_nop(docptr); docg4_erase_block()
918 write_nop(docptr); docg4_erase_block()
927 void __iomem *docptr = doc->virtadr; write_page() local
935 docptr + DOC_ECCCONF0); write_page()
936 write_nop(docptr); write_page()
945 writew(nand->oob_poi[6], docptr + DOCG4_OOB_6_7); write_page()
947 write_nop(docptr); write_page()
948 write_nop(docptr); write_page()
953 uint8_t hamming = readb(docptr + DOC_HAMMINGPARITY); write_page()
954 hamming = readb(docptr + DOC_HAMMINGPARITY); /* 2nd read */ write_page()
955 writew(hamming, docptr + DOCG4_OOB_6_7); write_page()
956 write_nop(docptr); write_page()
959 read_hw_ecc(docptr, ecc_buf); write_page()
965 writew(nand->oob_poi[7], docptr + DOCG4_OOB_6_7); write_page()
966 write_nop(docptr); write_page()
971 write_nop(docptr); write_page()
972 write_nop(docptr); write_page()
973 writew(0, docptr + DOC_DATAEND); write_page()
974 write_nop(docptr); write_page()
1142 void __iomem *docptr = doc->virtadr; docg4_suspend() local
1148 pwr_down = readb(docptr + DOC_POWERMODE); docg4_suspend()
1161 docptr + DOC_ASICMODE); docg4_suspend()
1163 docptr + DOC_ASICMODECONFIRM); docg4_suspend()
1165 write_nop(docptr); docg4_suspend()
1179 void __iomem *docptr = doc->virtadr; docg4_resume() local
1185 readb(docptr + 0x1fff); docg4_resume()
1266 void __iomem *docptr = doc->virtadr; read_id_reg() local
1270 id1 = readw(docptr + DOC_CHIPID); read_id_reg()
1271 id1 = readw(docptr + DOCG4_MYSTERY_REG); read_id_reg()
1272 id2 = readw(docptr + DOC_CHIPID_INV); read_id_reg()
1273 id2 = readw(docptr + DOCG4_MYSTERY_REG); read_id_reg()
H A Ddiskonchip.c243 void __iomem *docptr = doc->virtadr; _DoC_WaitReady() local
250 while ((ReadDOC(docptr, Mplus_FlashControl) & CDSN_CTRL_FR_B_MASK) != CDSN_CTRL_FR_B_MASK) { _DoC_WaitReady()
259 while (!(ReadDOC(docptr, CDSNControl) & CDSN_CTRL_FR_B)) { _DoC_WaitReady()
274 void __iomem *docptr = doc->virtadr; DoC_WaitReady() local
280 if ((ReadDOC(docptr, Mplus_FlashControl) & CDSN_CTRL_FR_B_MASK) != CDSN_CTRL_FR_B_MASK) DoC_WaitReady()
286 if (!(ReadDOC(docptr, CDSNControl) & CDSN_CTRL_FR_B)) DoC_WaitReady()
301 void __iomem *docptr = doc->virtadr; doc2000_write_byte() local
305 WriteDOC(datum, docptr, CDSNSlowIO); doc2000_write_byte()
306 WriteDOC(datum, docptr, 2k_CDSN_IO); doc2000_write_byte()
313 void __iomem *docptr = doc->virtadr; doc2000_read_byte() local
316 ReadDOC(docptr, CDSNSlowIO); doc2000_read_byte()
318 ret = ReadDOC(docptr, 2k_CDSN_IO); doc2000_read_byte()
328 void __iomem *docptr = doc->virtadr; doc2000_writebuf() local
333 WriteDOC_(buf[i], docptr, DoC_2k_CDSN_IO + i); doc2000_writebuf()
345 void __iomem *docptr = doc->virtadr; doc2000_readbuf() local
352 buf[i] = ReadDOC(docptr, 2k_CDSN_IO + i); doc2000_readbuf()
360 void __iomem *docptr = doc->virtadr; doc2000_readbuf_dword() local
368 *(uint8_t *) (&buf[i]) = ReadDOC(docptr, 2k_CDSN_IO + i); doc2000_readbuf_dword()
372 *(uint32_t *) (&buf[i]) = readl(docptr + DoC_2k_CDSN_IO + i); doc2000_readbuf_dword()
403 void __iomem *docptr = doc->virtadr; doc200x_ident_chip() local
413 ident.dword = readl(docptr + DoC_2k_CDSN_IO); doc200x_ident_chip()
463 void __iomem *docptr = doc->virtadr; doc2001_write_byte() local
465 WriteDOC(datum, docptr, CDSNSlowIO); doc2001_write_byte()
466 WriteDOC(datum, docptr, Mil_CDSN_IO); doc2001_write_byte()
467 WriteDOC(datum, docptr, WritePipeTerm); doc2001_write_byte()
474 void __iomem *docptr = doc->virtadr; doc2001_read_byte() local
476 //ReadDOC(docptr, CDSNSlowIO); doc2001_read_byte()
479 ReadDOC(docptr, ReadPipeInit); doc2001_read_byte()
480 //return ReadDOC(docptr, Mil_CDSN_IO); doc2001_read_byte()
481 return ReadDOC(docptr, LastDataRead); doc2001_read_byte()
488 void __iomem *docptr = doc->virtadr; doc2001_writebuf() local
492 WriteDOC_(buf[i], docptr, DoC_Mil_CDSN_IO + i); doc2001_writebuf()
494 WriteDOC(0x00, docptr, WritePipeTerm); doc2001_writebuf()
501 void __iomem *docptr = doc->virtadr; doc2001_readbuf() local
505 ReadDOC(docptr, ReadPipeInit); doc2001_readbuf()
508 buf[i] = ReadDOC(docptr, Mil_CDSN_IO + (i & 0xff)); doc2001_readbuf()
511 buf[i] = ReadDOC(docptr, LastDataRead); doc2001_readbuf()
518 void __iomem *docptr = doc->virtadr; doc2001plus_read_byte() local
521 ReadDOC(docptr, Mplus_ReadPipeInit); doc2001plus_read_byte()
522 ReadDOC(docptr, Mplus_ReadPipeInit); doc2001plus_read_byte()
523 ret = ReadDOC(docptr, Mplus_LastDataRead); doc2001plus_read_byte()
533 void __iomem *docptr = doc->virtadr; doc2001plus_writebuf() local
539 WriteDOC_(buf[i], docptr, DoC_Mil_CDSN_IO + i); doc2001plus_writebuf()
551 void __iomem *docptr = doc->virtadr; doc2001plus_readbuf() local
558 ReadDOC(docptr, Mplus_ReadPipeInit); doc2001plus_readbuf()
559 ReadDOC(docptr, Mplus_ReadPipeInit); doc2001plus_readbuf()
562 buf[i] = ReadDOC(docptr, Mil_CDSN_IO); doc2001plus_readbuf()
568 buf[len - 2] = ReadDOC(docptr, Mplus_LastDataRead); doc2001plus_readbuf()
571 buf[len - 1] = ReadDOC(docptr, Mplus_LastDataRead); doc2001plus_readbuf()
582 void __iomem *docptr = doc->virtadr; doc2001plus_select_chip() local
590 WriteDOC(0, docptr, Mplus_FlashSelect); doc2001plus_select_chip()
598 WriteDOC((DOC_FLASH_CE), docptr, Mplus_FlashSelect); doc2001plus_select_chip()
609 void __iomem *docptr = doc->virtadr; doc200x_select_chip() local
624 WriteDOC(floor, docptr, FloorSelect); doc200x_select_chip()
625 WriteDOC(chip, docptr, CDSNDeviceSelect); doc200x_select_chip()
640 void __iomem *docptr = doc->virtadr; doc200x_hwcontrol() local
647 WriteDOC(doc->CDSNControl, docptr, CDSNControl); doc200x_hwcontrol()
663 void __iomem *docptr = doc->virtadr; doc2001plus_command() local
670 WriteDOC(0x00, docptr, Mplus_WritePipeTerm); doc2001plus_command()
671 WriteDOC(0x00, docptr, Mplus_WritePipeTerm); doc2001plus_command()
691 WriteDOC(readcmd, docptr, Mplus_FlashCmd); doc2001plus_command()
693 WriteDOC(command, docptr, Mplus_FlashCmd); doc2001plus_command()
694 WriteDOC(0, docptr, Mplus_WritePipeTerm); doc2001plus_command()
695 WriteDOC(0, docptr, Mplus_WritePipeTerm); doc2001plus_command()
704 WriteDOC(column, docptr, Mplus_FlashAddress); doc2001plus_command()
707 WriteDOC((unsigned char)(page_addr & 0xff), docptr, Mplus_FlashAddress); doc2001plus_command()
708 WriteDOC((unsigned char)((page_addr >> 8) & 0xff), docptr, Mplus_FlashAddress); doc2001plus_command()
711 WriteDOC((unsigned char)((page_addr >> 16) & 0x0f), docptr, Mplus_FlashAddress); doc2001plus_command()
715 WriteDOC(0, docptr, Mplus_WritePipeTerm); doc2001plus_command()
716 WriteDOC(0, docptr, Mplus_WritePipeTerm); doc2001plus_command()
720 WriteDOC(0, docptr, Mplus_FlashControl); doc2001plus_command()
740 WriteDOC(NAND_CMD_STATUS, docptr, Mplus_FlashCmd); doc2001plus_command()
741 WriteDOC(0, docptr, Mplus_WritePipeTerm); doc2001plus_command()
742 WriteDOC(0, docptr, Mplus_WritePipeTerm); doc2001plus_command()
769 void __iomem *docptr = doc->virtadr; doc200x_dev_ready() local
774 if ((ReadDOC(docptr, Mplus_FlashControl) & CDSN_CTRL_FR_B_MASK) != CDSN_CTRL_FR_B_MASK) { doc200x_dev_ready()
785 if (!(ReadDOC(docptr, CDSNControl) & CDSN_CTRL_FR_B)) { doc200x_dev_ready()
809 void __iomem *docptr = doc->virtadr; doc200x_enable_hwecc() local
814 WriteDOC(DOC_ECC_RESET, docptr, ECCConf); doc200x_enable_hwecc()
815 WriteDOC(DOC_ECC_EN, docptr, ECCConf); doc200x_enable_hwecc()
818 WriteDOC(DOC_ECC_RESET, docptr, ECCConf); doc200x_enable_hwecc()
819 WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf); doc200x_enable_hwecc()
828 void __iomem *docptr = doc->virtadr; doc2001plus_enable_hwecc() local
833 WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf); doc2001plus_enable_hwecc()
834 WriteDOC(DOC_ECC_EN, docptr, Mplus_ECCConf); doc2001plus_enable_hwecc()
837 WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf); doc2001plus_enable_hwecc()
838 WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, Mplus_ECCConf); doc2001plus_enable_hwecc()
848 void __iomem *docptr = doc->virtadr; doc200x_calculate_ecc() local
854 WriteDOC(doc->CDSNControl & ~CDSN_CTRL_FLASH_IO, docptr, CDSNControl); doc200x_calculate_ecc()
855 WriteDOC(0, docptr, 2k_CDSN_IO); doc200x_calculate_ecc()
856 WriteDOC(0, docptr, 2k_CDSN_IO); doc200x_calculate_ecc()
857 WriteDOC(0, docptr, 2k_CDSN_IO); doc200x_calculate_ecc()
858 WriteDOC(doc->CDSNControl, docptr, CDSNControl); doc200x_calculate_ecc()
860 WriteDOC(0, docptr, Mplus_NOP); doc200x_calculate_ecc()
861 WriteDOC(0, docptr, Mplus_NOP); doc200x_calculate_ecc()
862 WriteDOC(0, docptr, Mplus_NOP); doc200x_calculate_ecc()
864 WriteDOC(0, docptr, NOP); doc200x_calculate_ecc()
865 WriteDOC(0, docptr, NOP); doc200x_calculate_ecc()
866 WriteDOC(0, docptr, NOP); doc200x_calculate_ecc()
871 ecc_code[i] = ReadDOC_(docptr, DoC_Mplus_ECCSyndrome0 + i); doc200x_calculate_ecc()
873 ecc_code[i] = ReadDOC_(docptr, DoC_ECCSyndrome0 + i); doc200x_calculate_ecc()
878 WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf); doc200x_calculate_ecc()
880 WriteDOC(DOC_ECC_DIS, docptr, ECCConf); doc200x_calculate_ecc()
909 void __iomem *docptr = doc->virtadr; doc200x_correct_data() local
916 dummy = ReadDOC(docptr, 2k_ECCStatus); doc200x_correct_data()
917 dummy = ReadDOC(docptr, 2k_ECCStatus); doc200x_correct_data()
918 dummy = ReadDOC(docptr, 2k_ECCStatus); doc200x_correct_data()
920 dummy = ReadDOC(docptr, Mplus_ECCConf); doc200x_correct_data()
921 dummy = ReadDOC(docptr, Mplus_ECCConf); doc200x_correct_data()
922 dummy = ReadDOC(docptr, Mplus_ECCConf); doc200x_correct_data()
924 dummy = ReadDOC(docptr, ECCConf); doc200x_correct_data()
925 dummy = ReadDOC(docptr, ECCConf); doc200x_correct_data()
926 dummy = ReadDOC(docptr, ECCConf); doc200x_correct_data()
933 calc_ecc[i] = ReadDOC_(docptr, DoC_Mplus_ECCSyndrome0 + i); doc200x_correct_data()
935 calc_ecc[i] = ReadDOC_(docptr, DoC_ECCSyndrome0 + i); doc200x_correct_data()
971 WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf); doc200x_correct_data()
973 WriteDOC(DOC_ECC_DIS, docptr, ECCConf); doc200x_correct_data()

Completed in 137 milliseconds