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

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

?? omap-flash.c

?? nandflash k9g808u0a在pxa270的驅(qū)動,由于pxa270沒有nandflash接口
?? C
字號:
/* * Flash memory access on OMAP based devices * * Copyright: (C) 2002 MontaVista Software Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. *//* * Flash unlock procedure taken from: * Flash memory access on EPXA based devices * * (C) 2000 Nicolas Pitre <nico@cam.org> *  Copyright (C) 2001 Altera Corporation *  Copyright (C) 2001 Red Hat, Inc. */#include <linux/config.h>#include <linux/module.h>#include <linux/types.h>#include <linux/kernel.h>#include <linux/init.h>#include <linux/slab.h>#include <linux/mtd/mtd.h>#include <linux/mtd/map.h>#include <linux/mtd/partitions.h>#include <asm/hardware.h>#include <asm/io.h>#ifndef CONFIG_ARCH_OMAP#error This is for OMAP architecture only#endif#define OMAP_CS0_START 0x00000000#define OMAP_CS3_START 0x0C000000static void omap_inval_cache(struct map_info *map, unsigned long from, ssize_t len){	cpu_dcache_invalidate_range(map->map_priv_2 + from,				    map->map_priv_2 + from + len);}static void omap_unlock_all(struct mtd_info * mtd){	int i, j;	/* Unlock the flash device. */	if(mtd->unlock){		for (i = 0; i < mtd->numeraseregions; i++) {			for (j = 0; j < mtd->eraseregions[i].numblocks; j++){				mtd->unlock(mtd, mtd->eraseregions[i].offset +							  j * mtd->eraseregions[i].erasesize,							  mtd->eraseregions[i].erasesize);			}		}	}}extern void omap_set_vpp(int vpp);extern int  omap_boot_from_cs0(void);void mtd_omap_set_vpp(struct map_info *map, int vpp){	omap_set_vpp(vpp);}#if	defined(CONFIG_MTD_OMAP_0)static struct map_info omap_map_flash_0 = {	.name		= "OMAP flash",	.set_vpp	= mtd_omap_set_vpp,	.bankwidth	= 2,	.inval_cache	= omap_inval_cache,};static struct mtd_partition *parsed_parts0;static int nb_parts0;static struct mtd_info *flash0_mtd;#endif#if	defined(CONFIG_MTD_OMAP_1)static struct map_info omap_map_flash_1 = {	.name		= "OMAP flash",	.set_vpp	= mtd_omap_set_vpp,	.bankwidth	= 2,	.inval_cache	= omap_inval_cache,};static struct mtd_partition *parsed_parts1;static int nb_parts1;static struct mtd_info *flash1_mtd;#endif/* * Here are partition information for all known OMAP-based devices. * See include/linux/mtd/partitions.h for definition of the mtd_partition * structure. * * The *_max_flash_size is the maximum possible mapped flash size which * is not necessarily the actual flash size.  It must be no more than * the value specified in the "struct map_desc *_io_desc" mapping * definition for the corresponding machine. * * Please keep these in alphabetical order, and formatted as per existing * entries.  Thanks. */#if	defined(CONFIG_MACH_OMAP_PERSEUS2)static unsigned long omap_perseus2_max_flash_size = OMAP_FLASH_0_SIZE;static struct mtd_partition omap_perseus2_partitions[] = {	{		.name =		"BootLoader and Params",		.size =		0x00100000,		.offset =	0,		.mask_flags =	MTD_WRITEABLE,	/* force read-only */	}, {		.name =		"Kernel",		.size =		0x00100000,		.offset =	MTDPART_OFS_APPEND,	}, {		.name =		"MainFS",		.size =		0x01BE0000,		.offset =	MTDPART_OFS_APPEND,	}, {		.name =		"GsmFFS",		.size =		0x00020000,		.offset =	MTDPART_OFS_APPEND,	}, {		.name =		"GSM",		.size =		MTDPART_SIZ_FULL,		.offset =	MTDPART_OFS_APPEND,	}};#endif#if	defined(CONFIG_OMAP_INNOVATOR)/* Both Flash 0 and 1 are the same size */static unsigned long innovator_max_flash_size = OMAP_FLASH_0_SIZE;#if	defined(CONFIG_MTD_OMAP_0)static struct mtd_partition innovator_flash_0_partitions[] = {	{		name:		"BootLoader",		size:		0x00020000,		offset:		0,		mask_flags:	MTD_WRITEABLE,  /* force read-only */	}, {		name:		"Params",		size:		0x00040000,		offset:		MTDPART_OFS_APPEND,		mask_flags:	MTD_WRITEABLE,  /* force read-only */	}, {		name:		"Kernel",		size:		0x00200000,		offset:		MTDPART_OFS_APPEND,	}, {		name:		"Flash0 FileSys",		size:		MTDPART_SIZ_FULL,		offset:		MTDPART_OFS_APPEND,	}};#endif#if	defined(CONFIG_MTD_OMAP_1)static struct mtd_partition innovator_flash_1_partitions[] = {	{		name:		"Flash1 FileSys",		size:		MTDPART_SIZ_FULL,		offset:		MTDPART_OFS_APPEND,	}};#endif#endif#if	defined(CONFIG_OMAP_PERSEUS)static unsigned long perseus_max_flash_size = OMAP_FLASH_CS0_SIZE;static struct mtd_partition perseus_partitions[] = {	{		name:		"Bootloader",		size:		0x00100000,		offset:		0,		mask_flags:	MTD_WRITEABLE,  /* force read-only */	}, {		name:		"zImage",		size:		0x000a0000,		offset:		MTDPART_OFS_APPEND,	}, {		name:		"Root FS",		size:		0x00660000,		offset:		MTDPART_OFS_APPEND,	}, {		name:		"User1 FS",		size:		0x00400000,		offset:		MTDPART_OFS_APPEND,	}, {		name:		"User2 FS",		size:		MTDPART_SIZ_FULL,		offset:		MTDPART_OFS_APPEND,	}};#endifstatic const char *part_probes[] __initdata = {"cmdlinepart", "RedBoot", NULL};#ifdef CONFIG_MTD_OMAP_0static int __init init_flash_0 (void){	struct mtd_partition *parts;	int parsed_nr_parts = 0;	/*	 * Static partition definition selection	 */	nb_parts0 =0;#if	defined(CONFIG_MACH_OMAP_PERSEUS2)	if (machine_is_omap_perseus2()) {		parts = omap_perseus2_partitions;		nb_parts0 = ARRAY_SIZE(omap_perseus2_partitions);		omap_map_flash_0.size = omap_perseus2_max_flash_size;	}#endif#if	defined(CONFIG_OMAP_INNOVATOR)	if (machine_is_innovator()) {		parts = innovator_flash_0_partitions;		nb_parts0 = ARRAY_SIZE(innovator_flash_0_partitions);		omap_map_flash_0.size = innovator_max_flash_size;	}#endif#if	defined(CONFIG_OMAP_PERSEUS)	if (machine_is_perseus()) {		parts = perseus_partitions;		nb_parts0 = ARRAY_SIZE(perseus_partitions);		omap_map_flash_0.size = perseus_max_flash_size;	}#endif	/*	 * Now let's probe for the actual flash.  Do it here since	 * specific machine settings might have been set above.	 */	printk(KERN_NOTICE "OMAP flash 0: probing %d-bit flash bus\n",		omap_map_flash_0.bankwidth*8);	if (omap_boot_from_cs0) {		omap_map_flash_0.map_priv_1 = (unsigned long)__ioremap(OMAP_CS0_START, OMAP_FLASH_0_SIZE, 0);		omap_map_flash_0.map_priv_2 = (unsigned long)__ioremap(OMAP_CS0_START, OMAP_FLASH_0_SIZE, L_PTE_CACHEABLE);	} else {		omap_map_flash_0.map_priv_1 = (unsigned long)__ioremap(OMAP_CS3_START, OMAP_FLASH_0_SIZE, 0);		omap_map_flash_0.map_priv_2 = (unsigned long)__ioremap(OMAP_CS3_START, OMAP_FLASH_0_SIZE, L_PTE_CACHEABLE);	}	if (!omap_map_flash_0.map_priv_1 || !omap_map_flash_0.map_priv_2) {		printk("Failed to ioremap flash 0\n");		if (omap_map_flash_0.map_priv_1)			iounmap((void *)omap_map_flash_0.map_priv_1);		if (omap_map_flash_0.map_priv_2)			iounmap((void *)omap_map_flash_0.map_priv_2);		return -EIO;	}	omap_map_flash_0.virt = omap_map_flash_0.map_priv_1;	omap_map_flash_0.cached = (void *)omap_map_flash_0.map_priv_2;	flash0_mtd = do_map_probe("cfi_probe", &omap_map_flash_0);	if (!flash0_mtd) {		if (omap_map_flash_0.map_priv_1)			iounmap((void *)omap_map_flash_0.map_priv_1);		if (omap_map_flash_0.map_priv_2)			iounmap((void *)omap_map_flash_0.map_priv_2);		return -ENXIO;	}	flash0_mtd->owner = THIS_MODULE;#if defined (CONFIG_ARCH_OMAP1610) || defined (CONFIG_ARCH_OMAP730)	omap_unlock_all(flash0_mtd);#endif	/*	 * Dynamic partition selection stuff (might override the static ones)	 */	parsed_nr_parts =		parse_mtd_partitions(flash0_mtd, part_probes, &parsed_parts0, 0);	if (parsed_nr_parts > 0) {		nb_parts0 = parsed_nr_parts;		add_mtd_partitions(flash0_mtd, parsed_parts0, parsed_nr_parts);	} else if (nb_parts0 == 0) {		printk(KERN_NOTICE "OMAP flash: no partition info available,"			"registering whole flash at once\n");		add_mtd_device(flash0_mtd);	} else {		printk(KERN_NOTICE "Using static partition definition\n");		add_mtd_partitions(flash0_mtd, parts, nb_parts0);	}	return 0;}#endif#if	defined(CONFIG_MTD_OMAP_1)static int __init init_flash_1 (void){	struct mtd_partition *parts;	int parsed_nr_parts = 0;	/*	 * Static partition definition selection	 */	nb_parts1 = 0;#if	defined(CONFIG_OMAP_INNOVATOR)	if (machine_is_innovator()) {		parts = innovator_flash_1_partitions;		nb_parts1 = ARRAY_SIZE(innovator_flash_1_partitions);		omap_map_flash_1.size = innovator_max_flash_size;	}#endif	/*	 * Now let's probe for the actual flash.  Do it here since	 * specific machine settings might have been set above.	 */	printk(KERN_NOTICE "OMAP flash 1: probing %d-bit flash bus\n",		omap_map_flash_1.bankwidth*8);	omap_map_flash_1.map_priv_1 = (unsigned long)__ioremap(OMAP_FLASH_1_START, OMAP_FLASH_1_SIZE, 0);	omap_map_flash_1.map_priv_2 = (unsigned long)__ioremap(OMAP_FLASH_1_START, OMAP_FLASH_1_SIZE, L_PTE_CACHEABLE);	if (!omap_map_flash_1.map_priv_1 || !omap_map_flash_1.map_priv_2) {		printk("Failed to ioremap flash 1\n");		if (omap_map_flash_1.map_priv_1)			iounmap((void *)omap_map_flash_1.map_priv_1);		if (omap_map_flash_1.map_priv_2)			iounmap((void *)omap_map_flash_1.map_priv_2);		return -EIO;	}	omap_map_flash_1.virt = omap_map_flash_1.map_priv_1;	omap_map_flash_1.cached = (void *)omap_map_flash_1.map_priv_2;	flash1_mtd = do_map_probe("cfi_probe", &omap_map_flash_1);	if (!flash1_mtd) {		if (omap_map_flash_1.map_priv_1)			iounmap((void *)omap_map_flash_1.map_priv_1);		if (omap_map_flash_1.map_priv_2)			iounmap((void *)omap_map_flash_1.map_priv_2);		return -ENXIO;	}	flash1_mtd->owner = THIS_MODULE;#if defined (CONFIG_ARCH_OMAP1610) || defined (CONFIG_ARCH_OMAP730)	omap_unlock_all(flash1_mtd);#endif	/*	 * Dynamic partition selection stuff (might override the static ones)	 */	parsed_nr_parts = 		parse_mtd_partitions(flash1_mtd, part_probes, &parsed_parts1, 0);	if (parsed_nr_parts > 0) {		nb_parts1 = parsed_nr_parts;		add_mtd_partitions(flash1_mtd, parsed_parts1, parsed_nr_parts);	} else if (nb_parts1 == 0) {		printk(KERN_NOTICE "OMAP flash 1: no partition info available,"			"registering whole flash at once\n");		add_mtd_device(flash1_mtd);	} else {		printk(KERN_NOTICE "Using static partition definition\n");		add_mtd_partitions(flash1_mtd, parts, nb_parts1);	}	return 0;}#endifint __init omap_mtd_init(void){	int status;#ifdef CONFIG_MTD_OMAP_0	if ((status = init_flash_0 ())) {		printk(KERN_ERR "OMAP Flash 0: unable to init map\n");	}#endif#ifdef CONFIG_MTD_OMAP_1	if ((status = init_flash_1 ())) {		printk(KERN_ERR "OMAP Flash 1: unable to init map\n");	}#endif	return status;}static void __exit omap_mtd_cleanup(void){#ifdef CONFIG_MTD_OMAP_0	if (flash0_mtd) {		if (nb_parts0)			del_mtd_partitions(flash0_mtd);		else			del_mtd_device(flash0_mtd);		if (parsed_parts0) {			kfree(parsed_parts0);			parsed_parts0 = NULL;		}		map_destroy(flash0_mtd);		flash0_mtd = NULL;		if (omap_map_flash_0.map_priv_1)			iounmap((void *)omap_map_flash_0.map_priv_1);		if (omap_map_flash_0.map_priv_2)			iounmap((void *)omap_map_flash_0.map_priv_2);	}#endif#ifdef CONFIG_MTD_OMAP_1	if (flash1_mtd) {		if (nb_parts1)			del_mtd_partitions(flash1_mtd);		else			del_mtd_device(flash1_mtd);		if (parsed_parts1) {			kfree(parsed_parts1);			parsed_parts1 = NULL;		}		map_destroy(flash1_mtd);		flash1_mtd = NULL;		if (omap_map_flash_1.map_priv_1)			iounmap((void *)omap_map_flash_1.map_priv_1);		if (omap_map_flash_1.map_priv_2)			iounmap((void *)omap_map_flash_1.map_priv_2);	}#endif}module_init(omap_mtd_init);module_exit(omap_mtd_cleanup);MODULE_AUTHOR("George G. Davis");MODULE_DESCRIPTION("OMAP CFI map driver");MODULE_LICENSE("GPL");

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜av一区二区| 国产麻豆成人精品| 91视频免费播放| 国产亚洲制服色| 亚洲欧美日韩国产综合在线 | 国产精品久久久久久亚洲毛片 | 国产精品传媒入口麻豆| 顶级嫩模精品视频在线看| 久久久精品免费网站| 99天天综合性| 一区二区三区在线视频观看58 | 国产精品理论片在线观看| 久久av资源站| 久久精品欧美日韩精品| 国产一区二区三区四区五区入口| www国产成人| 国产裸体歌舞团一区二区| 国产精品区一区二区三| 91麻豆精品在线观看| 亚洲综合在线免费观看| 欧美日韩一二三区| 奇米一区二区三区| 国产精品妹子av| 欧美在线999| 免费观看在线色综合| 精品日韩av一区二区| 黄页视频在线91| 国产精品嫩草99a| 欧美综合欧美视频| 青青草91视频| 亚洲美女偷拍久久| 日韩欧美一区二区三区在线| 激情文学综合丁香| 亚洲三级理论片| 欧美日韩一区二区电影| 国产乱子轮精品视频| 亚洲免费高清视频在线| 欧美一区二区三区在| 国产成人av一区| 亚洲国产精品麻豆| 国产日产欧美精品一区二区三区| 91激情五月电影| 麻豆传媒一区二区三区| 国产精品乱码人人做人人爱| 欧美日韩免费一区二区三区| 日本aⅴ免费视频一区二区三区| 欧美国产一区二区在线观看| 欧美日韩国产综合一区二区| 精品一区二区三区的国产在线播放| 日本一区二区在线不卡| 6080yy午夜一二三区久久| 东方aⅴ免费观看久久av| 日韩高清不卡在线| 国产精品国产自产拍高清av王其| 91精品国产一区二区人妖| 成人av在线电影| 日韩在线播放一区二区| 亚洲日本va午夜在线影院| 日韩欧美在线不卡| 在线观看91视频| 成人app下载| 日韩av电影天堂| 亚洲欧美日韩中文字幕一区二区三区| 精品美女一区二区| 欧美猛男gaygay网站| 蜜臀av国产精品久久久久| 亚洲午夜一区二区三区| 国产亚洲欧洲一区高清在线观看| 欧美老女人在线| 欧美精品在线观看一区二区| 色一情一乱一乱一91av| 国产精品自拍三区| 久热成人在线视频| 精品制服美女久久| 天天色天天爱天天射综合| 亚洲第一成年网| 亚洲影院久久精品| 性感美女久久精品| 亚洲综合视频在线观看| 亚洲综合视频在线| 亚洲午夜私人影院| 视频一区二区三区入口| 午夜亚洲国产au精品一区二区| 亚洲国产成人91porn| 亚洲午夜久久久| 午夜精品久久久久影视| 三级影片在线观看欧美日韩一区二区 | 欧美一区二区三区人| 欧美一级一级性生活免费录像| 欧美日韩一级黄| 日韩欧美国产高清| 日韩欧美国产一区二区三区| 欧美一区二区免费视频| 欧美自拍偷拍午夜视频| 在线国产电影不卡| 日韩欧美一区电影| 精品免费国产二区三区 | 免费久久99精品国产| 强制捆绑调教一区二区| 久久精品国内一区二区三区| 五月综合激情网| 久久99久久99小草精品免视看| 国产精品入口麻豆原神| 一区二区三区加勒比av| 成人免费在线观看入口| 一区二区三区在线影院| 日本人妖一区二区| 国产精品一二三在| 91麻豆免费观看| 欧美日韩三级在线| 久久精品视频在线看| 国产精品妹子av| 日韩精品成人一区二区在线| 韩国女主播一区| 日本精品免费观看高清观看| 欧美美女一区二区在线观看| 国产亚洲欧美日韩在线一区| 中文字幕视频一区| 轻轻草成人在线| 国产成人av一区二区| 欧美网站一区二区| 久久久久亚洲蜜桃| 亚洲国产精品自拍| 国内精品久久久久影院色| 色婷婷综合久久久中文一区二区 | 免费成人小视频| 99久久久久免费精品国产| 欧美午夜一区二区| 欧美国产视频在线| 日韩精品国产欧美| 91亚洲大成网污www| 777精品伊人久久久久大香线蕉| 国产精品免费看片| 日韩国产欧美一区二区三区| aaa欧美大片| 欧美一区二区三区色| 亚洲激情欧美激情| 狠狠色综合色综合网络| 欧美性猛片xxxx免费看久爱| 久久影视一区二区| 午夜一区二区三区视频| 成人午夜电影小说| 精品国产免费视频| 国产精品不卡在线| 国产乱码精品一区二区三区忘忧草| 国产一区二区三区香蕉| 日韩一区二区三区高清免费看看| 亚洲人成网站在线| 国产一区二区三区| 欧美成人一级视频| 亚洲午夜一区二区| 欧美性大战xxxxx久久久| 国产日韩在线不卡| 国产激情一区二区三区桃花岛亚洲| 欧美伊人久久大香线蕉综合69 | 色老头久久综合| 欧美激情一区二区三区不卡| 久草在线在线精品观看| 国产传媒久久文化传媒| 久久午夜免费电影| 亚洲宅男天堂在线观看无病毒| 一本大道久久a久久综合婷婷| 欧美日韩国产不卡| 亚洲精品中文在线观看| 99综合电影在线视频| 日韩一区二区影院| 亚洲国产欧美在线| 一本色道久久综合亚洲aⅴ蜜桃| 久久精子c满五个校花| 人人精品人人爱| 欧美电影在线免费观看| 亚洲最色的网站| 91丝袜美腿高跟国产极品老师 | 色婷婷综合久久久中文字幕| 国产精品美女久久福利网站| 国产一区二区三区最好精华液| 91日韩在线专区| 亚洲精品一区在线观看| 麻豆精品在线播放| 欧美电视剧免费全集观看| 久久精品国产久精国产爱| 久久久国际精品| 国产成人亚洲精品青草天美 | 国产盗摄一区二区三区| 国产精品麻豆欧美日韩ww| 成人免费看片app下载| 亚洲日本在线看| 精品一区二区三区香蕉蜜桃 | 久久理论电影网| 国产福利一区二区三区视频| 国产精品美女一区二区| 不卡一区二区三区四区| 午夜免费欧美电影| 欧美三级视频在线播放| 天堂在线一区二区| 国产亚洲人成网站| 91在线视频播放地址| 日韩中文字幕一区二区三区| 欧美成va人片在线观看| av电影天堂一区二区在线|