annotate gsm-fw/sysglue/sysinit.S @ 631:7cf154cd3891

gsm-fw/sysglue: prep for building flashable images
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 01 Sep 2014 17:04:19 +0000
parents e201f2130c9b
children 02d14592bb73
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
79
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 * This assembly module, which puts bits of code into several different
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 * sections, contains those essential entry point etc bits which are common
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 * to both the regular flashable build and the fc-xram development build.
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6
87
321f6a9ae989 nuc-fw: fixed .section and .align assembly directives
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 80
diff changeset
7 .section iram.vectors,"ax",%progbits
79
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 .code 32
631
7cf154cd3891 gsm-fw/sysglue: prep for building flashable images
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 514
diff changeset
9 #include "vectors.S"
79
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10
87
321f6a9ae989 nuc-fw: fixed .section and .align assembly directives
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 80
diff changeset
11 .section xip.text,"ax",%progbits
79
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 .code 32
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 .globl _FlashorXram_entry
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 _FlashorXram_entry:
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 /* first order of business: copy iram.text to where it's supposed to be */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 ldr r8, =__iramtext_flash_addr
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 ldr r9, =__iramtext_ram_addr
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 ldr r10, =__iramtext_size
80
39b1c369b67f nuc-fw: links to an ELF image
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 79
diff changeset
19 1: ldmia r8!, {r0-r7}
39b1c369b67f nuc-fw: links to an ELF image
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 79
diff changeset
20 stmia r9!, {r0-r7}
79
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 subs r10, r10, #0x20
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 bhi 1b
514
e201f2130c9b gsm-fw/sysglue/sysinit.S: enable Calypso boot ROM on entry for all targets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 312
diff changeset
23 /* enable Calypso boot ROM for the ARM exception and IRQ/FIQ vectors */
e201f2130c9b gsm-fw/sysglue/sysinit.S: enable Calypso boot ROM on entry for all targets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 312
diff changeset
24 ldr r1, =0xFFFFFB10
e201f2130c9b gsm-fw/sysglue/sysinit.S: enable Calypso boot ROM on entry for all targets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 312
diff changeset
25 mov r2, #0x0100
e201f2130c9b gsm-fw/sysglue/sysinit.S: enable Calypso boot ROM on entry for all targets
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 312
diff changeset
26 strh r2, [r1]
79
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 /* now we can call any function w/o worry as to where it lives */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 /* clear int.bss and ext.bss, using bzero() from libc */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 ldr r0, =__intbss_start
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30 ldr r1, =__intbss_size
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31 bl bzero
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 ldr r0, =__extbss_start
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33 ldr r1, =__extbss_size
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 bl bzero
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 /* we can start Nucleus now! */
947b1f473960 beginning of nuc-fw
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 b INT_Initialize
132
2c5160a9d652 nuc-fw: switched from nucdemo to Riviera, got some serial output
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 87
diff changeset
37
2c5160a9d652 nuc-fw: switched from nucdemo to Riviera, got some serial output
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 87
diff changeset
38 /*
2c5160a9d652 nuc-fw: switched from nucdemo to Riviera, got some serial output
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 87
diff changeset
39 * riviera/support/exception.c references exit()
2c5160a9d652 nuc-fw: switched from nucdemo to Riviera, got some serial output
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 87
diff changeset
40 * The following kludge will allow us to pass the link for the time being
2c5160a9d652 nuc-fw: switched from nucdemo to Riviera, got some serial output
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 87
diff changeset
41 * until we can find a better solution, such as hooking into DAR maybe.
2c5160a9d652 nuc-fw: switched from nucdemo to Riviera, got some serial output
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 87
diff changeset
42 */
2c5160a9d652 nuc-fw: switched from nucdemo to Riviera, got some serial output
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 87
diff changeset
43
2c5160a9d652 nuc-fw: switched from nucdemo to Riviera, got some serial output
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 87
diff changeset
44 .globl exit
2c5160a9d652 nuc-fw: switched from nucdemo to Riviera, got some serial output
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 87
diff changeset
45 exit:
2c5160a9d652 nuc-fw: switched from nucdemo to Riviera, got some serial output
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 87
diff changeset
46 b .