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

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

?? flash.c

?? Universal Bootloader which support OMAP2420.
?? C
字號:
/* * (C) Copyright 2001, 2002 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * Flash Routines for Intel devices * *-------------------------------------------------------------------- * See file CREDITS for list of people who contributed to this * project. * * 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 <common.h>#include <mpc8xx.h>flash_info_t flash_info[CFG_MAX_FLASH_BANKS];/*----------------------------------------------------------------------- */ulong flash_get_size (volatile unsigned long *baseaddr,					  flash_info_t * info){	short i;	unsigned long flashtest_h, flashtest_l;	info->sector_count = info->size = 0;	info->flash_id = FLASH_UNKNOWN;	/* Write query command sequence and test FLASH answer	 */	baseaddr[0] = 0x00980098;	baseaddr[1] = 0x00980098;	flashtest_h = baseaddr[0];	/* manufacturer ID	*/	flashtest_l = baseaddr[1];	if (flashtest_h != INTEL_MANUFACT || flashtest_l != INTEL_MANUFACT)		return (0);		/* no or unknown flash	*/	flashtest_h = baseaddr[2];	/* device ID	        */	flashtest_l = baseaddr[3];	if (flashtest_h != flashtest_l)		return (0);	switch (flashtest_h) {	case INTEL_ID_28F160C3B:		info->flash_id = FLASH_28F160C3B;		info->sector_count = 39;		info->size = 0x00800000;	/* 4 * 2 MB = 8 MB	*/		break;	case INTEL_ID_28F160F3B:		info->flash_id = FLASH_28F160F3B;		info->sector_count = 39;		info->size = 0x00800000;	/* 4 * 2 MB = 8 MB      */		break;	case INTEL_ID_28F640C3B:		info->flash_id = FLASH_28F640C3B;		info->sector_count = 135;		info->size = 0x02000000;	/* 16 * 2 MB = 32 MB	*/		break;	default:		return (0);			/* no or unknown flash	*/	}	info->flash_id |= INTEL_MANUFACT << 16; /* set manufacturer offset */	if (info->flash_id & FLASH_BTYPE) {		volatile unsigned long *tmp = baseaddr;		/* set up sector start adress table (bottom sector type)		 * AND unlock the sectors (if our chip is 160C3 or 640C3)		 */		for (i = 0; i < info->sector_count; i++) {			if (((info->flash_id & FLASH_TYPEMASK) == FLASH_28F160C3B) ||			    ((info->flash_id & FLASH_TYPEMASK) == FLASH_28F640C3B)) {				tmp[0] = 0x00600060;				tmp[1] = 0x00600060;				tmp[0] = 0x00D000D0;				tmp[1] = 0x00D000D0;			}			info->start[i] = (uint) tmp;			tmp += i < 8 ? 0x2000 : 0x10000; /* pointer arith       */		}	}	memset (info->protect, 0, info->sector_count);	baseaddr[0] = 0x00FF00FF;	baseaddr[1] = 0x00FF00FF;	return (info->size);}/*----------------------------------------------------------------------- */unsigned long flash_init (void){	unsigned long size_b0 = 0;	int i;	/* Init: no FLASHes known	 */	for (i = 0; i < CFG_MAX_FLASH_BANKS; ++i) {		flash_info[i].flash_id = FLASH_UNKNOWN;	}	/* Static FLASH Bank configuration here (only one bank) */	size_b0 = flash_get_size ((ulong *) CFG_FLASH0_BASE, &flash_info[0]);	if (flash_info[0].flash_id == FLASH_UNKNOWN || size_b0 == 0) {		printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",				size_b0, size_b0 >> 20);	}	/* protect monitor and environment sectors	 */#ifndef CONFIG_BOOT_ROM	/* If U-Boot is  booted from ROM the CFG_MONITOR_BASE > CFG_FLASH0_BASE	 * but we shouldn't protect it.	 */# if CFG_MONITOR_BASE >= CFG_FLASH0_BASE	flash_protect (FLAG_PROTECT_SET,		       CFG_MONITOR_BASE,		       CFG_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]	);# endif#endif	/* CONFIG_BOOT_ROM */#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)# ifndef  CFG_ENV_SIZE#  define CFG_ENV_SIZE	CFG_ENV_SECT_SIZE# endif	flash_protect (FLAG_PROTECT_SET,		       CFG_ENV_ADDR,		       CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);#endif	return (size_b0);}/*----------------------------------------------------------------------- */void flash_print_info (flash_info_t * info){	int i;	if (info->flash_id == FLASH_UNKNOWN) {		printf ("missing or unknown FLASH type\n");		return;	}	switch ((info->flash_id >> 16) & 0xff) {	case 0x89:		printf ("INTEL ");		break;	default:		printf ("Unknown Vendor ");		break;	}	switch (info->flash_id & FLASH_TYPEMASK) {	case FLASH_28F160C3B:		printf ("28F160C3B (16 M, bottom sector)\n");		break;	case FLASH_28F160F3B:		printf ("28F160F3B (16 M, bottom sector)\n");		break;	case FLASH_28F640C3B:		printf ("28F640C3B (64 M, bottom sector)\n");		break;	default:		printf ("Unknown Chip Type\n");		break;	}	printf ("  Size: %ld MB in %d Sectors\n",			info->size >> 20, info->sector_count);	printf ("  Sector Start Addresses:");	for (i = 0; i < info->sector_count; ++i) {		if ((i % 5) == 0)			printf ("\n   ");		printf (" %08lX%s",			info->start[i],			info->protect[i] ? " (RO)" : "     "		);	}	printf ("\n");}/*----------------------------------------------------------------------- */int flash_erase (flash_info_t * info, int s_first, int s_last){	int flag, prot, sect;	ulong start, now, last;	if ((s_first < 0) || (s_first > s_last)) {		if (info->flash_id == FLASH_UNKNOWN) {			printf ("- missing\n");		} else {			printf ("- no sectors to erase\n");		}		return 1;	}	prot = 0;	for (sect = s_first; sect <= s_last; sect++) {		if (info->protect[sect])			prot++;	}	if (prot) {		printf ("- Warning: %d protected sectors will not be erased!\n",				prot);	} else {		printf ("\n");	}	/* Start erase on unprotected sectors	 */	for (sect = s_first; sect <= s_last; sect++) {		volatile ulong *addr =				(volatile unsigned long *) info->start[sect];		start = get_timer (0);		last = start;		if (info->protect[sect] == 0) {			/* Disable interrupts which might cause a timeout here			 */			flag = disable_interrupts ();			/* Erase the block			 */			addr[0] = 0x00200020;			addr[1] = 0x00200020;			addr[0] = 0x00D000D0;			addr[1] = 0x00D000D0;			/* re-enable interrupts if necessary			 */			if (flag)				enable_interrupts ();			/* wait at least 80us - let's wait 1 ms			 */			udelay (1000);			last = start;			while ((addr[0] & 0x00800080) != 0x00800080 ||				   (addr[1] & 0x00800080) != 0x00800080) {				if ((now = get_timer (start)) > CFG_FLASH_ERASE_TOUT) {					printf ("Timeout (erase suspended!)\n");					/* Suspend erase					 */					addr[0] = 0x00B000B0;					addr[1] = 0x00B000B0;					goto DONE;				}				/* show that we're waiting				 */				if ((now - last) > 1000) {	/* every second */					serial_putc ('.');					last = now;				}			}			if (addr[0] & 0x00220022 || addr[1] & 0x00220022) {				printf ("*** ERROR: erase failed!\n");				goto DONE;			}		}		/* Clear status register and reset to read mode		 */		addr[0] = 0x00500050;		addr[1] = 0x00500050;		addr[0] = 0x00FF00FF;		addr[1] = 0x00FF00FF;	}	printf (" done\n");DONE:	return 0;}static int write_word (flash_info_t *, volatile unsigned long *, ulong);/*----------------------------------------------------------------------- * Copy memory to flash, returns: * 0 - OK * 1 - write timeout * 2 - Flash not erased */int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt){	ulong v;	int i, l, cc = cnt, res = 0;	for (v=0; cc > 0; addr += 4, cc -= 4 - l) {		l = (addr & 3);		addr &= ~3;		for (i = 0; i < 4; i++) {			v = (v << 8) + (i < l || i - l >= cc ?				*((unsigned char *) addr + i) : *src++);		}		if ((res = write_word (info, (volatile unsigned long *) addr, v)) != 0)			break;	}	return (res);}/*----------------------------------------------------------------------- * Write a word to Flash, returns: * 0 - OK * 1 - write timeout * 2 - Flash not erased */static int write_word (flash_info_t * info, volatile unsigned long *addr,					   ulong data){	int flag, res = 0;	ulong start;	/* Check if Flash is (sufficiently) erased	 */	if ((*addr & data) != data)		return (2);	/* Disable interrupts which might cause a timeout here	 */	flag = disable_interrupts ();	*addr = 0x00400040;	*addr = data;	/* re-enable interrupts if necessary	 */	if (flag)		enable_interrupts ();	start = get_timer (0);	while ((*addr & 0x00800080) != 0x00800080) {		if (get_timer (start) > CFG_FLASH_WRITE_TOUT) {			/* Suspend program			 */			*addr = 0x00B000B0;			res = 1;			goto OUT;		}	}	if (*addr & 0x00220022) {		printf ("*** ERROR: program failed!\n");		res = 1;	}OUT:	/* Clear status register and reset to read mode	 */	*addr = 0x00500050;	*addr = 0x00FF00FF;	return (res);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品男人天堂av| 色综合av在线| 日韩精品1区2区3区| 一区二区三区在线观看视频| 天天做天天摸天天爽国产一区| 国内偷窥港台综合视频在线播放| 欧美高清视频不卡网| 久久国产生活片100| 亚洲国产精品欧美一二99| 日日夜夜一区二区| 成人激情校园春色| 日本不卡视频一二三区| 精品国产一区二区三区av性色 | 亚洲另类在线一区| 色婷婷亚洲精品| www.亚洲色图.com| 欧美三级韩国三级日本三斤| 欧美精品自拍偷拍动漫精品| 亚洲欧洲日本在线| 国产在线精品视频| 国产日韩精品一区二区浪潮av| 亚洲第一成人在线| 蜜桃av一区二区三区| 亚洲第四色夜色| 久久国产尿小便嘘嘘| 成人免费视频视频在线观看免费| 日本国产一区二区| 欧美一个色资源| 国产精品国模大尺度视频| 一区二区三区视频在线观看| 久久精品国产亚洲aⅴ| 丁香婷婷综合五月| 欧美日韩一区国产| 中文字幕乱码一区二区免费| 亚洲午夜久久久久中文字幕久| 免费精品视频在线| 经典一区二区三区| 色噜噜狠狠成人中文综合| 久久精品亚洲国产奇米99| 亚洲欧美激情一区二区| 久久精品国产亚洲a| 日本韩国视频一区二区| 欧美sm极限捆绑bd| 亚洲一二三四在线| 成人高清免费在线播放| 欧美成人免费网站| 一区二区三区**美女毛片| 国产剧情一区在线| 欧美视频日韩视频| 中文字幕不卡在线播放| 国产一区在线不卡| 精品国产区一区| 国产成人午夜99999| 亚洲综合免费观看高清完整版在线 | 亚洲电影你懂得| 国产精品丝袜久久久久久app| 欧美aaaaa成人免费观看视频| 精品少妇一区二区三区视频免付费| 国产成人av一区| 国产精品入口麻豆九色| 欧美视频一区二区| 狠狠色丁香婷婷综合| 国产精品久久久久久久久图文区 | 久久精品国产亚洲一区二区三区| 国产三级精品三级| 欧美日韩一区二区三区在线| 精久久久久久久久久久| 亚洲欧美精品午睡沙发| 欧美tk—视频vk| 91蝌蚪porny九色| 精品一区二区三区免费播放| 亚洲欧洲另类国产综合| 日韩欧美中文字幕制服| 91麻豆swag| 国产老妇另类xxxxx| 亚洲成人一二三| 免费观看一级特黄欧美大片| 中文字幕一区av| 日韩欧美在线1卡| 日本高清不卡aⅴ免费网站| 久久66热re国产| 亚洲五码中文字幕| 综合激情成人伊人| 日韩欧美一区二区久久婷婷| 欧美影院精品一区| 成人丝袜高跟foot| 国内偷窥港台综合视频在线播放| 亚洲综合免费观看高清完整版| 国产网红主播福利一区二区| 欧美疯狂性受xxxxx喷水图片| 久久青草国产手机看片福利盒子| 欧美视频精品在线| 99精品在线观看视频| 国产精品一区二区x88av| 男女视频一区二区| 午夜精品久久久久久久久久久| 亚洲日本乱码在线观看| 中文字幕乱码亚洲精品一区| 久久综合九色综合欧美就去吻 | 国产精品三级视频| 久久人人97超碰com| 精品理论电影在线观看| 中文字幕一区二区三区乱码在线 | 日韩三级在线观看| 777奇米四色成人影色区| 在线观看国产一区二区| 色一情一乱一乱一91av| 成人妖精视频yjsp地址| 成人美女在线观看| 成人国产在线观看| 不卡视频在线观看| 97久久超碰国产精品| av电影在线观看完整版一区二区| 成人综合婷婷国产精品久久蜜臀| 国产精品一区二区在线观看网站| 精品一区二区三区免费播放| 国产剧情一区在线| 亚洲国产精品一区二区久久| 一区二区三区精品在线观看| 国产老肥熟一区二区三区| 国产呦萝稀缺另类资源| 国产中文字幕一区| 懂色一区二区三区免费观看| 99久久伊人久久99| 在线观看中文字幕不卡| 69堂成人精品免费视频| 日韩欧美一级片| 欧美国产亚洲另类动漫| 亚洲激情中文1区| 日本最新不卡在线| 黑人精品欧美一区二区蜜桃| 国产高清精品久久久久| jlzzjlzz亚洲女人18| 欧美天堂亚洲电影院在线播放| 91精品婷婷国产综合久久性色 | 日韩高清不卡一区| 狠狠色丁香婷综合久久| 成人亚洲一区二区一| 在线观看av一区| 欧美不卡视频一区| 国产精品视频一二三| 亚洲午夜一区二区| 狠狠色综合日日| 一本大道久久a久久综合婷婷| 91精品国产品国语在线不卡| 26uuu色噜噜精品一区| 亚洲欧洲日韩在线| 97精品国产97久久久久久久久久久久| 欧美在线免费视屏| 久久综合久久综合久久| 亚洲激情六月丁香| 国产一区二区看久久| 欧美午夜片在线观看| 久久精品视频免费| 无码av免费一区二区三区试看| 国产精品一二三| 7777精品伊人久久久大香线蕉超级流畅 | 精品视频123区在线观看| 日韩欧美电影一二三| 亚洲乱码精品一二三四区日韩在线| 日日夜夜免费精品| av动漫一区二区| 亚洲精品一区二区三区精华液 | 一区二区三区欧美| 极品美女销魂一区二区三区免费| 一本到不卡免费一区二区| 久久综合狠狠综合久久综合88| 亚洲黄色免费电影| 成人激情小说乱人伦| 精品国产乱码久久久久久影片| 亚洲永久精品大片| 波多野洁衣一区| 久久久三级国产网站| 欧美精品一区二区三区蜜桃| 国产精品美女久久福利网站 | 中文字幕字幕中文在线中不卡视频| 亚洲一区二区三区精品在线| 粉嫩aⅴ一区二区三区四区| 日韩精品在线一区二区| 亚洲国产精品欧美一二99| 91日韩精品一区| 欧美国产精品中文字幕| 国产一区二区三区免费播放| 欧美高清精品3d| 偷拍一区二区三区四区| 欧美亚洲国产一区二区三区va| 欧美精彩视频一区二区三区| 中文子幕无线码一区tr| 欧美午夜视频网站| 午夜精品成人在线视频| 精品奇米国产一区二区三区| 欧美人成免费网站| 国产精品一级在线| 经典三级一区二区| 成人动漫av在线| 韩国成人在线视频| 91视视频在线观看入口直接观看www| 欧美日韩你懂得| 粉嫩蜜臀av国产精品网站| 欧美国产精品一区二区三区|