fixing up switch to SVC and secure mode for pi3, thanks ultibo and others on the bare metal forum

This commit is contained in:
dwelch
2016-03-28 20:57:50 -04:00
parent 6f4c0d8bcc
commit 066f219ada
15 changed files with 607 additions and 482 deletions

View File

@@ -9,24 +9,74 @@ flavors of raspberry pi.
This directory is for aarch32 mode (dont use a config.txt) and switches
from HYP back to SVC mode.
I am going to run with this until it breaks. The solution still doesnt
work everywhere and way it should, so that is still a mystery. Thanks
to the folks at the raspberry pi bare metal forum and BSD and Linux and
other sources that all use eret to change the spsr
The bootloader is one level up and shared for both SVC and HYP as I
want the applications loaded to make the changes not the bootloader.
For now this seems to work switching back to SVC and to secure mode
.globl _start
_start:
ldr pc,reset_handler
ldr pc,undefined_handler
ldr pc,swi_handler
ldr pc,prefetch_handler
ldr pc,data_handler
ldr pc,hyp_handler
ldr pc,irq_handler
ldr pc,fiq_handler
reset_handler: .word reset
undefined_handler: .word hang
swi_handler: .word smc
prefetch_handler: .word hang
data_handler: .word hang
hyp_handler: .word hang
irq_handler: .word hang
fiq_handler: .word hang
reset:
;@ b skip
mrs r0,cpsr
and r1,r0,#0x1F
cmp r1,#0x1A
bne skip
bic r0,r0,#0x1F
orr r0,r0,#0x13
msr spsr_cxsf,r0
add r0,pc,#4
msr ELR_hyp,r0 ;@ .word 0xe12ef300
eret ;@ .word 0xe160006e
msr ELR_hyp,r0
eret
skip:
So I cant access the VBAR or SCR or others yet so more work to be done.
mrc p15, 0, r1, c12, c0, 0 ;@ get vbar
mov r0,#0x8000
;@ mov r1,#0x0000
ldmia r0!,{r2,r3,r4,r5,r6,r7,r8,r9}
stmia r1!,{r2,r3,r4,r5,r6,r7,r8,r9}
ldmia r0!,{r2,r3,r4,r5,r6,r7,r8,r9}
stmia r1!,{r2,r3,r4,r5,r6,r7,r8,r9}
mov r12,#0
mcr p15, 0, r12, c7, c10, 1
dsb
mov r12, #0
mcr p15, 0, r12, c7, c5, 0
mov r12, #0
mcr p15, 0, r12, c7, c5, 6
dsb
isb
smc #0
mrc p15,0,r2,c1,c0,0
bic r2,#0x1000
bic r2,#0x0004
mcr p15,0,r2,c1,c0,0
mov sp,#0x8000
mov r0,pc
bl notmain
hang: b hang
smc:
mrc p15, 0, r1, c1, c1, 0
bic r1, r1, #1
mcr p15, 0, r1, c1, c1, 0
movs pc, lr

View File

@@ -4,24 +4,70 @@
.globl _start
_start:
ldr pc,reset_handler
ldr pc,undefined_handler
ldr pc,swi_handler
ldr pc,prefetch_handler
ldr pc,data_handler
ldr pc,hyp_handler
ldr pc,irq_handler
ldr pc,fiq_handler
reset_handler: .word reset
undefined_handler: .word hang
swi_handler: .word smc
prefetch_handler: .word hang
data_handler: .word hang
hyp_handler: .word hang
irq_handler: .word hang
fiq_handler: .word hang
reset:
;@ b skip
mrs r0,cpsr
and r1,r0,#0x1F
cmp r1,#0x1A
bne skip
bic r0,r0,#0x1F
orr r0,r0,#0x13
msr spsr_cxsf,r0
add r0,pc,#4
msr ELR_hyp,r0 ;@ .word 0xe12ef300
eret ;@ .word 0xe160006e
msr ELR_hyp,r0
eret
skip:
mrc p15, 0, r1, c12, c0, 0 ;@ get vbar
mov r0,#0x8000
;@ mov r1,#0x0000
ldmia r0!,{r2,r3,r4,r5,r6,r7,r8,r9}
stmia r1!,{r2,r3,r4,r5,r6,r7,r8,r9}
ldmia r0!,{r2,r3,r4,r5,r6,r7,r8,r9}
stmia r1!,{r2,r3,r4,r5,r6,r7,r8,r9}
mov r12,#0
mcr p15, 0, r12, c7, c10, 1
dsb
mov r12, #0
mcr p15, 0, r12, c7, c5, 0
mov r12, #0
mcr p15, 0, r12, c7, c5, 6
dsb
isb
smc #0
mrc p15,0,r2,c1,c0,0
bic r2,#0x1000
bic r2,#0x0004
mcr p15,0,r2,c1,c0,0
mov sp,#0x8000
mov r0,pc
bl notmain
hang: b hang
smc:
mrc p15, 0, r1, c1, c1, 0
bic r1, r1, #1
mcr p15, 0, r1, c1, c1, 0
movs pc, lr
.globl PUT32
PUT32:
str r1,[r0]
@@ -46,6 +92,20 @@ GETCPSR:
mrs r0,cpsr
bx lr
.globl GETVBAR
GETVBAR:
mrc p15, 0, r0, c12, c0, 0
bx lr
.globl GETSCR
GETSCR:
mcr p15, 0, r0, c1, c1, 0
bx lr
.globl GETSCTLR
GETSCTLR:
mrc p15,0,r0,c1,c0,0
bx lr
;@-------------------------------------------------------------------------

View File

@@ -17,6 +17,9 @@ extern void dummy ( unsigned int );
extern unsigned int BRANCHTO ( unsigned int );
extern unsigned int GETCPSR ( void );
extern unsigned int GETVBAR ( void );
extern unsigned int GETSCTLR ( void );
extern unsigned int GETSCR ( void );
extern void uart_init ( void );
extern unsigned int uart_lcr ( void );
@@ -39,6 +42,11 @@ int notmain ( void )
hexstring(0x12345678);
hexstring(GETPC());
hexstring(GETCPSR());
hexstring(GETVBAR());
hexstring(GETSCTLR());
hexstring(GETSCR()); //this one hangs if not in the right mode
hexstring(0x87654321);
return(0);
}
//-------------------------------------------------------------------------

View File

@@ -31,3 +31,4 @@ kernel7.img : loader vectors.o periph.o bootloader07.o
$(ARMGNU)-objcopy bootloader07.elf -O ihex bootloader07.hex
$(ARMGNU)-objcopy bootloader07.elf -O binary kernel7.img

View File

@@ -3,9 +3,8 @@ See the top level README for information on where to find documentation
for the raspberry pi and the ARM processor inside. Also find information
on how to load and run these programs.
This example is for the pi3, see other directories for other flavors
of raspberry pi. I want to let the examples switch from HYP to SVC
mode so this bootloader does not make a switch.
This example is for the pi3 in aarch32 bit mode, see other directories
for other flavors of raspberry pi.
This is a very simple bootloader. Instead of the sd dance (see
top level README), this makes life a bit simpler and greatly reduces
@@ -48,4 +47,7 @@ will reset the board, and released allow it to boot again. Then you
can use this bootloader and simply press the button to try another
program.
Wow, forgot that the GPU planted bootstrap turns on the caches. And
I was seeing the cache coherency problems with doing that. In theory
I have that fixed, it invalidates I and D and branch prediction
before launching the downloaded code.

View File

@@ -13,9 +13,10 @@ extern void PUT16 ( unsigned int, unsigned int );
extern void PUT8 ( unsigned int, unsigned int );
extern unsigned int GET32 ( unsigned int );
extern unsigned int GETPC ( void );
extern unsigned int GETCPSR ( void );
extern unsigned int GETSCTLR ( void );
extern void BRANCHTO ( unsigned int );
extern void dummy ( unsigned int );
extern unsigned int GETCPSR ( void );
extern void uart_init ( void );
extern unsigned int uart_lcr ( void );
@@ -50,6 +51,7 @@ int notmain ( void )
hexstring(0x12345678);
hexstring(GETPC());
hexstring(GETCPSR());
hexstring(GETSCTLR());
uart_send('I');
uart_send('H');
@@ -148,11 +150,16 @@ int notmain ( void )
}
case 0x01:
{
for(ra=0;ra<20;ra++)
hexstring(sum);
state=0;
segment=0;
sum=0;
data=0;
record_type=0;
address=0;
byte_count=0;
state=0;
break;
}
case 0x02:

View File

@@ -129055,94 +129055,92 @@
:10FFE0000000000000000000000000000000000011
:10FFF0000000000000000000000000000000000001
:020000040020DA
:1000000002D3A0E3C20000EBFEFFFFEA001080E590
:1000000002D3A0E3B40000EBFEFFFFEA001080E59E
:100010001EFF2FE1B010C0E11EFF2FE10010C0E570
:100020001EFF2FE1000090E51EFF2FE10E00A0E172
:100030001EFF2FE110FF2FE11EFF2FE100000FE157
:100040001EFF2FE110402DE908009FE5F4FFFFEBB4
:100050001040BDE81EFF2FE15450213F10402DE914
:100060001C009FE5EEFFFFEB010010E3FBFFFF0A22
:1000700010009FE5EAFFFFEB1040BDE8FF0000E243
:100080001EFF2FE15450213F4050213F10402DE9E9
:100090000C009FE5E2FFFFEB1040BDE8010000E22D
:1000A0001EFF2FE15450213F10402DE90040A0E1F8
:1000B0001C009FE5DAFFFFEB200010E3FBFFFF0AC7
:1000C0000410A0E10C009FE5CFFFFFEB1040BDE85E
:1000D0001EFF2FE15450213F4050213F10402DE999
:1000E00010009FE5CEFFFFEB010C10E3FBFFFF1AB2
:1000F0001040BDE81EFF2FE15450213F70402DE914
:100100000050A0E12040A0E3044044E23504A0E117
:100110000F0000E2090050E3370080823000809237
:10012000E0FFFFEB000054E3F6FFFF1A2000A0E31E
:100130007040BDE8DBFFFFEA10402DE9EEFFFFEB6A
:100140000D00A0E3D7FFFFEB0A00A0E31040BDE8DD
:10015000D4FFFFEA10402DE90110A0E3D4009FE591
:10016000A9FFFFEB0010A0E3CC009FE5A6FFFFEB8B
:100170000010A0E3C4009FE5A3FFFFEB0310A0E382
:10018000BC009FE5A0FFFFEB0010A0E3B4009FE5DB
:100190009DFFFFEB0010A0E39C009FE59AFFFFEBA3
:1001A000C610A0E3A0009FE597FFFFEB9C109FE522
:1001B0009C009FE594FFFFEB98009FE598FFFFEB05
:1001C0003F1AC0E3121A81E388009FE58EFFFFEB20
:1001D0000010A0E380009FE58BFFFFEB0040A0E351
:1001E0000400A0E1014084E292FFFFEB960054E39B
:1001F000FAFFFF1A0319A0E360009FE582FFFFEBFF
:100200000040A0E30400A0E1014084E289FFFFEB8D
:10021000960054E3FAFFFF1A0010A0E33C009FE5AC
:1002200079FFFFEB0310A0E310009FE576FFFFEBE3
:100230001040BDE81EFF2FE10450213F4450213FF4
:100240006050213F4C50213F5050213F4850213FAA
:100250000E0100006850213F0400203F9400203F21
:100260009800203F10402DE91C409FE5F918A0E3BD
:100270000400A0E164FFFFEB0400A0E10C109FE587
:1002800061FFFFEB1040BDE81EFF2FE108B4003F07
:100290000002F90010402DE908009FE560FFFFEB28
:1002A0001040BDE81EFF2FE120B4003F70402DE953
:1002B00054409FE50400A0E159FFFFEB4C509FE53F
:1002C0000E16C0E3021681E30400A0E14EFFFFEB2F
:1002D0000500A0E152FFFFEB0E19C0E31C4084E2D1
:1002E0000500A0E1021981E347FFFFEB0400A0E154
:1002F0000219A0E344FFFFEB0400A0E10810A0E313
:1003000041FFFFEB7040BDE81EFF2FE11000203FD2
:100310000C00203FF0472DE90080A0E3E2FFFFEB57
:100320008BFFFFEB54029FE582FFFFEB3EFFFFEBED
:1003300080FFFFEB40FFFFEB7EFFFFEB4900A0E3F8
:1003400058FFFFEB4800A0E356FFFFEB4500A0E39A
:1003500054FFFFEB5800A0E352FFFFEB0D00A0E3BA
:1003600050FFFFEB0A00A0E30890A0E10860A0E1C5
:100370000850A0E10870A0E10840A0E149FFFFEBB0
:1003800035FFFFEB3A0050E32B00000A0D0050E36D
:100390000A00501301A0A00300A0A0132900000A26
:1003A0002030C0E3470053E35000000A013044E22C
:1003B000140053E303F19F97F0FFFFEA2C042000A1
:1003C0002C042000CC042000CC042000CC0420000D
:1003D000CC042000AC042000740420005004200051
:1003E0005004200050042000500420004404200049
:1003F000100420001004200010042000100420002D
:10040000100420001004200010042000100420001C
:10041000390050E3070040820992A0E10F0000E29A
:10042000150054E3099080E14800000A0AFFFFEB41
:100430003A0050E3014084E2D3FFFF1A0140A0E3F9
:10044000CEFFFFEA0662A0E10040A0E3CBFFFFEA97
:10045000390050E3070040820662A0E10F0000E28D
:10046000066080E10668A0E12668A0E1014084E220
:10047000C2FFFFEA390050E3070040820552A0E1C5
:100480000F0000E2055080E1FF5005E2010055E356
:100490002700000A0E40A033B8FFFF3A020055E3E0
:1004A0000940A0030040A013B4FFFFEA390050E365
:1004B000070040820552A0E10F0000E2055080E1F4
:1004C000FF5005E20840A0E3ACFFFFEA390050E32B
:1004D000070040820772A0E10F0000E2077080E190
:1004E0000778A0E1277886E1014084E2A3FFFFEAD4
:1004F0000D00A0E3EBFEFFEB2D00A0E3E9FEFFEB18
:100500002D00A0E3E7FEFFEB0D00A0E3E5FEFFEB0F
:100510000A00A0E3E3FEFFEB0A00A0E3E1FEFFEB2D
:100520000209A0E3C2FEFFEB0A00A0E1F047BDE82C
:100530001EFF2FE10800A0E10080A0E3FDFEFFEB1D
:100540000860A0E10870A0E10840A0E18BFFFFEA8D
:10055000693829E02334A0E1FF3CC3E3699423E038
:100560000700A0E1088087E00910A0E1A6FEFFEBEC
:10057000088089E0047087E20E40A0E37FFFFFEA75
:040580007856341263
:100030001EFF2FE100C0A0E33ACF07EE4FF07FF59F
:1000400000C0A0E315CF07EE00C0A0E3D5CF07EEB8
:100050004FF07FF56FF07FF510FF2FE11EFF2FE1CE
:1000600000000FE11EFF2FE1100F11EE1EFF2FE128
:1000700010402DE908009FE5E9FFFFEB1040BDE8C7
:100080001EFF2FE15450213F10402DE91C009FE539
:10009000E3FFFFEB010010E3FBFFFF0A10009FE509
:1000A000DFFFFFEB1040BDE8FF0000E21EFF2FE185
:1000B0005450213F4050213F10402DE90C009FE556
:1000C000D7FFFFEB1040BDE8010000E21EFF2FE16B
:1000D0005450213F10402DE90040A0E11C009FE555
:1000E000CFFFFFEB200010E3FBFFFF0A0410A0E1AD
:1000F0000C009FE5C4FFFFEB1040BDE81EFF2FE1A1
:100100005450213F4050213F10402DE910009FE501
:10011000C3FFFFEB010C10E3FBFFFF1A1040BDE82B
:100120001EFF2FE15450213F70402DE90050A0E107
:100130002040A0E3044044E23504A0E10F0000E2C7
:10014000090050E33700808230008092E0FFFFEB2F
:10015000000054E3F6FFFF1A2000A0E37040BDE862
:10016000DBFFFFEA10402DE9EEFFFFEB0D00A0E3FF
:10017000D7FFFFEB0A00A0E31040BDE8D4FFFFEA81
:1001800010402DE90110A0E3D4009FE59EFFFFEB96
:100190000010A0E3CC009FE59BFFFFEB0010A0E365
:1001A000C4009FE598FFFFEB0310A0E3BC009FE5B0
:1001B00095FFFFEB0010A0E3B4009FE592FFFFEB7B
:1001C0000010A0E39C009FE58FFFFFEBC610A0E3AB
:1001D000A0009FE58CFFFFEB9C109FE59C009FE536
:1001E00089FFFFEB98009FE58DFFFFEB3F1AC0E30F
:1001F000121A81E388009FE583FFFFEB0010A0E364
:1002000080009FE580FFFFEB0040A0E30400A0E139
:10021000014084E290FFFFEB960054E3FAFFFF1ADF
:100220000319A0E360009FE577FFFFEB0040A0E328
:100230000400A0E1014084E287FFFFEB960054E355
:10024000FAFFFF1A0010A0E33C009FE56EFFFFEBF2
:100250000310A0E310009FE56BFFFFEB1040BDE82B
:100260001EFF2FE10450213F4450213F6050213FA9
:100270004C50213F5050213F4850213F0E0100007B
:100280006850213F0400203F9400203F9800203F09
:1002900010402DE91C409FE5F918A0E30400A0E1FF
:1002A00059FFFFEB0400A0E10C109FE556FFFFEBA8
:1002B0001040BDE81EFF2FE108B4003F0002F90026
:1002C00010402DE908009FE555FFFFEB1040BDE809
:1002D0001EFF2FE120B4003F1EFF2FE1F0472DE964
:1002E0000070A0E3FBFFFFEBA4FFFFEB6C029FE5B8
:1002F0009BFFFFEB4CFFFFEB99FFFFEB57FFFFEB83
:1003000097FFFFEB57FFFFEB95FFFFEB4900A0E3E3
:100310006FFFFFEB4800A0E36DFFFFEB4500A0E39C
:100320006BFFFFEB5800A0E369FFFFEB0D00A0E3BC
:1003300067FFFFEB0A00A0E30790A0E10760A0E1E0
:100340000750A0E10780A0E10740A0E160FFFFEBBC
:100350004CFFFFEB3A0050E32B00000A0A0050E389
:100360000D00501301A0A00300A0A0132900000A53
:100370002030C0E3470053E35000000A013044E25C
:10038000140053E303F19F97F0FFFFEAFC03200002
:10039000FC0320009C0420009C0420009C042000FE
:1003A0009C0420007C042000440420002004200041
:1003B0002004200020042000200420001404200039
:1003C000E0032000E0032000E0032000E003200021
:1003D000E0032000E0032000E0032000E003200011
:1003E000390050E3070040820992A0E10F0000E2CB
:1003F000150054E3099080E14C00000A21FFFFEB57
:100400003A0050E3014084E2D3FFFF1A0140A0E329
:10041000CEFFFFEA0662A0E10040A0E3CBFFFFEAC7
:10042000390050E3070040820662A0E10F0000E2BD
:10043000066080E10668A0E12668A0E1014084E250
:10044000C2FFFFEA390050E3070040820552A0E1F5
:100450000F0000E2055080E1FF5005E2010055E386
:100460002700000A0E40A033B8FFFF3A020055E310
:100470000940A0030040A013B4FFFFEA390050E395
:10048000070040820552A0E10F0000E2055080E124
:10049000FF5005E20840A0E3ACFFFFEA390050E35B
:1004A000070040820882A0E10F0000E2088080E19E
:1004B0000888A0E1288886E1014084E2A3FFFFEAE2
:1004C0000D00A0E302FFFFEB2D00A0E300FFFFEB18
:1004D0002D00A0E3FEFEFFEB0D00A0E3FCFEFFEB12
:1004E0000A00A0E3FAFEFFEB0A00A0E3F8FEFFEB30
:1004F0000209A0E3CEFEFFEB0A00A0E1F047BDE851
:100500001EFF2FE11440A0E30700A0E114FFFFEB62
:10051000014054E2FBFFFF1A0470A0E10490A0E147
:100520000460A0E10450A0E10480A0E187FFFFEA9D
:10053000693829E02334A0E1FF3CC3E3699423E058
:100540000800A0E1077088E00910A0E1AEFEFFEB13
:10055000077089E0048088E20E40A0E37BFFFFEA99
:040560007856341283
:040000030000800079
:00000001FF

View File

@@ -10,7 +10,7 @@ Disassembly of section .text:
00200000 <skip>:
200000: e3a0d302 mov sp, #134217728 ; 0x8000000
200004: eb0000c2 bl 200314 <notmain>
200004: eb0000b4 bl 2002dc <notmain>
00200008 <hang>:
200008: eafffffe b 200008 <hang>
@@ -36,374 +36,368 @@ Disassembly of section .text:
200030: e12fff1e bx lr
00200034 <BRANCHTO>:
200034: e12fff10 bx r0
200034: e3a0c000 mov ip, #0
200038: ee07cf3a mcr 15, 0, ip, cr7, cr10, {1}
20003c: f57ff04f dsb sy
200040: e3a0c000 mov ip, #0
200044: ee07cf15 mcr 15, 0, ip, cr7, cr5, {0}
200048: e3a0c000 mov ip, #0
20004c: ee07cfd5 mcr 15, 0, ip, cr7, cr5, {6}
200050: f57ff04f dsb sy
200054: f57ff06f isb sy
200058: e12fff10 bx r0
00200038 <dummy>:
200038: e12fff1e bx lr
0020005c <dummy>:
20005c: e12fff1e bx lr
0020003c <GETCPSR>:
20003c: e10f0000 mrs r0, CPSR
200040: e12fff1e bx lr
00200060 <GETCPSR>:
200060: e10f0000 mrs r0, CPSR
200064: e12fff1e bx lr
00200044 <uart_lcr>:
200044: e92d4010 push {r4, lr}
200048: e59f0008 ldr r0, [pc, #8] ; 200058 <uart_lcr+0x14>
20004c: ebfffff4 bl 200024 <GET32>
200050: e8bd4010 pop {r4, lr}
200054: e12fff1e bx lr
200058: 3f215054 svccc 0x00215054
00200068 <GETSCTLR>:
200068: ee110f10 mrc 15, 0, r0, cr1, cr0, {0}
20006c: e12fff1e bx lr
0020005c <uart_recv>:
20005c: e92d4010 push {r4, lr}
200060: e59f001c ldr r0, [pc, #28] ; 200084 <uart_recv+0x28>
200064: ebffffee bl 200024 <GET32>
200068: e3100001 tst r0, #1
20006c: 0afffffb beq 200060 <uart_recv+0x4>
200070: e59f0010 ldr r0, [pc, #16] ; 200088 <uart_recv+0x2c>
200074: ebffffea bl 200024 <GET32>
200078: e8bd4010 pop {r4, lr}
20007c: e20000ff and r0, r0, #255 ; 0xff
00200070 <uart_lcr>:
200070: e92d4010 push {r4, lr}
200074: e59f0008 ldr r0, [pc, #8] ; 200084 <uart_lcr+0x14>
200078: ebffffe9 bl 200024 <GET32>
20007c: e8bd4010 pop {r4, lr}
200080: e12fff1e bx lr
200084: 3f215054 svccc 0x00215054
200088: 3f215040 svccc 0x00215040
0020008c <uart_check>:
20008c: e92d4010 push {r4, lr}
200090: e59f000c ldr r0, [pc, #12] ; 2000a4 <uart_check+0x18>
200094: ebffffe2 bl 200024 <GET32>
200098: e8bd4010 pop {r4, lr}
20009c: e2000001 and r0, r0, #1
2000a0: e12fff1e bx lr
2000a4: 3f215054 svccc 0x00215054
00200088 <uart_recv>:
200088: e92d4010 push {r4, lr}
20008c: e59f001c ldr r0, [pc, #28] ; 2000b0 <uart_recv+0x28>
200090: ebffffe3 bl 200024 <GET32>
200094: e3100001 tst r0, #1
200098: 0afffffb beq 20008c <uart_recv+0x4>
20009c: e59f0010 ldr r0, [pc, #16] ; 2000b4 <uart_recv+0x2c>
2000a0: ebffffdf bl 200024 <GET32>
2000a4: e8bd4010 pop {r4, lr}
2000a8: e20000ff and r0, r0, #255 ; 0xff
2000ac: e12fff1e bx lr
2000b0: 3f215054 svccc 0x00215054
2000b4: 3f215040 svccc 0x00215040
002000a8 <uart_send>:
2000a8: e92d4010 push {r4, lr}
2000ac: e1a04000 mov r4, r0
2000b0: e59f001c ldr r0, [pc, #28] ; 2000d4 <uart_send+0x2c>
2000b4: ebffffda bl 200024 <GET32>
2000b8: e3100020 tst r0, #32
2000bc: 0afffffb beq 2000b0 <uart_send+0x8>
2000c0: e1a01004 mov r1, r4
2000c4: e59f000c ldr r0, [pc, #12] ; 2000d8 <uart_send+0x30>
2000c8: ebffffcf bl 20000c <PUT32>
2000cc: e8bd4010 pop {r4, lr}
2000d0: e12fff1e bx lr
2000d4: 3f215054 svccc 0x00215054
2000d8: 3f215040 svccc 0x00215040
002000b8 <uart_check>:
2000b8: e92d4010 push {r4, lr}
2000bc: e59f000c ldr r0, [pc, #12] ; 2000d0 <uart_check+0x18>
2000c0: ebffffd7 bl 200024 <GET32>
2000c4: e8bd4010 pop {r4, lr}
2000c8: e2000001 and r0, r0, #1
2000cc: e12fff1e bx lr
2000d0: 3f215054 svccc 0x00215054
002000dc <uart_flush>:
2000dc: e92d4010 push {r4, lr}
2000e0: e59f0010 ldr r0, [pc, #16] ; 2000f8 <uart_flush+0x1c>
2000e4: ebffffce bl 200024 <GET32>
2000e8: e3100c01 tst r0, #256 ; 0x100
2000ec: 1afffffb bne 2000e0 <uart_flush+0x4>
2000f0: e8bd4010 pop {r4, lr}
2000f4: e12fff1e bx lr
2000f8: 3f215054 svccc 0x00215054
002000d4 <uart_send>:
2000d4: e92d4010 push {r4, lr}
2000d8: e1a04000 mov r4, r0
2000dc: e59f001c ldr r0, [pc, #28] ; 200100 <uart_send+0x2c>
2000e0: ebffffcf bl 200024 <GET32>
2000e4: e3100020 tst r0, #32
2000e8: 0afffffb beq 2000dc <uart_send+0x8>
2000ec: e1a01004 mov r1, r4
2000f0: e59f000c ldr r0, [pc, #12] ; 200104 <uart_send+0x30>
2000f4: ebffffc4 bl 20000c <PUT32>
2000f8: e8bd4010 pop {r4, lr}
2000fc: e12fff1e bx lr
200100: 3f215054 svccc 0x00215054
200104: 3f215040 svccc 0x00215040
002000fc <hexstrings>:
2000fc: e92d4070 push {r4, r5, r6, lr}
200100: e1a05000 mov r5, r0
200104: e3a04020 mov r4, #32
200108: e2444004 sub r4, r4, #4
20010c: e1a00435 lsr r0, r5, r4
200110: e200000f and r0, r0, #15
200114: e3500009 cmp r0, #9
200118: 82800037 addhi r0, r0, #55 ; 0x37
20011c: 92800030 addls r0, r0, #48 ; 0x30
200120: ebffffe0 bl 2000a8 <uart_send>
200124: e3540000 cmp r4, #0
200128: 1afffff6 bne 200108 <hexstrings+0xc>
20012c: e3a00020 mov r0, #32
200130: e8bd4070 pop {r4, r5, r6, lr}
200134: eaffffdb b 2000a8 <uart_send>
00200108 <uart_flush>:
200108: e92d4010 push {r4, lr}
20010c: e59f0010 ldr r0, [pc, #16] ; 200124 <uart_flush+0x1c>
200110: ebffffc3 bl 200024 <GET32>
200114: e3100c01 tst r0, #256 ; 0x100
200118: 1afffffb bne 20010c <uart_flush+0x4>
20011c: e8bd4010 pop {r4, lr}
200120: e12fff1e bx lr
200124: 3f215054 svccc 0x00215054
00200138 <hexstring>:
200138: e92d4010 push {r4, lr}
20013c: ebffffee bl 2000fc <hexstrings>
200140: e3a0000d mov r0, #13
200144: ebffffd7 bl 2000a8 <uart_send>
200148: e3a0000a mov r0, #10
20014c: e8bd4010 pop {r4, lr}
200150: eaffffd4 b 2000a8 <uart_send>
00200128 <hexstrings>:
200128: e92d4070 push {r4, r5, r6, lr}
20012c: e1a05000 mov r5, r0
200130: e3a04020 mov r4, #32
200134: e2444004 sub r4, r4, #4
200138: e1a00435 lsr r0, r5, r4
20013c: e200000f and r0, r0, #15
200140: e3500009 cmp r0, #9
200144: 82800037 addhi r0, r0, #55 ; 0x37
200148: 92800030 addls r0, r0, #48 ; 0x30
20014c: ebffffe0 bl 2000d4 <uart_send>
200150: e3540000 cmp r4, #0
200154: 1afffff6 bne 200134 <hexstrings+0xc>
200158: e3a00020 mov r0, #32
20015c: e8bd4070 pop {r4, r5, r6, lr}
200160: eaffffdb b 2000d4 <uart_send>
00200154 <uart_init>:
200154: e92d4010 push {r4, lr}
200158: e3a01001 mov r1, #1
20015c: e59f00d4 ldr r0, [pc, #212] ; 200238 <uart_init+0xe4>
200160: ebffffa9 bl 20000c <PUT32>
200164: e3a01000 mov r1, #0
200168: e59f00cc ldr r0, [pc, #204] ; 20023c <uart_init+0xe8>
20016c: ebffffa6 bl 20000c <PUT32>
200170: e3a01000 mov r1, #0
200174: e59f00c4 ldr r0, [pc, #196] ; 200240 <uart_init+0xec>
200178: ebffffa3 bl 20000c <PUT32>
20017c: e3a01003 mov r1, #3
200180: e59f00bc ldr r0, [pc, #188] ; 200244 <uart_init+0xf0>
200184: ebffffa0 bl 20000c <PUT32>
200188: e3a01000 mov r1, #0
20018c: e59f00b4 ldr r0, [pc, #180] ; 200248 <uart_init+0xf4>
200190: ebffff9d bl 20000c <PUT32>
200194: e3a01000 mov r1, #0
200198: e59f009c ldr r0, [pc, #156] ; 20023c <uart_init+0xe8>
20019c: ebffff9a bl 20000c <PUT32>
2001a0: e3a010c6 mov r1, #198 ; 0xc6
2001a4: e59f00a0 ldr r0, [pc, #160] ; 20024c <uart_init+0xf8>
2001a8: ebffff97 bl 20000c <PUT32>
2001ac: e59f109c ldr r1, [pc, #156] ; 200250 <uart_init+0xfc>
2001b0: e59f009c ldr r0, [pc, #156] ; 200254 <uart_init+0x100>
2001b4: ebffff94 bl 20000c <PUT32>
2001b8: e59f0098 ldr r0, [pc, #152] ; 200258 <uart_init+0x104>
2001bc: ebffff98 bl 200024 <GET32>
2001c0: e3c01a3f bic r1, r0, #258048 ; 0x3f000
2001c4: e3811a12 orr r1, r1, #73728 ; 0x12000
2001c8: e59f0088 ldr r0, [pc, #136] ; 200258 <uart_init+0x104>
2001cc: ebffff8e bl 20000c <PUT32>
2001d0: e3a01000 mov r1, #0
2001d4: e59f0080 ldr r0, [pc, #128] ; 20025c <uart_init+0x108>
2001d8: ebffff8b bl 20000c <PUT32>
2001dc: e3a04000 mov r4, #0
2001e0: e1a00004 mov r0, r4
2001e4: e2844001 add r4, r4, #1
2001e8: ebffff92 bl 200038 <dummy>
2001ec: e3540096 cmp r4, #150 ; 0x96
2001f0: 1afffffa bne 2001e0 <uart_init+0x8c>
2001f4: e3a01903 mov r1, #49152 ; 0xc000
2001f8: e59f0060 ldr r0, [pc, #96] ; 200260 <uart_init+0x10c>
2001fc: ebffff82 bl 20000c <PUT32>
200200: e3a04000 mov r4, #0
200204: e1a00004 mov r0, r4
200208: e2844001 add r4, r4, #1
20020c: ebffff89 bl 200038 <dummy>
200210: e3540096 cmp r4, #150 ; 0x96
200214: 1afffffa bne 200204 <uart_init+0xb0>
200218: e3a01000 mov r1, #0
20021c: e59f003c ldr r0, [pc, #60] ; 200260 <uart_init+0x10c>
200220: ebffff79 bl 20000c <PUT32>
200224: e3a01003 mov r1, #3
200228: e59f0010 ldr r0, [pc, #16] ; 200240 <uart_init+0xec>
20022c: ebffff76 bl 20000c <PUT32>
200230: e8bd4010 pop {r4, lr}
200234: e12fff1e bx lr
200238: 3f215004 svccc 0x00215004
20023c: 3f215044 svccc 0x00215044
200240: 3f215060 svccc 0x00215060
200244: 3f21504c svccc 0x0021504c
200248: 3f215050 svccc 0x00215050
20024c: 3f215048 svccc 0x00215048
200250: 0000010e andeq r0, r0, lr, lsl #2
200254: 3f215068 svccc 0x00215068
200258: 3f200004 svccc 0x00200004
20025c: 3f200094 svccc 0x00200094
200260: 3f200098 svccc 0x00200098
00200164 <hexstring>:
200164: e92d4010 push {r4, lr}
200168: ebffffee bl 200128 <hexstrings>
20016c: e3a0000d mov r0, #13
200170: ebffffd7 bl 2000d4 <uart_send>
200174: e3a0000a mov r0, #10
200178: e8bd4010 pop {r4, lr}
20017c: eaffffd4 b 2000d4 <uart_send>
00200264 <timer_init>:
200264: e92d4010 push {r4, lr}
200268: e59f401c ldr r4, [pc, #28] ; 20028c <timer_init+0x28>
20026c: e3a018f9 mov r1, #16318464 ; 0xf90000
200270: e1a00004 mov r0, r4
200274: ebffff64 bl 20000c <PUT32>
200278: e1a00004 mov r0, r4
20027c: e59f100c ldr r1, [pc, #12] ; 200290 <timer_init+0x2c>
200280: ebffff61 bl 20000c <PUT32>
200284: e8bd4010 pop {r4, lr}
200288: e12fff1e bx lr
20028c: 3f00b408 svccc 0x0000b408
200290: 00f90200 rscseq r0, r9, r0, lsl #4
00200180 <uart_init>:
200180: e92d4010 push {r4, lr}
200184: e3a01001 mov r1, #1
200188: e59f00d4 ldr r0, [pc, #212] ; 200264 <uart_init+0xe4>
20018c: ebffff9e bl 20000c <PUT32>
200190: e3a01000 mov r1, #0
200194: e59f00cc ldr r0, [pc, #204] ; 200268 <uart_init+0xe8>
200198: ebffff9b bl 20000c <PUT32>
20019c: e3a01000 mov r1, #0
2001a0: e59f00c4 ldr r0, [pc, #196] ; 20026c <uart_init+0xec>
2001a4: ebffff98 bl 20000c <PUT32>
2001a8: e3a01003 mov r1, #3
2001ac: e59f00bc ldr r0, [pc, #188] ; 200270 <uart_init+0xf0>
2001b0: ebffff95 bl 20000c <PUT32>
2001b4: e3a01000 mov r1, #0
2001b8: e59f00b4 ldr r0, [pc, #180] ; 200274 <uart_init+0xf4>
2001bc: ebffff92 bl 20000c <PUT32>
2001c0: e3a01000 mov r1, #0
2001c4: e59f009c ldr r0, [pc, #156] ; 200268 <uart_init+0xe8>
2001c8: ebffff8f bl 20000c <PUT32>
2001cc: e3a010c6 mov r1, #198 ; 0xc6
2001d0: e59f00a0 ldr r0, [pc, #160] ; 200278 <uart_init+0xf8>
2001d4: ebffff8c bl 20000c <PUT32>
2001d8: e59f109c ldr r1, [pc, #156] ; 20027c <uart_init+0xfc>
2001dc: e59f009c ldr r0, [pc, #156] ; 200280 <uart_init+0x100>
2001e0: ebffff89 bl 20000c <PUT32>
2001e4: e59f0098 ldr r0, [pc, #152] ; 200284 <uart_init+0x104>
2001e8: ebffff8d bl 200024 <GET32>
2001ec: e3c01a3f bic r1, r0, #258048 ; 0x3f000
2001f0: e3811a12 orr r1, r1, #73728 ; 0x12000
2001f4: e59f0088 ldr r0, [pc, #136] ; 200284 <uart_init+0x104>
2001f8: ebffff83 bl 20000c <PUT32>
2001fc: e3a01000 mov r1, #0
200200: e59f0080 ldr r0, [pc, #128] ; 200288 <uart_init+0x108>
200204: ebffff80 bl 20000c <PUT32>
200208: e3a04000 mov r4, #0
20020c: e1a00004 mov r0, r4
200210: e2844001 add r4, r4, #1
200214: ebffff90 bl 20005c <dummy>
200218: e3540096 cmp r4, #150 ; 0x96
20021c: 1afffffa bne 20020c <uart_init+0x8c>
200220: e3a01903 mov r1, #49152 ; 0xc000
200224: e59f0060 ldr r0, [pc, #96] ; 20028c <uart_init+0x10c>
200228: ebffff77 bl 20000c <PUT32>
20022c: e3a04000 mov r4, #0
200230: e1a00004 mov r0, r4
200234: e2844001 add r4, r4, #1
200238: ebffff87 bl 20005c <dummy>
20023c: e3540096 cmp r4, #150 ; 0x96
200240: 1afffffa bne 200230 <uart_init+0xb0>
200244: e3a01000 mov r1, #0
200248: e59f003c ldr r0, [pc, #60] ; 20028c <uart_init+0x10c>
20024c: ebffff6e bl 20000c <PUT32>
200250: e3a01003 mov r1, #3
200254: e59f0010 ldr r0, [pc, #16] ; 20026c <uart_init+0xec>
200258: ebffff6b bl 20000c <PUT32>
20025c: e8bd4010 pop {r4, lr}
200260: e12fff1e bx lr
200264: 3f215004 svccc 0x00215004
200268: 3f215044 svccc 0x00215044
20026c: 3f215060 svccc 0x00215060
200270: 3f21504c svccc 0x0021504c
200274: 3f215050 svccc 0x00215050
200278: 3f215048 svccc 0x00215048
20027c: 0000010e andeq r0, r0, lr, lsl #2
200280: 3f215068 svccc 0x00215068
200284: 3f200004 svccc 0x00200004
200288: 3f200094 svccc 0x00200094
20028c: 3f200098 svccc 0x00200098
00200294 <timer_tick>:
200294: e92d4010 push {r4, lr}
200298: e59f0008 ldr r0, [pc, #8] ; 2002a8 <timer_tick+0x14>
20029c: ebffff60 bl 200024 <GET32>
2002a0: e8bd4010 pop {r4, lr}
2002a4: e12fff1e bx lr
2002a8: 3f00b420 svccc 0x0000b420
00200290 <timer_init>:
200290: e92d4010 push {r4, lr}
200294: e59f401c ldr r4, [pc, #28] ; 2002b8 <timer_init+0x28>
200298: e3a018f9 mov r1, #16318464 ; 0xf90000
20029c: e1a00004 mov r0, r4
2002a0: ebffff59 bl 20000c <PUT32>
2002a4: e1a00004 mov r0, r4
2002a8: e59f100c ldr r1, [pc, #12] ; 2002bc <timer_init+0x2c>
2002ac: ebffff56 bl 20000c <PUT32>
2002b0: e8bd4010 pop {r4, lr}
2002b4: e12fff1e bx lr
2002b8: 3f00b408 svccc 0x0000b408
2002bc: 00f90200 rscseq r0, r9, r0, lsl #4
002002ac <leds_off>:
2002ac: e92d4070 push {r4, r5, r6, lr}
2002b0: e59f4054 ldr r4, [pc, #84] ; 20030c <leds_off+0x60>
2002b4: e1a00004 mov r0, r4
2002b8: ebffff59 bl 200024 <GET32>
2002bc: e59f504c ldr r5, [pc, #76] ; 200310 <leds_off+0x64>
2002c0: e3c0160e bic r1, r0, #14680064 ; 0xe00000
2002c4: e3811602 orr r1, r1, #2097152 ; 0x200000
2002c8: e1a00004 mov r0, r4
2002cc: ebffff4e bl 20000c <PUT32>
2002d0: e1a00005 mov r0, r5
2002d4: ebffff52 bl 200024 <GET32>
2002d8: e3c0190e bic r1, r0, #229376 ; 0x38000
2002dc: e284401c add r4, r4, #28
2002e0: e1a00005 mov r0, r5
2002e4: e3811902 orr r1, r1, #32768 ; 0x8000
2002e8: ebffff47 bl 20000c <PUT32>
2002ec: e1a00004 mov r0, r4
2002f0: e3a01902 mov r1, #32768 ; 0x8000
2002f4: ebffff44 bl 20000c <PUT32>
2002f8: e1a00004 mov r0, r4
2002fc: e3a01008 mov r1, #8
200300: ebffff41 bl 20000c <PUT32>
200304: e8bd4070 pop {r4, r5, r6, lr}
200308: e12fff1e bx lr
20030c: 3f200010 svccc 0x00200010
200310: 3f20000c svccc 0x0020000c
002002c0 <timer_tick>:
2002c0: e92d4010 push {r4, lr}
2002c4: e59f0008 ldr r0, [pc, #8] ; 2002d4 <timer_tick+0x14>
2002c8: ebffff55 bl 200024 <GET32>
2002cc: e8bd4010 pop {r4, lr}
2002d0: e12fff1e bx lr
2002d4: 3f00b420 svccc 0x0000b420
00200314 <notmain>:
200314: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
200318: e3a08000 mov r8, #0
20031c: ebffffe2 bl 2002ac <leds_off>
200320: ebffff8b bl 200154 <uart_init>
200324: e59f0254 ldr r0, [pc, #596] ; 200580 <notmain+0x26c>
200328: ebffff82 bl 200138 <hexstring>
20032c: ebffff3e bl 20002c <GETPC>
200330: ebffff80 bl 200138 <hexstring>
200334: ebffff40 bl 20003c <GETCPSR>
200338: ebffff7e bl 200138 <hexstring>
20033c: e3a00049 mov r0, #73 ; 0x49
200340: ebffff58 bl 2000a8 <uart_send>
200344: e3a00048 mov r0, #72 ; 0x48
200348: ebffff56 bl 2000a8 <uart_send>
20034c: e3a00045 mov r0, #69 ; 0x45
200350: ebffff54 bl 2000a8 <uart_send>
200354: e3a00058 mov r0, #88 ; 0x58
200358: ebffff52 bl 2000a8 <uart_send>
20035c: e3a0000d mov r0, #13
200360: ebffff50 bl 2000a8 <uart_send>
200364: e3a0000a mov r0, #10
200368: e1a09008 mov r9, r8
20036c: e1a06008 mov r6, r8
200370: e1a05008 mov r5, r8
200374: e1a07008 mov r7, r8
200378: e1a04008 mov r4, r8
20037c: ebffff49 bl 2000a8 <uart_send>
200380: ebffff35 bl 20005c <uart_recv>
200384: e350003a cmp r0, #58 ; 0x3a
200388: 0a00002b beq 20043c <notmain+0x128>
20038c: e350000d cmp r0, #13
200390: 1350000a cmpne r0, #10
200394: 03a0a001 moveq sl, #1
200398: 13a0a000 movne sl, #0
20039c: 0a000029 beq 200448 <notmain+0x134>
2003a0: e3c03020 bic r3, r0, #32
2003a4: e3530047 cmp r3, #71 ; 0x47
2003a8: 0a000050 beq 2004f0 <notmain+0x1dc>
2003ac: e2443001 sub r3, r4, #1
2003b0: e3530014 cmp r3, #20
2003b4: 979ff103 ldrls pc, [pc, r3, lsl #2]
2003b8: eafffff0 b 200380 <notmain+0x6c>
2003bc: 0020042c eoreq r0, r0, ip, lsr #8
2003c0: 0020042c eoreq r0, r0, ip, lsr #8
2003c4: 002004cc eoreq r0, r0, ip, asr #9
2003c8: 002004cc eoreq r0, r0, ip, asr #9
2003cc: 002004cc eoreq r0, r0, ip, asr #9
2003d0: 002004cc eoreq r0, r0, ip, asr #9
2003d4: 002004ac eoreq r0, r0, ip, lsr #9
2003d8: 00200474 eoreq r0, r0, r4, ror r4
2003dc: 00200450 eoreq r0, r0, r0, asr r4
2003e0: 00200450 eoreq r0, r0, r0, asr r4
2003e4: 00200450 eoreq r0, r0, r0, asr r4
2003e8: 00200450 eoreq r0, r0, r0, asr r4
2003ec: 00200444 eoreq r0, r0, r4, asr #8
2003f0: 00200410 eoreq r0, r0, r0, lsl r4
2003f4: 00200410 eoreq r0, r0, r0, lsl r4
2003f8: 00200410 eoreq r0, r0, r0, lsl r4
2003fc: 00200410 eoreq r0, r0, r0, lsl r4
200400: 00200410 eoreq r0, r0, r0, lsl r4
200404: 00200410 eoreq r0, r0, r0, lsl r4
200408: 00200410 eoreq r0, r0, r0, lsl r4
20040c: 00200410 eoreq r0, r0, r0, lsl r4
200410: e3500039 cmp r0, #57 ; 0x39
200414: 82400007 subhi r0, r0, #7
200418: e1a09209 lsl r9, r9, #4
20041c: e200000f and r0, r0, #15
200420: e3540015 cmp r4, #21
200424: e1809009 orr r9, r0, r9
200428: 0a000048 beq 200550 <notmain+0x23c>
20042c: ebffff0a bl 20005c <uart_recv>
200430: e350003a cmp r0, #58 ; 0x3a
200434: e2844001 add r4, r4, #1
200438: 1affffd3 bne 20038c <notmain+0x78>
20043c: e3a04001 mov r4, #1
200440: eaffffce b 200380 <notmain+0x6c>
200444: e1a06206 lsl r6, r6, #4
200448: e3a04000 mov r4, #0
20044c: eaffffcb b 200380 <notmain+0x6c>
200450: e3500039 cmp r0, #57 ; 0x39
200454: 82400007 subhi r0, r0, #7
200458: e1a06206 lsl r6, r6, #4
20045c: e200000f and r0, r0, #15
200460: e1806006 orr r6, r0, r6
200464: e1a06806 lsl r6, r6, #16
200468: e1a06826 lsr r6, r6, #16
20046c: e2844001 add r4, r4, #1
200470: eaffffc2 b 200380 <notmain+0x6c>
200474: e3500039 cmp r0, #57 ; 0x39
200478: 82400007 subhi r0, r0, #7
20047c: e1a05205 lsl r5, r5, #4
200480: e200000f and r0, r0, #15
200484: e1805005 orr r5, r0, r5
200488: e20550ff and r5, r5, #255 ; 0xff
20048c: e3550001 cmp r5, #1
200490: 0a000027 beq 200534 <notmain+0x220>
200494: 33a0400e movcc r4, #14
200498: 3affffb8 bcc 200380 <notmain+0x6c>
20049c: e3550002 cmp r5, #2
2004a0: 03a04009 moveq r4, #9
2004a4: 13a04000 movne r4, #0
2004a8: eaffffb4 b 200380 <notmain+0x6c>
2004ac: e3500039 cmp r0, #57 ; 0x39
2004b0: 82400007 subhi r0, r0, #7
2004b4: e1a05205 lsl r5, r5, #4
2004b8: e200000f and r0, r0, #15
2004bc: e1805005 orr r5, r0, r5
2004c0: e20550ff and r5, r5, #255 ; 0xff
2004c4: e3a04008 mov r4, #8
2004c8: eaffffac b 200380 <notmain+0x6c>
2004cc: e3500039 cmp r0, #57 ; 0x39
2004d0: 82400007 subhi r0, r0, #7
2004d4: e1a07207 lsl r7, r7, #4
2004d8: e200000f and r0, r0, #15
2004dc: e1807007 orr r7, r0, r7
2004e0: e1a07807 lsl r7, r7, #16
2004e4: e1867827 orr r7, r6, r7, lsr #16
2004e8: e2844001 add r4, r4, #1
2004ec: eaffffa3 b 200380 <notmain+0x6c>
2004f0: e3a0000d mov r0, #13
2004f4: ebfffeeb bl 2000a8 <uart_send>
2004f8: e3a0002d mov r0, #45 ; 0x2d
2004fc: ebfffee9 bl 2000a8 <uart_send>
200500: e3a0002d mov r0, #45 ; 0x2d
200504: ebfffee7 bl 2000a8 <uart_send>
200508: e3a0000d mov r0, #13
20050c: ebfffee5 bl 2000a8 <uart_send>
200510: e3a0000a mov r0, #10
200514: ebfffee3 bl 2000a8 <uart_send>
200518: e3a0000a mov r0, #10
20051c: ebfffee1 bl 2000a8 <uart_send>
200520: e3a00902 mov r0, #32768 ; 0x8000
200524: ebfffec2 bl 200034 <BRANCHTO>
200528: e1a0000a mov r0, sl
20052c: e8bd47f0 pop {r4, r5, r6, r7, r8, r9, sl, lr}
200530: e12fff1e bx lr
200534: e1a00008 mov r0, r8
200538: e3a08000 mov r8, #0
20053c: ebfffefd bl 200138 <hexstring>
200540: e1a06008 mov r6, r8
200544: e1a07008 mov r7, r8
200548: e1a04008 mov r4, r8
20054c: eaffff8b b 200380 <notmain+0x6c>
200550: e0293869 eor r3, r9, r9, ror #16
200554: e1a03423 lsr r3, r3, #8
200558: e3c33cff bic r3, r3, #65280 ; 0xff00
20055c: e0239469 eor r9, r3, r9, ror #8
200560: e1a00007 mov r0, r7
200564: e0878008 add r8, r7, r8
200568: e1a01009 mov r1, r9
20056c: ebfffea6 bl 20000c <PUT32>
200570: e0898008 add r8, r9, r8
200574: e2877004 add r7, r7, #4
200578: e3a0400e mov r4, #14
20057c: eaffff7f b 200380 <notmain+0x6c>
200580: 12345678 eorsne r5, r4, #120, 12 ; 0x7800000
002002d8 <leds_off>:
2002d8: e12fff1e bx lr
002002dc <notmain>:
2002dc: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
2002e0: e3a07000 mov r7, #0
2002e4: ebfffffb bl 2002d8 <leds_off>
2002e8: ebffffa4 bl 200180 <uart_init>
2002ec: e59f026c ldr r0, [pc, #620] ; 200560 <notmain+0x284>
2002f0: ebffff9b bl 200164 <hexstring>
2002f4: ebffff4c bl 20002c <GETPC>
2002f8: ebffff99 bl 200164 <hexstring>
2002fc: ebffff57 bl 200060 <GETCPSR>
200300: ebffff97 bl 200164 <hexstring>
200304: ebffff57 bl 200068 <GETSCTLR>
200308: ebffff95 bl 200164 <hexstring>
20030c: e3a00049 mov r0, #73 ; 0x49
200310: ebffff6f bl 2000d4 <uart_send>
200314: e3a00048 mov r0, #72 ; 0x48
200318: ebffff6d bl 2000d4 <uart_send>
20031c: e3a00045 mov r0, #69 ; 0x45
200320: ebffff6b bl 2000d4 <uart_send>
200324: e3a00058 mov r0, #88 ; 0x58
200328: ebffff69 bl 2000d4 <uart_send>
20032c: e3a0000d mov r0, #13
200330: ebffff67 bl 2000d4 <uart_send>
200334: e3a0000a mov r0, #10
200338: e1a09007 mov r9, r7
20033c: e1a06007 mov r6, r7
200340: e1a05007 mov r5, r7
200344: e1a08007 mov r8, r7
200348: e1a04007 mov r4, r7
20034c: ebffff60 bl 2000d4 <uart_send>
200350: ebffff4c bl 200088 <uart_recv>
200354: e350003a cmp r0, #58 ; 0x3a
200358: 0a00002b beq 20040c <notmain+0x130>
20035c: e350000a cmp r0, #10
200360: 1350000d cmpne r0, #13
200364: 03a0a001 moveq sl, #1
200368: 13a0a000 movne sl, #0
20036c: 0a000029 beq 200418 <notmain+0x13c>
200370: e3c03020 bic r3, r0, #32
200374: e3530047 cmp r3, #71 ; 0x47
200378: 0a000050 beq 2004c0 <notmain+0x1e4>
20037c: e2443001 sub r3, r4, #1
200380: e3530014 cmp r3, #20
200384: 979ff103 ldrls pc, [pc, r3, lsl #2]
200388: eafffff0 b 200350 <notmain+0x74>
20038c: 002003fc strdeq r0, [r0], -ip ; <UNPREDICTABLE>
200390: 002003fc strdeq r0, [r0], -ip ; <UNPREDICTABLE>
200394: 0020049c mlaeq r0, ip, r4, r0
200398: 0020049c mlaeq r0, ip, r4, r0
20039c: 0020049c mlaeq r0, ip, r4, r0
2003a0: 0020049c mlaeq r0, ip, r4, r0
2003a4: 0020047c eoreq r0, r0, ip, ror r4
2003a8: 00200444 eoreq r0, r0, r4, asr #8
2003ac: 00200420 eoreq r0, r0, r0, lsr #8
2003b0: 00200420 eoreq r0, r0, r0, lsr #8
2003b4: 00200420 eoreq r0, r0, r0, lsr #8
2003b8: 00200420 eoreq r0, r0, r0, lsr #8
2003bc: 00200414 eoreq r0, r0, r4, lsl r4
2003c0: 002003e0 eoreq r0, r0, r0, ror #7
2003c4: 002003e0 eoreq r0, r0, r0, ror #7
2003c8: 002003e0 eoreq r0, r0, r0, ror #7
2003cc: 002003e0 eoreq r0, r0, r0, ror #7
2003d0: 002003e0 eoreq r0, r0, r0, ror #7
2003d4: 002003e0 eoreq r0, r0, r0, ror #7
2003d8: 002003e0 eoreq r0, r0, r0, ror #7
2003dc: 002003e0 eoreq r0, r0, r0, ror #7
2003e0: e3500039 cmp r0, #57 ; 0x39
2003e4: 82400007 subhi r0, r0, #7
2003e8: e1a09209 lsl r9, r9, #4
2003ec: e200000f and r0, r0, #15
2003f0: e3540015 cmp r4, #21
2003f4: e1809009 orr r9, r0, r9
2003f8: 0a00004c beq 200530 <notmain+0x254>
2003fc: ebffff21 bl 200088 <uart_recv>
200400: e350003a cmp r0, #58 ; 0x3a
200404: e2844001 add r4, r4, #1
200408: 1affffd3 bne 20035c <notmain+0x80>
20040c: e3a04001 mov r4, #1
200410: eaffffce b 200350 <notmain+0x74>
200414: e1a06206 lsl r6, r6, #4
200418: e3a04000 mov r4, #0
20041c: eaffffcb b 200350 <notmain+0x74>
200420: e3500039 cmp r0, #57 ; 0x39
200424: 82400007 subhi r0, r0, #7
200428: e1a06206 lsl r6, r6, #4
20042c: e200000f and r0, r0, #15
200430: e1806006 orr r6, r0, r6
200434: e1a06806 lsl r6, r6, #16
200438: e1a06826 lsr r6, r6, #16
20043c: e2844001 add r4, r4, #1
200440: eaffffc2 b 200350 <notmain+0x74>
200444: e3500039 cmp r0, #57 ; 0x39
200448: 82400007 subhi r0, r0, #7
20044c: e1a05205 lsl r5, r5, #4
200450: e200000f and r0, r0, #15
200454: e1805005 orr r5, r0, r5
200458: e20550ff and r5, r5, #255 ; 0xff
20045c: e3550001 cmp r5, #1
200460: 0a000027 beq 200504 <notmain+0x228>
200464: 33a0400e movcc r4, #14
200468: 3affffb8 bcc 200350 <notmain+0x74>
20046c: e3550002 cmp r5, #2
200470: 03a04009 moveq r4, #9
200474: 13a04000 movne r4, #0
200478: eaffffb4 b 200350 <notmain+0x74>
20047c: e3500039 cmp r0, #57 ; 0x39
200480: 82400007 subhi r0, r0, #7
200484: e1a05205 lsl r5, r5, #4
200488: e200000f and r0, r0, #15
20048c: e1805005 orr r5, r0, r5
200490: e20550ff and r5, r5, #255 ; 0xff
200494: e3a04008 mov r4, #8
200498: eaffffac b 200350 <notmain+0x74>
20049c: e3500039 cmp r0, #57 ; 0x39
2004a0: 82400007 subhi r0, r0, #7
2004a4: e1a08208 lsl r8, r8, #4
2004a8: e200000f and r0, r0, #15
2004ac: e1808008 orr r8, r0, r8
2004b0: e1a08808 lsl r8, r8, #16
2004b4: e1868828 orr r8, r6, r8, lsr #16
2004b8: e2844001 add r4, r4, #1
2004bc: eaffffa3 b 200350 <notmain+0x74>
2004c0: e3a0000d mov r0, #13
2004c4: ebffff02 bl 2000d4 <uart_send>
2004c8: e3a0002d mov r0, #45 ; 0x2d
2004cc: ebffff00 bl 2000d4 <uart_send>
2004d0: e3a0002d mov r0, #45 ; 0x2d
2004d4: ebfffefe bl 2000d4 <uart_send>
2004d8: e3a0000d mov r0, #13
2004dc: ebfffefc bl 2000d4 <uart_send>
2004e0: e3a0000a mov r0, #10
2004e4: ebfffefa bl 2000d4 <uart_send>
2004e8: e3a0000a mov r0, #10
2004ec: ebfffef8 bl 2000d4 <uart_send>
2004f0: e3a00902 mov r0, #32768 ; 0x8000
2004f4: ebfffece bl 200034 <BRANCHTO>
2004f8: e1a0000a mov r0, sl
2004fc: e8bd47f0 pop {r4, r5, r6, r7, r8, r9, sl, lr}
200500: e12fff1e bx lr
200504: e3a04014 mov r4, #20
200508: e1a00007 mov r0, r7
20050c: ebffff14 bl 200164 <hexstring>
200510: e2544001 subs r4, r4, #1
200514: 1afffffb bne 200508 <notmain+0x22c>
200518: e1a07004 mov r7, r4
20051c: e1a09004 mov r9, r4
200520: e1a06004 mov r6, r4
200524: e1a05004 mov r5, r4
200528: e1a08004 mov r8, r4
20052c: eaffff87 b 200350 <notmain+0x74>
200530: e0293869 eor r3, r9, r9, ror #16
200534: e1a03423 lsr r3, r3, #8
200538: e3c33cff bic r3, r3, #65280 ; 0xff00
20053c: e0239469 eor r9, r3, r9, ror #8
200540: e1a00008 mov r0, r8
200544: e0887007 add r7, r8, r7
200548: e1a01009 mov r1, r9
20054c: ebfffeae bl 20000c <PUT32>
200550: e0897007 add r7, r9, r7
200554: e2888004 add r8, r8, #4
200558: e3a0400e mov r4, #14
20055c: eaffff7b b 200350 <notmain+0x74>
200560: 12345678 eorsne r5, r4, #120, 12 ; 0x7800000
Disassembly of section .ARM.attributes:
@@ -413,8 +407,8 @@ Disassembly of section .ARM.attributes:
8: 01006962 tsteq r0, r2, ror #18
c: 00000020 andeq r0, r0, r0, lsr #32
10: 4d524105 ldfmie f4, [r2, #-20] ; 0xffffffec
14: 54347620 ldrtpl r7, [r4], #-1568 ; 0xfffff9e0
18: 08020600 stmdaeq r2, {r9, sl}
14: 4b367620 blmi d9d89c <notmain+0xb9d5c0>
18: 08090600 stmdaeq r9, {r9, sl}
1c: 12010901 andne r0, r1, #16384 ; 0x4000
20: 15011404 strne r1, [r1, #-1028] ; 0xfffffbfc
24: 18031701 stmdane r3, {r0, r8, r9, sl, ip}
@@ -424,7 +418,7 @@ Disassembly of section .ARM.attributes:
Disassembly of section .comment:
00000000 <.comment>:
0: 3a434347 bcc 10d0d24 <notmain+0xed0a10>
0: 3a434347 bcc 10d0d24 <notmain+0xed0a48>
4: 4e472820 cdpmi 8, 4, cr2, cr7, cr0, {1}
8: 35202955 strcc r2, [r0, #-2389]! ; 0xfffff6ab
c: 302e332e eorcc r3, lr, lr, lsr #6

View File

@@ -138,24 +138,6 @@ unsigned int timer_tick ( void )
//-------------------------------------------------------------------------
void leds_off ( void )
{
#define GPFSEL3 0x3F20000C
#define GPFSEL4 0x3F200010
#define GPSET1 0x3F200020
#define GPCLR1 0x3F20002C
unsigned int ra;
ra=GET32(GPFSEL4);
ra&=~(7<<21);
ra|=1<<21;
PUT32(GPFSEL4,ra);
ra=GET32(GPFSEL3);
ra&=~(7<<15);
ra|=1<<15;
PUT32(GPFSEL3,ra);
PUT32(GPCLR1,1<<(47-32));
PUT32(GPCLR1,1<<(35-32));
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------

View File

@@ -9,6 +9,13 @@ _start:
.space 0x200000-0x8004,0
skip:
;@ stop caching !!!
;@ mrc p15,0,r2,c1,c0,0
;@ bic r2,#0x1000
;@ bic r2,#0x0004
;@ mcr p15,0,r2,c1,c0,0
mov sp,#0x08000000
bl notmain
hang: b hang
@@ -40,6 +47,15 @@ GETPC:
.globl BRANCHTO
BRANCHTO:
mov r12,#0
mcr p15, 0, r12, c7, c10, 1
dsb
mov r12, #0
mcr p15, 0, r12, c7, c5, 0
mov r12, #0
mcr p15, 0, r12, c7, c5, 6
dsb
isb
bx r0
.globl dummy
@@ -51,6 +67,13 @@ GETCPSR:
mrs r0,cpsr
bx lr
.globl GETSCTLR
GETSCTLR:
mrc p15,0,r0,c1,c0,0
bx lr
;@-------------------------------------------------------------------------
;@-------------------------------------------------------------------------