openocd: fix SPDX tag format for files .c
[openocd.git] / contrib / loaders / flash / msp432 / MSP432E4_FlashLibIf.h
1 /* SPDX-License-Identifier: BSD-3-Clause */
2
3 /******************************************************************************
4 *
5 * Copyright (C) 2014-2018 Texas Instruments Incorporated - http://www.ti.com/
6 *
7 ******************************************************************************/
8
9 #ifndef OPENOCD_LOADERS_FLASH_MSP432_MSP432E4_FLASHLIBIF_H
10 #define OPENOCD_LOADERS_FLASH_MSP432_MSP432E4_FLASHLIBIF_H
11
12 #include <stddef.h>
13 #include <stdint.h>
14
15 /* RAM loader */
16 static const uint32_t RAM_LOADER_START = 0x20000000u; /* Code space */
17 static const uint32_t RAM_LOADER_MAIN = 0x20000110u; /* Code space */
18 static const uint32_t RAM_LOADER_BUFFER1 = 0x20002000u; /* SBUS data space */
19 static const uint32_t RAM_LOADER_BUFFER2 = 0x20003000u; /* SBUS data space */
20 static const uint32_t RAM_LOADER_STACK = 0x20002000u; /* SBUS data space */
21
22 /* Address for flash function to be executed */
23 static const uint32_t FLASH_FUNCTION_ADDRESS = 0x20000150u;
24
25 enum flash_command {
26 FLASH_NO_COMMAND = 0,
27 FLASH_MASS_ERASE = 1,
28 FLASH_SECTOR_ERASE = 2,
29 FLASH_PROGRAM = 4,
30 FLASH_INIT = 8,
31 FLASH_EXIT = 16,
32 FLASH_CONTINUOUS_PROGRAM = 32
33 };
34
35 /* Address for algorithm program and flash buffer */
36 static const uint32_t DST_ADDRESS = 0x2000015Cu;
37 static const uint32_t SRC_LENGTH_ADDRESS = 0x20000160u;
38 static const uint32_t BUFFER1_STATUS_REGISTER = 0x20000164u;
39 static const uint32_t BUFFER2_STATUS_REGISTER = 0x20000168u;
40 static const uint32_t BUFFER_INACTIVE = 0x00000000u;
41 static const uint32_t BUFFER_ACTIVE = 0x00000001u;
42 static const uint32_t BUFFER_DATA_READY = 0x00000010u;
43 static const size_t SRC_LENGTH_MAX = 4096u;
44
45 /* Erase options */
46 static const uint32_t ERASE_PARAM_ADDRESS = 0x2000016Cu;
47 static const uint32_t ERASE_MAIN = 0x00000001u;
48 static const uint32_t ERASE_INFO = 0x00000002u;
49
50 /* Unlock BSL */
51 static const uint32_t UNLOCK_BSL_ADDRESS = 0x20000170u;
52 static const uint32_t LOCK_BSL_KEY = 0x00000000u;
53 static const uint32_t UNLOCK_BSL_KEY = 0x0000000Bu;
54
55 /* Address for return code */
56 static const uint32_t RETURN_CODE_ADDRESS = 0x20000154u;
57
58 /* Return codes */
59 static const uint32_t FLASH_BUSY = 0x00000001u;
60 static const uint32_t FLASH_SUCCESS = 0x00000ACEu;
61 static const uint32_t FLASH_ERROR = 0x0000DEADu;
62 static const uint32_t FLASH_TIMEOUT_ERROR = 0xDEAD0000u;
63 static const uint32_t FLASH_VERIFY_ERROR = 0xDEADDEADu;
64 static const uint32_t FLASH_WRONG_COMMAND = 0x00000BADu;
65 static const uint32_t FLASH_POWER_ERROR = 0x00DEAD00u;
66
67 /* Device ID address */
68 static const uint32_t DEVICE_ID_ADDRESS = 0x0020100Cu;
69 static const uint32_t PC_REGISTER = 15u;
70 static const uint32_t SP_REGISTER = 13u;
71
72 /* CS silicon and boot code revisions */
73 static const uint32_t SILICON_REV_ADDRESS = 0x00201010u;
74 static const uint32_t SILICON_REV_A = 0x00000041u;
75 static const uint32_t SILICON_REV_B = 0x00000042u;
76 static const uint32_t SILICON_REV_C = 0x00000043u;
77 static const uint32_t SILICON_REV_D = 0x00000044u;
78 static const uint32_t SILICON_REV_E = 0x00000045u;
79 static const uint32_t SILICON_REV_F = 0x00000046u;
80 static const uint32_t SILICON_REV_G = 0x00000047u;
81 static const uint32_t SILICON_REV_H = 0x00000048u;
82 static const uint32_t SILICON_REV_I = 0x00000049u;
83 static const uint32_t SILICON_REV_B_WRONG = 0x00004100u;
84
85 struct flash_interface {
86 volatile uint32_t FLASH_FUNCTION;
87 volatile uint32_t RETURN_CODE;
88 volatile uint32_t _RESERVED0;
89 volatile uint32_t DST_ADDRESS;
90 volatile uint32_t SRC_LENGTH;
91 volatile uint32_t BUFFER1_STATUS_REGISTER;
92 volatile uint32_t BUFFER2_STATUS_REGISTER;
93 volatile uint32_t ERASE_PARAM;
94 volatile uint32_t UNLOCK_BSL;
95 };
96
97 #define FLASH_LOADER_BASE ((uint32_t)0x20000150u)
98 #define FLASH_LOADER ((struct flash_interface *) FLASH_LOADER_BASE)
99
100 #endif /* OPENOCD_LOADERS_FLASH_MSP432_MSP432E4_FLASHLIBIF_H */

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)