• Carl-Daniel Hailfinger's avatar
    Add SPI multicommand infrastructure · d0478299
    Carl-Daniel Hailfinger authored
    
    Some SPI opcodes need to be sent in direct succession after each other
    without any chip deselect happening in between. A prominent example is
    WREN (Write Enable) directly before PP (Page Program). Intel calls the
    first opcode in such a row "preopcode".
    
    Right now, we ignore the direct succession requirement completely and it
    works pretty well because most onboard SPI masters have a timing or
    heuristics which make the problem disappear.
    The FT2232 SPI flasher is different. Since it is an external flasher,
    timing is very different to what we can expect from onboard flashers and
    this leads to failure at slow speeds.
    
    This patch allows any function to submit multiple SPI commands in a
    stream to any flasher. Support in the individual flashers isn't
    implemented yet, so there is one generic function which passes the each
    command in the stream one-by-one to the command functions of the
    selected SPI flash driver.
    Tested-by: default avatarJakob Bornecrantz <wallbraker@gmail.com>
    
    Corresponding to flashrom svn r645.
    Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
    Acked-by: default avatarJakob Bornecrantz <wallbraker@gmail.com>
    d0478299
ichspi.c 17.9 KB