From: James Bowman Date: Fri, 29 Sep 2017 01:01:52 +0000 (+0000) Subject: crti-hw.S: Add watchdog vector, FT930 IRQ support. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=db6601d2b6e471598716ec7ab88a780bd4676933;p=gcc.git crti-hw.S: Add watchdog vector, FT930 IRQ support. libgcc/ * config/ft32/crti-hw.S: Add watchdog vector, FT930 IRQ support. From-SVN: r253276 --- diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 68401477f52..7b1ffb1a0cc 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2017-09-28 James Bowman + + * config/ft32/crti-hw.S: Add watchdog vector, FT930 IRQ support. + 2017-09-26 Joseph Myers * config/microblaze/crti.S, config/microblaze/crtn.S, diff --git a/libgcc/config/ft32/crti-hw.S b/libgcc/config/ft32/crti-hw.S index c2951fc3c28..8ee1d38b47e 100644 --- a/libgcc/config/ft32/crti-hw.S +++ b/libgcc/config/ft32/crti-hw.S @@ -1,8 +1,8 @@ .global _start _start: # START Interrupt Vector Table [[ - jmp __PMSIZE-4 - jmp watchdog_init + jmp __PMSIZE-4 # RESET Vector + jmp interrupt_33 # Watchdog reset vector jmp interrupt_0 jmp interrupt_1 jmp interrupt_2 @@ -35,24 +35,29 @@ _start: jmp interrupt_29 jmp interrupt_30 jmp interrupt_31 - jmp __PMSIZE-8 + jmp __PMSIZE-8 # Interrupt vector 32 (NMI) # ]] END Interrupt Vector Table codestart: jmp init - + .global _exithook _exithook: # Debugger uses '_exithook' at 0x90 to catch program exit return - -watchdog_init: - ldk $r0,1 + init: ldk $sp,__RAMSIZE # Disable all interrupts - ldk $r4,0x80 - sta.b 0x100e3,$r4 - + lda $r1,0x10000 + 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 ldk.l $r4,__data_load_start ldk.l $r1,__data_load_end @@ -139,6 +144,7 @@ interrupt_\i: inth 30 inth 31 inth 32 + inth 33 # On entry: r0, already saved, holds the handler function interrupt_common: @@ -182,7 +188,7 @@ nullvector: .section .data .global vector_table vector_table: - .rept 33 + .rept 34 .long nullvector .endr