Chinaunix首页 | 论坛 | 博客
  • 博客访问: 8973
  • 博文数量: 9
  • 博客积分: 320
  • 博客等级: 一等列兵
  • 技术积分: 95
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-15 16:59
文章分类

全部博文(9)

文章存档

2011年(1)

2009年(1)

2008年(7)

我的朋友
最近访客

分类: LINUX

2008-09-23 21:16:35


VIVI-S3C2410-head.S阅读
                                     -------基于FFT-S2410提供的VIVI进行注释
                       2007-04-30
/*
 * vivi/arch/s3c2410/head.S:
 * Initialise hardware
 *
 * Copyright (C) 2001 MIZI Research, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 *
 * Author: Janghoon Lyu <nandy@mizi.com>
 * Date : $Date: 2005/03/29 03:06:30 $
 *
 * $Revision: 1.18 $
 *
 *
 * History:
 *
 * 2002-05-14: Janghoon Lyu <nandy@mizi.com>
 * - Initial code
 *
 */

#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

阅读(528) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-03-19 10:41:59

你好 看了你FFT-S2410提供的VIVI阅读笔记 想来你是有傅立叶公司的VIVI,我借了块板子也是FFT-2410的 但没有光盘了,也没有VIVI,网上找了一些了,都有些问题 可否发一份FFT-2410 的vivi 给我? 谢谢 我的EMAIL:javaisone@163.com