summaryrefslogtreecommitdiffstats
path: root/ports
diff options
context:
space:
mode:
authorJarielle Catbagan <jcatbagan93@gmail.com>2015-06-20 07:52:45 -0700
committerEd Sutter <edsutterjr@gmail.com>2015-06-27 08:42:51 -0400
commitd468669b08e67d2a1450606606b31642090da156 (patch)
treee58aea410ac7ec703e0ad7b864061d00acaf68e4 /ports
parentMap base Umon image in internal SRAM of AM335x/BBB (diff)
downloadumon-d468669b08e67d2a1450606606b31642090da156.tar.bz2
BBB/AM335x: Store addresses of custom exception handlers in the Public RAM reserved for exception vectors
The AM335x jumps to a predefined location when handling an exception. The default locations of the exception handlers are tablified in Table 26-3 under Section 26.1.3.2 in the AM335x TRM. When Umon is executing and an exception occurs the AM335x will normally try to jump to the default exception handler appropriate for the exception that has occured. Since Umon defines a set of custom exception handlers, the addresses of these exception handlers must be stored in the RAM exception vector space in the Public RAM of the AM335x. This is done so that when an exception occurs, instead of program execution being transferred to one of the default exception handlers, it will instead be transferred to a custom exception handler defined by Umon.
Diffstat (limited to 'ports')
-rw-r--r--ports/beagleboneblack/rom_reset.S37
1 files changed, 37 insertions, 0 deletions
diff --git a/ports/beagleboneblack/rom_reset.S b/ports/beagleboneblack/rom_reset.S
index 176f3a7..83d79df 100644
--- a/ports/beagleboneblack/rom_reset.S
+++ b/ports/beagleboneblack/rom_reset.S
@@ -93,6 +93,43 @@ coldstart_1:
orr r0,r0,#0xd3 // Set mode to supervisor, IRQ FIQ disabled.
msr cpsr,r0
+ /* store the address of the custom exception handlers in the exception vector space
+ of the AM335x Public RAM */
+ ldr r1, =undefined_instruction
+ movw r2, #0xce24
+ movt r2, #0x4030
+ str r1, [r2]
+
+ ldr r1, =software_interrupt
+ movw r2, #0xce28
+ movt r2, #0x4030
+ str r1, [r2]
+
+ ldr r1, =abort_prefetch
+ movw r2, #0xce2c
+ movt r2, #0x4030
+ str r1, [r2]
+
+ ldr r1, =abort_data
+ movw r2, #0xce30
+ movt r2, #0x4030
+ str r1, [r2]
+
+ ldr r1, =not_assigned
+ movw r2, #0xce34
+ movt r2, #0x4030
+ str r1, [r2]
+
+ ldr r1, =interrupt_request
+ movw r2, #0xce38
+ movt r2, #0x4030
+ str r1, [r2]
+
+ ldr r1, =fast_interrupt_request
+ movw r2, #0xce3c
+ movt r2, #0x4030
+ str r1, [r2]
+
// bl cache_init
/********************************************************************/