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

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

?? doc2000.c

?? nandflash k9g808u0a在pxa270的驅動,由于pxa270沒有nandflash接口
?? C
?? 第 1 頁 / 共 3 頁
字號:
	this->mfr = 0;	this->id = 0;	/* For each floor, find the number of valid chips it contains */	for (floor = 0; floor < MAX_FLOORS; floor++) {		ret = 1;		numchips[floor] = 0;		for (chip = 0; chip < maxchips && 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(KERN_NOTICE "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(KERN_NOTICE "No memory for allocating chip info structures\n");		return;	}	ret = 0;	/* Fill out the chip array with {floor, chipno} for each 	 * detected chip in the device. */	for (floor = 0; floor < MAX_FLOORS; 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 DoC2k_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, AliasResolution);	tmp2 = ReadDOC(doc2->virtadr, AliasResolution);	if (tmp1 != tmp2)		return 0;	WriteDOC((tmp1 + 1) % 0xff, doc1->virtadr, AliasResolution);	tmp2 = ReadDOC(doc2->virtadr, 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, AliasResolution);	return retval;}static const char im_name[] = "DoC2k_init";/* This routine is made available to other mtd code via * inter_module_register.  It must only be accessed through * inter_module_get which will bump the use count of this module.  The * addresses passed back in mtd are valid as long as the use count of * this module is non-zero, i.e. between inter_module_get and * inter_module_put.  Keith Owens <kaos@ocs.com.au> 29 Oct 2000. */static void DoC2k_init(struct mtd_info *mtd){	struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;	struct DiskOnChip *old = NULL;	int maxchips;	/* We must avoid being called twice for the same device. */	if (doc2klist)		old = (struct DiskOnChip *) doc2klist->priv;	while (old) {		if (DoC2k_is_alias(old, this)) {			printk(KERN_NOTICE			       "Ignoring DiskOnChip 2000 at 0x%lX - already configured\n",			       this->physadr);			iounmap((void *) this->virtadr);			kfree(mtd);			return;		}		if (old->nextdoc)			old = (struct DiskOnChip *) old->nextdoc->priv;		else			old = NULL;	}	switch (this->ChipID) {	case DOC_ChipID_Doc2kTSOP:		mtd->name = "DiskOnChip 2000 TSOP";		this->ioreg = DoC_Mil_CDSN_IO;		/* Pretend it's a Millennium */		this->ChipID = DOC_ChipID_DocMil;		maxchips = MAX_CHIPS;		break;	case DOC_ChipID_Doc2k:		mtd->name = "DiskOnChip 2000";		this->ioreg = DoC_2k_CDSN_IO;		maxchips = MAX_CHIPS;		break;	case DOC_ChipID_DocMil:		mtd->name = "DiskOnChip Millennium";		this->ioreg = DoC_Mil_CDSN_IO;		maxchips = MAX_CHIPS_MIL;		break;	default:		printk("Unknown ChipID 0x%02x\n", this->ChipID);		kfree(mtd);		iounmap((void *) this->virtadr);		return;	}	printk(KERN_NOTICE "%s found at address 0x%lX\n", mtd->name,	       this->physadr);	mtd->type = MTD_NANDFLASH;	mtd->flags = MTD_CAP_NANDFLASH;	mtd->ecctype = MTD_ECC_RS_DiskOnChip;	mtd->size = 0;	mtd->erasesize = 0;	mtd->oobblock = 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_ecc = doc_read_ecc;	mtd->write_ecc = doc_write_ecc;	mtd->writev_ecc = doc_writev_ecc;	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;	init_MUTEX(&this->lock);	/* Ident all the chips present. */	DoC_ScanChips(this, maxchips);	if (!this->totlen) {		kfree(mtd);		iounmap((void *) this->virtadr);	} else {		this->nextdoc = doc2klist;		doc2klist = mtd;		mtd->size = this->totlen;		mtd->erasesize = this->erasesize;		add_mtd_device(mtd);		return;	}}static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,		    size_t * retlen, u_char * buf){	/* Just a special case of doc_read_ecc */	return doc_read_ecc(mtd, from, len, retlen, buf, NULL, NULL);}static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,			size_t * retlen, u_char * buf, u_char * eccbuf, struct nand_oobinfo *oobsel){	struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;	unsigned long docptr;	struct Nand *mychip;	unsigned char syndrome[6];	volatile char dummy;	int i, len256 = 0, ret=0;	size_t left = len;	docptr = this->virtadr;	/* Don't allow read past end of device */	if (from >= this->totlen)		return -EINVAL;	down(&this->lock);	*retlen = 0;	while (left) {		len = left;		/* Don't allow a single read to cross a 512-byte block boundary */		if (from + len > ((from | 0x1ff) + 1))			len = ((from | 0x1ff) + 1) - from;		/* The ECC will not be calculated correctly if less than 512 is read */		if (len != 0x200 && eccbuf)			printk(KERN_WARNING			       "ECC needs a full sector read (adr: %lx size %lx)\n",			       (long) from, (long) len);		/* printk("DoC_Read (adr: %lx size %lx)\n", (long) from, (long) len); */		/* Find the chip which is to be used and select it */		mychip = &this->chips[from >> (this->chipshift)];		if (this->curfloor != mychip->floor) {			DoC_SelectFloor(this, mychip->floor);			DoC_SelectChip(this, mychip->chip);		} else if (this->curchip != mychip->chip) {			DoC_SelectChip(this, mychip->chip);		}		this->curfloor = mychip->floor;		this->curchip = mychip->chip;		DoC_Command(this,			    (!this->page256			     && (from & 0x100)) ? NAND_CMD_READ1 : NAND_CMD_READ0,			    CDSN_CTRL_WP);		DoC_Address(this, ADDR_COLUMN_PAGE, from, CDSN_CTRL_WP,			    CDSN_CTRL_ECC_IO);		if (eccbuf) {			/* Prime the ECC engine */			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);		}		/* treat crossing 256-byte sector for 2M x 8bits devices */		if (this->page256 && from + len > (from | 0xff) + 1) {			len256 = (from | 0xff) + 1 - from;			DoC_ReadBuf(this, buf, len256);			DoC_Command(this, NAND_CMD_READ0, CDSN_CTRL_WP);			DoC_Address(this, ADDR_COLUMN_PAGE, from + len256,				    CDSN_CTRL_WP, CDSN_CTRL_ECC_IO);		}		DoC_ReadBuf(this, &buf[len256], len - len256);		/* Let the caller know we completed it */		*retlen += len;		if (eccbuf) {			/* Read the ECC data through the DiskOnChip ECC logic */			/* Note: this will work even with 2M x 8bit devices as   */			/*       they have 8 bytes of OOB per 256 page. mf.      */			DoC_ReadBuf(this, eccbuf, 6);			/* Flush the pipeline */			if (DoC_is_Millennium(this)) {				dummy = ReadDOC(docptr, ECCConf);				dummy = ReadDOC(docptr, ECCConf);				i = ReadDOC(docptr, ECCConf);			} else {				dummy = ReadDOC(docptr, 2k_ECCStatus);				dummy = ReadDOC(docptr, 2k_ECCStatus);				i = ReadDOC(docptr, 2k_ECCStatus);			}			/* Check the ECC Status */			if (i & 0x80) {				int nb_errors;				/* There was an ECC error */#ifdef ECC_DEBUG				printk(KERN_ERR "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(KERN_ERR "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(KERN_DEBUG "ECC DATA at %lxB: %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);		}		/* according to 11.4.1, we need to wait for the busy line 	         * drop if we read to the end of the page.  */		if(0 == ((from + len) & 0x1ff))		{		    DoC_WaitReady(this);		}		from += len;		left -= len;		buf += len;	}	up(&this->lock);	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){	struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;	int di; /* Yes, DI is a hangover from when I was disassembling the binary driver */	unsigned long docptr;	volatile char dummy;	int len256 = 0;	struct Nand *mychip;	size_t left = len;	int status;	docptr = this->virtadr;	/* Don't allow write past end of device */	if (to >= this->totlen)		return -EINVAL;	down(&this->lock);	*retlen = 0;	while (left) {		len = left;		/* Don't allow a single write to cross a 512-byte block boundary */		if (to + len > ((to | 0x1ff) + 1))			len = ((to | 0x1ff) + 1) - to;		/* The ECC will not be calculated correctly if less than 512 is written *//* DBB-		if (len != 0x200 && eccbuf)			printk(KERN_WARNING			       "ECC needs a full sector write (adr: %lx size %lx)\n",			       (long) to, (long) len);   -DBB */		/* printk("DoC_Write (adr: %lx size %lx)\n", (long) to, (long) len); */		/* Find the chip which is to be used and select it */		mychip = &this->chips[to >> (this->chipshift)];		if (this->curfloor != mychip->floor) {			DoC_SelectFloor(this, mychip->floor);			DoC_SelectChip(this, mychip->chip);		} else if (this->curchip != mychip->chip) {			DoC_SelectChip(this, mychip->chip);		}		this->curfloor = mychip->floor;		this->curchip = mychip->chip;		/* Set device to main plane of flash */		DoC_Command(this, NAND_CMD_RESET, CDSN_CTRL_WP);		DoC_Command(this,			    (!this->page256			     && (to & 0x100)) ? NAND_CMD_READ1 : NAND_CMD_READ0,			    CDSN_CTRL_WP);		DoC_Command(this, NAND_CMD_SEQIN, 0);		DoC_Address(this, ADDR_COLUMN_PAGE, to, 0, CDSN_CTRL_ECC_IO);		if (eccbuf) {			/* Prime the ECC engine */			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);		}		/* treat crossing 256-byte sector for 2M x 8bits devices */		if (this->page256 && to + len > (to | 0xff) + 1) {			len256 = (to | 0xff) + 1 - to;			DoC_WriteBuf(this, buf, len256);			DoC_Command(this, NAND_CMD_PAGEPROG, 0);			DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP);			/* There's an implicit DoC_WaitReady() in DoC_Command */			dummy = ReadDOC(docptr, CDSNSlowIO);			DoC_Delay(this, 2);			if (ReadDOC_(docptr, this->ioreg) & 1) {				printk(KERN_ERR "Error programming flash\n");				/* Error in programming */				*retlen = 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品欧美久久久| 欧美电影免费观看完整版| 最新高清无码专区| 国内精品久久久久影院薰衣草| 日韩一级精品视频在线观看| 91黄色激情网站| 免费看精品久久片| 国产精品系列在线| 在线播放91灌醉迷j高跟美女| 轻轻草成人在线| 中文乱码免费一区二区| 一本久久综合亚洲鲁鲁五月天 | 欧美性色欧美a在线播放| 亚洲v日本v欧美v久久精品| 亚洲精品一区二区三区影院| 91原创在线视频| 久久国产精品色婷婷| 亚洲一区二区在线免费看| 日韩精品一区二区三区在线观看| 国产综合色在线| 亚洲天天做日日做天天谢日日欢| 欧美一级专区免费大片| 欧美视频一区在线| 97精品超碰一区二区三区| 高清不卡一二三区| 国产91精品一区二区麻豆亚洲| 午夜精品福利一区二区蜜股av | 亚洲色图.com| 国产欧美一区二区三区鸳鸯浴 | 国产欧美日韩中文久久| 精品国产凹凸成av人导航| 欧美精品久久一区| 91国偷自产一区二区开放时间| 国产成人在线观看免费网站| 美女一区二区久久| 韩国成人福利片在线播放| 久久99国产精品久久| 久久精品国产亚洲一区二区三区| 日韩精品每日更新| 免费高清不卡av| 国产一区二区三区在线看麻豆| 国产精品综合二区| 波多野结衣亚洲一区| 99精品视频在线观看| 欧美日韩日日摸| 欧美一区二区精品久久911| 欧美电视剧在线观看完整版| 精品国产乱码久久久久久蜜臀| 国产欧美一区二区精品性色| 国产精品国产三级国产a| 亚洲综合男人的天堂| 国产大陆亚洲精品国产| 99re成人精品视频| 欧美一区二区黄| 中文字幕人成不卡一区| 亚洲在线视频一区| 国产.精品.日韩.另类.中文.在线.播放| 欧洲一区二区三区免费视频| 精品福利视频一区二区三区| 亚洲欧美色综合| 国产精品1区2区3区在线观看| 欧美三级日韩三级| 亚洲日本在线天堂| 国产成人av自拍| 精品理论电影在线| 亚洲福利视频一区| 在线免费一区三区| 亚洲欧美日韩综合aⅴ视频| a级精品国产片在线观看| 欧美videossexotv100| 性欧美大战久久久久久久久| 成人激情综合网站| 国产视频911| 国产精品成人一区二区三区夜夜夜| 亚洲激情五月婷婷| 成人黄色片在线观看| 欧美一区二区三区免费在线看| 亚洲精品中文字幕在线观看| 国产成人在线视频网址| 欧美电视剧在线观看完整版| 丝袜美腿成人在线| 欧美精品欧美精品系列| 午夜精品免费在线| 欧美一区二视频| 久久国产精品72免费观看| 欧美一区二区视频在线观看 | 免费av成人在线| 91精品国产综合久久国产大片| 亚洲精品国产a| 欧美亚洲国产bt| 国产精品自在欧美一区| 国产日产亚洲精品系列| 成人精品鲁一区一区二区| 中文字幕国产精品一区二区| 99视频在线精品| 亚洲综合色自拍一区| 日韩欧美一级精品久久| 国产乱人伦精品一区二区在线观看 | 欧美成人女星排名| 高清不卡一区二区在线| 丝袜亚洲另类欧美| 中文字幕不卡一区| 欧美电影影音先锋| 波波电影院一区二区三区| 中文字幕一区二区三区蜜月| 国产精品三级在线观看| 欧美日韩国产乱码电影| 在线观看成人免费视频| 精品一区二区三区香蕉蜜桃| 亚洲18女电影在线观看| 久久综合久久久久88| 91精品国产麻豆国产自产在线 | 久久久久久黄色| 欧美一区二区在线观看| 色婷婷久久久综合中文字幕| 成人性生交大片免费看中文| 日韩国产一区二| 亚洲6080在线| 亚洲少妇最新在线视频| 国产精品久久久久桃色tv| 欧美一区二区美女| 欧美一级黄色片| 色婷婷久久久亚洲一区二区三区| 色婷婷久久99综合精品jk白丝| 久久精品国产99国产精品| 日韩精品一级中文字幕精品视频免费观看| 三级一区在线视频先锋| 国产成人av自拍| 亚洲美女免费视频| 久久婷婷一区二区三区| 欧美一级搡bbbb搡bbbb| 欧美精品欧美精品系列| 69堂成人精品免费视频| 欧美群妇大交群的观看方式| 欧美精品一区二区在线播放| 亚洲猫色日本管| 日韩精品最新网址| 69堂成人精品免费视频| 精品国产三级a在线观看| 91精品婷婷国产综合久久 | 亚洲欧美国产三级| 91年精品国产| 欧美精品一区二区蜜臀亚洲| 秋霞影院一区二区| 亚洲一区二区五区| 日本在线不卡视频一二三区| 精品久久久影院| 亚洲国产一区二区三区青草影视| 亚洲国产日产av| 久久99国内精品| 国产a级毛片一区| 91一区二区在线观看| 91精品国产91久久久久久最新毛片 | 亚洲精品国产成人久久av盗摄| 午夜视频在线观看一区二区 | 麻豆91免费观看| 在线视频欧美精品| 国产精品色在线观看| 亚洲狠狠丁香婷婷综合久久久| 91亚洲精品一区二区乱码| 欧美刺激午夜性久久久久久久| 国产精品久久影院| 亚洲成a人v欧美综合天堂| 国产精品综合av一区二区国产馆| 91蜜桃传媒精品久久久一区二区| 午夜精品在线看| 国产精品不卡在线观看| 一区二区三区欧美视频| 石原莉奈一区二区三区在线观看| 午夜精品123| proumb性欧美在线观看| 91最新地址在线播放| 日韩免费高清电影| 日本一区二区三区免费乱视频| 夜夜亚洲天天久久| 蜜臀va亚洲va欧美va天堂| 国产午夜精品久久久久久免费视 | 精品视频一区 二区 三区| 精品剧情在线观看| 激情图区综合网| 欧美成人一区二区三区片免费| 午夜精品福利在线| 国产一区二区免费看| 亚洲欧美视频一区| 盗摄精品av一区二区三区| 欧美成人一区二区三区片免费| 精品一区二区三区久久| 日本一区二区三区四区在线视频| xvideos.蜜桃一区二区| 夜色激情一区二区| 成人v精品蜜桃久久一区| 在线观看国产精品网站| 中文字幕一区二区日韩精品绯色| 午夜伊人狠狠久久| 欧美三级日本三级少妇99| 久久女同精品一区二区| 美国毛片一区二区| 欧美一区二区女人| 午夜av区久久| 538prom精品视频线放|