aboutsummaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorJian-Hong Pan <chienhung.pan@gmail.com>2022-11-10 00:14:10 +0800
committerAntonio Borneo <borneo.antonio@gmail.com>2023-01-15 15:04:06 +0000
commit63336f4aaf672899db78de4ce6781c9451851472 (patch)
treef069600ce4f02b92a63ab59d65a6912e00f6f23f /src/flash
parent21b14028ad7565f4916ae05a6c28b465eceb9150 (diff)
downloadriscv-openocd-63336f4aaf672899db78de4ce6781c9451851472.zip
riscv-openocd-63336f4aaf672899db78de4ce6781c9451851472.tar.gz
riscv-openocd-63336f4aaf672899db78de4ce6781c9451851472.tar.bz2
flash/nor, contrib/loaders: move numicro M4 write assembly to contrib/loaders
Simply move numicro M4 flash write assembly to contrib/loaders. Also, add corresponding Makefile and generated numicro_m4.inc. Signed-off-by: Jian-Hong Pan <chienhung.pan@gmail.com> Change-Id: I22b8be0a245857335b11bd0b538db415fc34748d Reviewed-on: https://review.openocd.org/c/openocd/+/7343 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/nor/numicro.c57
1 files changed, 1 insertions, 56 deletions
diff --git a/src/flash/nor/numicro.c b/src/flash/nor/numicro.c
index 2bba7b7..cbd2450 100644
--- a/src/flash/nor/numicro.c
+++ b/src/flash/nor/numicro.c
@@ -740,62 +740,7 @@ static const uint8_t numicro_flash_write_code[] = {
};
static const uint8_t numicro_m4_flash_write_code[] = {
- /* Params:
- * r0 - workarea buffer / result
- * r1 - target address
- * r2 - wordcount
- * Clobbered:
- * r4 - tmp
- * r5 - tmp
- * r6 - tmp
- * r7 - tmp
- */
-
- /* .L1: */
- /* for(register uint32_t i=0;i<wcount;i++){ */
- 0x04, 0x1C, /* mov r4, r0 */
- 0x00, 0x23, /* mov r3, #0 */
- /* .L2: */
- 0x0D, 0x1A, /* sub r5, r1, r0 */
- 0x67, 0x19, /* add r7, r4, r7 */
- 0x93, 0x42, /* cmp r3, r2 */
- 0x0C, 0xD0, /* beq .L7 */
- /* .L4: */
- /* NUMICRO_FLASH_ISPADR = faddr; */
- 0x08, 0x4E, /* ldr r6, .L8 */
- 0x37, 0x60, /* str r7, [r6] */
- /* NUMICRO_FLASH_ISPDAT = *pLW; */
- 0x80, 0xCC, /* ldmia r4!, {r7} */
- 0x08, 0x4D, /* ldr r5, .L8+4 */
- 0x2F, 0x60, /* str r7, [r5] */
- /* faddr += 4; */
- /* pLW++; */
- /* Trigger write action */
- /* NUMICRO_FLASH_ISPTRG = ISPTRG_ISPGO; */
- 0x08, 0x4D, /* ldr r5, .L8+8 */
- 0x01, 0x26, /* mov r6, #1 */
- 0x2E, 0x60, /* str r6, [r5] */
- /* .L3: */
- /* while((NUMICRO_FLASH_ISPTRG & ISPTRG_ISPGO) == ISPTRG_ISPGO){}; */
- 0x2F, 0x68, /* ldr r7, [r5] */
- 0xFF, 0x07, /* lsl r7, r7, #31 */
- 0xFC, 0xD4, /* bmi .L3 */
-
- 0x01, 0x33, /* add r3, r3, #1 */
- 0xEE, 0xE7, /* b .L2 */
- /* .L7: */
- /* return (NUMICRO_FLASH_ISPCON & ISPCON_ISPFF); */
- 0x05, 0x4B, /* ldr r3, .L8+12 */
- 0x18, 0x68, /* ldr r0, [r3] */
- 0x40, 0x21, /* mov r1, #64 */
- 0x08, 0x40, /* and r0, r1 */
- /* .L9: */
- 0x00, 0xBE, /* bkpt #0 */
- /* .L8: */
- 0x04, 0xC0, 0x00, 0x40,/* .word 0x4000C004 */
- 0x08, 0xC0, 0x00, 0x40,/* .word 0x4000C008 */
- 0x10, 0xC0, 0x00, 0x40,/* .word 0x4000C010 */
- 0x00, 0xC0, 0x00, 0x40 /* .word 0x4000C000 */
+#include "../../../contrib/loaders/flash/numicro_m4/numicro_m4.inc"
};
/* Program LongWord Block Write */