diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2011-11-04 21:35:26 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2011-11-04 21:35:26 +0000 |
commit | 532c717bccc95aa93bae7af8be0695bee83c32b5 (patch) | |
tree | 406d46e209a8a56f176c7afa20f14754800e77d9 /programmer.h | |
parent | b992d3433974479909e6fd584dd798d4badf27b9 (diff) | |
download | ast2050-flashrom-532c717bccc95aa93bae7af8be0695bee83c32b5.zip ast2050-flashrom-532c717bccc95aa93bae7af8be0695bee83c32b5.tar.gz |
Add opaque programmer registration infrastructure
An opaque programmer does not allow direct flash access and only offers
abstract probe/read/erase/write methods.
Due to that, opaque programmers need their own infrastructure and
registration framework.
Corresponding to flashrom svn r1459.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Diffstat (limited to 'programmer.h')
-rw-r--r-- | programmer.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/programmer.h b/programmer.h index 3d35a46..16947f1 100644 --- a/programmer.h +++ b/programmer.h @@ -24,6 +24,8 @@ #ifndef __PROGRAMMER_H__ #define __PROGRAMMER_H__ 1 +#include "flash.h" /* for chipaddr and flashchip */ + enum programmer { #if CONFIG_INTERNAL == 1 PROGRAMMER_INTERNAL, @@ -601,6 +603,19 @@ int sb600_probe_spi(struct pci_dev *dev); int wbsio_check_for_spi(void); #endif +/* opaque.c */ +struct opaque_programmer { + int max_data_read; + int max_data_write; + /* Specific functions for this programmer */ + int (*probe) (struct flashchip *flash); + int (*read) (struct flashchip *flash, uint8_t *buf, int start, int len); + int (*write) (struct flashchip *flash, uint8_t *buf, int start, int len); + int (*erase) (struct flashchip *flash, unsigned int blockaddr, unsigned int blocklen); +}; +extern const struct opaque_programmer *opaque_programmer; +void register_opaque_programmer(const struct opaque_programmer *pgm); + /* serprog.c */ #if CONFIG_SERPROG == 1 int serprog_init(void); |