-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
92 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fn main() { | ||
println!("cargo:rerun-if-changed=memory.x"); | ||
|
||
cc::Build::new().file("src/startup.S").compile("startup"); | ||
println!("cargo:rerun-if-changed=src/startup.S"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.cfi_sections .debug_frame | ||
|
||
# .thumb | ||
.section .text.pre_init, "ax" | ||
.globl __pre_init | ||
.type __pre_init,%function | ||
.thumb_func | ||
.cfi_startproc | ||
__pre_init: | ||
|
||
# Enable ITCM and DTCM | ||
ldr r0, =1 | ||
ldr r1, =0xE000EF90 | ||
ldr r2, [r1] | ||
# Set ITCMCR.EN | ||
orr r2, r2, r0 | ||
str r2, [r1] | ||
ldr r1, =0xE000EF94 | ||
ldr r2, [r1] | ||
# Set DTCMCR.EN | ||
orr r2, r2, r0 | ||
str r2, [r1] | ||
dsb | ||
isb | ||
|
||
# Analogous to cortex-m-rt Reset code for .data copying. | ||
# Initialise .itcm code. `__sitcm`, `__siitcm`, and `__eitcm` come from the | ||
# linker script. Copy from r2 into r0 until r0 reaches r1. | ||
ldr r0,=__sitcm | ||
ldr r1,=__eitcm | ||
ldr r2,=__siitcm | ||
1: | ||
cmp r1, r0 | ||
beq 2f | ||
# load 1 word from r2 to r3, inc r2 | ||
ldm r2!, {r3} | ||
# store 1 word from r3 to r0, inc r0 | ||
stm r0!, {r3} | ||
b 1b | ||
2: | ||
dsb | ||
isb | ||
bx lr | ||
.cfi_endproc |