Reset_Addr_RAM DCD __program_start // @0x00000060 To 0x50017FE0 Undefined_Addr_RAM DCD UndefinedHandler // @0x00000064 To 0x50017FE4 SWI_Addr_RAM DCD SWIHandler // @0x00000068 To 0x50017FE8 Prefetch_Addr_RAM DCD PrefetchAbortHandler // @0x0000006C To 0x50017FEC Abort_Addr_RAM DCD DataAbortHandler // @0x00000070 To 0x50017FF0 Reserve_Addr_RAM DCD __program_start // @0x00000074 To 0x50017FF4 IRQ_Addr_RAM DCD IRQHandler // @0x00000078 To 0x50017FF8 FIQ_Addr_RAM DCD FIQHandler // @0x0000007C To 0x50017FFC CopyEnd
//******************************************************************************* //* Function Name : FIQHandler //* Description : This function is called when FIQ exception is entered. //* Input : none //* Output : none //*******************************************************************************
VectorAddress EQU 0xFFFFF030 // VIC Vector address register address. VectorAddressDaisy EQU 0xFC000030 // Daisy VIC Vector address register I_Bit EQU 0x80 // when I bit is set, IRQ is disabled F_Bit EQU 0x40 // when F bit is set, FIQ is disabled
//******************************************************************************* //* Function Name : FIQHandler //* Description : This function is called when FIQ exception is entered. //* Input : none //* Output : none //******************************************************************************* FIQHandler SUB lr,lr,#4 // Update the link register. STMFD sp!,{r0-r7,lr} // Save The workspace plus the current return // address lr_fiq into the FIQ stack. ldr r0,=FIQ_Handler ldr lr,=FIQ_Handler_end bx r0 //Branch to FIQ_Handler. FIQ_Handler_end:
LDMFD sp!,{r0-r7,pc}^// Return to the instruction following... // ...the exception interrupt.
91x_init.s 改动:
EXTERN CopyStart
CODE32
//******************************************************************************* // --- Remap Flash Bank 0 at address 0x0 and Bank 1 at address 0x80000, // when the bank 0 is the boot bank, then enable the Bank 1. //*******************************************************************************
LDR R6, =0x54000004 // ;LDR R7, =0x6 // NON BOOT BANK Size = 512KB : (2^6) * 8 = 512KB ;LDR R7, =0x2 // NON BOOT BANK Size = 32KB : (2^2) * 8 = 322KB LDR R7, =0x3 // NON BOOT BANK Size = 32KB : (2^2) * 8 = 322KB STR R7, [R6]
LDR R6, =0x5400000C // BOOT BANK Address = 0x0 LDR R7, =0x0 STR R7, [R6] // 512KB Align LDR R6, =0x54000010 // NON BOOT BANK Address = 0x80000 LDR R7, =0x20000 // need to put 0x20000 because FMI bus on A[25:2] of CPU bus STR R7, [R6]
// --- Enable CS on both banks LDR R6, =0x54000018 LDR R7, =0x18 STR R7, [R6]