summaryrefslogtreecommitdiff
path: root/src/flash/nor/core.c
Commit message (Collapse)AuthorAgeFilesLines
* NOR: make flash_write_unlock() pad to sector endDavid Brownell2009-12-271-2/+42
| | | | | | | | | | | | | | Resolve a regression when using newish automagic "write_image" modes, by always padding to the end of affected sectors. Also document some issues associated with those automagic options, in the User's Guide and also some related code comments. We might need similar padding at the *beginning* of some sectors, but this is a minimalist fix for the problems which have currently been reported (plus doc updates). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* NOR: Allocate the right amount of memoryDavid Brownell2009-12-261-1/+1
| | | | Switch to calloc() to simplify review and initialization.
* cygwin build fixesDavid Brownell2009-12-191-4/+6
| | | | | | and shrink some too-long lines Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* NOR FLASH: only erase/unlock whole sectorsDavid Brownell2009-12-181-8/+36
| | | | | | | | | | | | | | | Much to my surprise, I observed a "flash erase_address ..." command erasing data which I said should not be erased. The issue turns out to be generic NOR flash code which was silently, and rather dangerously, morphing partial-sector references into unrequested whole-sector ones. This patch removes that low-level morphing. If desired, it can and should be done in higher level code. (We might need to fix some stuff in the GDB server code.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* eliminate src/flash/flash.cZachary T Welch2009-12-041-4/+187
| | | | | Move remaining NOR flash implemenation into flash/nor/core.c Removes flash.c from the build, leaving only its header to split.
* add flash/nor/drivers.cZachary T Welch2009-12-041-11/+0
| | | | | Encapsulates access to the flash_drivers array, providing a base of operations for future dynamic driver module loading features.
* move more nor flash implementation detailsZachary T Welch2009-12-041-0/+276
| | | | | | | | Splits the exec mode commands out of flash.c into the flash/nor/ files. The routines used by these high-level commands are moved into nor/core.c, with their internal declarations placed in nor/imp.h. Fixes distribution of <flash/nor/core.h> header.
* add flash/nor/core.[ch]Zachary T Welch2009-12-041-0/+65
The newly moved flash TCL routines access the internals of the module too much. Fix the layering issues by adding new core NOR flash APIs: <flash/nor/core.h>: - flash_driver_find_by_name() - self-descriptive <flash/nor/imp.h>: - flash_bank_add() - encapsulates adding banks to bank list - flash_bank_list() - encapsulates retreiving bank list This allows the externs in flash/nor/imp.h to be removed, and these mechanisms may now be re-used by other flash module code.