• Carl-Daniel Hailfinger's avatar
    SPI bitbanging: request/release bus · 2822888c
    Carl-Daniel Hailfinger authored
    
    
    SPI bitbanging on devices which speak SPI natively has a dual-use
    problem: We need to shut down normal SPI operations to do the bitbanging
    ourselves. Once we're done, it makes a lot of sense to reenable "normal"
    SPI operations again. Add request_bus/release_bus functions to struct
    bitbang_spi_master.
    Add a bitbang shutdown function (not used yet).
    Change MCP SPI and Intel NIC SPI to use the new request/release bus
    infrastructure.
    Cosmetic changes to a few error messages (80 column limit).
    
    There are multiple possible strategies for bus request/release:
    - Request at the start of a SPI command, release immediately afterwards.
    - Request at the start of a SPI multicommand, release once all commands
    of the multicommand are done.
    - Request on programmer init, release on shutdown.
    Each strategy has its own advantages. For now, we will stay with the
    first strategy which worked fine so far.
    
    Corresponding to flashrom svn r1171.
    Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
    Acked-by: default avatarUwe Hermann <uwe@hermann-uwe.de>
    2822888c
mcp6x_spi.c 4.98 KB