aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/tcl.c
diff options
context:
space:
mode:
authorTarek BOCHKATI <tarek.bouchkati@gmail.com>2021-07-29 21:44:55 +0100
committerAntonio Borneo <borneo.antonio@gmail.com>2021-09-04 07:25:56 +0000
commit9f733ba2f274c425178780812d1c44fa44e464e4 (patch)
treee3d03d74a8fe8a1f670335cbcf65a88d87499154 /src/flash/nor/tcl.c
parent57c61cee4b538b449421bc6ff8ebca5be70e60b1 (diff)
downloadriscv-openocd-9f733ba2f274c425178780812d1c44fa44e464e4.zip
riscv-openocd-9f733ba2f274c425178780812d1c44fa44e464e4.tar.gz
riscv-openocd-9f733ba2f274c425178780812d1c44fa44e464e4.tar.bz2
flash/nor/tcl: fix the flash name returned by 'flash list' command
The 'flash list' command returns the driver name as flash name which seems to be incorrect, the proposal is: - to fix this by returning the flash name - and add a new item 'driver' in the returned list example: before the change > flash list {name stm32l4x base 134217728 size 0 bus_width 0 chip_width 0} {name stm32l4x base 201326592 size 0 bus_width 0 chip_width 0} {name stm32l4x base 200933376 size 0 bus_width 0 chip_width 0} after the change > flash list {name stm32l5x.flash_ns driver stm32l4x ...} {name stm32l5x.flash_alias_s driver stm32l4x ...} {name stm32l5x.otp driver stm32l4x ...} Change-Id: I6d307b73c457549981a93c260be344378719af82 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6425 Reviewed-by: zapb <dev@zapb.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Diffstat (limited to 'src/flash/nor/tcl.c')
-rw-r--r--src/flash/nor/tcl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c
index cbc64dc..613012b 100644
--- a/src/flash/nor/tcl.c
+++ b/src/flash/nor/tcl.c
@@ -1350,6 +1350,8 @@ static int jim_flash_list(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
Jim_Obj *elem = Jim_NewListObj(interp, NULL, 0);
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "name", -1));
+ Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, p->name, -1));
+ Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "driver", -1));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, p->driver->name, -1));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "base", -1));
Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->base));