diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2007-11-27 21:14:26 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2007-11-27 21:14:26 +0000 |
commit | 6c81fcc2a11d7939504d32ac07a45cd3d205a0c3 (patch) | |
tree | cc66f61326bc233db1f1a69673ccea72acb78dfc /c/src/lib/libbsp/powerpc/shared/flash/flashPgm.h | |
parent | 2007-11-27 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-6c81fcc2a11d7939504d32ac07a45cd3d205a0c3.tar.bz2 |
2007-11-29 Till Straumann <strauman@slac.stanford.edu>
* shared/flash/flash.c, shared/flash/flashPgm.h:
added calls to obtain info about flash bank start,
size and block size.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/shared/flash/flashPgm.h')
-rw-r--r-- | c/src/lib/libbsp/powerpc/shared/flash/flashPgm.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/flash/flashPgm.h b/c/src/lib/libbsp/powerpc/shared/flash/flashPgm.h index 2d93cd094e..3b49ff172c 100644 --- a/c/src/lib/libbsp/powerpc/shared/flash/flashPgm.h +++ b/c/src/lib/libbsp/powerpc/shared/flash/flashPgm.h @@ -70,12 +70,13 @@ BSP_flashWriteDisable(int bank); * NOTES: - 'offset' and 'size' must be block-aligned. Common 16-bit devices * have a block size of 0x20000 bytes. If two such devices are * operated in parallel to form a 32-bit word then the 'effective' - * block size is 0x40000 bytes. + * block size is 0x40000 bytes. The block size can be queried by + * BSP_flashBlockSize(int bank); * * - erase operation is verified. */ int -BSP_flashErase(uint32_t bank, uint32_t offset, uint32_t size, int quiet); +BSP_flashErase(int bank, uint32_t offset, uint32_t size, int quiet); /* Write data from a buffer to flash. The target area is erased if necessary. * @@ -133,6 +134,30 @@ BSP_flashWriteFile(int bank, uint32_t offset, char *path, int quiet); int BSP_flashDumpInfo(FILE *f); +/* + * Obtain starting-address of flash bank (as seen from CPU) + * (returns ((uint32_t) -1) if the bank argument is invalid). + */ + +uint32_t +BSP_flashStart(int bank); + +/* + * Obtain size of flash bank (returns ((uint32_t) -1) if the + * bank argument is invalid). + */ +uint32_t +BSP_flashSize(int bank); + +/* + * Obtain block size of flash bank (sector size times + * number of devices in parallel; the block size determines + * alignment and granularity accepted by BSP_flashErase() + * (returns ((uint32_t) -1) if the bank argument is invalid). + */ +uint32_t +BSP_flashBlockSize(int bank); + #ifdef __cplusplus } #endif |