#include "config.h"
#include "linkage.h"
#include "machine.h"
/*其中"machine.h" 包括了smdk2410.h (有关开发板的配置) ,
包括memory map, Porocessor memory map ,FLASH, ROM, DRAM的物理地址和在VIVI用的虚拟地址(?),Architecture magic and machine type, UART,CPU,DRAM的初始化参数等
smdk2410.h进一步包括s3c2410.h, 有关CPU的设置,Definition of constants related to the S3C2410 microprocessor(based on ARM 920T).
*/
@ Start of executable code
ENTRY(_start)
ENTRY(ResetEntryPoint)
@
@ Exception vector table (physical address = 0x00000000)
@ 异常向量表地址
@ 0x00: Reset
b Reset @复位
ldr pc, _undefined_instruction @为定义指令
ldr pc, _software_interrupt @软件中断
ldr pc, _prefetch_abort @预取指中止异常
ldr pc, _data_abort @数据异常
ldr pc, _not_used @未使用
ldr pc, _irq @普通中断
ldr pc, _fiq @快速中断
_undefined_instruction: .word HandleUndef @undefined_instruction
_software_interrupt: .word HandleSWI @software_interrupt
_prefetch_abort: .word HandlePrefetchAbort @prefetch_abort
_data_abort: .word HandleDataAbort @data_abort
_not_used: .word HandleNotUsed @not_used
_irq: .word HandleIRQ @irq
_fiq: .word HandleFIQ @fiq
@
@ VIVI magics
@
@ 0x20: magic number so we can verify that we only put
.long 0
@ 0x24:
.long 0
@ 0x28: where this vivi was linked, so we can put it in memory in the right place
.long _start
@ 0x2C: this contains the platform, cpu and machine id。
@ Included in include/platform/smdk2410.h
.long ARCHITECTURE_MAGIC
@ 0x30: vivi capabilities
.long 0
#ifdef CONFIG_PM
@ 0x34:
b SleepRamProc
#endif
#ifdef CONFIG_TEST
@ 0x38:
b hmi
#endif
@
@ Start VIVI head
@
Reset:
@ disable watch dog timer
mov r1, #0x53000000
mov r2, #0x0
str r2, [r1]
@另一种platform,非SMDK
@in include/autoconf.h: #undef CONFIG_S3C2410_MPORT3
#ifdef CONFIG_S3C2410_MPORT3
@ Serial Initialize GPHCON
mov r1, #0x56000000
mov r2, #0x00000005
str r2, [r1, #0x70]
mov r2, #0x00000001
str r2, [r1, #0x78]
mov r2, #0x00000001
str r2, [r1, #0x74]
#endif
@ disable all interrupts
mov r1, #INT_CTL_BASE
mov r2, #0xffffffff
str r2, [r1, #oINTMSK]
ldr r2, =0x7ff
str r2, [r1, #oINTSUBMSK]
@ initialise system clocks
mov r1, #CLK_CTL_BASE
@”mvn rd,rm” = “rd = ~rm” 且0<= m,d <= 7
mvn r2, #0xff000000
str r2, [r1, #oLOCKTIME]
@ldr r2, mpll_50mhz
@str r2, [r1, #oMPLLCON]
@@in include/autoconf.h: #undef CONFIG_S3C2410_MPORT1
#ifndef CONFIG_S3C2410_MPORT1
@ 1:2:4 PCLK:HCLK:FCLK
mov r1, #CLK_CTL_BASE
mov r2, #0x3
str r2, [r1, #oCLKDIVN]
mrc p15, 0, r1, c1, c0, 0 @ read ctrl register in MMU
orr r1, r1, #0xc0000000 @ Asynchronous clocking model
mcr p15, 0, r1, c1, c0, 0 @ write ctrl register
@ now, CPU clock is 200 Mhz
mov r1, #CLK_CTL_BASE
ldr r2, mpll_200mhz
str r2, [r1, #oMPLLCON]
#else
@ 1:2:2
mov r1, #CLK_CTL_BASE
ldr r2, clock_clkdivn
str r2, [r1, #oCLKDIVN]
mrc p15, 0, r1, c1, c0, 0 @ read ctrl register
orr r1, r1, #0xc0000000 @ Asynchronous clocking mode
mcr p15, 0, r1, c1, c0, 0 @ write ctrl register
@ now, CPU clock is 100 Mhz
mov r1, #CLK_CTL_BASE
ldr r2, mpll_100mhz
str r2, [r1, #oMPLLCON]
#endif
@ set memory control registers
bl memsetup
#ifdef CONFIG_PM
@ Check if this is a wake-up from sleep
ldr r1, PMST_ADDR
ldr r0, [r1]
tst r0, #(PMST_SMR)
bne WakeupStart
#endif
#ifdef CONFIG_S3C2410_SMDK
@ All LED on
mov r1, #GPIO_CTL_BASE
add r1, r1, #oGPIO_F
ldr r2,=0x55aa
@ enable EINT0,EINT1,EINT2,EINT3 , otherelse(4) used for output
@GPF0, GPF1, GPF2, GPF3 for INT; GPF4~ GPF7 for output
str r2, [r1, #oGPIO_CON]
@disable pull-up
mov r2, #0xff
str r2, [r1, #oGPIO_UP]
mov r2, #0x00
str r2, [r1, #oGPIO_DAT]
#endif
#if 0
@ SVC
mrs r0, cpsr
bic r0, r0, #0xdf
orr r1, r0, #0xd3
msr cpsr_all, r1
#endif
@ set GPIO for UART
mov r1, #GPIO_CTL_BASE
add r1, r1, #oGPIO_H
@ gpio_con_uart = vGPHCON= 0x0016faaa, 在/vivi/include/platform/smdk2410.h中赋@ 值
ldr r2, gpio_con_uart
str r2, [r1, #oGPIO_CON]
@oGPIO_CON = 0x0
@ GPH0 bit[1:0] = 10 nCTS0
@GPH1 bit[3:2] = 10 nRTS0
@GPH2 bit[5:4] = 10 TXD0
@GPH3 bit[7:6] = 10 RXD0
@GPH4 bit[9:8] = 10 TXD1
@GPH5 bit[11:10] = 10 RXD1
@GPH6 bit[13:12] = 11 nRTS1
@GPH7 bit[15:14] = 11 nCTS1
@GPH8 bit[17:16] = 10 UEXTCLK
@GPH9 bit[19:18] = 01 Output
@GPH10 bit[21:20] = 01 Output
ldr r2, gpio_up_uart
|