📄 a90084.s
字号:
/************************************************************* * File: lib/a90084.s * Purpose: Part of C runtime library * Author: Phil Bunce (pjb@carmel.com) * Revision History: * 980409 Created from a4101.s */#ifndef L9A0084#define L9A0084#endif#include <mips.h> .globl a90084init .ent a90084inita90084init: beq a0,zero,1f j c90084init 1: # set BDC # !!! change so it doesn't change device size #### li t1,M_084_BDC li t0,0x000009d2 # SRAM, 8BIT,DC1=0,DW1=1,EA=0,WS=7,DC=2 sw t0,(t1) # set DOC li t1,M_084_D0C #li t0,0x00000897 # DRAM, 32BIT,RCD=2,CPW=0,RP=1,CP=0,EDO=1 li t0,0x00000a2f sw t0,(t1) # set D2C li t1,M_084_D2C li t0,0x000009d2 # SRAM, 8BIT,DC1=0,DW1=1,EA=0,WS=7,DC=2 sw t0,(t1) # set D3C li t1,M_084_D3C li t0,0x000009d4 # SRAM, 16BIT,DC1=0,DW1=1,EA=0,WS=7,BRE=0,DC=2 sw t0,(t1) # set REFRESH li t1,M_084_REFRESH li t0,200 # guess? sw t0,(t1) # set CCS li t1,M_084_CCS #li t0,(CCS_RP|CCS_IBS4|CCS_DBS4|CCS_DCEN|CCS_ICEN) li t0,(CCS_IBS4|CCS_DBS4|CCS_DCEN|CCS_ICEN) sw t0,(t1) # enable the clocks li t1,M_084_SYSCLK li t0,(SYSCLK_MCLKENP|SYSCLK_BIUCLK|SYSCLK_TMR0CLK) or t0,(SYSCLK_TMR1CLK|SYSCLK_SIO0CLK|SYSCLK_SIO1CLK) or t0,(SYSCLK_SIO2CLK)1: # sw t0,(t1) #lw t2,(t1) li t0,0x1ffff sw t0,(t1) # select the correct cache flushing routines la s0,r90084_flush j ra .end a90084init/************************************************************** Ulong specialRead0084(Ulong addr,Ulong cfg)* savecfg = read_target(XT_MEM,M_0084_CCS,4);* write_target(XT_MEM,M_0084_CCS,cfg,4);* val = read_target(XT_MEM,addr,4);* write_target(XT_MEM,M_0084_CCS,savecfg,4);* return(val);*/ .globl specialRead0084 .ent specialRead0084specialRead0084: la t0,1f or t0,K1BASE j t0 1: .set noreorder mfc0 t8,C0_SR nop and t0,t8,~SR_IEC mtc0 t0,C0_SR .set reorder li t4,M_084_CCS lw t3,(t4) # setup sw a1,(t4) lw zero,(t4) # wbflush .set noreorder;nop;nop;.set reorder # read lw v0,(a0) .set noreorder;nop;nop;.set reorder # restore sw t3,(t4) lw zero,(t4) # wbflush .set noreorder;nop;nop;.set reorder .set noreorder mtc0 t8,C0_SR .set reorder j ra .end specialRead0084
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -