Chinaunix首页 | 论坛 | 博客
  • 博客访问: 8966
  • 博文数量: 9
  • 博客积分: 320
  • 博客等级: 一等列兵
  • 技术积分: 95
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-15 16:59
文章分类

全部博文(9)

文章存档

2011年(1)

2009年(1)

2008年(7)

我的朋友
最近访客

分类: LINUX

2008-09-23 21:24:16




@
#ifdef CONFIG_DEBUG_LL

@
@ PrintFaultAddr: Print falut address
@
@ r12: contains address of instruction + 4
@
PrintFaultAddr:
    mov    r0, r12            @ Print address of instruction + 4
    ldr    r1, SerBase
    bl    PrintHexWord
    mrc    p15, 0, r0, c6, c0, 0    @ Read fault virtual address
    ldr    r1, SerBase
    bl    PrintHexWord
    mov    pc, lr

@ PrintHexNibble : prints the least-significant nibble in R0 as a
@ hex digit
@ r0 contains nibble to write as Hex
@ r1 contains base of serial port
@ writes ro with XXX, modifies r0,r1,r2
@ TODO : write ro with XXX reg to error handling
@ Falls through to PrintChar
PrintHexNibble:
    adr    r2, HEX_TO_ASCII_TABLE
    and    r0, r0, #0xF
    ldr    r0, [r2, r0]    @ convert to ascii
    b    PrintChar

@ PrintChar : prints the character in R0
@ r0 contains the character
@ r1 contains base of serial port
@ writes ro with XXX, modifies r0,r1,r2
@ TODO : write ro with XXX reg to error handling
PrintChar:
TXBusy:
    ldr    r2, [r1, #oUTRSTAT]
    and    r2, r2, #UTRSTAT_TX_EMPTY
    tst    r2, #UTRSTAT_TX_EMPTY
    beq    TXBusy    
    str    r0, [r1, #oUTXHL]
    mov    pc, lr

@ PrintWord : prints the 4 characters in R0
@ r0 contains the binary word
@ r1 contains the base of the serial port
@ writes ro with XXX, modifies r0,r1,r2
@ TODO : write ro with XXX reg to error handling
PrintWord:
    mov    r3, r0
    mov    r4, lr
    bl    PrintChar

    mov    r0, r3, LSR #8        /* shift word right 8 bits */
    bl    PrintChar

    mov    r0, r3, LSR #16        /* shift word right 16 bits */
    bl    PrintChar
    
    mov    r0, r3, LSR #24        /* shift word right 24 bits */
    bl    PrintChar

    mov    r0, #'\r'
    bl    PrintChar

    mov    r0, #'\n'
    bl    PrintChar

    mov    pc, r4

@ PrintHexWord : prints the 4 bytes in R0 as 8 hex ascii characters
@ followed by a newline
@ r0 contains the binary word
@ r1 contains the base of the serial port
@ writes ro with XXX, modifies r0,r1,r2
@ TODO : write ro with XXX reg to error handling
PrintHexWord:
    mov    r4, lr
    mov    r3, r0
    mov    r0, r3, LSR #28
    bl    PrintHexNibble
    mov    r0, r3, LSR #24
    bl    PrintHexNibble
    mov    r0, r3, LSR #20
    bl    PrintHexNibble
    mov    r0, r3, LSR #16
    bl    PrintHexNibble
    mov    r0, r3, LSR #12
    bl    PrintHexNibble
    mov    r0, r3, LSR #8
    bl    PrintHexNibble
    mov    r0, r3, LSR #4
    bl    PrintHexNibble
    mov    r0, r3
    bl    PrintHexNibble

    mov    r0, #'\r'
    bl    PrintChar

    mov    r0, #'\n'
    bl    PrintChar

    mov    pc, r4
#endif
    
@
@ Data Area
@
@ Memory configuration values
.align 4
mem_cfg_val:
    .long    vBWSCON
    .long    vBANKCON0
    .long    vBANKCON1
    .long    vBANKCON2
    .long    vBANKCON3
    .long    vBANKCON4
    .long    vBANKCON5
    .long    vBANKCON6
    .long    vBANKCON7
    .long    vREFRESH
    .long    vBANKSIZE
    .long    vMRSRB6
    .long    vMRSRB7

@ Processor clock values
.align 4
clock_locktime:
    .long    vLOCKTIME
mpll_50mhz:
    .long    vMPLLCON_50
#ifdef CONFIG_S3C2410_MPORT1
mpll_100mhz:
    .long vMPLLCON_100
#endif
mpll_200mhz:
    .long    vMPLLCON_200
clock_clkcon:
    .long    vCLKCON
clock_clkdivn:
    .long    vCLKDIVN
@ initial values for serial
uart_ulcon:
    .long    vULCON
uart_ucon:
    .long    vUCON
uart_ufcon:
    .long    vUFCON
uart_umcon:
    .long    vUMCON
@ inital values for GPIO
gpio_con_uart:
    .long    vGPHCON
gpio_up_uart:
    .long    vGPHUP

    .align    2
DW_STACK_START:
    .word    STACK_BASE+STACK_SIZE-4

#ifdef CONFIG_DEBUG_LL
    .align    2
HEX_TO_ASCII_TABLE:
    .ascii    "0123456789ABCDEF"
STR_STACK:
    .ascii    "STKP"
STR_UNDEF:
    .ascii    "UNDF"
STR_SWI:
    .ascii    "SWI "
STR_PREFETCH_ABORT:
    .ascii    "PABT"
STR_DATA_ABORT:
    .ascii    "DABT"
STR_IRQ:
    .ascii    "IRQ "
STR_FIQ:
    .ascii    "FIQ"
STR_NOT_USED:
    .ascii    "NUSD"
    .align 2
STR_OK:
    .ascii    "OK "
STR_FAIL:
    .ascii    "FAIL"
STR_CR:
    .ascii "\r\n"
#endif

.align 4
SerBase:
#if defined(CONFIG_SERIAL_UART0)
    .long UART0_CTL_BASE
#elif defined(CONFIG_SERIAL_UART1)
    .long UART1_CTL_BASE
#elif defined(CONFIG_SERIAL_UART2)
    .long UART2_CTL_BASE
#else
#error not defined base address of serial
#endif

#ifdef CONFIG_PM
.align 4
PMCTL0_ADDR:
    .long 0x4c00000c
PMCTL1_ADDR:
    .long 0x56000080
PMST_ADDR:
    .long 0x560000B4
PMSR0_ADDR:
    .long 0x560000B8
REFR_ADDR:
    .long 0x48000024
#endif

阅读(320) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~