Commit db6601d2 by James Bowman Committed by James Bowman

crti-hw.S: Add watchdog vector, FT930 IRQ support.

libgcc/
	* config/ft32/crti-hw.S: Add watchdog vector, FT930
	IRQ support.

From-SVN: r253276
parent 8da872d9
2017-09-28 James Bowman <james.bowman@ftdichip.com>
* config/ft32/crti-hw.S: Add watchdog vector, FT930 IRQ support.
2017-09-26 Joseph Myers <joseph@codesourcery.com> 2017-09-26 Joseph Myers <joseph@codesourcery.com>
* config/microblaze/crti.S, config/microblaze/crtn.S, * config/microblaze/crti.S, config/microblaze/crtn.S,
......
.global _start .global _start
_start: _start:
# START Interrupt Vector Table [[ # START Interrupt Vector Table [[
jmp __PMSIZE-4 jmp __PMSIZE-4 # RESET Vector
jmp watchdog_init jmp interrupt_33 # Watchdog reset vector
jmp interrupt_0 jmp interrupt_0
jmp interrupt_1 jmp interrupt_1
jmp interrupt_2 jmp interrupt_2
...@@ -35,24 +35,29 @@ _start: ...@@ -35,24 +35,29 @@ _start:
jmp interrupt_29 jmp interrupt_29
jmp interrupt_30 jmp interrupt_30
jmp interrupt_31 jmp interrupt_31
jmp __PMSIZE-8 jmp __PMSIZE-8 # Interrupt vector 32 (NMI)
# ]] END Interrupt Vector Table # ]] END Interrupt Vector Table
codestart: codestart:
jmp init jmp init
.global _exithook .global _exithook
_exithook: # Debugger uses '_exithook' at 0x90 to catch program exit _exithook: # Debugger uses '_exithook' at 0x90 to catch program exit
return return
watchdog_init:
ldk $r0,1
init: init:
ldk $sp,__RAMSIZE ldk $sp,__RAMSIZE
# Disable all interrupts # Disable all interrupts
ldk $r4,0x80 lda $r1,0x10000
sta.b 0x100e3,$r4 lshr $r1,$r1,20
cmp $r1,0x90
ldk $r1,0x100e3 # FT900 IRQ Control Register
jmpc z,1f
ldk $r1,0x10123 # FT930 IRQ Control Register
1:
ldk $r4,0x80
sti.b $r1,0,$r4
# Initialize DATA by copying from program memory # Initialize DATA by copying from program memory
ldk.l $r4,__data_load_start ldk.l $r4,__data_load_start
ldk.l $r1,__data_load_end ldk.l $r1,__data_load_end
...@@ -139,6 +144,7 @@ interrupt_\i: ...@@ -139,6 +144,7 @@ interrupt_\i:
inth 30 inth 30
inth 31 inth 31
inth 32 inth 32
inth 33
# On entry: r0, already saved, holds the handler function # On entry: r0, already saved, holds the handler function
interrupt_common: interrupt_common:
...@@ -182,7 +188,7 @@ nullvector: ...@@ -182,7 +188,7 @@ nullvector:
.section .data .section .data
.global vector_table .global vector_table
vector_table: vector_table:
.rept 33 .rept 34
.long nullvector .long nullvector
.endr .endr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment