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

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

?? doc2001plus.c

?? 飛思卡爾芯片imx27下的MTD模塊的驅動源碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
	for (floor = 0,ret = 1; floor < MAX_FLOORS_MPLUS; floor++) {		numchips[floor] = 0;		for (chip = 0; chip < MAX_CHIPS_MPLUS && ret != 0; chip++) {			ret = DoC_IdentChip(this, floor, chip);			if (ret) {				numchips[floor]++;				this->numchips++;			}		}	}	/* If there are none at all that we recognise, bail */	if (!this->numchips) {		printk("No flash chips recognised.\n");		return;	}	/* Allocate an array to hold the information for each chip */	this->chips = kmalloc(sizeof(struct Nand) * this->numchips, GFP_KERNEL);	if (!this->chips){		printk("MTD: No memory for allocating chip info structures\n");		return;	}	/* Fill out the chip array with {floor, chipno} for each	 * detected chip in the device. */	for (floor = 0, ret = 0; floor < MAX_FLOORS_MPLUS; floor++) {		for (chip = 0 ; chip < numchips[floor] ; chip++) {			this->chips[ret].floor = floor;			this->chips[ret].chip = chip;			this->chips[ret].curadr = 0;			this->chips[ret].curmode = 0x50;			ret++;		}	}	/* Calculate and print the total size of the device */	this->totlen = this->numchips * (1 << this->chipshift);	printk(KERN_INFO "%d flash chips found. Total DiskOnChip size: %ld MiB\n",	       this->numchips ,this->totlen >> 20);}static int DoCMilPlus_is_alias(struct DiskOnChip *doc1, struct DiskOnChip *doc2){	int tmp1, tmp2, retval;	if (doc1->physadr == doc2->physadr)		return 1;	/* Use the alias resolution register which was set aside for this	 * purpose. If it's value is the same on both chips, they might	 * be the same chip, and we write to one and check for a change in	 * the other. It's unclear if this register is usuable in the	 * DoC 2000 (it's in the Millennium docs), but it seems to work. */	tmp1 = ReadDOC(doc1->virtadr, Mplus_AliasResolution);	tmp2 = ReadDOC(doc2->virtadr, Mplus_AliasResolution);	if (tmp1 != tmp2)		return 0;	WriteDOC((tmp1+1) % 0xff, doc1->virtadr, Mplus_AliasResolution);	tmp2 = ReadDOC(doc2->virtadr, Mplus_AliasResolution);	if (tmp2 == (tmp1+1) % 0xff)		retval = 1;	else		retval = 0;	/* Restore register contents.  May not be necessary, but do it just to	 * be safe. */	WriteDOC(tmp1, doc1->virtadr, Mplus_AliasResolution);	return retval;}/* This routine is found from the docprobe code by symbol_get(), * which will bump the use count of this module. */void DoCMilPlus_init(struct mtd_info *mtd){	struct DiskOnChip *this = mtd->priv;	struct DiskOnChip *old = NULL;	/* We must avoid being called twice for the same device. */	if (docmilpluslist)		old = docmilpluslist->priv;	while (old) {		if (DoCMilPlus_is_alias(this, old)) {			printk(KERN_NOTICE "Ignoring DiskOnChip Millennium "				"Plus at 0x%lX - already configured\n",				this->physadr);			iounmap(this->virtadr);			kfree(mtd);			return;		}		if (old->nextdoc)			old = old->nextdoc->priv;		else			old = NULL;	}	mtd->name = "DiskOnChip Millennium Plus";	printk(KERN_NOTICE "DiskOnChip Millennium Plus found at "		"address 0x%lX\n", this->physadr);	mtd->type = MTD_NANDFLASH;	mtd->flags = MTD_CAP_NANDFLASH;	mtd->ecctype = MTD_ECC_RS_DiskOnChip;	mtd->size = 0;	mtd->erasesize = 0;	mtd->writesize = 512;	mtd->oobsize = 16;	mtd->owner = THIS_MODULE;	mtd->erase = doc_erase;	mtd->point = NULL;	mtd->unpoint = NULL;	mtd->read = doc_read;	mtd->write = doc_write;	mtd->read_oob = doc_read_oob;	mtd->write_oob = doc_write_oob;	mtd->sync = NULL;	this->totlen = 0;	this->numchips = 0;	this->curfloor = -1;	this->curchip = -1;	/* Ident all the chips present. */	DoC_ScanChips(this);	if (!this->totlen) {		kfree(mtd);		iounmap(this->virtadr);	} else {		this->nextdoc = docmilpluslist;		docmilpluslist = mtd;		mtd->size  = this->totlen;		mtd->erasesize = this->erasesize;		add_mtd_device(mtd);		return;	}}EXPORT_SYMBOL_GPL(DoCMilPlus_init);#if 0static int doc_dumpblk(struct mtd_info *mtd, loff_t from){	int i;	loff_t fofs;	struct DiskOnChip *this = mtd->priv;	void __iomem * docptr = this->virtadr;	struct Nand *mychip = &this->chips[from >> (this->chipshift)];	unsigned char *bp, buf[1056];	char c[32];	from &= ~0x3ff;	/* Don't allow read past end of device */	if (from >= this->totlen)		return -EINVAL;	DoC_CheckASIC(docptr);	/* 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;	/* Millennium Plus bus cycle sequence as per figure 2, section 2.4 */	WriteDOC((DOC_FLASH_CE | DOC_FLASH_WP), docptr, Mplus_FlashSelect);	/* Reset the chip, see Software Requirement 11.4 item 1. */	DoC_Command(docptr, NAND_CMD_RESET, 0);	DoC_WaitReady(docptr);	fofs = from;	DoC_Command(docptr, DoC_GetDataOffset(mtd, &fofs), 0);	DoC_Address(this, 3, fofs, 0, 0x00);	WriteDOC(0, docptr, Mplus_FlashControl);	DoC_WaitReady(docptr);	/* disable the ECC engine */	WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf);	ReadDOC(docptr, Mplus_ReadPipeInit);	ReadDOC(docptr, Mplus_ReadPipeInit);	/* Read the data via the internal pipeline through CDSN IO	   register, see Pipelined Read Operations 11.3 */	MemReadDOC(docptr, buf, 1054);	buf[1054] = ReadDOC(docptr, Mplus_LastDataRead);	buf[1055] = ReadDOC(docptr, Mplus_LastDataRead);	memset(&c[0], 0, sizeof(c));	printk("DUMP OFFSET=%x:\n", (int)from);        for (i = 0, bp = &buf[0]; (i < 1056); i++) {                if ((i % 16) == 0)                        printk("%08x: ", i);                printk(" %02x", *bp);                c[(i & 0xf)] = ((*bp >= 0x20) && (*bp <= 0x7f)) ? *bp : '.';                bp++;                if (((i + 1) % 16) == 0)                        printk("    %s\n", c);        }	printk("\n");	/* Disable flash internally */	WriteDOC(0, docptr, Mplus_FlashSelect);	return 0;}#endifstatic int doc_read(struct mtd_info *mtd, loff_t from, size_t len,		    size_t *retlen, u_char *buf){	int ret, i;	volatile char dummy;	loff_t fofs;	unsigned char syndrome[6], eccbuf[6];	struct DiskOnChip *this = mtd->priv;	void __iomem * docptr = this->virtadr;	struct Nand *mychip = &this->chips[from >> (this->chipshift)];	/* Don't allow read past end of device */	if (from >= this->totlen)		return -EINVAL;	/* Don't allow a single read to cross a 512-byte block boundary */	if (from + len > ((from | 0x1ff) + 1))		len = ((from | 0x1ff) + 1) - from;	DoC_CheckASIC(docptr);	/* 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;	/* Millennium Plus bus cycle sequence as per figure 2, section 2.4 */	WriteDOC((DOC_FLASH_CE | DOC_FLASH_WP), docptr, Mplus_FlashSelect);	/* Reset the chip, see Software Requirement 11.4 item 1. */	DoC_Command(docptr, NAND_CMD_RESET, 0);	DoC_WaitReady(docptr);	fofs = from;	DoC_Command(docptr, DoC_GetDataOffset(mtd, &fofs), 0);	DoC_Address(this, 3, fofs, 0, 0x00);	WriteDOC(0, docptr, Mplus_FlashControl);	DoC_WaitReady(docptr);	/* init the ECC engine, see Reed-Solomon EDC/ECC 11.1 .*/	WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf);	WriteDOC(DOC_ECC_EN, docptr, Mplus_ECCConf);	/* Let the caller know we completed it */	*retlen = len;	ret = 0;	ReadDOC(docptr, Mplus_ReadPipeInit);	ReadDOC(docptr, Mplus_ReadPipeInit);	/* Read the data via the internal pipeline through CDSN IO	   register, see Pipelined Read Operations 11.3 */	MemReadDOC(docptr, buf, len);	/* Read the ECC data following raw data */	MemReadDOC(docptr, eccbuf, 4);	eccbuf[4] = ReadDOC(docptr, Mplus_LastDataRead);	eccbuf[5] = ReadDOC(docptr, Mplus_LastDataRead);	/* Flush the pipeline */	dummy = ReadDOC(docptr, Mplus_ECCConf);	dummy = ReadDOC(docptr, Mplus_ECCConf);	/* Check the ECC Status */	if (ReadDOC(docptr, Mplus_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, Mplus_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 */#ifdef ECC_DEBUG			printk("%s(%d): Millennium Plus ECC error (from=0x%x:\n",				__FILE__, __LINE__, (int)from);			printk("        syndrome= %02x:%02x:%02x:%02x:%02x:"				"%02x\n",				syndrome[0], syndrome[1], syndrome[2],				syndrome[3], syndrome[4], syndrome[5]);			printk("          eccbuf= %02x:%02x:%02x:%02x:%02x:"				"%02x\n",				eccbuf[0], eccbuf[1], eccbuf[2],				eccbuf[3], eccbuf[4], eccbuf[5]);#endif				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 , Mplus_ECCConf);	/* Disable flash internally */	WriteDOC(0, docptr, Mplus_FlashSelect);	return ret;}static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,		     size_t *retlen, const u_char *buf){	int i, before, ret = 0;	loff_t fto;	volatile char dummy;	char eccbuf[6];	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;	/* Don't allow writes which aren't exactly one block (512 bytes) */	if ((to & 0x1ff) || (len != 0x200))		return -EINVAL;	/* Determine position of OOB flags, before or after data */	before = (this->interleave && (to & 0x200));	DoC_CheckASIC(docptr);	/* 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;	/* Millennium Plus bus cycle sequence as per figure 2, section 2.4 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91丨九色丨蝌蚪富婆spa| 国产精品久久久爽爽爽麻豆色哟哟 | 日本欧美一区二区三区| 欧美日韩国产综合草草| 亚洲最新视频在线观看| 91色综合久久久久婷婷| 精品中文字幕一区二区| 久久久久久夜精品精品免费| 国产成人啪午夜精品网站男同| 56国语精品自产拍在线观看| 亚洲成a人片在线观看中文| 欧美一级二级在线观看| 国产伦精品一区二区三区免费迷| 亚洲国产精品精华液2区45| 高清av一区二区| 一区二区三区国产| 日韩午夜精品电影| 成人av网在线| 男人操女人的视频在线观看欧美| 久久免费看少妇高潮| 成人av资源网站| 日本不卡高清视频| 亚洲同性gay激情无套| 欧美精品在线一区二区三区| 国产.欧美.日韩| 五月激情综合色| 中文字幕精品—区二区四季| 在线观看91精品国产麻豆| 国产成人免费视频网站| 首页国产丝袜综合| 国产精品美女久久久久久久久| 91精品久久久久久久99蜜桃| 成人亚洲一区二区一| 蜜桃在线一区二区三区| 亚洲一区在线观看视频| 日本一区二区三级电影在线观看| 欧美精品一级二级| www亚洲一区| 国产精品久久久久影视| 欧美日韩国产首页在线观看| 伊人婷婷欧美激情| 中文字幕乱码亚洲精品一区| 亚洲日本在线看| 奇米在线7777在线精品| 精品一区二区三区欧美| 91老师片黄在线观看| 国产成人精品免费看| 久久精品国产一区二区| 亚洲大片免费看| 尤物av一区二区| 欧美成人在线直播| 欧美日韩精品系列| 色婷婷av一区二区| 播五月开心婷婷综合| 久久国产精品色婷婷| 偷拍一区二区三区| 亚洲午夜免费电影| 午夜视频一区在线观看| 亚洲国产精品久久久男人的天堂 | 久久久精品免费免费| 2020国产成人综合网| 亚洲免费观看在线观看| 国产婷婷一区二区| 一区二区三区四区蜜桃 | 国产成人av电影在线观看| 丁香桃色午夜亚洲一区二区三区| 99re成人精品视频| 欧美精品一区二区高清在线观看| 国产日韩欧美综合一区| 一区二区三区国产精华| 国产一区在线观看视频| 在线一区二区观看| 国产精品卡一卡二| 奇米综合一区二区三区精品视频| 99久久久久免费精品国产| 欧美二区乱c少妇| 亚洲在线视频一区| 国产99久久久国产精品免费看 | 337p粉嫩大胆色噜噜噜噜亚洲| 最新欧美精品一区二区三区| 日韩电影在线观看电影| 成人av在线一区二区三区| 欧美电影免费观看高清完整版在线观看| 国产精品大尺度| 91麻豆高清视频| 91精品一区二区三区在线观看| 欧美私人免费视频| 日本伊人午夜精品| 亚洲国产精品精华液ab| 欧美日韩电影在线| 国产麻豆欧美日韩一区| 一区二区三区在线不卡| 欧美日韩一区小说| 婷婷成人激情在线网| 欧美色老头old∨ideo| 天天色 色综合| 69堂亚洲精品首页| 奇米一区二区三区| 精品99999| 91麻豆自制传媒国产之光| 亚洲午夜久久久久久久久电影院| 欧美在线一二三| 日本三级亚洲精品| 国产亚洲欧美激情| 91久久精品网| 日韩av一二三| 国产精品视频一区二区三区不卡| 国产激情视频一区二区在线观看| 亚洲啪啪综合av一区二区三区| 欧美性欧美巨大黑白大战| 久久电影网站中文字幕| 国产精品欧美综合在线| 欧美日韩精品一区二区三区| 久久精品久久99精品久久| 日韩理论电影院| 久久久电影一区二区三区| 91精品国产91热久久久做人人| 欧美96一区二区免费视频| 国产欧美一区二区精品性色| 欧美在线免费视屏| 国产成人三级在线观看| 日韩福利视频网| 一区二区三区在线影院| 久久综合九色综合欧美98 | 欧美日韩成人一区| 成人性生交大片免费看视频在线 | 久久精品国产秦先生| 日韩美女视频一区二区 | 久久久久亚洲蜜桃| 欧美精品乱码久久久久久按摩 | 成人黄页在线观看| 久久超碰97人人做人人爱| 亚洲图片自拍偷拍| 亚洲女性喷水在线观看一区| 国产欧美日韩亚州综合| 日韩午夜中文字幕| 欧美老肥妇做.爰bbww| 91久久线看在观草草青青| 91在线观看成人| 色婷婷国产精品综合在线观看| av电影天堂一区二区在线| 99v久久综合狠狠综合久久| 日本精品一区二区三区四区的功能| 色综合一区二区| 91精品国产一区二区三区| 精品动漫一区二区三区在线观看| 欧美国产日产图区| 午夜激情一区二区| 国产98色在线|日韩| 欧美日韩性生活| 国产视频一区不卡| 亚洲无线码一区二区三区| 免费视频一区二区| 国产一区二区主播在线| 国产麻豆视频一区| 色综合久久天天| 欧美日韩久久久久久| 欧美日韩另类一区| 精品毛片乱码1区2区3区| 精品久久一二三区| 国产精品视频线看| 亚洲欧美日韩一区二区 | 日韩毛片视频在线看| 亚洲电影一级片| 成人动漫视频在线| 日韩精品一区国产麻豆| 一区精品在线播放| 精品亚洲国内自在自线福利| 色成年激情久久综合| 久久美女艺术照精彩视频福利播放| 亚洲欧美日韩国产成人精品影院| 日本最新不卡在线| 99精品国产99久久久久久白柏| 欧美丰满嫩嫩电影| 亚洲欧美视频在线观看视频| 国模冰冰炮一区二区| 欧美色爱综合网| 亚洲天堂久久久久久久| 国产激情精品久久久第一区二区| 欧美一区二区三区免费| 亚洲主播在线播放| 欧美综合天天夜夜久久| 国产精品毛片久久久久久久| 蜜臀av性久久久久蜜臀aⅴ四虎| 91麻豆精东视频| 欧美大黄免费观看| 亚洲成人久久影院| 欧美午夜宅男影院| 一区二区三区四区高清精品免费观看| 美国毛片一区二区三区| 欧美日韩综合在线| 亚洲福利视频三区| 91久久精品日日躁夜夜躁欧美| 国产精品毛片高清在线完整版| 国产精品亚洲视频| 国产精品午夜久久| 精品系列免费在线观看| 26uuuu精品一区二区| 国产剧情在线观看一区二区 | 成人综合激情网|