21 #define MSPM0_FLASH_BASE_NONMAIN 0x41C00000
22 #define MSPM0_FLASH_END_NONMAIN 0x41C00400
23 #define MSPM0_FLASH_BASE_MAIN 0x0
24 #define MSPM0_FLASH_BASE_DATA 0x41D00000
27 #define MSPM0_FACTORYREGION 0x41C40000
28 #define MSPM0_TRACEID (MSPM0_FACTORYREGION + 0x000)
29 #define MSPM0_DID (MSPM0_FACTORYREGION + 0x004)
30 #define MSPM0_USERID (MSPM0_FACTORYREGION + 0x008)
31 #define MSPM0_SRAMFLASH (MSPM0_FACTORYREGION + 0x018)
34 #define FLASH_CONTROL_BASE 0x400CD000
35 #define FCTL_REG_DESC (FLASH_CONTROL_BASE + 0x10FC)
36 #define FCTL_REG_CMDEXEC (FLASH_CONTROL_BASE + 0x1100)
37 #define FCTL_REG_CMDTYPE (FLASH_CONTROL_BASE + 0x1104)
38 #define FCTL_REG_CMDADDR (FLASH_CONTROL_BASE + 0x1120)
39 #define FCTL_REG_CMDBYTEN (FLASH_CONTROL_BASE + 0x1124)
40 #define FCTL_REG_CMDDATA0 (FLASH_CONTROL_BASE + 0x1130)
41 #define FCTL_REG_CMDWEPROTA (FLASH_CONTROL_BASE + 0x11D0)
42 #define FCTL_REG_CMDWEPROTB (FLASH_CONTROL_BASE + 0x11D4)
43 #define FCTL_REG_CMDWEPROTNM (FLASH_CONTROL_BASE + 0x1210)
44 #define FCTL_REG_STATCMD (FLASH_CONTROL_BASE + 0x13D0)
47 #define FCTL_STATCMD_CMDDONE_MASK 0x00000001
48 #define FCTL_STATCMD_CMDDONE_STATDONE 0x00000001
51 #define FCTL_STATCMD_CMDPASS_MASK 0x00000002
52 #define FCTL_STATCMD_CMDPASS_STATPASS 0x00000002
58 #define FCTL_CMDEXEC_VAL_EXECUTE 0x00000001
61 #define FCTL_CMDTYPE_COMMAND_PROGRAM 0x00000001
62 #define FCTL_CMDTYPE_COMMAND_ERASE 0x00000002
65 #define FCTL_CMDTYPE_SIZE_ONEWORD 0x00000000
66 #define FCTL_CMDTYPE_SIZE_SECTOR 0x00000040
69 #define FCTL_FEATURE_VER_B 0xA
71 #define MSPM0_MAX_PROTREGS 3
73 #define MSPM0_FLASH_TIMEOUT_MS 8000
74 #define ERR_STRING_MAX 255
77 #define SYSCTL_BASE 0x400AF000
78 #define SYSCTL_SECCFG_SECSTATUS (SYSCTL_BASE + 0x00003048)
81 #define TI_MANUFACTURER_ID 0x17
84 #define MSPM0_NO_ID_FOUND 0
85 #define MSPM0_DEV_ID_FOUND 1
86 #define MSPM0_DEV_PART_ID_FOUND 2
131 {
"MSPM0L1105TDGS20R", 0x51DB, 0x16 },
132 {
"MSPM0L1105TDGS28R", 0x51DB, 0x83 },
133 {
"MSPM0L1105TDYYR", 0x51DB, 0x54 },
134 {
"MSPM0L1105TRGER", 0x51DB, 0x86 },
135 {
"MSPM0L1105TRHBR", 0x51DB, 0x68 },
136 {
"MSPM0L1106TDGS20R", 0x5552, 0x4B },
137 {
"MSPM0L1106TDGS28R", 0x5552, 0x98 },
138 {
"MSPM0L1106TDYYR", 0x5552, 0x9D },
139 {
"MSPM0L1106TRGER", 0x5552, 0x90 },
140 {
"MSPM0L1106TRHBR", 0x5552, 0x53 },
141 {
"MSPM0L1303SRGER", 0xef0, 0x17 },
142 {
"MSPM0L1303TRGER", 0xef0, 0xe2 },
143 {
"MSPM0L1304QDGS20R", 0xd717, 0x91 },
144 {
"MSPM0L1304QDGS28R", 0xd717, 0xb6 },
145 {
"MSPM0L1304QDYYR", 0xd717, 0xa0 },
146 {
"MSPM0L1304QRHBR", 0xd717, 0xa9 },
147 {
"MSPM0L1304SDGS20R", 0xd717, 0xfa },
148 {
"MSPM0L1304SDGS28R", 0xd717, 0x73 },
149 {
"MSPM0L1304SDYYR", 0xd717, 0xb7 },
150 {
"MSPM0L1304SRGER", 0xd717, 0x26 },
151 {
"MSPM0L1304SRHBR", 0xd717, 0xe4 },
152 {
"MSPM0L1304TDGS20R", 0xd717, 0x33 },
153 {
"MSPM0L1304TDGS28R", 0xd717, 0xa8 },
154 {
"MSPM0L1304TDYYR", 0xd717, 0xf9 },
155 {
"MSPM0L1304TRGER", 0xd717, 0xb7 },
156 {
"MSPM0L1304TRHBR", 0xd717, 0x5a },
157 {
"MSPM0L1305QDGS20R", 0x4d03, 0xb7 },
158 {
"MSPM0L1305QDGS28R", 0x4d03, 0x74 },
159 {
"MSPM0L1305QDYYR", 0x4d03, 0xec },
160 {
"MSPM0L1305QRHBR", 0x4d03, 0x78 },
161 {
"MSPM0L1305SDGS20R", 0x4d03, 0xc7 },
162 {
"MSPM0L1305SDGS28R", 0x4d03, 0x64 },
163 {
"MSPM0L1305SDYYR", 0x4d03, 0x91 },
164 {
"MSPM0L1305SRGER", 0x4d03, 0x73 },
165 {
"MSPM0L1305SRHBR", 0x4d03, 0x2d },
166 {
"MSPM0L1305TDGS20R", 0x4d03, 0xa0 },
167 {
"MSPM0L1305TDGS28R", 0x4d03, 0xfb },
168 {
"MSPM0L1305TDYYR", 0x4d03, 0xde },
169 {
"MSPM0L1305TRGER", 0x4d03, 0xea },
170 {
"MSPM0L1305TRHBR", 0x4d03, 0x85 },
171 {
"MSPM0L1306QDGS20R", 0xbb70, 0x59 },
172 {
"MSPM0L1306QDGS28R", 0xbb70, 0xf7 },
173 {
"MSPM0L1306QDYYR", 0xbb70, 0x9f },
174 {
"MSPM0L1306QRHBR", 0xbb70, 0xc2 },
175 {
"MSPM0L1306SDGS20R", 0xbb70, 0xf4 },
176 {
"MSPM0L1306SDGS28R", 0xbb70, 0x5 },
177 {
"MSPM0L1306SDYYR", 0xbb70, 0xe },
178 {
"MSPM0L1306SRGER", 0xbb70, 0x7f },
179 {
"MSPM0L1306SRHBR", 0xbb70, 0x3c },
180 {
"MSPM0L1306TDGS20R", 0xbb70, 0xa },
181 {
"MSPM0L1306TDGS28R", 0xbb70, 0x63 },
182 {
"MSPM0L1306TDYYR", 0xbb70, 0x35 },
183 {
"MSPM0L1306TRGER", 0xbb70, 0xaa },
184 {
"MSPM0L1306TRHBR", 0xbb70, 0x52 },
185 {
"MSPM0L1343TDGS20R", 0xb231, 0x2e },
186 {
"MSPM0L1344TDGS20R", 0x40b0, 0xd0 },
187 {
"MSPM0L1345TDGS28R", 0x98b4, 0x74 },
188 {
"MSPM0L1346TDGS28R", 0xf2b5, 0xef },
193 {
"MSPM0G1105TPTR", 0x8934, 0xD },
194 {
"MSPM0G1105TRGZR", 0x8934, 0xFE },
195 {
"MSPM0G1106TPMR", 0x477B, 0xD4 },
196 {
"MSPM0G1106TPTR", 0x477B, 0x71 },
197 {
"MSPM0G1106TRGZR", 0x477B, 0xBB },
198 {
"MSPM0G1106TRHBR", 0x477B, 0x0 },
199 {
"MSPM0G1107TDGS28R", 0x807B, 0x82 },
200 {
"MSPM0G1107TPMR", 0x807B, 0xB3 },
201 {
"MSPM0G1107TPTR", 0x807B, 0x32 },
202 {
"MSPM0G1107TRGER", 0x807B, 0x79 },
203 {
"MSPM0G1107TRGZR", 0x807B, 0x20 },
204 {
"MSPM0G1107TRHBR", 0x807B, 0xBC },
205 {
"MSPM0G1505SDGS28R", 0x13C4, 0x73 },
206 {
"MSPM0G1505SPMR", 0x13C4, 0x53 },
207 {
"MSPM0G1505SPTR", 0x13C4, 0x3E },
208 {
"MSPM0G1505SRGER", 0x13C4, 0x47 },
209 {
"MSPM0G1505SRGZR", 0x13C4, 0x34 },
210 {
"MSPM0G1505SRHBR", 0x13C4, 0x30 },
211 {
"MSPM0G1506SDGS28R", 0x5AE0, 0x3A },
212 {
"MSPM0G1506SPMR", 0x5AE0, 0xF6 },
213 {
"MSPM0G1506SRGER", 0x5AE0, 0x67 },
214 {
"MSPM0G1506SRGZR", 0x5AE0, 0x75 },
215 {
"MSPM0G1506SRHBR", 0x5AE0, 0x57 },
216 {
"MSPM0G1507SDGS28R", 0x2655, 0x6D },
217 {
"MSPM0G1507SPMR", 0x2655, 0x97 },
218 {
"MSPM0G1507SRGER", 0x2655, 0x83 },
219 {
"MSPM0G1507SRGZR", 0x2655, 0xD3 },
220 {
"MSPM0G1507SRHBR", 0x2655, 0x4D },
221 {
"MSPM0G3105SDGS20R", 0x4749, 0x21 },
222 {
"MSPM0G3105SDGS28R", 0x4749, 0xDD },
223 {
"MSPM0G3105SRHBR", 0x4749, 0xBE },
224 {
"MSPM0G3106SDGS20R", 0x54C7, 0xD2 },
225 {
"MSPM0G3106SDGS28R", 0x54C7, 0xB9 },
226 {
"MSPM0G3106SRHBR", 0x54C7, 0x67 },
227 {
"MSPM0G3107SDGS20R", 0xAB39, 0x5C },
228 {
"MSPM0G3107SDGS28R", 0xAB39, 0xCC },
229 {
"MSPM0G3107SRHBR", 0xAB39, 0xB7 },
230 {
"MSPM0G3505SDGS28R", 0xc504, 0x8e },
231 {
"MSPM0G3505SPMR", 0xc504, 0x1d },
232 {
"MSPM0G3505SPTR", 0xc504, 0x93 },
233 {
"MSPM0G3505SRGZR", 0xc504, 0xc7 },
234 {
"MSPM0G3505SRHBR", 0xc504, 0xe7 },
235 {
"MSPM0G3505TDGS28R", 0xc504, 0xdf },
236 {
"MSPM0G3506SDGS28R", 0x151f, 0x8 },
237 {
"MSPM0G3506SPMR", 0x151f, 0xd4 },
238 {
"MSPM0G3506SPTR", 0x151f, 0x39 },
239 {
"MSPM0G3506SRGZR", 0x151f, 0xfe },
240 {
"MSPM0G3506SRHBR", 0x151f, 0xb5 },
241 {
"MSPM0G3507SDGS28R", 0xae2d, 0xca },
242 {
"MSPM0G3507SPMR", 0xae2d, 0xc7 },
243 {
"MSPM0G3507SPTR", 0xae2d, 0x3f },
244 {
"MSPM0G3507SRGZR", 0xae2d, 0xf7 },
245 {
"MSPM0G3507SRHBR", 0xae2d, 0x4c },
246 {
"M0G3107QPMRQ1", 0x4e2f, 0x51 },
247 {
"M0G3107QPTRQ1", 0x4e2f, 0xc7},
248 {
"M0G3107QRGZRQ1", 0x4e2f, 0x8a },
249 {
"M0G3107QRHBRQ1", 0x4e2f, 0x9a},
250 {
"M0G3107QDGS28RQ1", 0x4e2f, 0xd5},
251 {
"M0G3107QDGS28RQ1", 0x4e2f, 0x67},
252 {
"M0G3107QDGS20RQ1", 0x4e2f, 0xfd},
253 {
"M0G3106QPMRQ1", 0x54C7, 0x08},
254 {
"M0G3105QDGS32RQ1", 0x1349, 0x08},
255 {
"M0G3106QPTRQ1", 0x54C7, 0x3F},
256 {
"M0G3105QDGS28RQ1", 0x1349, 0x1B},
257 {
"M0G3106QRGZRQ1", 0x94AD, 0xE6},
258 {
"M0G3105QDGS20RQ1", 0x1349, 0xFB},
259 {
"M0G3106QRHBRQ1", 0x94AD, 0x20},
260 {
"M0G3106QDGS32RQ1", 0x94AD, 0x8D},
261 {
"M0G3106QDGS28RQ1", 0x94AD, 0x03},
262 {
"M0G3106QDGS20RQ1", 0x94AD, 0x6F},
263 {
"M0G3105QPMRQ1", 0x1349, 0xD0},
264 {
"M0G3105QPTRQ1", 0x1349, 0xEF},
265 {
"M0G3105QRGZRQ1", 0x1349, 0x70},
266 {
"M0G3105QRHBRQ1", 0x1349, 0x01},
271 {
"MSPS003F4SPW20R", 0x57b3, 0x70},
272 {
"MSPM0C1104SDGS20R", 0x57b3, 0x71},
273 {
"MSPM0C1104SRUKR", 0x57b3, 0x73},
274 {
"MSPM0C1104SDYYR", 0x57b3, 0x75},
275 {
"MSPM0C1104SDDFR", 0x57b3, 0x77},
276 {
"MSPM0C1104SDSGR", 0x57b3, 0x79},
281 {
"MSPM0L1227SRGER", 0x7C32, 0xF1},
282 {
"MSPM0L1227SPTR", 0x7C32, 0xC9},
283 {
"MSPM0L1227SPMR", 0x7C32, 0x1C},
284 {
"MSPM0L1227SPNAR", 0x7C32, 0x91},
285 {
"MSPM0L1227SPNR", 0x7C32, 0x39},
286 {
"MSPM0L1228SRGER", 0x33F7, 0x13},
287 {
"MSPM0L1228SRHBR", 0x33F7, 0x3A},
288 {
"MSPM0L1228SRGZR", 0x33F7, 0xBC},
289 {
"MSPM0L1228SPTR", 0x33F7, 0xF8},
290 {
"MSPM0L1228SPMR", 0x33F7, 0xCE},
291 {
"MSPM0L1228SPNAR", 0x33F7, 0x59},
292 {
"MSPM0L1228SPNR", 0x33F7, 0x7},
293 {
"MSPM0L2227SRGZR", 0x5E8F, 0x90},
294 {
"MSPM0L2227SPTR", 0x5E8F, 0xA},
295 {
"MSPM0L2227SPMR", 0x5E8F, 0x6D},
296 {
"MSPM0L2227SPNAR", 0x5E8F, 0x24},
297 {
"MSPM0L2227SPNR", 0x5E8F, 0x68},
298 {
"MSPM0L2228SRGZR", 0x2C38, 0xB8},
299 {
"MSPM0L2228SPTR", 0x2C38, 0x25},
300 {
"MSPM0L2228SPMR", 0x2C38, 0x6E},
301 {
"MSPM0L2228SPNAR", 0x2C38, 0x63},
302 {
"MSPM0L2228SPNR", 0x2C38, 0x3C},
323 switch (
bank->base) {
335 LOG_ERROR(
"%s: Out of memory for mspm0_info!", __func__);
339 bank->driver_priv = mspm0_info;
353 if (mspm0_info->
did == 0)
357 "\nTI MSPM0 information: Chip is "
358 "%s rev %d Device Unique ID: 0x%" PRIu32
"\n",
362 "main flash: %uKiB in %u bank(s), sram: %uKiB, data flash: %uKiB",
373 return (var &
GENMASK(hi, lo)) >> lo;
403 LOG_ERROR(
"Failed to read sramflash register");
409 LOG_ERROR(
"Failed to read flashctl description register");
429 LOG_WARNING(
"Unknown Device ID[0x%" PRIx32
"], cannot identify target",
431 LOG_DEBUG(
"did 0x%" PRIx32
", traceid 0x%" PRIx32
", userid 0x%" PRIx32
432 ", flashram 0x%" PRIx32
"", did, mspm0_info->
traceid, userid,
438 unsigned char minfo_idx = 0xff;
452 unsigned char pinfo_idx = 0xff;
461 for (
unsigned int i = 0; i < minfo->
part_count; i++) {
484 switch (probe_status) {
486 mspm0_info->
name =
"mspm0x";
487 LOG_INFO(
"Unidentified PART[0x%x]/variant[0x%x"
488 "], unknown DeviceID[0x%x"
489 "]. Attempting to proceed as %s.", part, variant, pnum,
494 LOG_INFO(
"Unidentified PART[0x%x]/variant[0x%x"
495 "], known DeviceID[0x%x"
496 "]. Attempting to proceed as %s.", part, variant, pnum,
506 mspm0_info->
did = did;
522 LOG_DEBUG(
"Detected: main flash: %uKb in %u banks, sram: %uKb, data flash: %uKb",
532 static const struct {
536 { 2,
"CMDINPROGRESS" },
539 { 6,
"FAILILLADDR" },
552 return "FAILUNKNOWN";
556 unsigned int *
reg,
unsigned int *sector_mask)
561 unsigned int sector_num = (
addr >> 10);
562 unsigned int sector_in_bank = sector_num;
563 unsigned int phys_sector_num = sector_num;
564 uint32_t sysctl_sec_status;
565 unsigned int exec_upper_bank;
580 if (exec_upper_bank) {
601 switch (
bank->base) {
606 if (phys_sector_num < 32) {
607 *sector_mask =
BIT(phys_sector_num);
612 if (phys_sector_num >= 32 && sector_in_bank < 256) {
615 *sector_mask =
BIT(sector_in_bank / 8);
617 *sector_mask =
BIT((sector_in_bank - 32) / 8);
621 *sector_mask =
BIT((sector_in_bank / 8) % 32);
626 *sector_mask =
BIT(sector_num % 32);
639 LOG_ERROR(
"Unable to map sector protect reg for address 0x%08x",
addr);
656 switch (
bank->base) {
681 unsigned int reg = 0x0;
682 uint32_t sector_mask = 0x0;
688 LOG_ERROR(
"Unable to map sector protect reg for address 0x%08x",
addr);
691 LOG_ERROR(
"Unable to determine which bank to use 0x%08x",
addr);
729 uint32_t return_code = 0;
740 if (elapsed_ms > 500)
772 LOG_ERROR(
"Unprotecting sector of memory at address 0x%08" PRIx32
793 if (mspm0_info->
did == 0)
815 for (
unsigned int i = 0; i <
bank->num_sectors; i++)
816 bank->sectors[i].is_protected = 0;
829 LOG_ERROR(
"Please halt target for erasing flash");
833 if (mspm0_info->
did == 0)
840 &protect_reg_cache[i]);
842 LOG_ERROR(
"Failed saving flashctl protection status");
847 switch (
bank->base) {
849 for (
unsigned int csa = first; csa <= last; csa++) {
853 LOG_ERROR(
"Sector erase on MAIN failed at address 0x%08x "
854 "(sector: %u)",
addr, csa);
860 LOG_ERROR(
"Sector erase on NONMAIN failed");
863 for (
unsigned int csa = first; csa <= last; csa++) {
868 LOG_ERROR(
"Sector erase on DATA bank failed at address 0x%08x "
869 "(sector: %u)",
addr, csa);
873 LOG_ERROR(
"Invalid memory region access");
893 protect_reg_cache[i]);
895 LOG_ERROR(
"Failed re-applying protection status of flashctl");
922 LOG_ERROR(
"Please halt target for programming flash");
926 if (mspm0_info->
did == 0)
937 &protect_reg_cache[i]);
939 LOG_ERROR(
"Failed saving flashctl protection status");
948 unsigned int num_bytes_to_write;
959 num_bytes_to_write =
count;
964 bytes_en = (1 << num_bytes_to_write) - 1;
972 bytes_en |= (num_bytes_to_write > 8) ?
BIT(17) : 0;
975 LOG_ERROR(
"Invalid flash_word_size_bytes %d",
994 addr += num_bytes_to_write;
995 buffer += num_bytes_to_write;
996 count -= num_bytes_to_write;
1019 protect_reg_cache[i]);
1021 LOG_ERROR(
"Failed re-applying protection status of flashctl");
1037 if (mspm0_info->
did != 0)
1049 if (
bank->sectors) {
1050 free(
bank->sectors);
1054 bank->write_start_alignment = 4;
1055 bank->write_end_alignment = 4;
1057 switch (
bank->base) {
1060 bank->num_sectors = 0x1;
1082 LOG_INFO(
"Data region NOT available!");
1084 bank->num_sectors = 0x0;
1105 if (!
bank->sectors) {
1106 LOG_ERROR(
"Out of memory for sectors!");
1109 for (
unsigned int i = 0; i <
bank->num_sectors; i++) {
1112 bank->sectors[i].is_erased = -1;
1120 .flash_bank_command = mspm0_flash_bank_command,
void command_print_sameline(struct command_invocation *cmd, const char *format,...)
uint64_t buffer
Pointer to data buffer to send over SPI.
#define ERROR_FLASH_BANK_INVALID
#define ERROR_FLASH_SECTOR_INVALID
#define ERROR_FLASH_BANK_NOT_PROBED
#define ERROR_FLASH_OPERATION_FAILED
#define ERROR_FLASH_DST_OUT_OF_BANK
int default_flash_blank_check(struct flash_bank *bank)
Provides default erased-bank check handling.
int default_flash_read(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
Provides default read implementation for flash memory.
void default_flash_free_driver_priv(struct flash_bank *bank)
Deallocates bank->driver_priv.
#define LOG_WARNING(expr ...)
#define LOG_ERROR(expr ...)
#define LOG_INFO(expr ...)
#define LOG_DEBUG(expr ...)
#define FCTL_CMDEXEC_VAL_EXECUTE
static int mspm0_fctl_wait_cmd_ok(struct flash_bank *bank)
#define MSPM0_DEV_PART_ID_FOUND
#define FCTL_CMDTYPE_SIZE_SECTOR
#define MSPM0_FLASH_TIMEOUT_MS
#define FCTL_STATCMD_CMDDONE_MASK
static const char * mspm0_fctl_translate_ret_err(unsigned int return_code)
#define MSPM0_FLASH_BASE_MAIN
static int get_mspm0_info(struct flash_bank *bank, struct command_invocation *cmd)
static int mspm0_write(struct flash_bank *bank, const unsigned char *buffer, unsigned int offset, unsigned int count)
static const struct mspm0_part_info mspm0lx22x_parts[]
const struct flash_driver mspm0_flash
static unsigned int mspm0_extract_val(unsigned int var, unsigned char hi, unsigned char lo)
static const struct mspm0_part_info mspm0g_parts[]
#define MSPM0_MAX_PROTREGS
#define FCTL_REG_CMDBYTEN
#define FCTL_STATCMD_CMDPASS_MASK
static int mspm0_fctl_get_sector_reg(struct flash_bank *bank, unsigned int addr, unsigned int *reg, unsigned int *sector_mask)
static const struct mspm0_family_info mspm0_finf[]
#define MSPM0_FLASH_END_NONMAIN
static const struct mspm0_part_info mspm0l_parts[]
const unsigned char bit_offset
static int mspm0_fctl_unprotect_sector(struct flash_bank *bank, unsigned int addr)
static int mspm0_fctl_cfg_command(struct flash_bank *bank, uint32_t addr, uint32_t cmd, uint32_t byte_en)
static int mspm0_protect_check(struct flash_bank *bank)
#define FCTL_REG_CMDWEPROTB
#define FCTL_CMDTYPE_COMMAND_ERASE
FLASH_BANK_COMMAND_HANDLER(mspm0_flash_bank_command)
static const struct mspm0_part_info mspm0c_parts[]
#define MSPM0_NO_ID_FOUND
#define TI_MANUFACTURER_ID
#define MSPM0_FLASH_BASE_DATA
#define FCTL_FEATURE_VER_B
#define FCTL_STATCMD_CMDPASS_STATPASS
#define FCTL_STATCMD_CMDDONE_STATDONE
static const struct @12 mspm0_fctl_fail_decode_strings[]
static int mspm0_probe(struct flash_bank *bank)
#define FCTL_REG_CMDWEPROTA
#define MSPM0_FLASH_BASE_NONMAIN
#define MSPM0_DEV_ID_FOUND
static int mspm0_read_part_info(struct flash_bank *bank)
#define SYSCTL_SECCFG_SECSTATUS
#define FCTL_CMDTYPE_SIZE_ONEWORD
static int mspm0_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
static int mspm0_address_check(struct flash_bank *bank, unsigned int addr)
#define FCTL_CMDTYPE_COMMAND_PROGRAM
#define FCTL_REG_CMDWEPROTNM
static int mspm0_fctl_sector_erase(struct flash_bank *bank, uint32_t addr)
#define FCTL_REG_CMDDATA0
target_addr_t addr
Start address to search for the control block.
When run_command is called, a new instance will be created on the stack, filled with the proper value...
Provides details of a flash bank, available either on-chip or through a major interface.
Provides the implementation-independent structure that defines all of the callbacks required by OpenO...
const char * name
Gives a human-readable name of this flash driver, This field is used to select and initialize the dri...
Describes the geometry and status of a single flash sector within a flash bank.
const struct mspm0_part_info * part_info
unsigned int main_flash_num_banks
unsigned int protect_reg_base
unsigned int data_flash_size_kb
unsigned int protect_reg_count
unsigned int main_flash_size_kb
unsigned char flash_version
unsigned int sram_size_kb
unsigned char flash_word_size_bytes
int target_write_buffer(struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
int target_write_u32(struct target *target, target_addr_t address, uint32_t value)
int target_read_u32(struct target *target, target_addr_t address, uint32_t *value)
#define ERROR_TARGET_NOT_HALTED
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.