@ External interrupt pending clear 外部中断挂起寄存器清零,先读出寄存器的值,如后回写就可以了。因为这个寄存器是写1,清零,看下这个寄存器NOTES,就可知道。 NOTES: 1. Each bit is cleared by writing "1" ldrr0, =(ELFIN_GPIO_BASE+EINTPEND_OFFSET)/*EINTPEND*/ ldrr1, [r0] strr1, [r0]
ldrr0, =ELFIN_VIC0_BASE_ADDR @0x71200000 ldrr1, =ELFIN_VIC1_BASE_ADDR @0x71300000? Base address of VIC0 is 0x7120_0000 ? Base address of VIC1 is 0x7130_0000 ? Address of control register = base address + offset
@ Disable all interrupts (VIC0 and VIC1) mvnr3, #0x0 这里说下这个mvn指令,它与mov的不同之处在于,先把源操作寄存器的内容取反,再送到目的寄存器 strr3, [r0, #oINTMSK] strr3, [r1, #oINTMSK]
@ Set all interrupts as IRQ movr3, #0x0 strr3, [r0, #oINTMOD] strr3, [r1, #oINTMOD]
/* init system clock */ bl system_clock_init去看system_clock_init的源码,在同一个文件中,如下所示:s3c6410手册中,与时钟有关的部分主要在 第三章 SYSTEM CONTROLLER中,摘自文中的一段话:The System Clock Control logic in 6410 generates the required system clock signals, ARMCLK for CPU, HCLK for AXI/AHB-bus peripherals, and PCLK for the APB bus peripherals. There are three PLLs in 6410. One is for ARMCLK only. Second is for HCLK and PCLK. The third thing is for peripheral, especially for audio related clocks.The clock control logic generates slow-rate clock-signals for ARMCLK, HCLK and PCLK by bypassing externally supplied clock sources. The clock signal to each peripheral block can be enabled or disabled by software control to reduce the power consumption. /* * system_clock_init: Initialize core clock and bus clock. * void system_clock_init(void) */ system_clock_init: ldr r0, =ELFIN_CLOCK_POWER_BASE @0x7e00f000这个地址是APLL_LOCK寄存器的地址,作为基地址
下面这段代码都是和时钟有关,在此之前先来说下ASYNC MODE和SYNC MODE的去别,看下面:S3C6410 has APLL and MPLL, so you can use that MPLL is source for HCLK, PCLK, etc.(ASYNC mode). In default configuration setting is SYNC mode APLL support main clock for FCLK, HCLK, PCLK, etc. If you want to use ASYNC mode, you have to disabling definition for SMDK6410 SYNC mode selection in “include/configs/smdk6410.h”#define CONFIG_SYNC_MODE应该大致明白了吧,同时在Smdk6410.h (includeconfigs)文件中,有如下定义,#if defined(CONFIG_CLK_666_133_66) /* FIN 12MHz, Fout 666MHz */ #define APLL_MDIV 333 #define APLL_PDIV 3 #define APLL_SDIV 1 #undef CONFIG_SYNC_MODE /* ASYNC MODE */
#elif defined(CONFIG_CLK_OTHERS) /*If you have to use another value, please define pll value here*/ /* FIN 12MHz, Fout 532MHz */ #define APLL_MDIV 266 #define APLL_PDIV 3 #define APLL_SDIV 1 #define CONFIG_SYNC_MODE
#else #error "Not Support Fequency or Mode!! you have to setup right configuration." #endif上面这段代码说明什么呢?SYNC mode is supported under FCLK 532 ?等. If you want to use FCLK 667 ?, you must use ASYNC mode。下面的源码下篇再分析: #ifdef CONFIG_SYNC_MODE ldr r1, [r0, #OTHERS_OFFSET] mov r2, #0x40 orr r1, r1, r2 str r1, [r0, #OTHERS_OFFSET]