亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲自拍与偷拍| 亚洲精品乱码久久久久| 亚洲第一主播视频| bt欧美亚洲午夜电影天堂| 精品久久久久99| 久久97超碰国产精品超碰| 日韩女优av电影| 亚洲精品国产一区二区精华液 | 欧美一级理论片| 偷窥国产亚洲免费视频| 色婷婷av久久久久久久| 亚洲女同ⅹxx女同tv| 一本大道久久a久久精品综合| 国产精品久久久久久久蜜臀| 成av人片一区二区| 亚洲天堂成人网| 97久久精品人人做人人爽 | 国产精品欧美一级免费| 成人免费观看男女羞羞视频| 日韩一区二区三区在线视频| 日本免费新一区视频| 亚洲激情六月丁香| 偷拍一区二区三区四区| 一区二区三区在线免费| 日本亚洲三级在线| 捆绑调教美女网站视频一区| 免费xxxx性欧美18vr| 蓝色福利精品导航| 精品一区二区三区蜜桃| 国产成人综合网| 91久久香蕉国产日韩欧美9色| 在线观看一区日韩| 精品日韩在线一区| 中文字幕电影一区| 亚洲制服丝袜av| 国产成人免费av在线| 国产乱对白刺激视频不卡| 欧美视频你懂的| 国产乱子轮精品视频| 一区二区三区高清不卡| 毛片基地黄久久久久久天堂| 91亚洲男人天堂| 美女一区二区在线观看| 日本一区二区成人在线| 综合av第一页| 欧美疯狂性受xxxxx喷水图片| 五月综合激情网| 国产精品久久一卡二卡| 欧美综合一区二区三区| 久久疯狂做爰流白浆xx| 亚洲欧美自拍偷拍色图| 欧美日韩一区国产| 国产精品一级在线| 亚洲午夜视频在线| 欧美极品aⅴ影院| 91福利区一区二区三区| 久久aⅴ国产欧美74aaa| 亚洲精品一区二区在线观看| 91网址在线看| 亚洲va中文字幕| 中文无字幕一区二区三区| 欧美亚男人的天堂| 国产精品伊人色| 日韩一区精品字幕| 国产精品久久久久久久久免费相片 | 91小视频免费观看| 精品一区二区在线观看| 亚洲精品一二三区| 国产日产欧美一区| 日韩欧美亚洲一区二区| 日本高清不卡aⅴ免费网站| 国产精品一区专区| 欧美aⅴ一区二区三区视频| 久久精品视频在线看| 欧美高清dvd| 在线精品视频免费观看| 国产不卡在线视频| 国产一区二区91| 日本91福利区| 亚洲精品五月天| 国产精品久久久久久久久搜平片 | 日本韩国精品在线| 成人欧美一区二区三区小说| 99精品久久只有精品| 精品国精品自拍自在线| 精品视频在线免费看| 国产成人一级电影| 91精品蜜臀在线一区尤物| 欧美精品一区二区高清在线观看| 日韩视频国产视频| 国产又黄又大久久| 午夜私人影院久久久久| 亚洲自拍偷拍欧美| 裸体歌舞表演一区二区| 日韩中文字幕91| 日韩精品资源二区在线| 91成人在线精品| 国产欧美精品一区aⅴ影院 | 国产精品你懂的| 777欧美精品| 91福利在线导航| 国产91对白在线观看九色| 极品瑜伽女神91| 视频一区欧美精品| 亚洲一区二区三区国产| 亚洲chinese男男1069| 美女一区二区在线观看| 欧美一区二区三级| 99这里只有久久精品视频| 国产亚洲午夜高清国产拍精品| 久久影音资源网| 日韩理论片中文av| 性做久久久久久免费观看| 国产偷国产偷精品高清尤物| 欧美一区二区播放| 国产日韩三级在线| 一区二区欧美国产| 麻豆91免费观看| 成人av动漫网站| 欧美日免费三级在线| 精品1区2区在线观看| 亚洲一区二区三区免费视频| 视频一区视频二区中文字幕| 久久精品国产精品亚洲红杏| 久久久久国产一区二区三区四区| 国产精品国产三级国产普通话99| 亚洲国产精品一区二区www在线| 国产美女娇喘av呻吟久久| 在线一区二区三区四区五区| 久久蜜臀中文字幕| 日日摸夜夜添夜夜添国产精品| 丁香激情综合五月| 91在线观看视频| 日本欧美一区二区三区| kk眼镜猥琐国模调教系列一区二区| 欧美日韩不卡一区二区| 国产精品欧美久久久久一区二区| 免费精品99久久国产综合精品| 99热这里都是精品| 久久天天做天天爱综合色| 香蕉加勒比综合久久| 91在线精品一区二区| 国产调教视频一区| 青青草成人在线观看| 欧美日韩精品一区视频| 一区二区三区在线观看动漫 | 91美女在线观看| 国产亚洲欧美日韩日本| 免费成人av在线播放| 欧美区一区二区三区| 亚洲一本大道在线| 94-欧美-setu| 综合av第一页| 91在线观看免费视频| 国产精品亲子乱子伦xxxx裸| 国产麻豆精品95视频| 欧美xxxxxxxxx| 亚洲成人激情社区| 91精品91久久久中77777| 日本一区二区三区久久久久久久久不| 美女视频黄频大全不卡视频在线播放| 欧美色视频一区| 中文字幕在线观看一区| jizzjizzjizz欧美| 国产欧美精品一区二区三区四区| 国产成人亚洲综合a∨猫咪| www国产成人| 麻豆中文一区二区| 日韩欧美你懂的| 日韩高清不卡一区二区| 欧美久久一二区| 国产欧美一区二区三区沐欲| 精品一区二区综合| 精品国产乱码久久久久久1区2区| 午夜在线电影亚洲一区| 在线不卡的av| 日韩成人精品在线| 日韩精品一区二区在线观看| 国产乱码精品1区2区3区| 欧美电影免费观看高清完整版在线 | 日韩欧美成人一区| 青青草精品视频| 欧美一区二区在线不卡| 日韩和欧美的一区| 欧美日韩综合一区| 日韩高清一级片| 日韩欧美色电影| 国产一区二区美女诱惑| 久久婷婷色综合| 日本中文字幕一区| 在线视频综合导航| 亚洲线精品一区二区三区八戒| 欧美性猛交xxxx乱大交退制版| 亚洲国产色一区| 欧美手机在线视频| 亚洲国产精品欧美一二99| 精品国产精品一区二区夜夜嗨| 免费观看在线综合色| 国产精品美女久久久久久久| 成人美女在线观看|