1. 14 Jul, 2010 1 commit
  2. 03 Jul, 2010 1 commit
  3. 28 May, 2010 1 commit
  4. 26 May, 2010 1 commit
    • Carl-Daniel Hailfinger's avatar
      Handle the following architectures in generic flashrom code · cceafa2a
      Carl-Daniel Hailfinger authored
      
      - x86/x86_64 (little endian)
      - PowerPC (big endian)
      - MIPS (big+little endian)
      
      No changes to programmer specific code. This means any drivers with MMIO
      access will _not_ suddenly start working on big endian systems, but with
      this patch everything is in place to fix them.
      
      Compilation should work on all architectures listed above for all
      drivers except nic3com and nicrealtek which require PCI Port IO which is
      x86-only for now.
      
      To compile without nic3com and nicrealtek, run
      make distclean
      make CONFIG_NIC3COM=no CONFIG_NICREALTEK=no
      
      Thanks to Misha Manulis for testing early versions of this patch on
      PowerPC (big endian) with the satasii programmer.
      Thanks to Segher Boessenkool for design review and for helping out with
      compiler tricks and pointing out that we need eieio on PowerPC.
      Thanks to Vladimir Serbinenko for compile testing on MIPS (little
      endian) and PowerPC (big endian) and for runtime testing on MIPS (little
      endian).
      Thanks to David Daney for compile testing on MIPS (big endian).
      Thanks to Uwe Hermann for compile and runtime testing on x86_64.
      
      DO NOT RUN flashrom ON NON-X86 AFTER APPLYING THIS PATCH!
      This patch only provides the infrastructure, but does not convert any
      drivers, so flashrom will compile, but it won't do the right thing on
      non-x86 platforms.
      
      Corresponding to flashrom svn r1013.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      Acked-by: default avatarMisha Manulis <misha@manulis.com>
      Acked-by: default avatarVladimir 'phcoder/φ-coder' Serbinenko <phcoder@gmail.com>
      Acked-by: default avatarUwe Hermann <uwe@hermann-uwe.de>
      Acked-by: default avatarSegher Boessenkool <segher@kernel.crashing.org>
      cceafa2a
  5. 21 May, 2010 1 commit
  6. 07 May, 2010 1 commit
  7. 25 Mar, 2010 1 commit
  8. 26 Feb, 2010 1 commit
  9. 11 Feb, 2010 1 commit
    • Carl-Daniel Hailfinger's avatar
      Rewrite substantial parts of the ICH SPI support · f15e1abb
      Carl-Daniel Hailfinger authored
      
      This megapatch rewrites substantial parts of ICH SPI to actually do
      what the SPI layer wants instead of its own weird idea about commands
      (running unrequested commands, running modified commands). Besides that,
      there is a fair share of cleanups as well.
      
      - Add JEDEC_EWSR (Enable Write Status Register) to default commands. -
      Mark a no longer used opcode/preopcode table as unused. - Declare all
      commands as non-atomic/standalone by default. The ICH SPI driver has
      no business executing commands (preopcodes) automatically if they were
      not requested. - Automatically adjust preopcode/opcode pairings (like
      WREN+ERASE) based on what the SPI layer requested. The ICH SPI driver
      has no business executing altered opcode pairs as it sees fit. - Fix
      incomplete initialization in the case of a locked down chipset. Leaving
      the first 4 opcodes with uninitialized pairings had unpredictable
      results. - switch() exists for a reason. Nested if() checking on the
      same variable is an interesting style. - Actually check if the requested
      readcnt/writecnt for a command is supported by the hardware instead
      of delivering corrupt/incomplete commands and data. - If a command
      has unsupported readlen/writelen, complain loudly to the user. - Use
      find_opcode instead of open-coding the same stuff in a dozen variations.
      - Introduce infrastructure for updating the command set of unlocked
      chipsets on the fly.
      
      Corresponding to flashrom svn r894.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      Acked-by: default avatarDavid Hendricks <dhendrix@google.com>
      f15e1abb
  10. 07 Jan, 2010 1 commit
    • Carl-Daniel Hailfinger's avatar
      Allow one to disable programmer debug messages at compile time · 5609fa75
      Carl-Daniel Hailfinger authored
      
      Programmer debug messages during programmer init/shutdown are useful
      because they print hardware settings and desired configuration.
      
      They help in getting a quick overview of hardware and software state on
      startup and shutdown.
      
      Programmer debug messages during flash chip access are mostly a
      distraction in logs and should only be enabled if someone is having
      problems which are suspected to stem from a programmer hardware or
      programmer software bug. Disable those messages by default, they can be
      reenabled by #define COMM_DEBUG in the affected programmer file.
      
      An added benefit is a tremendous size reduction in verbose
      probe/read/write/erase logs because only flash chip driver messages
      remain. In some cases, logs will shrink from 65 MB to 10 kB or less.
      
      The right(tm) fix would be two different debug levels (DEBUG and SPEW)
      and the ability to differentiate between programmer debug messages and
      flash chip debug messages. Until the design for the message printing
      infrastructure is finished, this is the best stop-gap measure we can
      get.
      
      Corresponding to flashrom svn r834.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      Acked-by: default avatarSean Nelson <audioahcked@gmail.com>
      5609fa75
  11. 25 Nov, 2009 1 commit
  12. 22 Oct, 2009 1 commit
    • Carl-Daniel Hailfinger's avatar
      ichspi: remove obnoxious debug message · 0709a782
      Carl-Daniel Hailfinger authored
      
      Since we don't have any debug level printing infrastructure yet, I
      propose to kill the obnoxious debug message in ichspi.c which was added
      to check for correct PREOP handling.
      
      We know the code works fine (after getting a few reports over 100 MB
      long) and there's no point in keeping it around anymore. If there is any
      desire, we can reinstate it as print_spew or whatever once the debug
      level infrastructure is merged, but at that point we probably just are
      happy that the debug output isn't there anymore.
      
      Corresponding to flashrom svn r753.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      Acked-by: default avatarLuc Verhaegen <libv@skynet.be>
      0709a782
  13. 18 Sep, 2009 1 commit
  14. 02 Sep, 2009 1 commit
  15. 09 Aug, 2009 1 commit
  16. 22 Jul, 2009 1 commit
  17. 14 Jul, 2009 1 commit
  18. 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
  19. 24 Jun, 2009 1 commit
  20. 17 Jun, 2009 1 commit
  21. 16 Jun, 2009 1 commit
  22. 13 Jun, 2009 1 commit
  23. 05 Jun, 2009 1 commit
  24. 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
  25. 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
  26. 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
  27. 16 May, 2009 2 commits
  28. 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
  29. 09 May, 2009 2 commits
  30. 15 Apr, 2009 1 commit
  31. 26 Jan, 2009 1 commit
  32. 15 Jan, 2009 1 commit
  33. 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
  34. 08 Dec, 2008 1 commit
  35. 18 Nov, 2008 1 commit
  36. 03 Nov, 2008 1 commit
  37. 02 Nov, 2008 1 commit
  38. 18 Oct, 2008 1 commit