From: David B. <dbr...@us...> - 2010-01-20 19:47:10
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 22d25e69213c49395ee0d40f6cc1eda935873ed2 (commit) via 6f2b88448fff59d00f625d0d361a7b9abf6bd673 (commit) from d036f1700171e0f8056d616a198f17b9be5719e0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 22d25e69213c49395ee0d40f6cc1eda935873ed2 Author: David Brownell <dbr...@us...> Date: Wed Jan 20 10:46:53 2010 -0800 board configs -- unique names for flash chips Don't give the same names to both flash chips on two OMAP boards. For OSK, enable DCC downloads (removing a warning). Signed-off-by: David Brownell <dbr...@us...> diff --git a/tcl/board/omap2420_h4.cfg b/tcl/board/omap2420_h4.cfg index 12efa05..d789e25 100644 --- a/tcl/board/omap2420_h4.cfg +++ b/tcl/board/omap2420_h4.cfg @@ -8,7 +8,5 @@ reset_config trst_and_srst separate # Board configs can vary a *LOT* ... parts, jumpers, etc. # This GP board boots from cs0 using NOR (2x32M), and also # has 64M NAND on cs6. -set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME cfi 0x04000000 0x02000000 2 2 $_TARGETNAME -set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME cfi 0x06000000 0x02000000 2 2 $_TARGETNAME +flash bank h4.u10 cfi 0x04000000 0x02000000 2 2 $_TARGETNAME +flash bank h4.u11 cfi 0x06000000 0x02000000 2 2 $_TARGETNAME diff --git a/tcl/board/osk5912.cfg b/tcl/board/osk5912.cfg index c33ae28..f4378f8 100644 --- a/tcl/board/osk5912.cfg +++ b/tcl/board/osk5912.cfg @@ -19,10 +19,8 @@ etm_dummy config $_TARGETNAME # standard boards populate two 16 MB chips, but manufacturing # options or an expansion board could change this config. -set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME cfi 0x00000000 0x01000000 2 2 $_TARGETNAME -set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME cfi 0x01000000 0x01000000 2 2 $_TARGETNAME +flash bank osk.u1 cfi 0x00000000 0x01000000 2 2 $_TARGETNAME +flash bank osk.u2 cfi 0x01000000 0x01000000 2 2 $_TARGETNAME proc osk5912_init {} { omap5912_reset @@ -32,3 +30,5 @@ proc osk5912_init {} { flash probe 1 } $_TARGETNAME configure -event reset-init { osk5912_init } + +arm7_9 dcc_downloads enable commit 6f2b88448fff59d00f625d0d361a7b9abf6bd673 Author: David Brownell <dbr...@us...> Date: Wed Jan 20 10:43:32 2010 -0800 gdb_server: correctly report flash sector sizes Report each region of same-size sectors separately, instead of incorrectly reporting that every sector has the same size. This is a longstanding bug on NOR flash chips with non-uniform sector sizes. It was largely hidden by other bugs in flash handling. When some of those were recently fixed, this one was exposed as a regression on str710. [oyv...@zy...: update the loop to behave on str7 ] Signed-off-by: Ãyvind Harboe <oyv...@zy...> Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 6ed7243..f3e0575 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1613,22 +1613,6 @@ static int decode_xfer_read(char *buf, char **annex, int *ofs, unsigned int *len return 0; } -static int gdb_calc_blocksize(struct flash_bank *bank) -{ - uint32_t i; - uint32_t block_size = 0xffffffff; - - /* loop through all sectors and return smallest sector size */ - - for (i = 0; i < (uint32_t)bank->num_sectors; i++) - { - if (bank->sectors[i].size < block_size) - block_size = bank->sectors[i].size; - } - - return block_size; -} - static int compare_bank (const void * a, const void * b) { struct flash_bank *b1, *b2; @@ -1666,7 +1650,6 @@ static int gdb_memory_map(struct connection *connection, int offset; int length; char *separator; - int blocksize; uint32_t ram_start = 0; int i; @@ -1683,6 +1666,7 @@ static int gdb_memory_map(struct connection *connection, * it has no concept of non-cacheable read/write memory (i/o etc). * * FIXME Most non-flash addresses are *NOT* RAM! Don't lie. + * Current versions of GDB assume unlisted addresses are RAM... */ banks = malloc(sizeof(struct flash_bank *)*flash_get_bank_count()); @@ -1701,29 +1685,60 @@ static int gdb_memory_map(struct connection *connection, compare_bank); for (i = 0; i < flash_get_bank_count(); i++) { + int j; + unsigned sector_size = 0; + uint32_t start, end; + p = banks[i]; + start = p->base; + end = p->base + p->size; if (ram_start < p->base) xml_printf(&retval, &xml, &pos, &size, "<memory type=\"ram\" start=\"0x%x\" " "length=\"0x%x\"/>\n", - ram_start, p->base-ram_start); + ram_start, p->base - ram_start); - /* If device has uneven sector sizes, eg. str7, lpc - * we pass the smallest sector size to gdb memory map - * - * FIXME Don't lie about flash regions with different - * sector sizes; just tell GDB about each region as - * if it were a separate flash device. + /* Report adjacent groups of same-size sectors. So for + * example top boot CFI flash will list an initial region + * with several large sectors (maybe 128KB) and several + * smaller ones at the end (maybe 32KB). STR7 will have + * regions with 8KB, 32KB, and 64KB sectors; etc. */ - blocksize = gdb_calc_blocksize(p); + for (j = 0; j < p->num_sectors; j++) { + unsigned group_len; + + /* Maybe start a new group of sectors. */ + if (sector_size == 0) { + start = p->base + p->sectors[j].offset; + xml_printf(&retval, &xml, &pos, &size, + "<memory type=\"flash\" " + "start=\"0x%x\" ", + start); + sector_size = p->sectors[j].size; + } + + /* Does this finish a group of sectors? + * If not, continue an already-started group. + */ + if (j == p->num_sectors -1) + group_len = (p->base + p->size) - start; + else if (p->sectors[j + 1].size != sector_size) + group_len = p->base + p->sectors[j + 1].offset + - start; + else + continue; + + xml_printf(&retval, &xml, &pos, &size, + "length=\"0x%x\">\n" + "<property name=\"blocksize\">" + "0x%x</property>\n" + "</memory>\n", + group_len, + sector_size); + sector_size = 0; + } - xml_printf(&retval, &xml, &pos, &size, - "<memory type=\"flash\" start=\"0x%x\" " - "length=\"0x%x\">\n" \ - "<property name=\"blocksize\">0x%x</property>\n" \ - "</memory>\n", \ - p->base, p->size, blocksize); ram_start = p->base + p->size; } ----------------------------------------------------------------------- Summary of changes: src/server/gdb_server.c | 77 +++++++++++++++++++++++++++------------------ tcl/board/omap2420_h4.cfg | 6 +-- tcl/board/osk5912.cfg | 8 ++-- 3 files changed, 52 insertions(+), 39 deletions(-) hooks/post-receive -- Main OpenOCD repository |