亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? doc2001.c

?? 根據fs2410移植過后的mtd驅動源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
	DoC_WaitReady(docptr);	if (eccbuf) {		/* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/		WriteDOC (DOC_ECC_RESET, docptr, ECCConf);		WriteDOC (DOC_ECC_EN, docptr, ECCConf);	} else {		/* disable the ECC engine */		WriteDOC (DOC_ECC_RESET, docptr, ECCConf);		WriteDOC (DOC_ECC_DIS, docptr, ECCConf);	}	/* Read the data via the internal pipeline through CDSN IO register,	   see Pipelined Read Operations 11.3 */	dummy = ReadDOC(docptr, ReadPipeInit);#ifndef USE_MEMCPY	for (i = 0; i < len-1; i++) {		/* N.B. you have to increase the source address in this way or the		   ECC logic will not work properly */		buf[i] = ReadDOC(docptr, Mil_CDSN_IO + (i & 0xff));	}#else	memcpy_fromio(buf, docptr + DoC_Mil_CDSN_IO, len - 1);#endif	buf[len - 1] = ReadDOC(docptr, LastDataRead);	/* Let the caller know we completed it */	*retlen = len;        ret = 0;	if (eccbuf) {		/* Read the ECC data from Spare Data Area,		   see Reed-Solomon EDC/ECC 11.1 */		dummy = ReadDOC(docptr, ReadPipeInit);#ifndef USE_MEMCPY		for (i = 0; i < 5; i++) {			/* N.B. you have to increase the source address in this way or the			   ECC logic will not work properly */			eccbuf[i] = ReadDOC(docptr, Mil_CDSN_IO + i);		}#else		memcpy_fromio(eccbuf, docptr + DoC_Mil_CDSN_IO, 5);#endif		eccbuf[5] = ReadDOC(docptr, LastDataRead);		/* Flush the pipeline */		dummy = ReadDOC(docptr, ECCConf);		dummy = ReadDOC(docptr, ECCConf);		/* Check the ECC Status */		if (ReadDOC(docptr, ECCConf) & 0x80) {                        int nb_errors;			/* There was an ECC error */#ifdef ECC_DEBUG			printk("DiskOnChip ECC Error: Read at %lx\n", (long)from);#endif			/* Read the ECC syndrom through the DiskOnChip ECC logic.			   These syndrome will be all ZERO when there is no error */			for (i = 0; i < 6; i++) {				syndrome[i] = ReadDOC(docptr, ECCSyndrome0 + i);			}                        nb_errors = doc_decode_ecc(buf, syndrome);#ifdef ECC_DEBUG			printk("ECC Errors corrected: %x\n", nb_errors);#endif                        if (nb_errors < 0) {				/* We return error, but have actually done the read. Not that				   this can be told to user-space, via sys_read(), but at least				   MTD-aware stuff can know about it by checking *retlen */				ret = -EIO;                        }		}#ifdef PSYCHO_DEBUG		printk("ECC DATA at %lx: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",		       (long)from, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],		       eccbuf[4], eccbuf[5]);#endif		/* disable the ECC engine */		WriteDOC(DOC_ECC_DIS, docptr , ECCConf);	}	return ret;}static int doc_write (struct mtd_info *mtd, loff_t to, size_t len,		      size_t *retlen, const u_char *buf){	char eccbuf[6];	return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, NULL);}static int doc_write_ecc (struct mtd_info *mtd, loff_t to, size_t len,			  size_t *retlen, const u_char *buf, u_char *eccbuf,			 struct nand_oobinfo *oobsel){	int i,ret = 0;	volatile char dummy;	struct DiskOnChip *this = mtd->priv;	void __iomem *docptr = this->virtadr;	struct Nand *mychip = &this->chips[to >> (this->chipshift)];	/* Don't allow write past end of device */	if (to >= this->totlen)		return -EINVAL;#if 0	/* Don't allow a single write to cross a 512-byte block boundary */	if (to + len > ( (to | 0x1ff) + 1))		len = ((to | 0x1ff) + 1) - to;#else	/* Don't allow writes which aren't exactly one block */	if (to & 0x1ff || len != 0x200)		return -EINVAL;#endif	/* Find the chip which is to be used and select it */	if (this->curfloor != mychip->floor) {		DoC_SelectFloor(docptr, mychip->floor);		DoC_SelectChip(docptr, mychip->chip);	} else if (this->curchip != mychip->chip) {		DoC_SelectChip(docptr, mychip->chip);	}	this->curfloor = mychip->floor;	this->curchip = mychip->chip;	/* Reset the chip, see Software Requirement 11.4 item 1. */	DoC_Command(docptr, NAND_CMD_RESET, 0x00);	DoC_WaitReady(docptr);	/* Set device to main plane of flash */	DoC_Command(docptr, NAND_CMD_READ0, 0x00);	/* issue the Serial Data In command to initial the Page Program process */	DoC_Command(docptr, NAND_CMD_SEQIN, 0x00);	DoC_Address(docptr, 3, to, 0x00, 0x00);	DoC_WaitReady(docptr);	if (eccbuf) {		/* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/		WriteDOC (DOC_ECC_RESET, docptr, ECCConf);		WriteDOC (DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf);	} else {		/* disable the ECC engine */		WriteDOC (DOC_ECC_RESET, docptr, ECCConf);		WriteDOC (DOC_ECC_DIS, docptr, ECCConf);	}	/* Write the data via the internal pipeline through CDSN IO register,	   see Pipelined Write Operations 11.2 */#ifndef USE_MEMCPY	for (i = 0; i < len; i++) {		/* N.B. you have to increase the source address in this way or the		   ECC logic will not work properly */		WriteDOC(buf[i], docptr, Mil_CDSN_IO + i);	}#else	memcpy_toio(docptr + DoC_Mil_CDSN_IO, buf, len);#endif	WriteDOC(0x00, docptr, WritePipeTerm);	if (eccbuf) {		/* Write ECC data to flash, the ECC info is generated by the DiskOnChip ECC logic		   see Reed-Solomon EDC/ECC 11.1 */		WriteDOC(0, docptr, NOP);		WriteDOC(0, docptr, NOP);		WriteDOC(0, docptr, NOP);		/* Read the ECC data through the DiskOnChip ECC logic */		for (i = 0; i < 6; i++) {			eccbuf[i] = ReadDOC(docptr, ECCSyndrome0 + i);		}		/* ignore the ECC engine */		WriteDOC(DOC_ECC_DIS, docptr , ECCConf);#ifndef USE_MEMCPY		/* Write the ECC data to flash */		for (i = 0; i < 6; i++) {			/* N.B. you have to increase the source address in this way or the			   ECC logic will not work properly */			WriteDOC(eccbuf[i], docptr, Mil_CDSN_IO + i);		}#else		memcpy_toio(docptr + DoC_Mil_CDSN_IO, eccbuf, 6);#endif		/* write the block status BLOCK_USED (0x5555) at the end of ECC data		   FIXME: this is only a hack for programming the IPL area for LinuxBIOS		   and should be replace with proper codes in user space utilities */		WriteDOC(0x55, docptr, Mil_CDSN_IO);		WriteDOC(0x55, docptr, Mil_CDSN_IO + 1);		WriteDOC(0x00, docptr, WritePipeTerm);#ifdef PSYCHO_DEBUG		printk("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",		       (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],		       eccbuf[4], eccbuf[5]);#endif	}	/* Commit the Page Program command and wait for ready	   see Software Requirement 11.4 item 1.*/	DoC_Command(docptr, NAND_CMD_PAGEPROG, 0x00);	DoC_WaitReady(docptr);	/* Read the status of the flash device through CDSN IO register	   see Software Requirement 11.4 item 5.*/	DoC_Command(docptr, NAND_CMD_STATUS, CDSN_CTRL_WP);	dummy = ReadDOC(docptr, ReadPipeInit);	DoC_Delay(docptr, 2);	if (ReadDOC(docptr, Mil_CDSN_IO) & 1) {		printk("Error programming flash\n");		/* Error in programming		   FIXME: implement Bad Block Replacement (in nftl.c ??) */		*retlen = 0;		ret = -EIO;	}	dummy = ReadDOC(docptr, LastDataRead);	/* Let the caller know we completed it */	*retlen = len;	return ret;}static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,			size_t *retlen, u_char *buf){#ifndef USE_MEMCPY	int i;#endif	volatile char dummy;	struct DiskOnChip *this = mtd->priv;	void __iomem *docptr = this->virtadr;	struct Nand *mychip = &this->chips[ofs >> this->chipshift];	/* Find the chip which is to be used and select it */	if (this->curfloor != mychip->floor) {		DoC_SelectFloor(docptr, mychip->floor);		DoC_SelectChip(docptr, mychip->chip);	} else if (this->curchip != mychip->chip) {		DoC_SelectChip(docptr, mychip->chip);	}	this->curfloor = mychip->floor;	this->curchip = mychip->chip;	/* disable the ECC engine */	WriteDOC (DOC_ECC_RESET, docptr, ECCConf);	WriteDOC (DOC_ECC_DIS, docptr, ECCConf);	/* issue the Read2 command to set the pointer to the Spare Data Area.	   Polling the Flash Ready bit after issue 3 bytes address in	   Sequence Read Mode, see Software Requirement 11.4 item 1.*/	DoC_Command(docptr, NAND_CMD_READOOB, CDSN_CTRL_WP);	DoC_Address(docptr, 3, ofs, CDSN_CTRL_WP, 0x00);	DoC_WaitReady(docptr);	/* Read the data out via the internal pipeline through CDSN IO register,	   see Pipelined Read Operations 11.3 */	dummy = ReadDOC(docptr, ReadPipeInit);#ifndef USE_MEMCPY	for (i = 0; i < len-1; i++) {		/* N.B. you have to increase the source address in this way or the		   ECC logic will not work properly */		buf[i] = ReadDOC(docptr, Mil_CDSN_IO + i);	}#else	memcpy_fromio(buf, docptr + DoC_Mil_CDSN_IO, len - 1);#endif	buf[len - 1] = ReadDOC(docptr, LastDataRead);	*retlen = len;	return 0;}static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,			 size_t *retlen, const u_char *buf){#ifndef USE_MEMCPY	int i;#endif	volatile char dummy;	int ret = 0;	struct DiskOnChip *this = mtd->priv;	void __iomem *docptr = this->virtadr;	struct Nand *mychip = &this->chips[ofs >> this->chipshift];	/* Find the chip which is to be used and select it */	if (this->curfloor != mychip->floor) {		DoC_SelectFloor(docptr, mychip->floor);		DoC_SelectChip(docptr, mychip->chip);	} else if (this->curchip != mychip->chip) {		DoC_SelectChip(docptr, mychip->chip);	}	this->curfloor = mychip->floor;	this->curchip = mychip->chip;	/* disable the ECC engine */	WriteDOC (DOC_ECC_RESET, docptr, ECCConf);	WriteDOC (DOC_ECC_DIS, docptr, ECCConf);	/* Reset the chip, see Software Requirement 11.4 item 1. */	DoC_Command(docptr, NAND_CMD_RESET, CDSN_CTRL_WP);	DoC_WaitReady(docptr);	/* issue the Read2 command to set the pointer to the Spare Data Area. */	DoC_Command(docptr, NAND_CMD_READOOB, CDSN_CTRL_WP);	/* issue the Serial Data In command to initial the Page Program process */	DoC_Command(docptr, NAND_CMD_SEQIN, 0x00);	DoC_Address(docptr, 3, ofs, 0x00, 0x00);	/* Write the data via the internal pipeline through CDSN IO register,	   see Pipelined Write Operations 11.2 */#ifndef USE_MEMCPY	for (i = 0; i < len; i++) {		/* N.B. you have to increase the source address in this way or the		   ECC logic will not work properly */		WriteDOC(buf[i], docptr, Mil_CDSN_IO + i);	}#else	memcpy_toio(docptr + DoC_Mil_CDSN_IO, buf, len);#endif	WriteDOC(0x00, docptr, WritePipeTerm);	/* Commit the Page Program command and wait for ready	   see Software Requirement 11.4 item 1.*/	DoC_Command(docptr, NAND_CMD_PAGEPROG, 0x00);	DoC_WaitReady(docptr);	/* Read the status of the flash device through CDSN IO register	   see Software Requirement 11.4 item 5.*/	DoC_Command(docptr, NAND_CMD_STATUS, 0x00);	dummy = ReadDOC(docptr, ReadPipeInit);	DoC_Delay(docptr, 2);	if (ReadDOC(docptr, Mil_CDSN_IO) & 1) {		printk("Error programming oob data\n");		/* FIXME: implement Bad Block Replacement (in nftl.c ??) */		*retlen = 0;		ret = -EIO;	}	dummy = ReadDOC(docptr, LastDataRead);	*retlen = len;	return ret;}int doc_erase (struct mtd_info *mtd, struct erase_info *instr){	volatile char dummy;	struct DiskOnChip *this = mtd->priv;	__u32 ofs = instr->addr;	__u32 len = instr->len;	void __iomem *docptr = this->virtadr;	struct Nand *mychip = &this->chips[ofs >> this->chipshift];	if (len != mtd->erasesize)		printk(KERN_WARNING "Erase not right size (%x != %x)n",		       len, mtd->erasesize);	/* Find the chip which is to be used and select it */	if (this->curfloor != mychip->floor) {		DoC_SelectFloor(docptr, mychip->floor);		DoC_SelectChip(docptr, mychip->chip);	} else if (this->curchip != mychip->chip) {		DoC_SelectChip(docptr, mychip->chip);	}	this->curfloor = mychip->floor;	this->curchip = mychip->chip;	instr->state = MTD_ERASE_PENDING;	/* issue the Erase Setup command */	DoC_Command(docptr, NAND_CMD_ERASE1, 0x00);	DoC_Address(docptr, 2, ofs, 0x00, 0x00);	/* Commit the Erase Start command and wait for ready	   see Software Requirement 11.4 item 1.*/	DoC_Command(docptr, NAND_CMD_ERASE2, 0x00);	DoC_WaitReady(docptr);	instr->state = MTD_ERASING;	/* Read the status of the flash device through CDSN IO register	   see Software Requirement 11.4 item 5.	   FIXME: it seems that we are not wait long enough, some blocks are not	   erased fully */	DoC_Command(docptr, NAND_CMD_STATUS, CDSN_CTRL_WP);	dummy = ReadDOC(docptr, ReadPipeInit);	DoC_Delay(docptr, 2);	if (ReadDOC(docptr, Mil_CDSN_IO) & 1) {		printk("Error Erasing at 0x%x\n", ofs);		/* There was an error		   FIXME: implement Bad Block Replacement (in nftl.c ??) */		instr->state = MTD_ERASE_FAILED;	} else		instr->state = MTD_ERASE_DONE;	dummy = ReadDOC(docptr, LastDataRead);	mtd_erase_callback(instr);	return 0;}/**************************************************************************** * * Module stuff * ****************************************************************************/static int __init init_doc2001(void){	inter_module_register(im_name, THIS_MODULE, &DoCMil_init);	return 0;}static void __exit cleanup_doc2001(void){	struct mtd_info *mtd;	struct DiskOnChip *this;	while ((mtd=docmillist)) {		this = mtd->priv;		docmillist = this->nextdoc;		del_mtd_device(mtd);		iounmap(this->virtadr);		kfree(this->chips);		kfree(mtd);	}	inter_module_unregister(im_name);}module_exit(cleanup_doc2001);module_init(init_doc2001);MODULE_LICENSE("GPL");MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org> et al.");MODULE_DESCRIPTION("Alternative driver for DiskOnChip Millennium");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级视频在线| 精品欧美一区二区久久| 国产一区二区不卡| 懂色av中文字幕一区二区三区 | 免费在线观看一区二区三区| 亚洲成国产人片在线观看| 日韩激情一二三区| 久久99国产乱子伦精品免费| 国模娜娜一区二区三区| 成人黄色软件下载| 欧美日韩国产123区| 日韩欧美一级特黄在线播放| 久久久一区二区三区| 18涩涩午夜精品.www| 五月激情综合婷婷| 国产风韵犹存在线视精品| 日本道色综合久久| 2020国产精品自拍| 亚洲成av人在线观看| 国产69精品久久久久777| 欧美综合在线视频| 久久久国产一区二区三区四区小说| 亚洲丝袜精品丝袜在线| 毛片基地黄久久久久久天堂| 色狠狠一区二区三区香蕉| 欧美v亚洲v综合ⅴ国产v| 亚洲乱码国产乱码精品精可以看| 久久99九九99精品| 欧美欧美欧美欧美| 成人免费一区二区三区视频| 国产精品一区二区在线观看不卡| 在线观看不卡一区| 亚洲色图都市小说| zzijzzij亚洲日本少妇熟睡| 日韩欧美第一区| 日本va欧美va瓶| 欧美视频日韩视频| 一级精品视频在线观看宜春院 | 一区二区三区中文字幕| 国产一区二区不卡在线| 在线播放91灌醉迷j高跟美女| 一区在线观看视频| av成人动漫在线观看| 中文字幕高清不卡| www.欧美.com| 中文字幕一区二区日韩精品绯色| 国产成人av电影在线播放| 久久亚洲一区二区三区明星换脸| 激情久久五月天| 久久久久久久久久久久久久久99 | 日韩精品一区二区三区视频| 日韩av电影天堂| 欧美成人三级电影在线| 日本不卡一区二区| 日韩欧美一区在线| 国产一区不卡精品| 国产精品夫妻自拍| 欧美三日本三级三级在线播放| 亚洲二区视频在线| 久久久久久久久蜜桃| 极品少妇一区二区| 欧美亚洲另类激情小说| 亚洲少妇最新在线视频| 色欧美乱欧美15图片| 日本免费新一区视频| 久久青草欧美一区二区三区| 成人理论电影网| 亚洲国产精品影院| xfplay精品久久| 欧美日韩一区二区三区四区| 久久电影国产免费久久电影 | 91精品婷婷国产综合久久| 激情综合色综合久久| 亚洲啪啪综合av一区二区三区| 色综合天天天天做夜夜夜夜做| 日韩av不卡一区二区| 国产欧美精品国产国产专区 | 亚洲日本在线a| 91精品视频网| 在线观看www91| 成人性色生活片| 国产主播一区二区| 亚洲成人综合视频| 亚洲婷婷综合色高清在线| 精品黑人一区二区三区久久| 精品视频一区二区三区免费| 丁香天五香天堂综合| 美女视频黄免费的久久| 一区二区三区在线视频免费观看| 久久久久久夜精品精品免费| 91麻豆精品国产自产在线观看一区| 日本大香伊一区二区三区| 国产99精品国产| 国产一区欧美一区| 国产精品一区二区男女羞羞无遮挡| 天天操天天色综合| 亚洲一区二区成人在线观看| 国产精品每日更新在线播放网址| 欧美精品一区二区三区一线天视频| 在线电影一区二区三区| 欧美电影影音先锋| 日韩欧美国产电影| 久久精品亚洲一区二区三区浴池| 日韩欧美一区二区视频| 精品对白一区国产伦| 国产三级久久久| 国产精品国产三级国产普通话三级 | 精品国产一区二区在线观看| 欧美精品亚洲一区二区在线播放| 不卡一区二区三区四区| 成人性生交大片免费看在线播放 | 一本在线高清不卡dvd| 播五月开心婷婷综合| 成人激情小说乱人伦| 久久不见久久见免费视频7| 天堂资源在线中文精品| 亚洲成a人v欧美综合天堂下载| 亚洲第一激情av| 免费国产亚洲视频| 亚洲图片欧美色图| 五月婷婷综合激情| 日韩电影免费在线看| 亚洲高清在线视频| 日韩国产欧美三级| 日韩成人免费电影| 国产一区二区福利视频| 91麻豆精品视频| 欧美亚洲高清一区| 日韩精品一区国产麻豆| 国产清纯白嫩初高生在线观看91 | 精品国产sm最大网站免费看| 色偷偷久久一区二区三区| 国产成人av一区二区三区在线| 国产成人av一区二区三区在线观看| 91在线免费看| 在线观看亚洲专区| 日韩三级.com| 亚洲精品亚洲人成人网| 麻豆成人av在线| 色综合久久久久久久久| 色999日韩国产欧美一区二区| 宅男在线国产精品| 亚洲免费电影在线| 日产国产欧美视频一区精品| 国产精品资源在线| 欧美一区二区在线不卡| 欧美国产日韩亚洲一区| 免费成人你懂的| 日本高清不卡在线观看| 中文一区二区在线观看| 日本欧美肥老太交大片| 高清不卡在线观看av| 欧美日韩黄视频| 国产亚洲精品资源在线26u| 亚洲成a人v欧美综合天堂| 一本色道久久综合狠狠躁的推荐| 日韩精品专区在线影院重磅| 亚洲男人的天堂一区二区| 成人av电影在线| 国产欧美综合色| 日本强好片久久久久久aaa| 日本久久精品电影| 中文字幕成人网| 国产成人免费在线视频| 国产亚洲成aⅴ人片在线观看| 老司机午夜精品| 日韩欧美激情在线| 男男视频亚洲欧美| 日韩午夜激情av| 美腿丝袜亚洲色图| 91麻豆精品国产综合久久久久久| 亚洲福利视频一区二区| av中文字幕一区| 制服丝袜亚洲色图| 国产欧美一区二区精品婷婷| 国产真实精品久久二三区| **性色生活片久久毛片| 欧美日韩国产另类不卡| 精品亚洲国内自在自线福利| 国产成人亚洲精品狼色在线| 成人av网站免费| 欧美一区二区三区免费视频| 日韩欧美不卡一区| 国产精品乱码一区二区三区软件 | 久久爱www久久做| 国产精品99久久久久| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 无吗不卡中文字幕| 国产成人av影院| 一本到一区二区三区| 久久综合av免费| 亚洲第一搞黄网站| 91网站黄www| 精品奇米国产一区二区三区| 一区二区在线电影| 国产精品1024| 欧美精品一区二区久久婷婷 | 免费成人在线观看视频| 色婷婷久久久亚洲一区二区三区 | 亚洲视频在线观看三级|