📄 stbwakeup.s
字号:
##############################################################
##
## STBwakeup.S
##
## 30210-01jf modify: clear unused nop for panel standby
###############################################################
#include <platform.h>
##############################################################
#
#WakeUp_Standby
#
##############################################################
.align 4
.text
.globl WakeUp_Standby
.ent WakeUp_Standby
.set noreorder
WakeUp_Standby:
# nop
# nop
la $2, 0xBFC00000
# nop
# nop
jr $2
# nop
nop
.set reorder
.end WakeUp_Standby
##############################################################
#
#StandbyCodeFillCache
# Fill Data to D Cache and Instraction to I Cache
#
##############################################################
.globl StandbyCodeFillCache
.ent StandbyCodeFillCache
StandbyCodeFillCache:
#ifdef SOFT_STANDBY_ENABLE
la $5, _IRstandby_global_start
test:
la $4, _IRstandby_global_end
#endif
Download_D_cache_Copy_Loop:
lw $2, 0($5) # Pickup a word content
addiu $5, 4 # Increment source address
# nop
bne $4, $5, Download_D_cache_Copy_Loop # Not at end? Continue with clear
# nop # Delay slot
nop
//load from 0x80000180 for INT_General_Exception
//if INT_General_Exception addresss or content changed, instructions as follow must be modified
la $5, INT_General_Exception_Hdlr
la $4, IR_END_label
Download_I_cache_Copy_Loop:
.set mips3
cache 20,0($5)
.set mips2
addiu $5, 4
# nop
bne $4, $5, Download_I_cache_Copy_Loop
# nop
nop
//load from 0x80000180 for INT_General_Exception
//if INT_General_Exception addresss or content changed, instructions as follow must be modified
la $5, 0x80000180 # General exception handler address ;INT_BASE_STB==0x80000180
.set mips3
cache 20,0($5)
cache 20,4($5)
cache 20,8($5)
cache 20,12($5)
cache 20,16($5)
cache 20,20($5)
.set mips2
nop
j $31
# nop
nop
.end StandbyCodeFillCache
#make sure dram control is turned off ?
##############################################################
##tpe020613 Tom Yang add for m3351 power down
##sequency as follow:
## (1)Servo Power Down
## (2)ADC Power Down
## (3) Audio PLL Power Down
## (4)TV DAC Power Down
## (5)MPEG power down
## (6)DRAM Power down jeff&tom
## (7)CPU Power down ------------can not do it
##############################################################
.text
.set noreorder
.align 2
.globl Servo_ADC_Audio_TVDAC_MPEG_CPU_powerdown
.ent Servo_ADC_Audio_TVDAC_MPEG_CPU_powerdown
Servo_ADC_Audio_TVDAC_MPEG_CPU_powerdown:
################# 1 Servo Power down
#//20030620 Tom Yang for standby removed li $3, 0xDF010000 # set uP wait delay
#//20030620 Tom Yang for standby removed li $2, 0xC000
#//20030620 Tom Yang for standby removed sw $2, 0($3)
#//20030620 Tom Yang for standby removed
#//20030620 Tom Yang for standby removed li $3, 0xDF001000
#//20030620 Tom Yang for standby removed li $2, 0x1F
#//20030620 Tom Yang for standby removed sb $2, 0x88($3)
#//20030620 Tom Yang for standby removed li $2, 0x03
#//20030620 Tom Yang for standby removed sb $2, 0x139($3)
#//20030620 Tom Yang for standby removed li $2, 0xFF
#//20030620 Tom Yang for standby removed sb $2, 0x138($3)
#//20030620 Tom Yang for standby removed lb $2, 0x88($3)
#//20030620 Tom Yang for standby removed lb $2, 0x139($3)
#//20030620 Tom Yang for standby removed lb $2, 0x138($3)
################## 2 ADC power down
li $3, 0xDF000000
lb $2, 0x1E7($3) # ADC power down
or $2, $2, 0x04 # set 0xDF0001E7 bit 2 to 1
sb $2, 0x1E7($3)
################## 3 Audio PLL power down
li $3, 0xDF000000
lb $2, 0x1E6($3) # Audio PLL power down
or $2, $2, 0x20 # set 0xDF0001E4 bit 21 to 1
sb $2, 0x1E6($3)
################## 4 TV DAC power down
li $2, 0x04 # TV DAC power down
sb $2, 0x19C($3) # set 0xDF00019C to 0x04
li $2, 0x40
sb $2, 0x19D($3) # set 0xDF00019D to 0x40
################## 5 MPEG power down
lb $2, 0x0($3) # MPEG power down
or $2, $2, 0x40 # set 0xDF000000 bit 6 to 1
sb $2, 0x0($3)
################## 6 DRAM power down
DRAM_POWER_DOWN:
li $3, 0xDF000000
lb $2, 0x75($3) # DRAM power down
or $2, $2, 0x40 # set 0xDF000075 bit 6 to 1
sb $2, 0x75($3)
# nop
nop
################## 7 CPU power down ------------can not do it
# nop # CPU power down
# nop
# nop
# nop
# .word 0x42000020 # waiti
# nop
j $31
nop
# nop
.end Servo_ADC_Audio_TVDAC_MPEG_CPU_powerdown
#--------------------------------------------------------------------
#
# Function_Name: EnIRInt
# Description: Enable IR interrupts
# Arguments: None
# Return Value: None
#
#--------------------------------------------------------------------
# .globl EnIRInt
# .ent EnIRInt
#EnIRInt:
# mfc0 $8, $12
# nop
# or $8, 0x00000401
# mtc0 $8, $12
# nop
# nop
# subu $29, 8
# sw $8, 0($29)
# sw $1, 4($29)
# nop
# lw $8, 0x00000400 #only enable IR interrupt
# bne $8, $0, no_enable # needed by cycle timer
# nop
#
# mfc0 $8, $12
# nop
# or $8, 0x00000001
# mtc0 $8, $12
# nop
# nop
# nop
#no_enable:
# lw $8, 0($29)
# lw $1, 4($29)
# addu $29, 8
# jr $31
# nop
# nop
# .end EnIRInt
##############################################################
#
#alert_STB:
#
#
##############################################################
/* .align 2
.globl alert_STB
.ent alert_STB
alert_STB:
# .frame $fp,8,$31 # vars= 0, regs= 1/0, args= 0, extra= 0
# .mask 0x40000000,-8
# .fmask 0x00000000,0
# subu $sp,$sp,8
# sd $fp,0($sp)
# move $fp,$sp
# sw $4,12($fp)
# lw $2,12($fp)
subu $sp, 4
sw $31, 0($sp)
jal RegSave_STB
# nop
# nop
nop
li $10, 0xff103000
sw $0, 0x0c($10) # clear TE=0
li $2, 0x70 # set TE=1, enable transmitter
sw $2, 0x0c($10) # write 0x0c register
move $2, $4
li $5, 0x04
send:
lb $3, 0($2)
sw $3, 0x04($10) # send to 0x04
sw $0, 0x10($10) # clear TDRE bit in 0x10
check_end:
lw $4, 0x10($10) # read 0x10 register
and $6, $4, $5
beq $6, $0, check_end # transmitting not finished
nop
addiu $2, $2, 1
bne $3, $0, send # if char is not \0, send next char
nop
jal RegLoad_STB
nop
# nop
# nop
lw $31, 0($sp)
addu $sp, 4
# nop # Delay slot
# nop # Delay slot
# nop # Delay slot
# move $sp,$fp # sp not trusted here
# ld $fp,0($sp)
# addu $sp,$sp,8
j $31
nop
# nop
.end alert_STB
*/
#--------------------------------------------------------------------
#
# Function_Name: RegSave_STB
# Description: Save registers
# Arguments: None
# Return Value: None
#
#--------------------------------------------------------------------
.globl RegSave_STB
.ent RegSave_STB
.set noreorder
.set noat
RegSave_STB:
subu $29, 128 # use stack to save regs
sw $1, 1*4($29) # Reserved for the assembler
sw $2, 2*4($29)
sw $3, 3*4($29)
sw $4, 4*4($29)
sw $5, 5*4($29)
sw $6, 6*4($29)
sw $7, 7*4($29)
sw $8, 8*4($29)
sw $9, 9*4($29)
sw $10, 10*4($29)
sw $11, 11*4($29)
sw $12, 12*4($29)
sw $13, 13*4($29)
sw $14, 14*4($29)
sw $15, 15*4($29)
sw $16, 16*4($29)
sw $17, 17*4($29)
sw $18, 18*4($29)
sw $19, 19*4($29)
sw $20, 20*4($29)
sw $21, 21*4($29)
sw $22, 22*4($29)
sw $23, 23*4($29)
sw $24, 24*4($29)
sw $25, 25*4($29)
sw $26, 26*4($29)
sw $27, 27*4($29)
sw $28, 28*4($29)
sw $30, 29*4($29)
mfhi $8
sw $8, 30*4($29)
mflo $8
sw $8, 31*4($29)
jr $31
nop
.set at
.set reorder
.end RegSave_STB
#--------------------------------------------------------------------
#
# Function_Name: RegLoad_STB
# Description: Restore registers
# Arguments: None
# Return Value: None
#
#--------------------------------------------------------------------
.globl RegLoad_STB
.ent RegLoad_STB
.set noat
RegLoad_STB:
lw $8, 30*4($29)
mthi $8
lw $8, 31*4($29)
mtlo $8
lw $1, 1*4($29)
lw $2, 2*4($29)
lw $3, 3*4($29)
lw $4, 4*4($29)
lw $5, 5*4($29)
lw $6, 6*4($29)
lw $7, 7*4($29)
lw $8, 8*4($29)
lw $9, 9*4($29)
lw $10, 10*4($29)
lw $11, 11*4($29)
lw $12, 12*4($29)
lw $13, 13*4($29)
lw $14, 14*4($29)
lw $15, 15*4($29)
lw $16, 16*4($29)
lw $17, 17*4($29)
lw $18, 18*4($29)
lw $19, 19*4($29)
lw $20, 20*4($29)
lw $21, 21*4($29)
lw $22, 22*4($29)
lw $23, 23*4($29)
lw $24, 24*4($29)
lw $25, 25*4($29)
lw $26, 26*4($29)
lw $27, 27*4($29)
lw $28, 28*4($29)
lw $30, 29*4($29)
addu $29, 128 # restore original sp value
jr $31
nop
.set at
.end RegLoad_STB
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -