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

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

?? lart.c

?? nandflash k9g808u0a在pxa270的驅(qū)動,由于pxa270沒有nandflash接口
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * MTD driver for the 28F160F3 Flash Memory (non-CFI) on LART. * * $Id: lart.c,v 1.2 2007/09/21 03:09:24 quy Exp $ * * Author: Abraham vd Merwe <abraham@2d3d.co.za> * * Copyright (c) 2001, 2d3D, Inc. * * This code 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. * * References: * *    [1] 3 Volt Fast Boot Block Flash Memory" Intel Datasheet *           - Order Number: 290644-005 *           - January 2000 * *    [2] MTD internal API documentation *           - http://www.linux-mtd.infradead.org/tech/ * * Limitations: * *    Even though this driver is written for 3 Volt Fast Boot *    Block Flash Memory, it is rather specific to LART. With *    Minor modifications, notably the without data/address line *    mangling and different bus settings, etc. it should be *    trivial to adapt to other platforms. * *    If somebody would sponsor me a different board, I'll *    adapt the driver (: *//* debugging *///#define LART_DEBUG/* partition support */#define HAVE_PARTITIONS#include <linux/kernel.h>#include <linux/module.h>#include <linux/types.h>#include <linux/init.h>#include <linux/errno.h>#include <linux/mtd/mtd.h>#ifdef HAVE_PARTITIONS#include <linux/mtd/partitions.h>#endif#ifndef CONFIG_SA1100_LART#error This is for LART architecture only#endifstatic char module_name[] = "lart";/* * These values is specific to 28Fxxxx3 flash memory. * See section 2.3.1 in "3 Volt Fast Boot Block Flash Memory" Intel Datasheet */#define FLASH_BLOCKSIZE_PARAM		(4096 * BUSWIDTH)#define FLASH_NUMBLOCKS_16m_PARAM	8#define FLASH_NUMBLOCKS_8m_PARAM	8/* * These values is specific to 28Fxxxx3 flash memory. * See section 2.3.2 in "3 Volt Fast Boot Block Flash Memory" Intel Datasheet */#define FLASH_BLOCKSIZE_MAIN		(32768 * BUSWIDTH)#define FLASH_NUMBLOCKS_16m_MAIN	31#define FLASH_NUMBLOCKS_8m_MAIN		15/* * These values are specific to LART *//* general */#define BUSWIDTH			4				/* don't change this - a lot of the code _will_ break if you change this */#define FLASH_OFFSET		0xe8000000		/* see linux/arch/arm/mach-sa1100/lart.c *//* blob */#define NUM_BLOB_BLOCKS		FLASH_NUMBLOCKS_16m_PARAM#define BLOB_START			0x00000000#define BLOB_LEN			(NUM_BLOB_BLOCKS * FLASH_BLOCKSIZE_PARAM)/* kernel */#define NUM_KERNEL_BLOCKS	7#define KERNEL_START		(BLOB_START + BLOB_LEN)#define KERNEL_LEN			(NUM_KERNEL_BLOCKS * FLASH_BLOCKSIZE_MAIN)/* initial ramdisk */#define NUM_INITRD_BLOCKS	24#define INITRD_START		(KERNEL_START + KERNEL_LEN)#define INITRD_LEN			(NUM_INITRD_BLOCKS * FLASH_BLOCKSIZE_MAIN)/* * See section 4.0 in "3 Volt Fast Boot Block Flash Memory" Intel Datasheet */#define READ_ARRAY			0x00FF00FF		/* Read Array/Reset */#define READ_ID_CODES		0x00900090		/* Read Identifier Codes */#define ERASE_SETUP			0x00200020		/* Block Erase */#define ERASE_CONFIRM		0x00D000D0		/* Block Erase and Program Resume */#define PGM_SETUP			0x00400040		/* Program */#define STATUS_READ			0x00700070		/* Read Status Register */#define STATUS_CLEAR		0x00500050		/* Clear Status Register */#define STATUS_BUSY			0x00800080		/* Write State Machine Status (WSMS) */#define STATUS_ERASE_ERR	0x00200020		/* Erase Status (ES) */#define STATUS_PGM_ERR		0x00100010		/* Program Status (PS) *//* * See section 4.2 in "3 Volt Fast Boot Block Flash Memory" Intel Datasheet */#define FLASH_MANUFACTURER			0x00890089#define FLASH_DEVICE_8mbit_TOP		0x88f188f1#define FLASH_DEVICE_8mbit_BOTTOM	0x88f288f2#define FLASH_DEVICE_16mbit_TOP		0x88f388f3#define FLASH_DEVICE_16mbit_BOTTOM	0x88f488f4/***************************************************************************************************//* * The data line mapping on LART is as follows: *  *   	 U2  CPU |   U3  CPU *   	 ------------------- *   	  0  20  |   0   12 *   	  1  22  |   1   14 *   	  2  19  |   2   11 *   	  3  17  |   3   9 *   	  4  24  |   4   0 *   	  5  26  |   5   2 *   	  6  31  |   6   7 *   	  7  29  |   7   5 *   	  8  21  |   8   13 *   	  9  23  |   9   15 *   	  10 18  |   10  10 *   	  11 16  |   11  8 *   	  12 25  |   12  1 *   	  13 27  |   13  3 *   	  14 30  |   14  6 *   	  15 28  |   15  4 *//* Mangle data (x) */#define DATA_TO_FLASH(x)				\	(									\		(((x) & 0x08009000) >> 11)	+	\		(((x) & 0x00002000) >> 10)	+	\		(((x) & 0x04004000) >> 8)	+	\		(((x) & 0x00000010) >> 4)	+	\		(((x) & 0x91000820) >> 3)	+	\		(((x) & 0x22080080) >> 2)	+	\		((x) & 0x40000400)			+	\		(((x) & 0x00040040) << 1)	+	\		(((x) & 0x00110000) << 4)	+	\		(((x) & 0x00220100) << 5)	+	\		(((x) & 0x00800208) << 6)	+	\		(((x) & 0x00400004) << 9)	+	\		(((x) & 0x00000001) << 12)	+	\		(((x) & 0x00000002) << 13)		\	)/* Unmangle data (x) */#define FLASH_TO_DATA(x)				\	(									\		(((x) & 0x00010012) << 11)	+	\		(((x) & 0x00000008) << 10)	+	\		(((x) & 0x00040040) << 8)	+	\		(((x) & 0x00000001) << 4)	+	\		(((x) & 0x12200104) << 3)	+	\		(((x) & 0x08820020) << 2)	+	\		((x) & 0x40000400)			+	\		(((x) & 0x00080080) >> 1)	+	\		(((x) & 0x01100000) >> 4)	+	\		(((x) & 0x04402000) >> 5)	+	\		(((x) & 0x20008200) >> 6)	+	\		(((x) & 0x80000800) >> 9)	+	\		(((x) & 0x00001000) >> 12)	+	\		(((x) & 0x00004000) >> 13)		\	)/*  * The address line mapping on LART is as follows: * *   	 U3  CPU |   U2  CPU *   	 ------------------- *   	  0  2   |   0   2 *   	  1  3   |   1   3 *   	  2  9   |   2   9 *   	  3  13  |   3   8 *   	  4  8   |   4   7 *   	  5  12  |   5   6 *   	  6  11  |   6   5 *   	  7  10  |   7   4 *   	  8  4   |   8   10 *   	  9  5   |   9   11 *   	 10  6   |   10  12 *   	 11  7   |   11  13 * *   	 BOOT BLOCK BOUNDARY * *   	 12  15  |   12  15 *   	 13  14  |   13  14 *   	 14  16  |   14  16 *  *   	 MAIN BLOCK BOUNDARY * *   	 15  17  |   15  18 *   	 16  18  |   16  17 *   	 17  20  |   17  20 *   	 18  19  |   18  19 *   	 19  21  |   19  21 * * As we can see from above, the addresses aren't mangled across * block boundaries, so we don't need to worry about address * translations except for sending/reading commands during * initialization *//* Mangle address (x) on chip U2 */#define ADDR_TO_FLASH_U2(x)				\	(									\		(((x) & 0x00000f00) >> 4)	+	\		(((x) & 0x00042000) << 1)	+	\		(((x) & 0x0009c003) << 2)	+	\		(((x) & 0x00021080) << 3)	+	\		(((x) & 0x00000010) << 4)	+	\		(((x) & 0x00000040) << 5)	+	\		(((x) & 0x00000024) << 7)	+	\		(((x) & 0x00000008) << 10)		\	)/* Unmangle address (x) on chip U2 */#define FLASH_U2_TO_ADDR(x)				\	(									\		(((x) << 4) & 0x00000f00)	+	\		(((x) >> 1) & 0x00042000)	+	\		(((x) >> 2) & 0x0009c003)	+	\		(((x) >> 3) & 0x00021080)	+	\		(((x) >> 4) & 0x00000010)	+	\		(((x) >> 5) & 0x00000040)	+	\		(((x) >> 7) & 0x00000024)	+	\		(((x) >> 10) & 0x00000008)		\	)/* Mangle address (x) on chip U3 */#define ADDR_TO_FLASH_U3(x)				\	(									\		(((x) & 0x00000080) >> 3)	+	\		(((x) & 0x00000040) >> 1)	+	\		(((x) & 0x00052020) << 1)	+	\		(((x) & 0x00084f03) << 2)	+	\		(((x) & 0x00029010) << 3)	+	\		(((x) & 0x00000008) << 5)	+	\		(((x) & 0x00000004) << 7)		\	)/* Unmangle address (x) on chip U3 */#define FLASH_U3_TO_ADDR(x)				\	(									\		(((x) << 3) & 0x00000080)	+	\		(((x) << 1) & 0x00000040)	+	\		(((x) >> 1) & 0x00052020)	+	\		(((x) >> 2) & 0x00084f03)	+	\		(((x) >> 3) & 0x00029010)	+	\		(((x) >> 5) & 0x00000008)	+	\		(((x) >> 7) & 0x00000004)		\	)/***************************************************************************************************/static __u8 read8 (__u32 offset){   volatile __u8 *data = (__u8 *) (FLASH_OFFSET + offset);#ifdef LART_DEBUG   printk (KERN_DEBUG "%s(): 0x%.8x -> 0x%.2x\n",__FUNCTION__,offset,*data);#endif   return (*data);}static __u32 read32 (__u32 offset){   volatile __u32 *data = (__u32 *) (FLASH_OFFSET + offset);#ifdef LART_DEBUG   printk (KERN_DEBUG "%s(): 0x%.8x -> 0x%.8x\n",__FUNCTION__,offset,*data);#endif   return (*data);}static void write32 (__u32 x,__u32 offset){   volatile __u32 *data = (__u32 *) (FLASH_OFFSET + offset);   *data = x;#ifdef LART_DEBUG   printk (KERN_DEBUG "%s(): 0x%.8x <- 0x%.8x\n",__FUNCTION__,offset,*data);#endif}/***************************************************************************************************//* * Probe for 16mbit flash memory on a LART board without doing * too much damage. Since we need to write 1 dword to memory, * we're f**cked if this happens to be DRAM since we can't * restore the memory (otherwise we might exit Read Array mode). * * Returns 1 if we found 16mbit flash memory on LART, 0 otherwise. */static int flash_probe (void){   __u32 manufacturer,devtype;   /* setup "Read Identifier Codes" mode */   write32 (DATA_TO_FLASH (READ_ID_CODES),0x00000000);   /* probe U2. U2/U3 returns the same data since the first 3	* address lines is mangled in the same way */   manufacturer = FLASH_TO_DATA (read32 (ADDR_TO_FLASH_U2 (0x00000000)));   devtype = FLASH_TO_DATA (read32 (ADDR_TO_FLASH_U2 (0x00000001)));   /* put the flash back into command mode */   write32 (DATA_TO_FLASH (READ_ARRAY),0x00000000);   return (manufacturer == FLASH_MANUFACTURER && (devtype == FLASH_DEVICE_16mbit_TOP || FLASH_DEVICE_16mbit_BOTTOM));}/* * Erase one block of flash memory at offset ``offset'' which is any * address within the block which should be erased. * * Returns 1 if successful, 0 otherwise. */static inline int erase_block (__u32 offset){   __u32 status;#ifdef LART_DEBUG   printk (KERN_DEBUG "%s(): 0x%.8x\n",__FUNCTION__,offset);#endif   /* erase and confirm */   write32 (DATA_TO_FLASH (ERASE_SETUP),offset);   write32 (DATA_TO_FLASH (ERASE_CONFIRM),offset);   /* wait for block erase to finish */   do	 {		write32 (DATA_TO_FLASH (STATUS_READ),offset);		status = FLASH_TO_DATA (read32 (offset));	 }   while ((~status & STATUS_BUSY) != 0);   /* put the flash back into command mode */   write32 (DATA_TO_FLASH (READ_ARRAY),offset);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
经典三级视频一区| 欧美电视剧免费全集观看| 欧美中文字幕一区二区三区| 欧美一级专区免费大片| 1000精品久久久久久久久| 久久爱www久久做| 91精品福利视频| 国产喂奶挤奶一区二区三区| 日韩影视精彩在线| 色综合色综合色综合色综合色综合| 欧美一区二区视频免费观看| 亚洲欧美日韩中文字幕一区二区三区 | 亚洲视频一区二区免费在线观看| 日本欧美一区二区| 欧美在线不卡一区| 亚洲欧洲精品天堂一级| 国产成人午夜电影网| 4438成人网| 亚洲一区二区精品3399| 91成人网在线| 一区二区三区91| 91视频观看免费| 亚洲啪啪综合av一区二区三区| 成人高清视频在线| 国产亲近乱来精品视频| 国产露脸91国语对白| 欧美成人猛片aaaaaaa| 日本vs亚洲vs韩国一区三区| 在线播放91灌醉迷j高跟美女 | 日本道免费精品一区二区三区| 久久精品亚洲一区二区三区浴池| 麻豆精品新av中文字幕| 欧美成人精品1314www| 久久精品久久久精品美女| 欧美一区二区三区在线观看 | 欧美日韩一级片网站| 亚洲精品成人天堂一二三| 91香蕉视频mp4| 亚洲嫩草精品久久| 欧美亚洲综合网| 亚洲大片一区二区三区| 91麻豆精品久久久久蜜臀| 奇米在线7777在线精品| 久久一日本道色综合| 国产精品一品二品| 中文字幕一区二区三区在线观看| 99免费精品在线观看| 亚洲视频综合在线| 欧美亚洲国产一区二区三区va | 亚洲男人电影天堂| 在线精品视频免费播放| 亚洲成av人片| 久久日一线二线三线suv| 福利一区在线观看| 亚洲三级电影网站| 欧美一区二区三区思思人| 国内外成人在线| 成人欧美一区二区三区| 欧美日韩一区中文字幕| 精品一区二区三区免费毛片爱| 国产午夜精品久久| 精品视频一区三区九区| 国内精品自线一区二区三区视频| 国产精品欧美久久久久无广告| 欧美亚洲禁片免费| 国产精品一区一区| 亚洲最色的网站| 久久理论电影网| 91国产视频在线观看| 久久se这里有精品| 亚洲免费观看高清| 精品福利视频一区二区三区| 91女神在线视频| 六月婷婷色综合| 亚洲精品少妇30p| 精品国产区一区| 欧美中文字幕久久| 国产一区二区三区日韩| 亚洲美女视频在线| 久久久久国产成人精品亚洲午夜| 在线视频观看一区| 国产福利不卡视频| 日韩成人一区二区三区在线观看| 中文字幕不卡在线| 欧美电影免费提供在线观看| 色婷婷综合久久| 国产盗摄精品一区二区三区在线 | 丝袜美腿高跟呻吟高潮一区| 国产色爱av资源综合区| 欧美老肥妇做.爰bbww| 99久久精品免费精品国产| 久久se这里有精品| 丝袜脚交一区二区| 亚洲成人免费在线| 亚洲免费观看高清完整版在线 | 欧美色综合网站| 99国内精品久久| 丰满岳乱妇一区二区三区| 精东粉嫩av免费一区二区三区| 午夜久久久影院| 一区二区三区四区乱视频| 国产精品免费久久| 久久精品在这里| 久久久久久久网| 精品国产区一区| 欧美一区二区三区四区视频| 欧美日韩激情一区二区| 欧美系列日韩一区| 91福利在线观看| 在线观看欧美黄色| 日本精品视频一区二区三区| jlzzjlzz欧美大全| 不卡的av网站| av网站免费线看精品| www.av精品| 99久久99久久精品国产片果冻| 成人免费av网站| 北条麻妃一区二区三区| 99久久久久久99| 91福利小视频| 91精品国产全国免费观看| 日韩一区二区三区在线观看| 日韩欧美国产综合| 亚洲精品一区在线观看| 久久久久一区二区三区四区| 国产视频一区在线观看| 中文字幕一区二区视频| 亚洲精品中文在线影院| 亚洲小少妇裸体bbw| 日韩综合一区二区| 奇米777欧美一区二区| 久久国产日韩欧美精品| 国产aⅴ综合色| 91亚洲精华国产精华精华液| 欧美吞精做爰啪啪高潮| 91精品国产91久久久久久一区二区 | 色噜噜狠狠成人中文综合 | 色婷婷久久一区二区三区麻豆| 欧美色综合天天久久综合精品| 欧美一区二区国产| 久久久www免费人成精品| 中文字幕一区二| 偷拍与自拍一区| 国产福利一区在线| 欧美亚洲高清一区| 久久久精品免费免费| 亚洲乱码中文字幕| 理论片日本一区| 91在线观看高清| 欧美成人在线直播| 亚洲欧美日韩国产中文在线| 全部av―极品视觉盛宴亚洲| 国产成人在线影院| 欧美日韩国产高清一区二区三区 | 这里只有精品电影| 欧美韩日一区二区三区四区| 亚洲一区二区三区爽爽爽爽爽| 极品少妇一区二区三区精品视频| 99国产精品久久久久| 91精品国产麻豆| 亚洲欧美日韩国产成人精品影院| 日本成人超碰在线观看| 91视频你懂的| 欧美精品一区二区在线观看| 亚洲日本va午夜在线影院| 久草在线在线精品观看| 在线观看视频91| 日本一区二区高清| 日本最新不卡在线| 色综合色综合色综合色综合色综合 | 日韩毛片在线免费观看| 九九精品一区二区| proumb性欧美在线观看| 久久精品一区四区| 麻豆一区二区99久久久久| 日本二三区不卡| 亚洲手机成人高清视频| 国产精品系列在线播放| 日韩片之四级片| 亚州成人在线电影| 色婷婷综合久久久久中文 | 99精品欧美一区二区三区小说 | 亚洲欧美一区二区久久| 五月激情六月综合| 一本久久综合亚洲鲁鲁五月天 | 久久99日本精品| 51精品久久久久久久蜜臀| 亚洲欧美一区二区久久| 9l国产精品久久久久麻豆| 欧美极品少妇xxxxⅹ高跟鞋 | 这里是久久伊人| 午夜精品aaa| 欧美三级日韩在线| 亚洲国产成人va在线观看天堂| 一本久久a久久免费精品不卡| 国产精品久久午夜夜伦鲁鲁| 国产精品综合网| 欧美成人video| 激情成人综合网| 日韩欧美国产系列|