1. 10 Jul, 2009 1 commit
    • 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
  2. 24 Jun, 2009 1 commit
  3. 17 Jun, 2009 1 commit
  4. 16 Jun, 2009 1 commit
  5. 13 Jun, 2009 1 commit
  6. 05 Jun, 2009 1 commit
  7. 31 May, 2009 1 commit
    • Carl-Daniel Hailfinger's avatar
      Add bus type annotation to struct flashchips · 1dfe0ff1
      Carl-Daniel Hailfinger authored
      
      Right now, the annotation only differentiates between SPI and non-SPI.
      Anyone who knows more about a specific flash chip should feel free to
      update it.
      
      The existing flashbus variable was abused to denote the SPI controller
      type. Use an aptly named variable for that purpose.
      
      Once this patch is merged, the chipset/programmer init functions can set
      supported flash chip types and flashrom can automatically select only
      matching probe/read/erase/write functions. A side benefit of that will
      be the elimination of the Winbond W29EE011 vs. AMIC A49LF040A conflict.
      
      Corresponding to flashrom svn r556.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      Acked-by: default avatarUwe Hermann <uwe@hermann-uwe.de>
      1dfe0ff1
  8. 26 May, 2009 1 commit
    • Carl-Daniel Hailfinger's avatar
      Use REMS instead of RES in the ICH SPI default opcode table · 15aa7c65
      Carl-Daniel Hailfinger authored
      
      RES is Read Electronic Signature (1 Byte, identical for different chips)
      REMS is Read Electronic Manufacturer Signature (2 Bytes, mostly unique)
      RDID is Read JEDEC ID (3 bytes, unique)
      
      Of the chips which don't support RDID, a sizable portion supports REMS
      which gives us both a manufacturer ID and a device ID. This is clearly
      superior to having only a device ID (the RES case) which has multiple
      documented collisions.
      
      The RES/REMS problem is aggravated by inconsistent naming in vendor data
      sheets. What's in a name? Considering that we have 1-byte IDs, 2-byte
      IDs and 3+byte IDs with varying names but mostly consistent opcodes, it
      makes sense to set our own standard about how the opcodes are called.
      
      The best way forward would be to have the ICH SPI driver reprogram the
      opcode menu on the fly if the opcode menu doesn't contain the requested
      opcode and the opcode menu is not locked. Until that happens, this patch
      improves detection accuracy by a factor of 256 for some chips.
      
      Corresponding to flashrom svn r549.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      
      Tested-by: Uwe Hermann
      with the flash chip "SST SST25VF040.REMS".
      Acked-by: default avatarRonald G. Minnich <rminnich@gmail.com>
      15aa7c65
  9. 17 May, 2009 1 commit
    • Carl-Daniel Hailfinger's avatar
      Use accessor functions for MMIO · 78185dcb
      Carl-Daniel Hailfinger authored
      
      Some MMIO accesses used volatile, others didn't (and risked
      non-execution of side effects) and even with volatile, some accesses
      looked dubious.
      
      Since the MMIO accessor functions and the onboard flash accessor
      functions are functionally identical (but have different signatures),
      make the flash accessors wrappers for the MMIO accessors.
      
      For some of the conversions, I used Coccinelle. Semantic patch follows:
      
      @@ typedef uint8_t; expression a; volatile uint8_t *b; @@ - b[a] + *(b
      + a) @@ expression a; volatile uint8_t *b; @@ - *(b) |= (a); + *(b) =
      *(b) | (a); @@ expression a; volatile uint8_t *b; @@ - *(b) = (a); +
      mmio_writeb(a, b); @@ volatile uint8_t *b; @@ - *(b) + mmio_readb(b) @@
      type T; T b; @@ ( mmio_readb | mmio_writeb ) (..., - (T) - (b) + b )
      
      Corresponding to flashrom svn r524.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      
      Uwe tested read, write, erase with this patch on a random board to make
      sure nothing breaks.
      Acked-by: default avatarUwe Hermann <uwe@hermann-uwe.de>
      78185dcb
  10. 16 May, 2009 2 commits
  11. 13 May, 2009 1 commit
    • Carl-Daniel Hailfinger's avatar
      There are various reasons why a SPI command can fail · 3e9dbea1
      Carl-Daniel Hailfinger authored
      
      Among others, I have seen the following problems: - The SPI opcode is
      not supported by the controller. ICH-style controllers exhibit this if
      SPI config is locked down. - The address in in a prohibited area. This
      can happen on ICH for any access (BBAR) and for writes in chipset write
      protected areas. - There is no SPI controller.
      
      Introduce separate error codes for unsupported opcode and prohibited
      address.
      
      Add the ability to adjust REMS and RES addresses to the minium supported
      read address with the help of spi_get_valid_read_addr(). That function
      needs to call SPI controller specific functions like reading BBAR on
      ICH.
      
      Corresponding to flashrom svn r500.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      Acked-by: default avatarUwe Hermann <uwe@hermann-uwe.de>
      3e9dbea1
  12. 09 May, 2009 2 commits
  13. 15 Apr, 2009 1 commit
  14. 26 Jan, 2009 1 commit
  15. 15 Jan, 2009 1 commit
  16. 15 Dec, 2008 1 commit
    • FENG yu ning's avatar
      Various ichspi.c refinements · f041e9b5
      FENG yu ning authored
      
      * add a generic preop-opcode-pair table.
      
      * rename ich_check_opcodes to ich_init_opcodes.
      
      * let ich_init_opcodes do not need to access flashchip structure:
        . move the definition of struct preop_opcode_pair to a better place
        . remove preop_opcode_pairs from 'struct flashchip'
        . modify ich_init_opcodes and generate_opcodes so that they do not access the flashchip structure
      
      * call ich_init_opcodes during chipset enable. Now OPCODES generation mechanism works.
      
      * fix a coding style mistake.
      
      Corresponding to flashrom svn r367 and coreboot v2 svn r3814.
      Signed-off-by: default avatarFENG yu ning <fengyuning1984@gmail.com>
      Acked-by: default avatarPeter Stuge <peter@stuge.se>
      f041e9b5
  17. 08 Dec, 2008 1 commit
  18. 18 Nov, 2008 1 commit
  19. 03 Nov, 2008 1 commit
  20. 02 Nov, 2008 1 commit
  21. 18 Oct, 2008 1 commit
  22. 07 Jul, 2008 1 commit
  23. 30 Jun, 2008 2 commits
  24. 29 Jun, 2008 2 commits
  25. 27 Jun, 2008 2 commits
  26. 16 May, 2008 1 commit