
        .align
        .text
        .global _init_ram,hardware_init_hook
hardware_init_hook:
	    /*watch dog disable */
	    LDR	    r0,WTCON	    
	    LDR	    r1,=0x0 		
	    STR	    r1,[r0]

	    /*disable cache and write-buffer*/
	    LDR	    r0,SYSCFG001    
	    LDR	    r1,=0x0 		
	    STR	    r1,[r0]
	    
	    /*all interrupt disable*/	
	    LDR	    r0,INTMSK
	    LDR	    r1,MASKALL    
	    STR	    r1,[r0]
	    
	    /*set clock register*/
	    LDR	    r0,LOCKTIME
            LDR	    r1,LOCKTIME_DAT     /*count = t_lock * Fin (t_lock=200us, Fin=4MHz) = 800*/
            STR	    r1,[r0]

            LDR	    r0,PLLCON			/*temporary setting of PLL*/
            LDR	    r1,PLLCON_DAT   	/*Fin=10MHz,Fout=60MHz*/
            STR     r1,[r0]
        
            LDR	    r0,CLKCON		
            LDR	    r1,CLKCON_DAT	    /*All unit block CLK enable	*/
            STR	    r1,[r0]
            
            /*set memory control register*/
            LDR     r0,PtImageMemorySelect
            LDMIA   r0,{r1-r13}
            LDR     r0,ROMCntr_Offset
            STMIA   r0,{r1-r13}
          
ROMCntr_Offset:
    .word   0x01c80000
PtImageMemorySelect:
    .word   MEMINTDATA
MEMINTDATA:
    .word   0x11111112
    .word   0x600
    .word   0x7FFC
    .word   0x7FFC
    .word   0x7FFC
    .word   0x7FFC
    .word   0x7FFC
    .word   0x18000
    .word   0x18000
    .word   0x820591
    .word   0x16
    .word   0x20
    .word   0x20
WTCON:
    .word   0x01d30000
SYSCFG001:
    .word   0x01c00000
INTMSK :
    .word   0x01e0000c
MASKALL:
    .word   0x07ffffff
LOCKTIME:    
    .word   0x01d8000c
LOCKTIME_DAT:
    .word   0x320
PLLCON_DAT:
    .word   0x48032
PLLCON:
    .word   0x01d80000 
CLKCON:    
    .word   0x01d80004
CLKCON_DAT:
    .word   0x7ff8 



