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

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

?? s29gl128m90.c

?? umon bootloader source code, support mips cpu.
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
**************************************************************************************
*                            Copyright (c) 2005 vBridge Microsystem, Inc.  
*                                  Unpublished & Not for Publication
*                                        All Rights Reserved                   
*   
* File        : 28F640J3.c                     
*                                                                         
* Description : 
*             
* Date        :                                                            
**************************************************************************************
*/
#include "config.h"

#ifdef INCLUDE_NOR_FLASH_S29GL128M90
#ifdef INCLUDE_FLASH


#include "pif.h"
#include "S29GL128M90.h"
#include "flash.h"
#include "Def_type.h"

#define INTEL_DT28F128J5		0x00890018
#define INTEL_28F640			0x00890017
#define INTEL_DT28F640J5		0x00890015
#define ST_M58LW064D		0x00200017
#define ST_M25P64			0x00172020
#define S29GL128M90			0x0001227e

typedef unsigned char uchar;
extern char *boot_device_name;


/*
**************************************************************************************
*                                       NorFlashPifInit
*
* Description: initialize the PCMCIA interface
*
* Arguments  : devID     controls which PCMCIA device to access. 
*                                  0 – CS0
*                                  1 – CS1
*                                  2 – CS2
*                                  3 – CS3
*                            For Virtex-4, devID = 0.
*
* Return     : none
*
* Note(s)    : Before any Nor flash operations, you should call it at first.
**************************************************************************************
*/
/*4> word 0xa80a0000
0x04000000
5> word 0xa80a0010
0x890F0FFF
6>*/ 
void NorFlashPifInit(void)
{
    unsigned int tmp;
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    
    PifTimingRegSet(0xf /* setup */, 0xf /* hold */, 0xf /* interval */, \
                    0xf /* wait_cycle */, PIF_NO_WAIT /* ioack_wait */, \
                    PCMCIA_WIDTH_16BIT /* pcmcia_width */, PCMCIA_NO_CHECK /* wait */, \
                    PCMCIA_INSERT_IDLE /* swait */, PIF_CS0 /* devID */, \
                    PIF_OE /* xfr_type */);
    
    PIF_INTR_DIS();       // Disable the PIF interrupts
    PIF_DONE_CLEAR();     // Clear the bit done
    
    tmp = *(unsigned int *)0xa80a001c;
    tmp &= 0x7fffffff;
    *(unsigned int *)0xa80a001c = tmp;
	*(volatile unsigned *)(0xa8010020) =0x80000004;
}

/*
*********************************************************************************************
*                                       NorFlashErase
*
* Description: erase one specified block.
*
* Arguments  : block_no     is the block number. 
*
* Return     : SUCCESSFUL  shows the erasure is successful.
*              FAILED      shows the erasure is failed.
*
* Note(s)    : 
*********************************************************************************************
*/
int NorFlashErase(int block_no)
{
    short status;
    	
#if 0
    /* the first cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = block_no * NOR_FLASH_BYTES_PER_SECTOR;    // the byte address
    PIF_START();
    rPIF_PCMCIA_DATA = NOR_FLASH_ERASE_BLOCK1;
    
    PifWaitTillDone();         // Wait till the first cycle complete
    
    /* the second cycle of block erase */	
    PIF_START();
    rPIF_PCMCIA_DATA = NOR_FLASH_ERASE_BLOCK2;
    
    PifWaitTillDone();         // Wait till the second cycle complete
#endif    

    /* the first cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0xaaa;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = 0xaa;
    PifWaitTillDone();         // Wait till the first cycle complete

    /* the second cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0x554;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = 0x55;
    PifWaitTillDone();         // Wait till the first cycle complete
    
    /* the third cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0xaaa;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = 0x80;
    PifWaitTillDone();         // Wait till the first cycle complete

    /* the fourth cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0xaaa;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = 0xaa;
    PifWaitTillDone();         // Wait till the first cycle complete

    /* the fifth cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0x554;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = 0x55;
    PifWaitTillDone();         // Wait till the first cycle complete

    /* the sixth cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    //rPIF_PCI_DEV_A = block_no * NOR_FLASH_BYTES_PER_SECTOR ;    // the byte address
    rPIF_PCI_DEV_A = block_no * NOR_FLASH_BYTES_PER_SECTOR * 2;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = 0x30;
    PifWaitTillDone();         // Wait till the first cycle complete


    status = 0x0;
    while(!(status & 0x80)) {     // Flash is busy?
        NorFlashRd(rPIF_PCI_DEV_A, &status, 1);
    }
   // printf("Erase OK Status %d  !\r\n", status);    	    
	
    //if(status & 0x20)             // Whether the SR4 or SR5 is set
    //    return FAILED;
    return SUCCESSFUL;
}

/*
*********************************************************************************************
*                                       NorFlashProg
*
* Description: program a half-word into the specified address
*
* Arguments  : addr     is the byte address. 
*              data     is the half-word to be programmed.
*
* Return     : SUCCESSFUL  shows the erasure is successful.
*              FAILED      shows the erasure is failed.
*
* Note(s)    : 
*********************************************************************************************
*/
int NorFlashProg(int addr, short data)
{
    short status;

    addr = addr * 1;

    /* the first cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0xaaa;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = 0xaa;
    PifWaitTillDone();         // Wait till the first cycle complete

    /* the second cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0x554;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = 0x55;
    PifWaitTillDone();         // Wait till the first cycle complete
    
    /* the third cycle */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0xaaa;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = NOR_FLASH_PROG_WORD;
    PifWaitTillDone();         // Wait till the first cycle complete
    
    /* the fourth cycle */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = addr;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = data;
    PifWaitTillDone();         // Wait till the second cycle complete
    
    status = 0x0;
    
    while(!((status&0x80) == (data&0x80))) {     // Flash is busy?
        NorFlashRd(addr, &status, 1);
    }
   HwDelayUs(100);
    //printf("Program OK addr %d  !\r\n", addr);    	    
    //if(status & 0x22)             // Whether the SR1 SR3 or SR4 is set
    //    return FAILED;
    return SUCCESSFUL;
}

/*
*********************************************************************************************
*                                       NorFlashClrSR
*
* Description: clr the flash status.
*
* Arguments  : none
*
* Return     : none
*
* Note(s)    : If FAILED returns after program or erase operation, 
*              you should run NorFlashClrSR before the next program or erase operation. 
*              The function does not verify.
*********************************************************************************************
*/
void NorFlashClrSR(void)
{           	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    PIF_START();
    rPIF_PCMCIA_DATA = NOR_FLASH_CL_SR;
    
    PifWaitTillDone();         // Wait till the first cycle complete	            
}

/*
*********************************************************************************************
*                                       NorFlashRdSR
*
* Description: read the flash status.
*
* Arguments  : none
*
* Return     : the flash status
*
* Note(s)    : 
*********************************************************************************************
*/
short NorFlashRdSR(void)
{   
    short status;
    	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    PIF_START();
    rPIF_PCMCIA_DATA = NOR_FLASH_RD_SR;
    
    PifWaitTillDone();         // Wait till the first cycle complete	
    
    NorFlashRd(0, &status, 1);
    return(status);
}

short NorFlashRdManufacturerID(void)
{
   	short mID;
	    /* the first cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0xaaa;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = 0xaa;
    PifWaitTillDone();         // Wait till the first cycle complete

    /* the second cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0x554;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = 0x55;
    PifWaitTillDone();         // Wait till the first cycle complete
        	  /* the third cycle */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0xaaa;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = NOR_FLASH_RD_ID;
    PifWaitTillDone();         // Wait till the first cycle complete
    
    
    NorFlashRd(0, &mID, 1);	return mID;
}

short NorFlashRdDeviceID(void)
{
   	short deviceID;
	    /* the first cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0xaaa;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = 0xaa;
    PifWaitTillDone();         // Wait till the first cycle complete

    /* the second cycle of block erase */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0x554;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = 0x55;
    PifWaitTillDone();         // Wait till the first cycle complete
        	  /* the third cycle */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    rPIF_PCI_DEV_A = 0xaaa;    // the byte address
    
    PifPCMCIAModeRegSet(PIF_CBUS_MODE, PCMCIA_MSTR_BS_8BYTE);    
    PIF_START();
    rPIF_PCMCIA_DATA = NOR_FLASH_RD_ID;
    PifWaitTillDone();         // Wait till the first cycle complete
    
    
    NorFlashRd(2, &deviceID, 1);	return deviceID;
}


int NorFlashRdID(void)
{
    short mid,did;

	mid = NorFlashRdManufacturerID();
	did = NorFlashRdDeviceID();

	return (mid<<16 | did);
}

/*
*********************************************************************************************
*                                       NorFlashRdData
*
* Description: read the data from the specified address.
*
* Arguments  : start_addr       is the start byte address.
*              data             is the data pointer.
*              number           is the data of number to be read. It is counted by half-words.
*
* Return     : none.
*
* Note(s)    : 
*********************************************************************************************
*/
void NorFlashRdData(int start_addr, short *data, int number)
{
    int i;	
#if 1	
    /* The read array command */	
    PIF_WRITE_SET();
    rPIF_PCI_LEN = 2;
    PIF_START();
    rPIF_PCMCIA_DATA = NOR_FLASH_RD_ARRAY;
    
    PifWaitTillDone();           // Wait till the first cycle complete
 #endif   
    NorFlashRd(start_addr, data, number);    	
}

/*
*********************************************************************************************
*                                       NorFlashRdDataBurst
*
* Description: read the data from the specified address.
*
* Arguments  : start_addr       is the start byte address.
*              data             is the data pointer.
*              number           is the data of number to be read. It is counted by half-words.
*                               Maximum is 2047. 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久免费偷拍视频| 成人综合在线观看| 亚洲精品美腿丝袜| 欧美韩国日本不卡| 中文字幕av免费专区久久| 国产亚洲成av人在线观看导航| 欧美日韩精品欧美日韩精品| 91精品国产综合久久久久久漫画 | 蜜桃av噜噜一区二区三区小说| 一区二区在线看| 久久影院午夜片一区| 国产人妖乱国产精品人妖| 久久网站最新地址| 国产精品乱人伦中文| 亚洲最快最全在线视频| 天堂午夜影视日韩欧美一区二区| 日韩1区2区3区| 秋霞电影网一区二区| 青青国产91久久久久久| 国产成人久久精品77777最新版本| 波多野结衣中文字幕一区二区三区 | 久久精品国产成人一区二区三区| 奇米777欧美一区二区| 国产黄色成人av| 一本色道久久加勒比精品| 91精品福利视频| 欧美视频一区二区在线观看| 日韩精品中午字幕| 国产精品乱人伦| 日韩和欧美一区二区| 韩国v欧美v日本v亚洲v| 波多野洁衣一区| 欧美精品一级二级三级| 久久精品亚洲国产奇米99| 夜色激情一区二区| 婷婷国产在线综合| 国产99久久久国产精品| 91视频一区二区三区| 欧美色图片你懂的| 久久免费视频色| 亚洲成年人影院| 高清久久久久久| 91精品国产综合久久久久久久久久| 国产精品污www在线观看| 亚洲无线码一区二区三区| 国产精品一区二区不卡| 91高清视频在线| 6080国产精品一区二区| 亚洲欧美韩国综合色| 精品系列免费在线观看| 欧美午夜精品免费| 中文字幕一区二区三区精华液| 免费观看在线色综合| 欧美色涩在线第一页| 国产精品美女视频| 国产一区二区电影| 精品女同一区二区| 天堂一区二区在线| 欧美午夜精品一区| 亚洲欧美日韩久久| 成人福利在线看| 国产欧美日韩另类一区| 狠狠网亚洲精品| 日韩免费高清电影| 日韩综合在线视频| 色8久久精品久久久久久蜜| 中文字幕一区二区三区精华液| 国产激情一区二区三区四区| 精品成人免费观看| 看电影不卡的网站| 日韩情涩欧美日韩视频| 亚洲123区在线观看| 欧美性做爰猛烈叫床潮| 中文字幕日本不卡| 国产在线视频一区二区| 337p日本欧洲亚洲大胆色噜噜| 美女在线视频一区| 久久综合精品国产一区二区三区| 久久精品国产精品亚洲综合| 日韩午夜三级在线| 久久99国内精品| 久久久三级国产网站| 成人免费视频app| 一区免费观看视频| 91成人网在线| 青青青爽久久午夜综合久久午夜| 日韩久久免费av| 国产91在线观看丝袜| 国产精品污污网站在线观看| av一区二区三区| 国产日韩av一区| 91年精品国产| 亚洲成人午夜电影| 日韩精品在线看片z| 国产91精品一区二区麻豆亚洲| 亚洲国产精品成人综合色在线婷婷 | 九色|91porny| 精品久久久久香蕉网| av电影在线观看完整版一区二区| 亚洲精品大片www| 欧美一区二区在线免费观看| 韩国v欧美v日本v亚洲v| 国产农村妇女毛片精品久久麻豆 | 99久久综合色| 国产精品亲子伦对白| 欧美日韩精品一区视频| 国产乱色国产精品免费视频| 亚洲美女免费在线| 欧美一区二区三区免费在线看| 国产成人h网站| 亚洲午夜激情网页| 国产拍揄自揄精品视频麻豆| 在线精品亚洲一区二区不卡| 韩日欧美一区二区三区| 一区二区在线电影| 国产欧美日韩综合| 欧美一区二区视频观看视频| 不卡视频免费播放| 免费在线视频一区| 一区二区三区精品在线| 国产人成一区二区三区影院| 3d成人h动漫网站入口| 99精品国产热久久91蜜凸| 蜜桃视频一区二区三区在线观看| 中文字幕亚洲欧美在线不卡| 精品国产亚洲一区二区三区在线观看| 91丝袜美腿高跟国产极品老师 | 国产精品99久久不卡二区| 亚洲午夜在线电影| 国产精品灌醉下药二区| 久久免费的精品国产v∧| 欧美高清视频在线高清观看mv色露露十八 | 欧美日韩国产在线播放网站| 成人开心网精品视频| 国产一区欧美日韩| 美国精品在线观看| 日韩福利电影在线| 天天操天天色综合| 亚洲国产精品一区二区久久| 亚洲三级电影全部在线观看高清| 精品三级在线看| 欧美成人精品1314www| 7777精品伊人久久久大香线蕉完整版 | 精品va天堂亚洲国产| 91精品久久久久久久91蜜桃| 欧美日韩午夜精品| 欧美日韩五月天| 欧美日韩精品二区第二页| 欧美丝袜自拍制服另类| 精品视频一区二区不卡| 欧美日韩中文字幕一区| 欧美日韩国产精品自在自线| 欧美精品久久99久久在免费线 | 色一情一乱一乱一91av| 91视频一区二区三区| 91九色02白丝porn| 欧美人伦禁忌dvd放荡欲情| 欧美区一区二区三区| 欧美另类变人与禽xxxxx| 日韩一区二区三区免费看| 日韩欧美国产wwwww| 欧美精品一区二区久久婷婷| 久久精品人人做人人综合| 亚洲国产精品二十页| 亚洲美女在线国产| 亚洲va天堂va国产va久| 蜜桃视频一区二区三区| 国产精品一区二区在线观看不卡| 国产大片一区二区| 成人av资源网站| 欧美中文字幕亚洲一区二区va在线| 欧美亚洲动漫精品| 日韩精品综合一本久道在线视频| 国产亚洲欧美一级| 亚洲免费观看在线视频| 日韩**一区毛片| 成年人国产精品| 制服丝袜亚洲色图| 欧美国产国产综合| 亚洲国产成人va在线观看天堂| 日本亚洲最大的色成网站www| 国产激情精品久久久第一区二区| 91美女片黄在线观看91美女| 欧美一区二区视频在线观看| 日本一区二区三区高清不卡| 一区二区三区在线免费观看| 久久精品国产秦先生| 成人ar影院免费观看视频| 91精品免费在线| 中文字幕一区二区三区乱码在线| 日本欧美在线观看| 99在线精品视频| 欧美电影免费观看完整版| 国产精品国产三级国产有无不卡 | av亚洲精华国产精华精| 在线电影院国产精品| 中文字幕一区三区| 国产在线日韩欧美| 欧美日韩国产一区| 亚洲精品国产精品乱码不99|