Mercurial > flash_v2
changeset 1765:bfd6d67dba43
V2 flash. Miscellaneous fixes to the legacy API and legacy device
driver support
| author | bartv |
|---|---|
| date | Tue, 22 Feb 2005 23:21:12 +0000 |
| parents | 96ec7e534d98 |
| children | 5783e8dbedf5 |
| files | packages/io/flash/current/ChangeLog packages/io/flash/current/src/legacy_api.c packages/io/flash/current/src/legacy_dev.c |
| diffstat | 3 files changed, 22 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/io/flash/current/ChangeLog +++ b/packages/io/flash/current/ChangeLog @@ -1,3 +1,15 @@ +2005-01-28 Nick Garnett <nickg@ecoscentric.com> + + * src/legacy_dev.c (legacy_flash_init): Assign flash_info.pf from + flash device field. Otherwise drivers try to call an invalid + address. + (legacy_flash_program): The last argument to flash_program_buf() + is not the block size but the programming buffer size. + +2005-01-19 Jonathan Larmour <jifl@eCosCentric.com> + + * src/legacy_api.c (flash_errmsg): Was missing. Add. + 2004-12-02 Bart Veer <bartv@ecoscentric.com> * include/flash_dev.h: now provides everything needed by flash
--- a/packages/io/flash/current/src/legacy_api.c +++ b/packages/io/flash/current/src/legacy_api.c @@ -135,3 +135,10 @@ int flash_read(void *flash_base, void *r return cyg_flash_read((cyg_flashaddr_t)flash_base, ram_base, len, (cyg_flashaddr_t *)err_address); } + +char *flash_errmsg(int err) +{ + return (char *)cyg_flash_errmsg(err); +} + +// EOF legacy_api.c
--- a/packages/io/flash/current/src/legacy_dev.c +++ b/packages/io/flash/current/src/legacy_dev.c @@ -89,6 +89,8 @@ legacy_flash_init (struct cyg_flash_dev int err; static cyg_flash_block_info_t block_info[1]; + flash_info.pf = dev->pf; + err=flash_hwr_init(); if (!err) { @@ -139,13 +141,12 @@ legacy_flash_program(struct cyg_flash_de { typedef int code_fun(cyg_flashaddr_t, const void *, int, unsigned long, int); code_fun *_flash_program_buf; - size_t block_size = dev->block_info[0].block_size; size_t block_mask = ~(block_mask -1); int stat; _flash_program_buf = (code_fun*) cyg_flash_anonymizer(&flash_program_buf); - stat = (*_flash_program_buf)(base, data, len, block_mask ,block_size); + stat = (*_flash_program_buf)(base, data, len, block_mask, flash_info.buffer_size); return flash_hwr_map_error(stat); }
