flash/nor: Add Infineon XMC1000 flash driver
[openocd.git] / contrib / loaders / flash / xmc1xxx / xmc1xxx.S
1 /*
2 * Infineon XMC1000 flash
3 *
4 * Copyright (c) 2016 Andreas Färber
5 *
6 * Based on XMC1100 AA-Step Reference Manual
7 *
8 * License: GPL-2.0+
9 */
10
11 .text
12 .syntax unified
13 .cpu cortex-m0
14 .thumb
15 .thumb_func
16
17 #define NVMSTATUS 0x00
18 #define NVMPROG 0x04
19 #define NVMCONF 0x08
20
21 #define NVMSTATUS_BUSY (1 << 0)
22 #define NVMSTATUS_VERR_NOFAIL (0x0 << 2)
23 #define NVMSTATUS_VERR_MASK (0x3 << 2)
24
25 #define NVMPROG_ACTION_IDLE 0x00
26 #define NVMPROG_ACTION_WRITE_CONTINUOUS 0xA1
27 #define NVMPROG_ACTION_PAGE_ERASE_CONTINUOUS 0xA2
28 #define NVMPROG_ACTION_VERIFY_CONTINUOUS 0xE0
29
30 #define NVMCONF_HRLEV_NR (0x0 << 1)
31 #define NVMCONF_HRLEV_HRE (0x2 << 1)
32 #define NVMCONF_HRLEV_MASK (0x3 << 1)
33
34 #define NVM_WORD_SIZE 4
35 #define NVM_BLOCK_SIZE (4 * NVM_WORD_SIZE)
36 #define NVM_PAGE_SIZE (16 * NVM_BLOCK_SIZE)
37
38 .macro busy_wait, nvmbase, tmp, tmp2
39 1:
40 ldrh \tmp, [\nvmbase, #NVMSTATUS]
41 movs \tmp2, #NVMSTATUS_BUSY
42 ands \tmp, \tmp, \tmp2
43 cmp \tmp, \tmp2
44 beq 1b
45
46 .endm

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)