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

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

?? f_st30_arm.s

?? realview22.rar
?? S
字號:
; ============================================================================
; F_ST30_ARM - Flash programming algorithm for ST30 Embedded Flash
;
; Library Name: Included into container .s file.
;
; Module Name:  F_ST30_ARM.S
; Module Descr: Flash programming for ST30 Embedded Flash
; Creation Date:2002
; Author:       Ian Field
;
; THIS INFORMATION IS PROPRIETARY TO
; ARM, INC.
; 1981 North Broadway, Suite 245
; Walnut Creek, CA 94596
; USA
; ----------------------------------------------------------------------
; Copyright (c) 2002  ARM, Inc.
; ALL RIGHTS RESERVED;
;
; Revisions of F_ST30_ARM.S: (latest revision on top)
; #.#  Name  Date      Description
; ---  ----- --------  -----------------------------------------------------
; 1.0  Ian   09/02     Ported to ST30
; $Revision: 1.1.6.1 $
;
; Implementation notes:
;
; GENERAL
; -------
;
;       This file is to be included into another asm file which has the
; board/chip specific knowledge needed for initialization and the like.
; That is, this is the algorithm only.
;
;       This file is based on information on Intel Boot block flash 
; of various forms. It is generalized to handle x8 and x16 accesses.
; It does not need to know the block sizes or positions as that is all
; passed in. 
;
;       This uses the standard RVDEBUG implementation for an API. That
; means that registers are used for passing arguments and returning
; status. The registers used are based on the save/restore list. The
; first registers are assumed to be the ones to use for passing args.
; In the case of ARM, this is R0, R1, R2, R3, etc.
;
; REGISTER MODEL
; --------------
;
;       The register model for this routine is as follows:
;       R0:     Input: page of Flash (not used on ARM)
;               Output:status return to host
;       R1:     Input: base address of Flash block to operate on
;       R2/R3/R4/R5/R8/R9: Input: arguments
;               Typical meanings: R2=Counter
;       R6/R7:Scratch
;
; -----------------------------------------------------------------------------
; Description:
; ----------------------------------------------------------------------------
;                               NOTICE
;
;       This code is proprietary and secret; the use of this source is
; restricted, and all rights are reserved.
;
;       If reading for interest, enjoy.
;
;       If maintaining, read comments carefully! There are some inter-depen-
; dencies and connectivities. Areas with particular connection are marked.
; There are some variable protocols that are not self evident: check all uses
; of variables before making big changes.
; ============================================================================
;

;************************************************************************/
;* DEFINE ENTRY POINTS                                                  */
;************************************************************************/

;       EXPORT          FLASH_init      // provided by asm that includes us
;       EXPORT          FLASH_erase_all // not available
        EXPORT          FLASH_erase
        EXPORT          FLASH_write_erase
        EXPORT          FLASH_write
        EXPORT          FLASH_validate
        EXPORT          FLASH_break
;       EXPORT          FLASH_term      // we do not need one

;************************************************************************/
;* DEFINE MACROS AND EQUATES                                            */
;************************************************************************/


;************************************************************************/
;* THE GLOBAL FUNCTIONS (EXPORTED PUBLICLY)                             */
;************************************************************************/
 
;* -----------------------------------------------------------------------
;  FLASH_erase - erase a Flash block
;
;  Notes:
;     - this erases a Flash block on request from host. The host has
;       the information on which end has the boot block and its size,
;       so we do not need to worry about that. 
;     - we may be asked to erase one or a set of blocks, but all will
;       have the same size.
;
;  Input/Output:
;     - In: R1=Base of 1st Flash Block to erase
;           R0=Page of Flash (no meaning for ARM)
;           R2=Count of blocks to do
;           R4=Size of blocks (for iterate) -- used to be R3, why?!?
;     - Out:R0=status code (0=OK, else error)
;     - Scratch: R6,R7
;  ----------------------------------------------------------------------- */

FLASH_erase
        bl      erase_block     ; erase block in R1
        bne     flash_exit      ; failed on this one

        subs    R2,R2,#1        ; count down
        addne   R1,R1,R4        ; setup for next block if more
        bne     FLASH_erase     ; more to do
        b       flash_exit      ; Stop routine on breakpoint

;* -----------------------------------------------------------------------
;  FLASH_write - write to a Flash block
;  FLASH_write_erase - erase then write
;
;  Notes:
;     - this writes a buffer into a flash block. The caller is responsible
;       for pre-erasing if needed.
;     - note: this is writing half-words and not bytes
;     - the host knows about block sizes and all, and passes in the needed
;       info.
;     - if we are writing into a later part of the block, this will be
;       handled by the host.
;
;  Input/Output:
;     - In: R1=Base of Flash Block to write
;           R0=Page of Flash (no meaning for ARM)
;           R2=Count of bytes to copy
;           R4=Offset in block to copy into (from base)
;           R5=Address of buffer to copy from
;           R8=Page of buffer (no meaning for ARM)
;           R9=0 if no verify, else same value as R2 (count)
;     - Out:R0=status code (0=OK, else error)
;     - Scratch: R6,R7
;   Notes:
;     - no speed benefit in using double word over single word prog,.
;       24us vs 48us. Bulk of time is spent erasing sectors.
;     - double word requires first word is even word address aligned.
;  ----------------------------------------------------------------------- */

FLASH_write_erase
        bl      erase_block     ; erase block in R1
        bne     flash_exit      ; failed on this one
FLASH_write
        add     R4,R4,R1        ; compute start address
write_loop
        mov     R6,#0x00100000
        mov     R7,#0x20000000  ; word program
        str     R7,[R6]

        str     R4,[R6,#0x10]   ; write address
        add     R4,R4,#4
        ldr     R7,[R5],#4      ; load 1st value from buffer then inc
        str     R7,[R6,#0x08]

        ldr     R7,[R6]
        orr     R7,R7,#0x80000000
        str     R7,[R6]

        bl      wait_for_ready  ; wait for Flash to finish write

        subs    R2,R2,#4        ; decrement count, more?
        bgt     write_loop      ; yes, continue

        bl      check_status    ; check Flash status and return in R0

        cmp     R9,#0           ; want verify?
        beq     done_write      ; no, just quit

        cmp     R0,#0           ; write went ok?
        bne     done_write      ; no, just quit

        mov     R2,R9           ; reset count
        sub     R4,R4,R2        ; back up to start of block to verify
        sub     R5,R5,R2        ; back up to start of buffer to verify
        b       FLASH_validate  ; go on to validate code

done_write
        b       flash_exit      ; Stop routine on breakpoint

;* -----------------------------------------------------------------------
;  FLASH_validate - validate write to a Flash block
;
;  Notes:
;     - this compares a buffer and a flash block. The caller uses this
;       after a write to verify the write worked.
;     - the host knows about block sizes and all, and passes in the needed
;       info.
;
;  Input/Output:
;     - In: R1=Base of Flash block to verify
;           R0=Page of Flash (no meaning for ARM)
;           R2=Count of bytes to verify
;           R4=Offset in block to verify from
;           R5=Address of buffer to verify against
;           R8=Page of buffer (no meaning for ARM)
;     - Out:R0=status code (0=OK, else error)
;     - Scratch: R6,R7
;  ----------------------------------------------------------------------- */

FLASH_validate
        mov     R6,#0
        mov     R7,#0
validate_loop
        ldr     R7,[R5],#4      ; load value from buffer
        ldr     R6,[R4],#4      ; load value from Flash
        cmp     R6,R7           ; same?
        bne     bad_validate    ; no, failed

        subs    R2,R2,#4        ; decrement count, more?
        bgt     validate_loop   ; yes, continue

        bl      check_status    ; check Flash status and return in R0

        b       flash_exit      ; Stop routine on breakpoint

bad_validate
        mov     R0,#1           ; compare
        b       flash_exit      ; Stop routine on breakpoint

;* -----------------------------------------------------------------------
;  FLASH_break - end of function entry for all Flash routines
;
;  Notes:
;     - this routine is the Stop routine for the flash code. It runs over
;       what should be a break (set by host). If the host messes up, it
;       will loop forever allowing the host to halt it.
;
;  Input/Output:
;     - In: R0=status code to return (0=OK, else error)
;           R1=base of Flash block operated on
;   ----------------------------------------------------------------------- */

Local_init                      ; we have no local init
flash_exit
        mov     R6,#0x00100000  ; clear status bits
        mov     R7,#0x00000000
        str     R7,[R6]
FLASH_break
        nop                     ; place to put breakpoint from host
forever
        b       forever         ; in case host screws up

;************************************************************************/
;* STATIC FUNCTIONS                                                     */
;************************************************************************/

;* -----------------------------------------------------------------------
;  erase_block - erase a block of the flash and check if OK
;
;  Notes:
;     - this handles erase of a Flash block and returns status in R0
;       as well as the Z flag
;
;  Input/Output:
;     - In: R1=Base of Flash
;     - Out:R0=Status (0=OK, else failed)
;     - Scratch: R0,R6
;  ----------------------------------------------------------------------- */

erase_block
        mov     R6,#0x100000
        mov     R0,#0x08000000
        str     R0,[R6,#0x00]   ; Set SER in FCR0

        mov     R0,#0x000000FF
        orr     R0,R0,#0x0000FF00
        orr     R0,R0,#0x000F0000
        and     R0,R1,R0        ; base of 0x00000000 or 0x80000000

        cmp     R0,#0x00002000  ; B0F0
        movlt   R0,#0x00000001
        blt     erase_set_sectors
        cmp     R0,#0x00008000  ; B0F1
        movlt   R0,#0x00000002
        blt     erase_set_sectors
        cmp     R0,#0x00010000  ; B0F2
        movlt   R0,#0x00000004
        blt     erase_set_sectors
        cmp     R0,#0x00020000  ; B0F3
        movlt   R0,#0x00000008
        blt     erase_set_sectors
        cmp     R0,#0x00030000  ; B0F4
        movlt   R0,#0x00000010
        blt     erase_set_sectors
        cmp     R0,#0x00040000  ; B0F5
        movlt   R0,#0x00000020
        blt     erase_set_sectors
        cmp     R0,#0x000C8000  ; B1F0
        movlt   R0,#0x00010000
        blt     erase_set_sectors
        cmp     R0,#0x000D0000  ; B1F1
        movlt   R0,#0x00020000
        blt     erase_set_sectors
        cmp     R0,#0x000E8000  ; B2F0
        movlt   R0,#0x00100000
        blt     erase_set_sectors
        cmp     R0,#0x000F0000  ; B2F1
        movlt   R0,#0x00200000
        blt     erase_set_sectors
        mov     R0,#0xA5        ; else, no erase
        mov     R15,R14
erase_set_sectors
        str     R0, [R6,#0x04]

        mov     R6,#0x100000
        ldr     R0,[R6,#0x00]   ; Operation start
        orr     R0,R0,#0x80000000
        str     R0,[R6,#0x00]

        mov     R6,R14          ; save link for call below
        bl      wait_for_ready  ; wait for erase to finish
        bl      check_status    ; check Flash status and return in R0
        mov     R15,R6          ; Return with code in R0 and Z bit

;* -----------------------------------------------------------------------
;  check_status - check to see if operation completed OK.
;
;  Notes:
;     - this reads the error status of the Flash and returns in R0.
;
;  Input/Output:
;     - In: R1=Base of Flash
;     - Out:R0=Status (0=OK, else failed)
;     - Scratch: R7
;  ----------------------------------------------------------------------- */

check_status
        mov     R7,#0x100000
        ldr     R0,[R7,#0x00]   ; get status
        mov     R7,#0x000F0000
        and     R0,R0,R7
        mov     R15,R14         ; Return with code in R0

;* -----------------------------------------------------------------------
;  wait_for_ready - wait for Flash to complete an operation.
;
;  Notes:
;     - this reads the status of the Flash until done.
;
;  Input/Output:
;     - In: R1=Base of Flash
;     - Scratch: R0,R7
;  ----------------------------------------------------------------------- */

wait_for_ready
        mov     R7,#0x100000
        ldr     R0,[R7,#0x00]   ; get status
        mov     R7,#0x0000000E
        add     R7,R7,#0x3E000000
        and     R0,R0,R7
        mov     R7,#0x00000000

        cmp     R0,R7           ; read back as 0x00 means OK
        bne     wait_for_ready  ; no, wait some more
        mov     R15,R14         ; Return

        END

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩久久久一区| 波多野结衣亚洲一区| 欧美精品一二三| 日韩精品福利网| 日韩精品一区二区三区swag | 久久激情五月婷婷| 2020国产成人综合网| 国产精品一二三| 欧美国产精品一区二区三区| 成人精品电影在线观看| 亚洲女厕所小便bbb| 欧美区一区二区三区| 国产综合久久久久影院| 国产欧美一区视频| 欧美在线视频你懂得| 日韩av网站免费在线| 欧美国产精品一区二区| 在线欧美日韩国产| 国产一区二区视频在线| 亚洲欧洲国产日韩| 日韩欧美色电影| 91丨porny丨国产入口| 蜜桃久久久久久| 1区2区3区精品视频| 欧美一区二区三区小说| 99riav一区二区三区| 日日摸夜夜添夜夜添国产精品 | 国产三级三级三级精品8ⅰ区| 成人a区在线观看| 日韩影院精彩在线| 欧美高清一级片在线观看| 欧美日韩亚州综合| 成人午夜电影网站| 日本三级亚洲精品| 亚洲精品v日韩精品| 久久精品综合网| 欧美精品1区2区3区| 国产成人精品网址| 日本在线播放一区二区三区| 中文字幕亚洲一区二区av在线| 日韩一区国产二区欧美三区| a级精品国产片在线观看| 免费观看91视频大全| 一区二区三区在线视频观看58 | 国产欧美一区二区三区在线看蜜臀 | 欧美日韩亚洲综合| 成人综合在线视频| 国产做a爰片久久毛片| 国产福利一区二区三区| 亚洲综合丝袜美腿| 国产精品久久久久影院老司 | 国产精品美女久久久久久久久久久| 欧美日韩精品系列| 色综合天天综合色综合av| 国产精品一区二区你懂的| 婷婷激情综合网| 亚洲成人免费电影| 一区二区三区在线看| 国产女主播视频一区二区| 日韩精品自拍偷拍| 欧美一区二区黄| 欧美日本一道本| 精品视频免费在线| 欧美日韩国产123区| 色女孩综合影院| 97se亚洲国产综合自在线观| 国产成人在线免费观看| 九九视频精品免费| 奇米精品一区二区三区四区 | 欧美xxxxx牲另类人与| 欧美一区二区视频在线观看2020| 欧美性xxxxxx少妇| 在线欧美日韩精品| 欧美日产在线观看| 日韩三级精品电影久久久| 7799精品视频| 日韩一区二区三区在线观看| 欧美顶级少妇做爰| 日韩免费视频一区| 久久久久国产成人精品亚洲午夜| 精品日韩欧美在线| 久久精品人人做人人爽人人| 久久天堂av综合合色蜜桃网| 欧美极品美女视频| 国产精品美女视频| 中文字幕日韩av资源站| 一级精品视频在线观看宜春院| 亚洲大片精品永久免费| 蜜臀av一级做a爰片久久| 精油按摩中文字幕久久| 国产二区国产一区在线观看| 成人毛片视频在线观看| 色先锋资源久久综合| 欧美人牲a欧美精品| 日韩欧美激情在线| 久久精品综合网| 亚洲精品免费在线| 青青草视频一区| 国产高清精品网站| 色94色欧美sute亚洲线路二| 91麻豆精品国产自产在线| 久久久久久久久久看片| 中文字幕亚洲成人| 日韩专区一卡二卡| 国产+成+人+亚洲欧洲自线| 91麻豆高清视频| 欧美一区二区三区人| 久久久91精品国产一区二区三区| 日韩美女视频一区二区 | 中文字幕亚洲成人| 日韩黄色免费电影| 国产成人综合在线观看| 欧美视频一区二区三区四区| 日韩欧美综合一区| 日韩码欧中文字| 麻豆精品国产传媒mv男同| 97久久精品人人做人人爽| 91精品国产色综合久久ai换脸| 国产精品免费观看视频| 奇米影视一区二区三区| 不卡一区在线观看| 欧美一区二区三区影视| 亚洲区小说区图片区qvod| 老司机精品视频一区二区三区| 91捆绑美女网站| 久久久精品一品道一区| 亚洲超碰精品一区二区| 成人黄色在线视频| 精品国产一区二区三区久久久蜜月 | 久久人人97超碰com| 亚洲综合免费观看高清完整版 | 久久免费精品国产久精品久久久久| 亚洲乱码中文字幕综合| 狠狠色综合播放一区二区| 欧美日韩一区二区在线观看| 久久精品水蜜桃av综合天堂| 日日噜噜夜夜狠狠视频欧美人| 99精品视频中文字幕| 久久久国产精华| 日产欧产美韩系列久久99| 色噜噜狠狠成人网p站| 亚洲国产精品激情在线观看| 精一区二区三区| 欧美精品第1页| 亚洲国产日韩在线一区模特| 成人aaaa免费全部观看| 久久九九全国免费| 国产在线麻豆精品观看| 欧美一级艳片视频免费观看| 亚洲国产日产av| 日本二三区不卡| 亚洲视频免费在线观看| 97se亚洲国产综合自在线| 国产精品欧美一级免费| 福利视频网站一区二区三区| 日韩精品一区二区三区视频 | 精品美女一区二区| 免费日韩伦理电影| 日韩精品一区二区三区在线播放| 亚洲va韩国va欧美va精品| 欧美日韩亚洲综合| 偷拍一区二区三区四区| 欧美剧情电影在线观看完整版免费励志电影 | 久久精品欧美日韩精品| 国产一区二区三区四区五区美女| 欧美电视剧在线看免费| 久久99国产精品尤物| www激情久久| 国产米奇在线777精品观看| 久久亚洲综合色一区二区三区 | 成人精品一区二区三区中文字幕 | 欧美大片拔萝卜| 美女视频黄免费的久久 | 久久精品国产一区二区| 精品日韩一区二区三区免费视频| 久久精品国产99国产| 精品国产一区二区三区忘忧草| 紧缚奴在线一区二区三区| xnxx国产精品| 成人黄色小视频在线观看| 亚洲欧美电影一区二区| 91官网在线观看| 日韩精品一二三| 久久久精品天堂| 91免费观看在线| 午夜电影久久久| xfplay精品久久| 99re成人精品视频| 日韩精品一二三| 久久精品视频免费| 色视频成人在线观看免| 蜜臀久久99精品久久久画质超高清 | 国产喷白浆一区二区三区| 99精品黄色片免费大全| 午夜亚洲国产au精品一区二区| 精品欧美久久久| 色呦呦日韩精品| 精品亚洲国内自在自线福利| 国产精品区一区二区三| 7777精品伊人久久久大香线蕉最新版|