This is an automated email from Gerrit.

Robert Jordens ([email protected]) just uploaded a new patch set to Gerrit, which 
you can find at http://openocd.zylin.com/5217

-- gerrit

commit 4da73ae499f1e71d26436dfdee4f7134f745bf90
Author: whitequark <[email protected]>
Date:   Fri Jan 19 18:41:51 2018 +0000

    flash/nor: return num_sectors from flash list
    
    This allows to easily calculate sector size.
    
    Change-Id: I4d36cdce025556bf2a9c920da29ebc99fd718980
    Signed-off-by: Robert Jördens <[email protected]>

diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c
index b336cff..e224f81 100644
--- a/src/flash/nor/tcl.c
+++ b/src/flash/nor/tcl.c
@@ -1168,8 +1168,8 @@ COMMAND_HANDLER(handle_flash_banks_command)
        unsigned n = 0;
        for (struct flash_bank *p = flash_bank_list(); p; p = p->next, n++) {
                command_print(CMD, "#%d : %s (%s) at " TARGET_ADDR_FMT ", size 
0x%8.8" PRIx32 ", "
-                       "buswidth %u, chipwidth %u", p->bank_number,
-                       p->name, p->driver->name, p->base, p->size,
+                       "numsectors %u, buswidth %u, chipwidth %u", 
p->bank_number,
+                       p->name, p->driver->name, p->base, p->size, 
p->num_sectors,
                        p->bus_width, p->chip_width);
        }
        return ERROR_OK;
@@ -1194,6 +1194,8 @@ static int jim_flash_list(Jim_Interp *interp, int argc, 
Jim_Obj * const *argv)
                Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, 
p->base));
                Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, 
"size", -1));
                Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, 
p->size));
+               Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, 
"num_sectors", -1));
+               Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, 
p->num_sectors));
                Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, 
"bus_width", -1));
                Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, 
p->bus_width));
                Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, 
"chip_width", -1));

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to