annotate target-utils/compalstage/compalstage.S @ 992:a7b0b426f9ca

target-utils: boot ROM UART autodetection revamped The new implementation should work with both the familiar Calypso C035 boot ROM version found in our regular targets as well as the older Calypso F741979B version found on the vintage D-Sample board.
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Wed, 30 Dec 2015 21:28:41 +0000
parents 48c08499cede
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
314
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 .text
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 .org 0
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 #if THUMB_ENTRY
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 .code 16
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 bx pc
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 nop
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 #endif
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 .code 32
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 /* delay loop like OsmocomBB does */
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 mov r1, #0xa0000
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 1: subs r1, r1, #1
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 bne 1b
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 /* enable the Calypso boot ROM */
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 ldr r1, reg_addr
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 mov r2, #0x0100
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 strh r2, [r1]
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 /* jump to it! */
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 mov pc, #0
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 reg_addr:
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 .word 0xFFFFFB10
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24 #if PAD_TO_1003
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 .org 0x3be0
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 .ascii "1003"
48c08499cede compalstage binaries built
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 #endif