📄 int_5307.s
字号:
;/* None */;/* */;/* OUTPUTS */;/* */;/* None */;/* */;/* HISTORY */;/* */;/* NAME DATE REMARKS */;/* */;/* B. Sellew 04-28-1998 Created and verified version 1.0 */;/* */;/*************************************************************************/ XDEF _INT_Initialize_INT_Initialize: XDEF _main_main:;VOID INT_Initialize(void);{;; /* Lockout interrupts during initialization. */; MOVE.W #$2700,SR ; Lockout interrupts;; /* Initialize chip selects */; move.l #0x10000000,-(sp) jsr _mcf5307_sim_init jsr _mcf5307_timer_init jsr _mcf5307_pport_init jsr _mcf5307_mbus_init jsr _mcf5307_dma_init jsr _mcf5307_cs_init jsr _mcf5307_uart_init ;; /* Setup the vectors loaded flag to indicate to other routines in the ; system whether or not all of the default vectors have been loaded. ; If INT_Loaded_Flag is 1, all of the default vectors have been loaded.; Otherwise, if INT_Loaded_Flag is 0, registering an LISR cause the; default vector to be loaded. */; INT_Loaded_Flag = 1;; MOVE.L #1,D0 MOVE.L D0,_INT_Loaded_Flag;; /* Reset the VBR to point to address zero. */; MOVE.L A7,D1 MOVE.L #0,D0 MOVEA.L D0,A7 MOVEC.L A7,VBR MOVEA.L D1,A7; ***** BEGIN board specific code for the MCF5307 evaluation board *****;; /* Set up Timer 1 for a 10ms periodic tick that generates a Level 5; autovector. */; MOVE.L #ICR1_CFG,D0 ; Pick up configuration value for ICR1 MOVE.B D0,(MBAR_ADDR+ICR1) ; Setup Timer 1 interrupt for lev 5, pri 0 MOVE.L #TRR1_LOAD,D0 ; Pick up compare value MOVE.W D0,(MBAR_ADDR+TRR1) ; Load into TRR1, val = (25MHz / 16) / 100 MOVE.L #TMR1_CFG,D0 ; Pick up configuration value for TMR1 MOVE.W D0,(MBAR_ADDR+TMR1) ; Setup Timer 1 ; Prescaler = 0 ; Enable reference interrupt ; Restart timer after reference reached ; System clock / 16 ; Enable timer MOVE.L (MBAR_ADDR+IMR),D0 ; Get current interrupt lockout status ANDI.L #IMR_MASK,D0 ; Clear Timer 1 bit MOVE.L D0,(MBAR_ADDR+IMR) ; Enable Timer 1 interrupt MOVEA.L #0,A0 ; level 1 Pointer to the vector table MOVE.L #0x19,D0 ; vector number is #0x19 LSL.L #2,D0 ; Adjust for the vector size ADDA.L D0,A0 ; Add in offset to vector base MOVE.L #_INT_Level_1_Auto,D0 ; stardard use LISR MOVE.L D0,(A0) MOVEA.L #0,A0 ; level 2 Pointer to the vector table MOVE.L #0x1A,D0 ; vector number is #0x1a LSL.L #2,D0 ; Adjust for the vector size ADDA.L D0,A0 ; Add in offset to vector base MOVE.L #_INT_Level_2_Auto,D0 ; stardard use LISR MOVE.L D0,(A0) MOVEA.L #0,A0 ; level 3 Pointer to the vector table MOVE.L #0x1B,D0 ; vector number is #0x1b LSL.L #2,D0 ; Adjust for the vector size ADDA.L D0,A0 ; Add in offset to vector base MOVE.L #_INT__Interrupt_Level3, D0 ; direct map to interrupt MOVE.L D0,(A0) MOVEA.L #0,A0 ; leval 4 Pointer to the vector table MOVE.L #0x1C,D0 ; vector number is #0x1c LSL.L #2,D0 ; Adjust for the vector size ADDA.L D0,A0 ; Add in offset to vector base MOVE.L #_INT_Level_4_Auto, D0 ; stardard use LISR MOVE.L D0,(A0) MOVEA.L #0,A0 ; level 5 Pointer to the vector table MOVE.L #0x1D,D0 ; vector number is #0x1d LSL.L #2,D0 ; Adjust for the vector size ADDA.L D0,A0 ; stardard use LISR MOVE.L #_INT_Timer_Interrupt, D0 MOVE.L D0,(A0) MOVEA.L #0,A0 ; leval 6 Pointer to the vector table MOVE.L #0x1E,D0 ; vector number is #0x1e LSL.L #2,D0 ; Adjust for the vector size ADDA.L D0,A0 ; Add in offset to vector base MOVE.L #_INT_Level_6_Auto, D0 ; stardard use LISR MOVE.L D0,(A0) MOVEA.L #0,A0 ; leval 7 Pointer to the vector table MOVE.L #0x1F,D0 ; vector number is #0x1f LSL.L #2,D0 ; Adjust for the vector size ADDA.L D0,A0 ; Add in offset to vector base MOVE.L #_INT_Level_7_Auto, D0 ; stardard use LISR MOVE.L D0,(A0) JSR _cpu_cache_disable ;//in cache.s JSR _EnableCache; ***** END board specific code for the MCF5307 evaluation board *****;; /* Save the current value of the system stack. */; CLR.L -(A7) ; Place a NULL on the system stack MOVE.L A7,_TCD_System_Stack ; Save system stack pointer; ; /* Define the global data structures that need to be initialized by this; routine. These structures are used to define the system timer ; management HISR. */; TMD_HISR_Stack_Ptr = _sys_memory;; TMD_HISR_Stack_Size = HISR_STACK;; TMD_HISR_Priority = 0;; MOVE.L #HISR_STACK,D0 ; pick up size of HISR stack MOVE.L D0,_TMD_HISR_Stack_Size ; store in variable CLR.L D0 ; get a 0 MOVE.L D0,_TMD_HISR_Priority ; store priority = 0 MOVE.L #_sys_memory,D0 ; get address of sys_memory section MOVE.L D0,_TMD_HISR_Stack_Ptr ; set up as HISR stack ADD.L #HISR_STACK,D0 ; move available mem pointer up;; /* Invalidate, then enable the cache */;; MOVE.L #CACHE_INV,D1 ; pick up Invalidate All command; MOVEC D1,CACR ; invalidate all cache lines; MOVE.L #CACHE_EN,D1 ; pick up Enable command; MOVEC D1,CACR ; enable the cache, but default to ; cache-inhibited access for all ; memory not defined in ACRs; MOVE.L #ACR0_CFG,D1 ; pick up ACR0 configuration; MOVEC D1,ACR0 ; enable cache for DRAM accesses ;;; /* Call INC_Initialize with a pointer to the first available memory ; address after the compiler's global data. This memory may be used; by the application. */; INC_Initialize(first_available_address);; MOVE.L D0,-(A7) JSR _INC_Initialize;};;;/*************************************************************************/;/* */;/* FUNCTION */;/* */;/* INT_Vectors_Loaded */;/* */;/* DESCRIPTION */;/* */;/* This function returns the flag that indicates whether or not */;/* all the default vectors have been loaded. If it is false, */;/* each LISR register also loads the ISR shell into the actual */;/* vector table. */;/* */;/* AUTHOR */;/* */;/* Barry Sellew, Accelerated Technology, Inc. */;/* */;/* CALLED BY */;/* */;/* TCC_Register_LISR Register LISR for vector */;/* */;/* CALLS */;/* */;/* None */;/* */;/* INPUTS */;/* */;/* None */;/* */;/* OUTPUTS */;/* */;/* None */;/* */;/* HISTORY */;/* */;/* NAME DATE REMARKS */;/* */;/* B. Sellew 04-28-1998 Created and verified version 1.0 */;/* */;/*************************************************************************/ XDEF _INT_Vectors_Loaded_INT_Vectors_Loaded:;INT INT_Vectors_Loaded(void);{;; /* Just return the loaded vectors flag. */; return(INT_Loaded_Flag);; MOVE.L _INT_Loaded_Flag,D0 ; Put the flag into D0 RTS ; Return to caller
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -