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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? flashpic.c

?? 《嵌入式固件開(kāi)發(fā)》一書(shū)的源碼
?? C
字號(hào):
/* 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_FLASHstruct uart405 {    union {        vuchar  data;       /* DATA_REG */        vuchar  dllsb;      /* DL_LSB (when DLAB is set in linectl reg) */    } b0;    union {        vuchar  inte;       /* INT_ENABLE */        vuchar  dlmsb;      /* DL_MSB when DLAB is set in linectl reg) */    } b1;    vuchar  fifoctl;        /* FIFO_CONTROL */    vuchar  linectl;        /* LINE_CONTROL */    vuchar  modemctl;       /* MODEM_CONTROL */    vuchar  linestat;       /* LINE_STATUS */    vuchar  modemstat;      /* MODEM_STATUS */    vuchar  scratch;        /* SCRATCH */};#define UARTA   ((struct uart405 *)0xef600300)#define THRE    0x20    /* Transmit Holding Register Empty */#define FLASH_ROT(x) (((x>>1)&0x7FFFFF)|((x&0x1)<<22)) /* Flasherase():   This "broke" version of flash driver does not support a per-sector   flash erase; so, we copy the monitor sectors to RAM, then erase the   entire device, then re-write the monitor to flash.*/intFlasherase(struct flashinfo *fdev,int snum){    volatile int i, j;    int bytecnt;    uchar *src, *dest;    ulong   foo;    src = (uchar *)0xfff80000;    dest = (uchar *)0x00200000;    while(src != 0)        *dest++ = *src++;        UARTA->b0.data = 'a';    while(!(UARTA->linestat & THRE));    *(uchar *)0xff800000 = 0xF0;    *(uchar *)(0xff800000 | FLASH_ROT((unsigned)0xAAA)) = 0xAA;    *(uchar *)(0xff800000 | FLASH_ROT((unsigned)0x555)) = 0x55;    *(uchar *)(0xff800000 | FLASH_ROT((unsigned)0xAAA)) = 0x80;    *(uchar *)(0xff800000 | FLASH_ROT((unsigned)0xAAA)) = 0xAA;    *(uchar *)(0xff800000 | FLASH_ROT((unsigned)0x555)) = 0x55;    *(uchar *)(0xff800000 | FLASH_ROT((unsigned)0xAAA)) = 0x10;    UARTA->b0.data = 'b';    while(!(UARTA->linestat & THRE));    /* Wait for device erase to complete or timeout.. */    for(j=10000000;j>0;j--) {        if (*(uchar *)fdev->base & 0x80)            break;    }    if (j == 0) {        UARTA->b0.data = 'c';        while(!(UARTA->linestat & THRE));    }    else {        UARTA->b0.data = 'C';        while(!(UARTA->linestat & THRE));    }    bytecnt = 0x80000;    src = (uchar *)0x00200000;    dest = (uchar *)0xfff80000;    for (i=0;i<bytecnt;i+=fdev->width) {        /* Flash write command */        foo = (ulong)dest & 0x3ff800;        *(uchar *)((ulong)fdev->base | foo) = 0xf0;        *(uchar *)((ulong)fdev->base | (foo | 0x555)) = 0xaa;        *(uchar *)((ulong)fdev->base | (foo | 0x4002aa)) = 0x55;        *(uchar *)((ulong)fdev->base | (foo | 0x555)) = 0xa0;        Fwrite(dest,src);        /* Wait for write to complete or timeout. */        for(j=10000000;j>0;j--) {            if (Is_Equal(dest,src)) {                if (Is_Equal(dest,src))                    break;            }        }        if ((i % 1000) == 0) {            if (j == 0) {                UARTA->b0.data = '.';                while(!(UARTA->linestat & THRE));            }             else {                UARTA->b0.data = '!';                while(!(UARTA->linestat & THRE));            }        }        dest++; src++;                }    return(0);}/* EndFlasherase():   Function place holder to determine the "end" of the   sectorerase() function.*/voidEndFlasherase(){}/* Flashwrite():   Return 0 if successful, else -1.   Note: this assumes that source & destination properly aligned   based on the width of the flash bank.*/intFlashwrite(struct flashinfo *fdev,ftype *dest,ftype *src,long bytecnt){    int i, ret;    ulong   foo;    /* Each pass through this loop writes 'fdev->width' bytes... */    ret = 0;    for (i=0;i<bytecnt;i+=fdev->width) {        /* Flash write command */        foo = (ulong)dest & 0x3ff800;        *(uchar *)((ulong)fdev->base | foo) = 0xf0;        *(uchar *)((ulong)fdev->base | (foo | 0x555)) = 0xaa;        *(uchar *)((ulong)fdev->base | (foo | 0x4002aa)) = 0x55;        *(uchar *)((ulong)fdev->base | (foo | 0x555)) = 0xa0;        Fwrite(dest,src);        /* Wait for write to complete or timeout. */        while(1) {            if (Is_Equal(dest,src)) {                if (Is_Equal(dest,src))                    break;            }        }        dest++; src++;    }    *(uchar *)fdev->base = 0xF0;    return(ret);}/* EndFlashwrite():    Function place holder to determine the "end" of the    Flashwrite() function.*/voidEndFlashwrite(){}/* 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.*/intFlashewrite(struct flashinfo *fdev,ftype *dest,ftype *src,int bytecnt){    int i;    ulong   foo;    void    (*reset)();    ftype   *src1, *dest1;    src1 = src;    dest1 = dest;    /* Erase the entire device... */    *(uchar *)fdev->base = 0xf0;    *(uchar *)((ulong)fdev->base | FLASH_ROT(0xaaa)) = 0xaa;    *(uchar *)((ulong)fdev->base | FLASH_ROT(0x555)) = 0x55;    *(uchar *)((ulong)fdev->base | FLASH_ROT(0xaaa)) = 0x80;    *(uchar *)((ulong)fdev->base | FLASH_ROT(0xaaa)) = 0xaa;    *(uchar *)((ulong)fdev->base | FLASH_ROT(0x555)) = 0x55;    *(uchar *)((ulong)fdev->base | FLASH_ROT(0xAAA)) = 0x10;    while(1) {        if (*(uchar *)fdev->base & 0x80)            break;    }    /* Read/reset command: */    *(uchar *)fdev->base = 0xf0;    for(i=0;i<bytecnt;i+=fdev->width) {        /* Flash write command */        foo = (ulong)dest & 0x3ff800;        *(uchar *)((ulong)fdev->base | foo) = 0xf0;        *(uchar *)((ulong)fdev->base | (foo | 0x555)) = 0xaa;        *(uchar *)((ulong)fdev->base | (foo | 0x4002aa)) = 0x55;        *(uchar *)((ulong)fdev->base | (foo | 0x555)) = 0xa0;        Fwrite(dest,src);        /* Wait for write to complete or timeout. */        while(1) {            if (Is_Equal(dest,src)) {                if (Is_Equal(dest,src))                    break;            }        }        dest++; src++;    }    /* Issue the read/reset command sequence: */    *(uchar *)fdev->base = 0xF0;    /* 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.*/voidEndFlashewrite(){}/* 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.*/intFlashtype(struct flashinfo *fdev){    ushort  man, dev;    /* Issue the autoselect command sequence: */    *(uchar *)fdev->base = 0xF0;    *(uchar *)((ulong)fdev->base | FLASH_ROT(0xAAA)) = 0xAA;    *(uchar *)((ulong)fdev->base | FLASH_ROT(0x555)) = 0x55;    *(uchar *)((ulong)fdev->base | FLASH_ROT(0xAAA)) = 0x90;        man = (ushort)*(uchar *)fdev->base;    dev = (ushort)*(uchar *)((ulong)fdev->base | FLASH_ROT(0x2));    man &= 0xff;    dev &= 0xff;    man <<= 8;    dev |= man;    fdev->id = (ushort)dev;    /* Issue the read/reset command sequence: */    *(uchar *)fdev->base = 0xF0;    return((int)(fdev->id));}/* EndFlashtype():    Function place holder to determine the "end" of the    Flashtype() function.*/voidEndFlashtype(){}#endif

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区免费在线电影| 久久亚洲精品小早川怜子| 免费在线视频一区| 国产精品欧美经典| 日韩免费高清av| 91久久国产综合久久| 国产精品一区二区91| 日韩黄色小视频| 中文字幕在线观看不卡视频| 欧美mv和日韩mv的网站| 欧美日韩国产在线播放网站| 成人小视频在线| 免费人成精品欧美精品| 亚洲第一狼人社区| 亚洲柠檬福利资源导航| 国产精品嫩草影院av蜜臀| 精品91自产拍在线观看一区| 欧美日韩精品电影| 欧美午夜一区二区三区免费大片| 国产成人a级片| 美女一区二区三区在线观看| 亚洲一区二区av电影| 亚洲色图欧美在线| 欧美国产欧美亚州国产日韩mv天天看完整| 91精品国产一区二区| 欧洲精品中文字幕| 在线一区二区三区四区五区| 成人激情校园春色| 国产成人鲁色资源国产91色综| 久久se精品一区二区| 蜜臀久久99精品久久久久久9| 天堂一区二区在线免费观看| 亚洲一区二区高清| 亚洲国产成人porn| 亚洲一区二区精品视频| 亚洲一二三区在线观看| 樱桃视频在线观看一区| 亚洲美女屁股眼交| 亚洲在线视频一区| 亚洲午夜精品17c| 亚洲自拍偷拍图区| 亚洲一区二区三区免费视频| 亚洲午夜av在线| 亚洲第一成人在线| 日韩经典一区二区| 日韩高清不卡一区二区三区| 日韩在线播放一区二区| 日本亚洲电影天堂| 日韩电影在线一区| 久久99久国产精品黄毛片色诱| 久久97超碰色| 国产精品影视在线| 成人一区在线看| 99精品久久免费看蜜臀剧情介绍| 91免费视频大全| 欧美在线高清视频| 91精品婷婷国产综合久久性色| 欧美一区二区三区在线| 精品电影一区二区| 中文字幕va一区二区三区| 亚洲女与黑人做爰| 日韩高清国产一区在线| 国产精品影视在线观看| 91在线播放网址| 欧美日韩在线播放| 欧美成人精精品一区二区频| 久久精品视频一区二区三区| 国产精品久久看| 亚洲最新视频在线观看| 日本中文字幕一区二区视频 | 欧美精品日韩综合在线| 91精品国产一区二区三区香蕉| 精品99一区二区| |精品福利一区二区三区| 午夜欧美在线一二页| 精品一区二区三区在线播放视频| 成人免费高清视频| 3atv一区二区三区| 国产亚洲福利社区一区| 亚洲制服丝袜av| 国产精品亚洲一区二区三区在线| 日本道在线观看一区二区| 日韩色视频在线观看| 国产精品久久久99| 婷婷久久综合九色综合伊人色| 国产成人午夜视频| 精品视频免费在线| 国产精品色哟哟网站| 免费在线看成人av| 97国产一区二区| 久久在线免费观看| 亚洲成人av中文| 99这里只有精品| 精品久久久久久久久久久久久久久久久| 国产精品另类一区| 捆绑紧缚一区二区三区视频| 色婷婷亚洲综合| 中国色在线观看另类| 美国毛片一区二区| 欧美亚洲国产一区二区三区| 久久精品人人做人人爽97| 日韩影院在线观看| 色香蕉成人二区免费| 国产清纯在线一区二区www| 日韩成人一区二区三区在线观看| 色综合久久久久| 国产三级三级三级精品8ⅰ区| 免费在线视频一区| 欧美日韩大陆一区二区| 亚洲视频在线一区观看| 国产乱码精品一区二区三区忘忧草| 欧美色大人视频| 亚洲人123区| 不卡在线观看av| 久久久久免费观看| 久久精品国产一区二区三区免费看| 欧美婷婷六月丁香综合色| 亚洲欧美日韩综合aⅴ视频| 国产精品一二三| 久久综合九色综合欧美就去吻| 日韩激情在线观看| 欧美电影一区二区| 五月婷婷欧美视频| 欧美日韩一区二区在线视频| 亚洲人成精品久久久久久| 99麻豆久久久国产精品免费| 日本一区二区三区四区| 国产麻豆欧美日韩一区| 精品99一区二区三区| 激情丁香综合五月| 精品国产91洋老外米糕| 美女尤物国产一区| 精品三级在线看| 激情综合网最新| 精品国产免费视频| 国产乱码精品一区二区三区五月婷 | 国产成a人亚洲精品| 久久综合精品国产一区二区三区| 久久国产精品99久久人人澡| 日韩视频免费观看高清完整版在线观看 | 国产激情视频一区二区在线观看| 2021国产精品久久精品| 国产精品一区二区你懂的| 久久精品一区二区三区av| 国产成人av电影在线播放| 久久精品一区二区三区不卡牛牛| 风间由美性色一区二区三区| 国产精品久久久久久亚洲伦| 99久久免费精品| 亚洲永久精品国产| 欧美高清你懂得| 精品午夜一区二区三区在线观看| 久久青草欧美一区二区三区| 国产成人午夜精品影院观看视频| 国产欧美日韩综合| 色婷婷av久久久久久久| 一片黄亚洲嫩模| 欧美一区二区在线免费播放| 国产一区二区视频在线播放| 中文字幕av一区二区三区| 色综合 综合色| 日韩高清一区二区| 欧美国产日产图区| 91国产视频在线观看| 免费成人美女在线观看.| 久久久久久免费网| 91丝袜美女网| 日本欧美一区二区| 国产精品国产三级国产专播品爱网| 色噜噜夜夜夜综合网| 欧美bbbbb| 综合在线观看色| 欧美一区日本一区韩国一区| 国产精品自拍在线| 亚洲国产va精品久久久不卡综合| 精品久久久久久亚洲综合网| 色综合天天做天天爱| 蜜桃久久久久久| 中国av一区二区三区| 欧美精品 日韩| 成人国产精品免费观看| 婷婷国产v国产偷v亚洲高清| 日本一区二区三区在线观看| 在线播放91灌醉迷j高跟美女 | 欧美一区二区视频网站| 国产麻豆精品在线观看| 亚洲资源在线观看| 欧美激情一二三区| 日韩亚洲欧美综合| 91福利社在线观看| 国产精品18久久久久久久久久久久 | 99综合电影在线视频| 理论电影国产精品| 亚洲一二三级电影| 国产精品久久久久久久久免费相片 | 正在播放一区二区| 成人黄色大片在线观看| 蜜桃精品在线观看| 一区二区三区高清| 国产精品国产三级国产普通话99|