summaryrefslogtreecommitdiff
path: root/src/flash/nor
Commit message (Collapse)AuthorAgeFilesLines
* flash: fix error handlingØyvind Harboe2010-09-211-11/+2
| | | | | | sensible error must be reported at failure site Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* embeddedice: fix error handlingØyvind Harboe2010-09-211-6/+0
| | | | | | error is now reported at failure site. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* warnings: fix alignment warningsØyvind Harboe2010-09-201-2/+2
| | | | | | | These warnings are for architectures that do not support non-aligned word access. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* cfi: add sst39vf6401bFlemming Futtrup2010-09-152-0/+15
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* cfi: random crash in cfi_probe() fixedØyvind Harboe2010-09-111-1/+5
| | | | | | | | for non_cfi cfi chips free() was invoked on rodata. The mystery is why this bug has survived for so long. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* cfi: tighten up type usage a bitØyvind Harboe2010-09-111-2/+3
| | | | | | | | | | sizeof() is a bit less scary than seing assumption about size of type, no bug as such. Use NULL instead of 0 for pointers. More obvious that it is a pointer from code inspection. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* Numonyx M29W160ET patchWookey2010-09-031-3/+4
| | | | | | | | | Someone called David Carne popped up on IRC and offered a fix (as he's not on this list so can;t post here). I am just passing it on. (thanx David) 10:54 < davidc__> Basically; the Numonyx M29W160ET has an incorrect CFI PRI block; it describes the erase blocks backwards 10:54 < davidc__> the linked patch has a fixup for that part [really trivial]:
* flash: increase stellaris flash loader bufferSpencer Oliver2010-08-311-1/+1
| | | | | | This speeds up programming for targets with more working area, Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* str9x: faster flash erase of entire chipFredrik Hederstierna2010-08-121-6/+23
| | | | | | | The patch improves flash erase for STR9x in case of a full bank erase. Then the chip erase command is used instead which improves speed significantly. Also I think it might help if e.g. STR912 enters some state where flash banks are locked, and a chip erase command is the key for unlocking the flash.
* stellaris flash comment updateDavid Brownell2010-08-011-1/+1
| | | | | | | | This flash driver works on more than just two chips. (Though it does need work still, e.g. to protect more than 64K. (On non-'3748-A0 chips where errata allow that.)) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* flash: remove algorithm exit_point address for supported targetsSpencer Oliver2010-07-204-5/+4
| | | | | | | | | For the above targets the exit_point is optional when used with run_algorithm, so remove it. This makes updating the algorithm less error prone. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* flash: use bkpt for str9 flash algo algorithmSpencer Oliver2010-07-161-3/+2
| | | | | | | STR9 is ARMv5 arch so use bkpt instruction rather than waste a breakpoint. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* at91sam3s* supportOlaf Lüke2010-06-251-15/+328
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* nor/str7x: review scope of symbolsAntonio Borneo2010-06-211-1/+1
| | | | | | Add "static" qualifier to private function. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* nor/virtual: review scope of symbolsAntonio Borneo2010-06-211-2/+2
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* target/avr: review scope of symbolsAntonio Borneo2010-06-211-13/+0
| | | | | | | | | Add "static" qualifier to private functions. Move duplicated global declarations from "target/avrt.c" and "nor/avrf.c" to "target/avrt.h". Remove unused declarations form "nor/avrf.c". Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* nor/at91sam3: replace helper membufAntonio Borneo2010-06-171-87/+39
| | | | | | | | | | | | | Helper ./src/helper/membuf.c is only used in at91sam3.c 1) Replace membuf with LOG_* 2) The original code in sam3_GetDetails() invalidates all the buffered output of sam3_GetInfo(). The new code skips sam3_GetInfo() if its output should not be printed. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* tms470: -Wshadow warning fixesØyvind Harboe2010-06-161-2/+2
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* str9xpec: -Wshadow warning fixesØyvind Harboe2010-06-161-3/+3
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* str9x: -Wshadow warning fixesØyvind Harboe2010-06-161-3/+3
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* str7x: -Wshadow warning fixesØyvind Harboe2010-06-161-3/+3
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* stm32x: -Wshadow warning fixesØyvind Harboe2010-06-161-2/+2
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* stellaris: -Wshadow warning fixesØyvind Harboe2010-06-151-2/+2
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* lpc2900: -Wshadow warning fixesØyvind Harboe2010-06-151-15/+15
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* lpc2000: -Wshadow warning fixesØyvind Harboe2010-06-151-3/+2
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ecos flash: -Wshadow warning fixesØyvind Harboe2010-06-151-2/+0
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* at91sam7: -Wshadow warning fixesØyvind Harboe2010-06-151-26/+26
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* flash: -Wshadow warning fixØyvind Harboe2010-06-151-2/+1
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* cfi: add LOG_ERROR() in case of unsupported intel erase algorithmØyvind Harboe2010-06-141-0/+3
| | | | | | | found by code inspection. There are many other places in CFI where LOG_ERROR() should be called similarly... Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* flash: fix bug in error propagation of flash write_imageØyvind Harboe2010-06-143-6/+3
| | | | | | | | | | | when a write/unlock/erase failed during write_image, then an error was not propagated back up so e.g. flash write image from tcl scripts would not throw an exception. Also flash filling speed was printed even when the operation failed. Output is now less confusing. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* cfi: fix gaffe introduced in previous versionØyvind Harboe2010-06-141-2/+2
| | | | | | | | flash probe broke w/in last commit. ecc8041c0f4c30a7310c0f8414a5261ee7a090ca Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* flash: add error handling to get_flash_by_addr/nameØyvind Harboe2010-06-113-25/+38
| | | | | | | autoprobing can fail and this error has to be reported up the call stack. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* cfi: fix error propagationØyvind Harboe2010-06-112-118/+341
| | | | | | | | | | any read/write operation to memory can fail. block write algorithm error propagation was broken in that it would continue after an error was reported writing data to ram or the algorithm failing. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* flash: add error message if image is too big for flashØyvind Harboe2010-06-091-1/+5
| | | | | | | replaced assert() w/error message if the image is too big. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* flash: flash erase_address takes unsigned argumentsØyvind Harboe2010-06-091-4/+4
| | | | | | | fixed bug where address was parsed as a signed, rather than unsigned it. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* cfi: fix GDB keep alive bugØyvind Harboe2010-06-081-0/+2
| | | | | | Long running CFI writes could cause GDB timeout. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* stm32 : change returned value of mass_erase functiongcembed2010-06-031-4/+5
| | | | | | | | | | | | | | Hello, "stm32x mass_erase" return ERROR_OK even if something goes wrong. Here is a summary of changes : * in stm32x_mass_erase : return ERROR_FLASH_OPERATION_FAILED when error detected in FLASH_SR register; * in COMMAND_HANDLER(stm32x_handle_mass_erase_command) : return the returned value of stm32x_mass_erase(). I don't know if there is reason to always return ERROR_OK ? Gaëtan
* nor: fix memory leaks during probeSpencer Oliver2010-05-295-0/+30
| | | | | | | Fix similar memory leaks as per commit: ef72484b785ec7462a0415afea679d08b864c7fb Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* flash: virtual driver update for get_flash_bank_by_name_noprobeSpencer Oliver2010-05-261-2/+2
| | | | | | Make sure we do not probe a flash when getting info. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* nor: add get_flash_bank_by_name autoprobeSpencer Oliver2010-05-263-4/+32
| | | | | | | | | | | When a flash cmd is called using the flash name the autoprobe function is not called. autoprobe is called if flash_command_get_bank falls through to get_flash_bank_by_num. This makes both get_flash_bank_by_name and get_flash_bank_by_num behave the same. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* flash: add virtual flash bank driverSpencer Oliver2010-05-263-1/+248
| | | | | | | | | | | | | This adds a virtual flash bank driver that allows virtual banks to be defined that refer to an existing flash bank. For example the real address for bank0 on the pic32 is 0x1fc00000 but the user program will either be in kseg0 (0xbfc00000) or kseg1 (0x9fc00000). This also means that gdb will be aware of all the read only flash addresses. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* NOR/CFI: fix memory leak; check malloc return valueAntonio Borneo2010-05-261-3/+48
| | | | | | | | | | | Every time command "flash probe #" is executed, memory structures are re-allocated without preventive free() of former areas, causing memory leak. Also, memory allocation does not check return value, determining segmentation fault in case of out of memory. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* Change kb/s to KiB/s in messages about kibibytesJon Povey2010-05-161-4/+4
| | | | | | | Change download rate messages about kibibytes from "kb/s" to "KiB/s" units. See: http://en.wikipedia.org/wiki/Data_rate_units Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk>
* NOR/CFI: minor code cleanupAntonio Borneo2010-05-161-8/+0
| | | | | | | Remove few LOG_DEBUG() messages, together with code and variables required to build such messages. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR/CFI: add cfi_read() implementationAntonio Borneo2010-05-161-2/+72
| | | | | | | | | | Final step to force bus_width size during CFI flash read. Added CFI specific implementation cfi_read() that uses only accesses at bus_width size. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR: add read() callback to struct flash_driverAntonio Borneo2010-05-1623-1/+72
| | | | | | | | | | | | | | Final target is to force bus_width size during CFI flash read. In this first step I need to replace default flash read with flash specific implementation. This patch introduces: - flash_driver_read() layer; - default_flash_read(), backward compatible; - read() callback in struct flash_driver; - proper initialization in every flash_driver instance. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR/TCL: fix typo in error messageAntonio Borneo2010-05-161-1/+1
| | | | Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR: fix comment for DoxygenAntonio Borneo2010-05-161-2/+3
| | | | | | Either bus_width and chip_width are in bytes. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR/CFI: remove use of cfi_add_byte()Antonio Borneo2010-05-161-40/+1
| | | | | | | Remove the function cfi_add_byte() and rewrite the only instance of it. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NOR/CFI: use bus_width for memory access in cfi_write()Antonio Borneo2010-05-161-54/+15
| | | | | | | | | | | | | | During cfi_write(), head and tail of destination area could be not aligned to bus_width. Since write operation must be at bus_width size, source buffer size is extended and buffer padded with current values read from flash. Force using bus_width to read current value from flash. Do not use cfi_add_byte() anymore, to allow removing this function later on. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>