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

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

?? flashpic.c

?? umon bootloader source code, support mips cpu.
?? C
字號:
/* flashpic.c:
   This file contains the flash-support code that is relocated to
   RAM prior to execution.  This file supports all bus widths, dependent
   on the definition of WIDTH8, WIDTH16, or WIDTH32 on the command line.
   Refer to flash.h for definition of the width-dependent macros.
*/

#include "cpu.h"
#include "flashdev.h"
#include "flash.h"
#include "config.h"
#include "stddefs.h"

#if INCLUDE_FLASH

/* Flasherase():
   Based on the 'snum' value, erase the appropriate sector(s).
   Return 0 if success, else -1.
*/
int
Flasherase(struct flashinfo *fdev,int snum)
{
	ftype	val;
	ulong	add;
	int	ret, sector;

	ret = 0;
	add = (ulong)(fdev->base);

	/* Erase the request sector(s): */
	for (sector=0;sector<fdev->sectorcnt;sector++) {
		if ((!FlashProtectWindow) &&
		    (fdev->sectors[sector].protected)) {
			add += fdev->sectors[sector].size;
			continue;
		}
		if ((snum == ALL_SECTORS) || (snum == sector)) {
			/* Issue the sector erase command sequence: */
			Write_aa_to_aaa();
			Write_55_to_555();
			Write_80_to_aaa();
			Write_aa_to_aaa();
			Write_55_to_555();
			Write_30_to_(add);
	
			/* Wait for sector erase to complete or timeout.. */
			/* DQ7 polling: wait for D7 to be 1. */
			/* DQ6 toggling: wait for D6 to not toggle. */
			/* DQ5 timeout: if DQ7 is 0, and DQ5 = 1, timeout. */
			while(1) {
				if (Is_ff(add)) {
					if (Is_ff(add))
						break;
				}
				if (D5_Timeout(add)) {
					if (Is_not_ff(add))
						ret = -1;
					break;
				}
			}
		}
		add += fdev->sectors[sector].size;
	}

	/* If the erase failed for some reason, then issue the read/reset */
	/* command sequence prior to returning... */
	if (ret == -1) {
		Write_f0_to_base();
		val = Read_555();
	}
	return(ret);
}

/* EndFlasherase():
   Function place holder to determine the "end" of the
   sectorerase() function.
*/
void
EndFlasherase()
{}


/* Flashwrite():
   Return 0 if successful, else -1.
   Note: this assumes that source & destination properly aligned
   based on the width of the flash bank.
*/
int
Flashwrite(struct flashinfo *fdev,ftype *dest,ftype *src,long bytecnt)
{
	int	i, ret;
	ftype	val;

	/* Each pass through this loop writes 'fdev->width' bytes... */
	ret = 0;
	for (i=0;i<bytecnt;i+=fdev->width) {

		/* Flash write command */
		Write_aa_to_aaa();
		Write_55_to_555();
		Write_a0_to_aaa();

		/* Write the value */
		Fwrite(dest,src);

		/* Wait for write to complete or timeout. */
		while(1) {
			if (Is_Equal(dest,src)) {
				if (Is_Equal(dest,src))
					break;
			}
			/* Check D5 for timeout... */
			if (D5_Timeout(dest)) {
				if (Is_Not_Equal(dest,src))
					ret = -1;
				goto done;
			}
		}
		dest++; src++;
	}

done:
	/* Read/reset command: */
	Write_f0_to_base();
	val = Read_555();
	return(ret);
}

/* EndFlashwrite():
	Function place holder to determine the "end" of the
	Flashwrite() function.
*/
void
EndFlashwrite()
{}

/* Ewrite():
   Erase all sectors that are part of the address space to be written,
   then write the data to that address space.  This is basically a
   concatenation of flasherase and flashwrite done in one step.  This is
   necessary primarily for re-writing the bootcode; because after the boot
   code is erased, there is nowhere to return so the re-write must be done
   while executing out of ram also.
*/

int
Flashewrite(struct flashinfo *fdev,ftype *dest,ftype *src,int bytecnt)
{
	int	i;
	ulong	add;
	void	(*reset)();
	ftype	val, *src1, *dest1;

	add = (ulong)(fdev->base);
	src1 = src;
	dest1 = dest;

	/* For each sector, if it overlaps any of the destination space */
	/* then erase that sector. */
	for (i=0;i<fdev->sectorcnt;i++) {
		if ((((uchar *)dest) > (fdev->sectors[i].end)) ||
		    (((uchar *)dest+bytecnt-1) < (fdev->sectors[i].begin))) {
			add += fdev->sectors[i].size;
			continue;
		}

		/* Sector erase command: */
		Write_aa_to_aaa();
		Write_55_to_555();
		Write_80_to_aaa();
		Write_aa_to_aaa();
		Write_55_to_555();
		Write_30_to_(add);
	
		/* Wait for sector erase to complete or timeout.. */
		/* DQ7 polling: wait for D7 to be 1. */
		/* DQ6 toggling: wait for D6 to not toggle. */
		/* DQ5 timeout: if DQ7 is 0, and DQ5 = 1, timeout. */
		while(1) {
			if (Is_ff(add)) {
				if (Is_ff(add))
					break;
			}
			/* Check D5 for timeout... */
			/* In this case, there is nothing to return to */
			/* because the flash was just erased, so just break.*/
			if (D5_Timeout(add)) {
				goto quit;
			}
		}
		add += fdev->sectors[i].size;
	}

	/* Read/reset command: */
	Write_f0_to_base();
	val = Read_555();

	for(i=0;i<bytecnt;i+=fdev->width) {
		/* Write command: */
		Write_aa_to_aaa();
		Write_55_to_555();
		Write_a0_to_aaa();
		Fwrite(dest,src);

		while(1) {
			if (Is_Equal(dest,src)) {
				if (Is_Equal(dest,src))
					break;
			}
			/* Check D5 for timeout... */
			if (D5_Timeout(dest)) {
				if (Is_Not_Equal(dest,src))
					goto quit;
				continue;
			}
		}

		dest++; src++;
	}

quit:
	/* Issue the read/reset command sequence: */
	Write_f0_to_base();
	val = Read_555();

	/* Wait till flash is readable, or timeout: */
	for(i=0;i<FLASH_TIMEOUT;i++) {
		if (Is_Equal(dest1,src1))
			break;
	}

	/* Now that the re-programming of flash is complete, reset: */
	reset = RESETFUNC();
	reset();

	return(0);	/* won't get here */
}

/* EndFlashewrite():
	Function place holder to determine the "end" of the
	FlashEraseAndWrite() function.
*/
void
EndFlashewrite()
{}


/* Flashtype():
   Use the AUTOSELECT command sequence to determine the type of device.
   Note: there is one additional step that I found necessary to keep
   SGS29040 device happy... For some reason after issuing the read/reset
   command and returning (to code that actually executes out of the FLASH
   device) I was consistently getting an illegal opcode exception at
   the return location in the flash.  It appears that the SGS part needs
   a bit of time after the read/reset to be able to fetch an instruction.
   Reading a value in the flash (stored in val) prior to issuing the
   command sequence, then waiting for that read to be the same after 
   issuing the read/reset, assures the algorithm of not returning unless
   the flash device is readable.  Note that I found this ONLY to be necessary
   for the signature read command of SGS flash.
*/

int
Flashtype(struct flashinfo *fdev)
{
	ushort	man, dev;

	/* Issue the autoselect command sequence: */
	Write_aa_to_aaa();
	Write_55_to_555();
	Write_90_to_aaa();
	
	man = (ushort)Read_0000();	/* manufacturer ID */
	dev = (ushort)Read_0002();	/* device ID */
	man &= 0xff;
	dev &= 0xff;
	man <<=8;
	dev |= man;

	fdev->id = (ushort)dev;

	/* Issue the read/reset command sequence: */
	Write_f0_to_base();

	return((int)(fdev->id));
}

/* EndFlashtype():
	Function place holder to determine the "end" of the
	Flashtype() function.
*/
void
EndFlashtype()
{}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区二区成人精品| 91极品视觉盛宴| 欧美伊人久久久久久久久影院| 制服丝袜日韩国产| 国产精品美女久久久久久久网站| 日韩成人一级大片| 99久久精品免费| 久久久国产精品麻豆| 男人的j进女人的j一区| 91福利在线看| 中文字幕在线免费不卡| 国产福利一区二区三区视频在线| 91精品国产品国语在线不卡| 一区二区三区精品在线| 9色porny自拍视频一区二区| 精品处破学生在线二十三| 日韩精品福利网| 欧美色成人综合| 夜夜亚洲天天久久| 99精品黄色片免费大全| 国产精品午夜免费| 国产成人精品午夜视频免费| 精品久久久影院| 男女性色大片免费观看一区二区| 欧美午夜免费电影| 亚洲精品视频在线看| 色诱亚洲精品久久久久久| 最新中文字幕一区二区三区| 国产69精品久久久久毛片| 国产拍欧美日韩视频二区 | 中文字幕一区二区在线观看| 国产一区二区三区久久悠悠色av| 日韩精品一区二区三区视频 | 亚洲精品国产一区二区精华液| 风间由美一区二区三区在线观看| 久久久精品tv| 99在线视频精品| 亚洲天堂av一区| 在线观看国产精品网站| 国产一区高清在线| 国产香蕉久久精品综合网| 豆国产96在线|亚洲| 亚洲欧洲精品成人久久奇米网| 91亚洲精品一区二区乱码| 亚洲欧美激情插| 欧美日韩国产综合久久| 日本视频一区二区| 国产女同性恋一区二区| a亚洲天堂av| 亚洲国产日韩在线一区模特| 欧美人与z0zoxxxx视频| 麻豆精品视频在线观看视频| 久久综合九色综合欧美亚洲| av在线这里只有精品| 亚洲精品日产精品乱码不卡| 欧美精品色综合| 国产精品一二三四五| 亚洲人精品午夜| 日韩女优av电影在线观看| 成人福利电影精品一区二区在线观看| 亚洲欧洲日韩综合一区二区| 欧美日韩精品欧美日韩精品一 | 精品日本一线二线三线不卡| 国产精品伊人色| 亚洲综合免费观看高清完整版在线| 欧美日韩成人激情| 不卡的av电影| 日本vs亚洲vs韩国一区三区| 中文字幕欧美三区| 欧美精品久久久久久久久老牛影院| 国产一区二区三区在线看麻豆| 椎名由奈av一区二区三区| 欧美日韩你懂得| 丁香另类激情小说| 日本人妖一区二区| 亚洲人快播电影网| 久久久久久久综合| 91精品国产色综合久久不卡蜜臀 | 亚洲理论在线观看| 精品免费国产二区三区| 色综合久久久久网| 国产成人av影院| 日韩和的一区二区| 亚洲欧美韩国综合色| 国产三级一区二区| 欧美一区二区三区在线| 在线亚洲免费视频| 国产成人亚洲精品青草天美| 97se亚洲国产综合自在线| 激情文学综合网| 午夜精品成人在线| 亚洲三级在线播放| 国产精品色呦呦| 欧美精品一区二区三区四区| 欧美精品第一页| 欧美主播一区二区三区美女| av不卡在线播放| 成人一区二区三区在线观看| 极品少妇xxxx精品少妇| 欧美bbbbb| 日本怡春院一区二区| 亚洲成av人片观看| 艳妇臀荡乳欲伦亚洲一区| 国产精品三级久久久久三级| 久久久久88色偷偷免费| 日韩欧美国产精品| 日韩美女一区二区三区四区| 日韩欧美国产三级| 欧美一区二区三区人| 欧美日韩一区小说| 欧美日本一道本在线视频| 精品视频1区2区3区| 色婷婷久久一区二区三区麻豆| 国产米奇在线777精品观看| 狠狠色丁香婷婷综合| 久久99在线观看| 国产一区二区三区久久久| 国产一区二区三区精品视频| 国产ts人妖一区二区| 国产精品亚洲视频| 国产精品一区二区在线观看网站| 国产一区二区精品在线观看| 国产一区二区三区最好精华液| 国产一区二区三区四区五区入口 | 97久久超碰精品国产| 日本韩国欧美三级| 国产欧美一区二区三区网站 | 亚洲国产精品ⅴa在线观看| 国产三级精品三级在线专区| 国产亚洲一区二区三区在线观看| 国产日韩欧美激情| 亚洲欧美日本韩国| 亚洲午夜视频在线观看| 老司机精品视频导航| 国产91精品一区二区麻豆亚洲| 成人av在线电影| 欧美日韩中文一区| 精品国产乱码久久| 国产精品三级视频| 午夜激情综合网| 国产成人自拍在线| 欧美日韩在线免费视频| 精品裸体舞一区二区三区| 中文字幕一区二| 手机精品视频在线观看| 国产老妇另类xxxxx| 99久久精品国产一区二区三区| 欧美日韩国产天堂| 国产日韩欧美电影| 亚洲777理论| 成人网在线播放| 欧美一区二区三区思思人| 国产精品短视频| 久久成人综合网| 成人ar影院免费观看视频| 欧美一区二区日韩一区二区| 国产精品久久久久桃色tv| 日韩av电影天堂| 色爱区综合激月婷婷| 精品国产精品网麻豆系列 | 欧美性猛交xxxx乱大交退制版| 日韩欧美国产1| 一区二区三区在线视频观看 | 91搞黄在线观看| 久久久91精品国产一区二区三区| 国产精品影视在线| 69堂成人精品免费视频| 中文字幕五月欧美| 国产自产v一区二区三区c| 欧美色网站导航| 成人欧美一区二区三区| 韩国精品一区二区| 欧美顶级少妇做爰| 一区二区三区 在线观看视频| 国产精品一二三区| 精品少妇一区二区三区日产乱码 | 日韩欧美国产三级| 亚洲va韩国va欧美va| 日本韩国精品在线| 中文字幕永久在线不卡| 国产91富婆露脸刺激对白 | 91麻豆精品久久久久蜜臀| |精品福利一区二区三区| 国产成人精品免费一区二区| 欧美大片国产精品| 蜜臀av一区二区| 51精品视频一区二区三区| 亚洲高清免费观看高清完整版在线观看 | 亚洲精品亚洲人成人网| 成人激情免费视频| 国产精品女人毛片| 成人做爰69片免费看网站| 久久久不卡网国产精品二区| 国产美女一区二区三区| 精品久久一区二区三区| 九色|91porny| 久久一夜天堂av一区二区三区| 久久99精品久久久久久久久久久久 | 国产日韩综合av| 粉嫩一区二区三区性色av|