contrib: add ram loader src code
[openocd.git] / contrib / loaders / flash / stellaris.s
1 /***************************************************************************
2 * Copyright (C) 2006 by Magnus Lundin *
3 * lundin@mlu.mine.nu *
4 * *
5 * Copyright (C) 2008 by Spencer Oliver *
6 * spen@spen-soft.co.uk *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22 ***************************************************************************/
23
24 .text
25 .syntax unified
26 .cpu cortex-m3
27 .thumb
28 .thumb_func
29 .align 2
30
31 /*
32 Call with :
33 r0 = buffer address
34 r1 = destination address
35 r2 = bytecount (in) - endaddr (work)
36
37 Used registers:
38 r3 = pFLASH_CTRL_BASE
39 r4 = FLASHWRITECMD
40 r5 = #1
41 r6 = bytes written
42 r7 = temp reg
43 */
44
45 write:
46 ldr r3,pFLASH_CTRL_BASE
47 ldr r4,FLASHWRITECMD
48 movs r5, 1
49 movs r6, #0
50 mainloop:
51 str r1, [r3, #0]
52 ldr r7, [r0, r6]
53 str r7, [r3, #4]
54 str r4, [r3, #8]
55 waitloop:
56 ldr r7, [r3, #8]
57 tst r7, r5
58 bne waitloop
59 adds r1, r1, #4
60 adds r6, r6, #4
61 cmp r6, r2
62 bne mainloop
63 bkpt #0
64
65 pFLASH_CTRL_BASE: .word 0x400FD000
66 FLASHWRITECMD: .word 0xA4420001

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)