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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? s3c2410.c

?? mtd-snapshot-20041027
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* linux/drivers/mtd/nand/s3c2410.c * * Copyright (c) 2004 Simtec Electronics * Ben Dooks <ben@simtec.co.uk> * * Samsung S3C2410 NAND driver * * Changelog: *	21-Sep-2004  BJD  Initial version *	23-Sep-2004  BJD  Mulitple device support *	28-Sep-2004  BJD  Fixed ECC placement for Hardware mode *	12-Oct-2004  BJD  Fixed errors in use of platform data * * $Id: s3c2410.c,v 1.5 2004/10/12 10:10:15 bjd Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/#include <config/mtd/nand/s3c2410/hwecc.h>#include <config/mtd/nand/s3c2410/debug.h>#ifdef CONFIG_MTD_NAND_S3C2410_DEBUG#define DEBUG#endif#include <linux/module.h>#include <linux/types.h>#include <linux/init.h>#include <linux/kernel.h>#include <linux/string.h>#include <linux/ioport.h>#include <linux/device.h>#include <linux/delay.h>#include <linux/err.h>#include <linux/mtd/mtd.h>#include <linux/mtd/nand.h>#include <linux/mtd/nand_ecc.h>#include <linux/mtd/partitions.h>#include <asm/io.h>#include <asm/mach-types.h>#include <asm/hardware/clock.h>#include <asm/arch/regs-nand.h>#include <asm/arch/nand.h>#define PFX "s3c2410-nand: "#ifdef CONFIG_MTD_NAND_S3C2410_HWECCstatic int hardware_ecc = 1;#elsestatic int hardware_ecc = 0;#endif/* new oob placement block for use with hardware ecc generation */static struct nand_oobinfo nand_hw_eccoob = {	.useecc = MTD_NANDECC_AUTOPLACE,	.eccbytes = 3,	.eccpos = {0, 1, 2 },	.oobfree = { {8, 8} }};/* controller and mtd information */struct s3c2410_nand_info;struct s3c2410_nand_mtd {	struct mtd_info			mtd;	struct nand_chip		chip;	struct s3c2410_nand_set		*set;	struct s3c2410_nand_info	*info;	int				scan_res;};/* overview of the s3c2410 nand state */struct s3c2410_nand_info {	/* mtd info */	struct nand_hw_control		controller;	struct s3c2410_nand_mtd		*mtds;	struct s3c2410_platform_nand	*platform;	/* device info */	struct device			*device;	struct resource			*area;	struct clk			*clk;	void				*regs;	int				mtd_count;};/* conversion functions */static struct s3c2410_nand_mtd *s3c2410_nand_mtd_toours(struct mtd_info *mtd){	return container_of(mtd, struct s3c2410_nand_mtd, mtd);}static struct s3c2410_nand_info *s3c2410_nand_mtd_toinfo(struct mtd_info *mtd){	return s3c2410_nand_mtd_toours(mtd)->info;}static struct s3c2410_nand_info *to_nand_info(struct device *dev){	return (struct s3c2410_nand_info *)dev_get_drvdata(dev);}static struct s3c2410_platform_nand *to_nand_plat(struct device *dev){	return (struct s3c2410_platform_nand *)dev->platform_data;}/* timing calculations */#define NS_IN_KHZ 10000000static int s3c2410_nand_calc_rate(int wanted, unsigned long clk, int max){	int result;	result = (wanted * NS_IN_KHZ) / clk;	result++;	pr_debug("result %d from %ld, %d\n", result, clk, wanted);	if (result > max) {		printk("%d ns is too big for current clock rate %ld\n",		       wanted, clk);		return -1;	}	if (result < 1)		result = 1;	return result;}#define to_ns(ticks,clk) (((clk) * (ticks)) / NS_IN_KHZ)/* controller setup */static int s3c2410_nand_inithw(struct s3c2410_nand_info *info, 			       struct device *dev){	struct s3c2410_platform_nand *plat = to_nand_plat(dev);	unsigned int tacls, twrph0, twrph1;	unsigned long clkrate = clk_get_rate(info->clk);	unsigned long cfg;	/* calculate the timing information for the controller */	if (plat != NULL) {		tacls = s3c2410_nand_calc_rate(plat->tacls, clkrate, 8);		twrph0 = s3c2410_nand_calc_rate(plat->twrph0, clkrate, 8);		twrph1 = s3c2410_nand_calc_rate(plat->twrph0, clkrate, 8);	} else {		/* default timings */		tacls = 8;		twrph0 = 8;		twrph1 = 8;	}		if (tacls < 0 || twrph0 < 0 || twrph1 < 0) {		printk(KERN_ERR PFX "cannot get timings suitable for board\n");		return -EINVAL;	}	printk(KERN_INFO PFX "timing: Tacls %ldns, Twrph0 %ldns, Twrph1 %ldns\n",	       to_ns(tacls, clkrate),	       to_ns(twrph0, clkrate),	       to_ns(twrph1, clkrate));	cfg  = S3C2410_NFCONF_EN;	cfg |= S3C2410_NFCONF_TACLS(tacls-1);	cfg |= S3C2410_NFCONF_TWRPH0(twrph0-1);	cfg |= S3C2410_NFCONF_TWRPH1(twrph1-1);	pr_debug(PFX "NF_CONF is 0x%lx\n", cfg);	writel(cfg, info->regs + S3C2410_NFCONF);	return 0;}/* select chip */static void s3c2410_nand_select_chip(struct mtd_info *mtd, int chip){	struct s3c2410_nand_info *info;	struct s3c2410_nand_mtd *nmtd; 	struct nand_chip *this = mtd->priv;	unsigned long cur;	nmtd = (struct s3c2410_nand_mtd *)this->priv;	info = nmtd->info;	cur = readl(info->regs + S3C2410_NFCONF);	if (chip == -1) {		cur |= S3C2410_NFCONF_nFCE;	} else {		if (chip > nmtd->set->nr_chips) {			printk(KERN_ERR PFX "chip %d out of range\n", chip);			return;		}		if (info->platform != NULL) {			if (info->platform->select_chip != NULL)				(info->platform->select_chip)(nmtd->set, chip);		}		cur &= ~S3C2410_NFCONF_nFCE;	}	writel(cur, info->regs + S3C2410_NFCONF);}/* command and control functions */static void s3c2410_nand_hwcontrol(struct mtd_info *mtd, int cmd){	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);	unsigned long cur;	switch (cmd) {	case NAND_CTL_SETNCE:		cur = readl(info->regs + S3C2410_NFCONF);		cur &= ~S3C2410_NFCONF_nFCE;		writel(cur, info->regs + S3C2410_NFCONF);		break;	case NAND_CTL_CLRNCE:		cur = readl(info->regs + S3C2410_NFCONF);		cur |= S3C2410_NFCONF_nFCE;		writel(cur, info->regs + S3C2410_NFCONF);		break;		/* we don't need to implement these */	case NAND_CTL_SETCLE:	case NAND_CTL_CLRCLE:	case NAND_CTL_SETALE:	case NAND_CTL_CLRALE:		pr_debug(PFX "s3c2410_nand_hwcontrol(%d) unusedn", cmd);		break;	}}/* s3c2410_nand_command * * This function implements sending commands and the relevant address * information to the chip, via the hardware controller. Since the * S3C2410 generates the correct ALE/CLE signaling automatically, we * do not need to use hwcontrol.*/static void s3c2410_nand_command (struct mtd_info *mtd, unsigned command,				  int column, int page_addr){	register struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);	register struct nand_chip *this = mtd->priv;	/*	 * Write out the command to the device.	 */	if (command == NAND_CMD_SEQIN) {		int readcmd;		if (column >= mtd->oobblock) {			/* OOB area */			column -= mtd->oobblock;			readcmd = NAND_CMD_READOOB;		} else if (column < 256) {			/* First 256 bytes --> READ0 */			readcmd = NAND_CMD_READ0;		} else {			column -= 256;			readcmd = NAND_CMD_READ1;		}				writeb(readcmd, info->regs + S3C2410_NFCMD);	}	writeb(command, info->regs + S3C2410_NFCMD);	/* Set ALE and clear CLE to start address cycle */	if (column != -1 || page_addr != -1) {		/* Serially input address */		if (column != -1) {			/* Adjust columns for 16 bit buswidth */			if (this->options & NAND_BUSWIDTH_16)				column >>= 1;			writeb(column, info->regs + S3C2410_NFADDR);		}		if (page_addr != -1) {			writeb((unsigned char) (page_addr), info->regs + S3C2410_NFADDR);			writeb((unsigned char) (page_addr >> 8), info->regs + S3C2410_NFADDR);			/* One more address cycle for higher density devices */			if (this->chipsize & 0x0c000000) 				writeb((unsigned char) ((page_addr >> 16) & 0x0f),				       info->regs + S3C2410_NFADDR);		}		/* Latch in address */	}		/* 	 * program and erase have their own busy handlers 	 * status and sequential in needs no delay	*/	switch (command) {				case NAND_CMD_PAGEPROG:	case NAND_CMD_ERASE1:	case NAND_CMD_ERASE2:	case NAND_CMD_SEQIN:	case NAND_CMD_STATUS:		return;	case NAND_CMD_RESET:		if (this->dev_ready)				break;		udelay(this->chip_delay);		writeb(NAND_CMD_STATUS, info->regs + S3C2410_NFCMD);		while ( !(this->read_byte(mtd) & 0x40));		return;	/* This applies to read commands */		default:		/* 		 * If we don't have access to the busy pin, we apply the given		 * command delay		*/		if (!this->dev_ready) {			udelay (this->chip_delay);			return;		}		}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产jizzjizz一区二区| 精品一区二区三区在线观看国产| 处破女av一区二区| 欧美激情在线看| 91丨porny丨最新| 亚洲一二三四久久| 91精品综合久久久久久| 精品一区二区在线看| 国产免费成人在线视频| av在线不卡电影| 午夜精品久久久久久久99樱桃| 欧美一区二区成人| 东方欧美亚洲色图在线| 一区二区三区欧美久久| 日韩一区二区在线观看视频播放| 国产一区二区精品久久| 1000部国产精品成人观看| 欧美日韩免费不卡视频一区二区三区| 日韩av一区二区三区| 欧美激情一区在线| 欧美日韩一卡二卡三卡| 国产一区二区精品在线观看| 亚洲精品ww久久久久久p站| 欧美一区二区三区影视| 国产91丝袜在线18| 午夜成人免费视频| 中文字幕免费不卡在线| 欧美日韩一区三区| 国产99精品视频| 婷婷一区二区三区| 国产精品伦一区二区三级视频| 欧美视频一区二区| 不卡一区二区三区四区| 日本午夜一本久久久综合| 中文字幕一区视频| 精品国产精品一区二区夜夜嗨| 色综合久久中文字幕综合网| 蜜桃免费网站一区二区三区| 亚洲美女免费视频| 久久久精品免费免费| 7777女厕盗摄久久久| caoporn国产精品| 国精品**一区二区三区在线蜜桃| 亚洲最新在线观看| 国产亚洲精品bt天堂精选| 欧美老肥妇做.爰bbww| 成人的网站免费观看| 麻豆一区二区在线| 亚洲大片免费看| 亚洲欧美乱综合| 亚洲国产精品av| 久久免费的精品国产v∧| 日韩一区二区三区免费观看| 欧美丝袜自拍制服另类| 色综合久久综合中文综合网| 国产99久久久久久免费看农村| 久久99精品国产麻豆不卡| 五月激情六月综合| 亚洲国产另类av| 一区二区三区中文字幕精品精品| 日本一二三四高清不卡| 2020国产精品久久精品美国| 91麻豆精品国产91久久久久久| 在线免费视频一区二区| 91影院在线免费观看| 不卡的av网站| 成人激情免费电影网址| 岛国精品一区二区| 国产精品123区| 国产精品综合一区二区三区| 韩国成人在线视频| 狠狠色伊人亚洲综合成人| 久久精品999| 九九国产精品视频| 麻豆91精品视频| 美女性感视频久久| 国产在线一区二区| 国产在线日韩欧美| 国产精品1024| 成人午夜av影视| 92国产精品观看| 欧亚洲嫩模精品一区三区| 欧美三级视频在线| 777亚洲妇女| 精品剧情v国产在线观看在线| 日韩视频永久免费| 26uuu欧美日本| 国产欧美日韩在线视频| 国产精品福利一区| 亚洲一区二区三区在线看| 视频一区在线视频| 久久99国产精品麻豆| 国产精品一二二区| 91福利在线播放| 欧美美女一区二区在线观看| 日韩亚洲欧美一区| 久久久精品黄色| 亚洲美女偷拍久久| 免费看日韩精品| 国产伦精品一区二区三区视频青涩 | 欧美一区二区三区四区五区 | 色偷偷成人一区二区三区91| 欧美色中文字幕| 日韩欧美第一区| 欧美激情在线一区二区| 亚洲综合色视频| 日韩电影免费在线看| 成人午夜在线播放| 欧美伊人久久久久久久久影院| 欧美一级理论片| 中文字幕日韩欧美一区二区三区| 一区二区三区自拍| 国产剧情在线观看一区二区| 成人福利视频网站| 91精品国产91久久综合桃花| 久久久久国色av免费看影院| 一个色在线综合| 在线一区二区三区四区五区| 精品久久久久一区二区国产| 国产精品第四页| 久久aⅴ国产欧美74aaa| 91麻豆视频网站| 久久免费美女视频| 午夜久久久影院| 色综合久久久网| 久久久久亚洲综合| 日本美女一区二区| 91麻豆免费看片| 欧美电影精品一区二区| 亚洲免费av高清| 盗摄精品av一区二区三区| 91精品国产全国免费观看| 亚洲欧美日韩久久精品| 成人免费视频一区| 日韩欧美激情在线| 亚洲电影中文字幕在线观看| 成人美女在线观看| 欧美va在线播放| 午夜国产不卡在线观看视频| www.亚洲精品| 中文字幕乱码一区二区免费| 久久爱另类一区二区小说| 在线播放中文一区| 亚洲国产精品久久久久婷婷884| 99久久国产综合色|国产精品| 久久久亚洲精华液精华液精华液| 男女激情视频一区| 欧美日韩一二三区| 一区二区三区四区在线| 97久久超碰国产精品电影| 久久九九99视频| 国内成+人亚洲+欧美+综合在线 | 粉嫩高潮美女一区二区三区| 日韩一区二区免费在线电影 | 日韩欧美一级片| 日韩电影在线免费看| 在线观看视频一区二区欧美日韩| 综合中文字幕亚洲| 成人短视频下载| 中文字幕在线观看不卡视频| 国产不卡免费视频| 国产日韩欧美激情| 国产宾馆实践打屁股91| 久久久精品tv| 风间由美一区二区三区在线观看| 久久久久久日产精品| 国产成人午夜精品影院观看视频| 精品久久人人做人人爱| 国产在线精品国自产拍免费| 久久―日本道色综合久久| 国产一区二区三区在线观看精品 | 亚洲免费观看视频| 色综合色狠狠天天综合色| 亚洲欧美国产三级| 在线免费av一区| 亚洲18色成人| 欧美大片在线观看一区二区| 国产一区二区三区日韩| 久久九九久久九九| 91亚洲精品一区二区乱码| 亚洲国产综合视频在线观看| 欧美精品一二三区| 91美女片黄在线观看| 一区二区三区精品视频在线| 56国语精品自产拍在线观看| 免费视频最近日韩| 国产亚洲一区二区三区在线观看 | 国产精品亚洲专一区二区三区| 国产亚洲成年网址在线观看| 成人高清视频在线| 亚洲成av人片观看| 欧美电视剧在线看免费| 豆国产96在线|亚洲| 一区二区三区四区在线播放| 91精品国产综合久久久蜜臀粉嫩| 国模一区二区三区白浆| 一卡二卡三卡日韩欧美| 日韩午夜小视频| 成年人午夜久久久| 免费精品视频在线|