projects
/
fw
/
openocd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
flash/nor/spi: add micron MT25QU01G
[fw/openocd]
/
src
/
flash
/
nor
/
psoc6.c
diff --git
a/src/flash/nor/psoc6.c
b/src/flash/nor/psoc6.c
index 9c834fde6ba8b12853ff4bdf422c5df74e7a8fbc..c6166aff8f8d924d713188ac4ff503506b8a2a2d 100644
(file)
--- a/
src/flash/nor/psoc6.c
+++ b/
src/flash/nor/psoc6.c
@@
-24,11
+24,12
@@
#include <time.h>
#include "imp.h"
#include <time.h>
#include "imp.h"
+#include "helper/time_support.h"
+#include "target/arm_adi_v5.h"
#include "target/target.h"
#include "target/cortex_m.h"
#include "target/breakpoints.h"
#include "target/target_type.h"
#include "target/target.h"
#include "target/cortex_m.h"
#include "target/breakpoints.h"
#include "target/target_type.h"
-#include "time_support.h"
#include "target/algorithm.h"
/**************************************************************************************************
#include "target/algorithm.h"
/**************************************************************************************************
@@
-181,10
+182,8
@@
destroy_rp_free_wa:
/* Something went wrong, do some cleanup */
destroy_reg_param(®_params);
/* Something went wrong, do some cleanup */
destroy_reg_param(®_params);
- if (g_stack_area) {
- target_free_working_area(target, g_stack_area);
- g_stack_area = NULL;
- }
+ target_free_working_area(target, g_stack_area);
+ g_stack_area = NULL;
return hr;
}
return hr;
}
@@
-491,11
+490,10
@@
static const char *protection_to_str(uint8_t protection)
/** ***********************************************************************************************
* @brief psoc6_get_info Displays human-readable information about acquired device
* @param bank current flash bank
/** ***********************************************************************************************
* @brief psoc6_get_info Displays human-readable information about acquired device
* @param bank current flash bank
- * @param buf pointer to buffer for human-readable text
- * @param buf_size size of the buffer
+ * @param cmd pointer to command invocation instance
* @return ERROR_OK in case of success, ERROR_XXX code otherwise
*************************************************************************************************/
* @return ERROR_OK in case of success, ERROR_XXX code otherwise
*************************************************************************************************/
-static int psoc6_get_info(struct flash_bank *bank,
char *buf, int buf_size
)
+static int psoc6_get_info(struct flash_bank *bank,
struct command_invocation *cmd
)
{
struct psoc6_target_info *psoc6_info = bank->driver_priv;
{
struct psoc6_target_info *psoc6_info = bank->driver_priv;
@@
-506,7
+504,7
@@
static int psoc6_get_info(struct flash_bank *bank, char *buf, int buf_size)
if (hr != ERROR_OK)
return hr;
if (hr != ERROR_OK)
return hr;
-
snprintf(buf, buf_size
,
+
command_print_sameline(cmd
,
"PSoC6 Silicon ID: 0x%08" PRIX32 "\n"
"Protection: %s\n"
"Main Flash size: %" PRIu32 " kB\n"
"PSoC6 Silicon ID: 0x%08" PRIX32 "\n"
"Protection: %s\n"
"Main Flash size: %" PRIu32 " kB\n"
@@
-744,9
+742,6
@@
static int psoc6_erase(struct flash_bank *bank, unsigned int first,
if (hr != ERROR_OK)
goto exit_free_wa;
if (hr != ERROR_OK)
goto exit_free_wa;
- for (unsigned int i = first; i < first + rows_in_sector; i++)
- bank->sectors[i].is_erased = 1;
-
first += rows_in_sector;
} else {
/* Perform Row Erase otherwise */
first += rows_in_sector;
} else {
/* Perform Row Erase otherwise */
@@
-754,7
+749,6
@@
static int psoc6_erase(struct flash_bank *bank, unsigned int first,
if (hr != ERROR_OK)
goto exit_free_wa;
if (hr != ERROR_OK)
goto exit_free_wa;
- bank->sectors[first].is_erased = 1;
first += 1;
}
}
first += 1;
}
}
@@
-1019,7
+1013,7
@@
static const struct command_registration psoc6_exec_command_handlers[] = {
.name = "reset_halt",
.handler = psoc6_handle_reset_halt,
.mode = COMMAND_EXEC,
.name = "reset_halt",
.handler = psoc6_handle_reset_halt,
.mode = COMMAND_EXEC,
- .usage =
NULL
,
+ .usage =
""
,
.help = "Tries to simulate broken Vector Catch",
},
COMMAND_REGISTRATION_DONE
.help = "Tries to simulate broken Vector Catch",
},
COMMAND_REGISTRATION_DONE