Changeset 1475 for trunk/flash.h


Ignore:
Timestamp:
Dec 20, 2011 1:19:29 AM (17 months ago)
Author:
hailfinger
Message:

Have all programmer init functions register bus masters/programmers

All programmer types (Parallel, SPI, Opaque) now register themselves
into a generic programmer list and probing is now programmer-centric
instead of chip-centric.
Registering multiple SPI/... masters at the same time is now possible
without any problems. Handling multiple flash chips is still unchanged,
but now we have the infrastructure to deal with "dual BIOS" and "one
flash behind southbridge and one flash behind EC" sanely.

A nice side effect is that this patch kills quite a few global variables
and improves the situation for libflashrom.

Hint for developers:
struct {spi,par,opaque}_programmer now have a void *data pointer to
store any additional programmer-specific data, e.g. hardware
configuration info.

Note:
flashrom -f -c FOO -r forced_read.bin
does not work anymore. We have to find an architecturally clean way to
solve this.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@…>
Acked-by: Michael Karcher <flashrom@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/flash.h

    r1474 r1475  
    172172        /* Some flash devices have an additional register space. */ 
    173173        chipaddr virtual_registers; 
     174        struct registered_programmer *pgm; 
    174175}; 
    175176 
     
    225226        write_gran_256bytes, 
    226227}; 
    227 extern enum chipbustype buses_supported; 
    228228extern int verbose; 
    229229extern const char flashrom_version[]; 
     
    232232int read_memmapped(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); 
    233233int erase_flash(struct flashctx *flash); 
    234 int probe_flash(int startchip, struct flashctx *fill_flash, int force); 
     234int probe_flash(struct registered_programmer *pgm, int startchip, struct flashctx *fill_flash, int force); 
    235235int read_flash_to_file(struct flashctx *flash, const char *filename); 
    236236int min(int a, int b); 
     
    257257/* Something happened that shouldn't happen, we'll abort. */ 
    258258#define ERROR_FATAL -0xee 
     259#define ERROR_FLASHROM_BUG -200 
     260/* We reached one of the hardcoded limits of flashrom. This can be fixed by 
     261 * increasing the limit of a compile-time allocation or by switching to dynamic 
     262 * allocation. 
     263 * Note: If this warning is triggered, check first for runaway registrations. 
     264 */ 
     265#define ERROR_FLASHROM_LIMIT -201 
    259266 
    260267/* cli_output.c */ 
     
    298305uint32_t spi_get_valid_read_addr(struct flashctx *flash); 
    299306 
     307enum chipbustype get_buses_supported(void); 
    300308#endif                          /* !__FLASH_H__ */ 
Note: See TracChangeset for help on using the changeset viewer.