xlli_setClocks FUNCTION
;
; This code segment gets the platform hex switch settings and loads the appropriate N and L values into
; the CCCR register. Switch register Bits 15:11 and 7 are ignored by this code.
;
ldr r1, =xlli_PLATFORM_REGISTERS ; Get platform register base address
ldr r2, [r1, #xlli_PLATFORM_SWITCH_offset] ; Load platform switch settings into r2
and r3, r2, #0x7F ; Get both HEX rotary values
mov r3, r3, LSL #2 ; Multiply by 4 to get word offset
add r1, pc, #xlli_CLK_DATA - (.+8) ; Load address of CLK_DATA into r1
add r1, r1, r3 ; Point to address that contains the CCCR data to be loaded
ldr r5, [r1] ; load CCCR value into r5
ands r3, r2, #0x80 ; Is bit 7 set (to set the CCCR A bit)? - This is why we only
; need a table that goes through 7F (they're the same above it)
orrne r5, r5, #0x2000000 ; YES - set the A bit
这一段摘自xlli_lowlev_init.s,用于设定频率,现在用的这个文件不是从Mainstone或Armland中复制过来的,与它们之间都有不同,不知道当初用的是哪的文件。从上面前几行可以知道开发板上有跳线类的东西用来设频率,但是我们的板子上没有,所以会取不到这个值,最终频率就设成13MHz,并且在汇编中没再改变过。这个Armland的板子上在xlli_setClocks里自己另设了一个值放进去,以上的行全部被注释掉。