1. 14 Apr, 2012 1 commit
  2. 18 Dec, 2011 1 commit
  3. 14 Dec, 2011 1 commit
    • Carl-Daniel Hailfinger's avatar
      Use struct flashctx instead of struct flashchip for flash chip access · 63fd9026
      Carl-Daniel Hailfinger authored
      
      Struct flashchip is used only for the flashchips array and for
      operations which do not access hardware, e.g. printing a list of
      supported flash chips.
      
      struct flashctx (flash context) contains all data available in
      struct flashchip, but it also contains runtime information like
      mapping addresses. struct flashctx is expected to grow additional
      members over time, a prime candidate being programmer info.
      struct flashctx contains all of struct flashchip with identical
      member layout, but struct flashctx has additional members at the end.
      
      The separation between struct flashchip/flashctx shrinks the memory
      requirement of the big flashchips array and allows future extension
      of flashctx without having to worry about bloat.
      
      Corresponding to flashrom svn r1473.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      Acked-by: default avatarMichael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
      63fd9026
  4. 23 Nov, 2011 1 commit
  5. 18 Sep, 2011 2 commits
  6. 26 Jun, 2011 1 commit
  7. 13 Oct, 2010 2 commits
  8. 10 Oct, 2010 2 commits
    • Carl-Daniel Hailfinger's avatar
      Simplify calls to inner write functions · 184b95f4
      Carl-Daniel Hailfinger authored
      
      No behavioural changes, just equivalence transformations.
      
      Corresponding to flashrom svn r1209.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      Acked-by: default avatarUwe Hermann <uwe@hermann-uwe.de>
      184b95f4
    • Carl-Daniel Hailfinger's avatar
      Unify chip write functions · b30a5ed4
      Carl-Daniel Hailfinger authored
      
      The currently used write functions (wrappers) all use helpers which
      perform the actual write (inner functions).
      
      The signature of the write wrappers is: int write_chip(struct flashchip
      *flash, uint8_t * buf);
      
      The signature of the inner write functions varied a lot. This patch
      changes them to: int write_part(struct flashchip *flash, uint8_t *src,
      int start, int len);
      
      Did you know that flashrom has only 8 inner write functions for all
      flash chips? write_page_write_jedec_common write_sector_jedec_common
      write_sector_28sf040 spi_chip_write_256_new spi_chip_write_1_new
      spi_aai_write_new write_page_82802ab write_page_m29f400bt
      
      Export all inner write functions.
      
      Change the function signature of wait_82802ab to eliminate single-use
      variables.
      
      Remove an error message in write_page_m29f400bt which was printed for
      every byte written regardless of success.
      
      Add sharplhf00l04.c to the list of flash chip drivers in the Makefile.
      While the functions in there are unused, I suspect we will need them
      later, and by hooking the file up we ensure that compilation won't
      break.
      
      Corresponding to flashrom svn r1208.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      Acked-by: default avatarUwe Hermann <uwe@hermann-uwe.de>
      b30a5ed4
  9. 08 Oct, 2010 2 commits
  10. 16 Jul, 2010 1 commit
  11. 24 Mar, 2010 1 commit
  12. 26 Feb, 2010 1 commit
  13. 23 Dec, 2009 1 commit
  14. 27 Nov, 2009 1 commit
    • Michael Karcher's avatar
      Use common jedec functionality where appropriate · 1c296ca8
      Michael Karcher authored
      The deleted function in en29f002a.c is reintroduced as
      write_by_byte_jedec in jedec.c as it contains no chip-specific
      instructions. It is not yet used in other chip drivers, as key addresses
      (0x2AAA/0x5555) are often specified with less bits. After crosschecking
      datasheets, most of the fixmes can probably be resolved as indicated in
      them, causing significant code reduction.
      
      The common JEDEC code for bytewise programming does not program 0xFF
      at all. The chips that had a dedicated bytewise flash function which
      has been changed to write_jedec_1 thus changed flashing behaviour
      and the "write" test flag has been removed. This applies to: AMD
      Am29F002BB/Am29F002NBB AMD Am29F002BT/Am29F002NBT (TEST_OK_PREW before)
      AMIC A29002B AMIC A29002T (TEST_OK_PREW before) EON EN29F002(A)(N)B EON
      EN29F002(A)(N)T (TEST_OK_PREW before) Macronix MX29F001B (TEST_OK_PREW
      before) Macronix MX29F001T (TEST_OK_PREW before) Macronix MX29F002B
      Macronix MX29F002T (TEST_OK_PREW before) ...
      1c296ca8
  15. 26 Nov, 2009 1 commit
    • Michael Karcher's avatar
      Refine support for the JEDEC Software Data Protection · 972cec28
      Michael Karcher authored
      This patch removes the extremely dangerous unprotect_jedec function
      which is not used at all within flashrom code, and renames the
      misleadingly named protect_jedec function to start_program_jedec.
      
      Calls to protect_jedec after flashing are removed, because a) on LPC
      chips, the command sent by protoct_jedec is not even in the datasheet
      and b) on parallel chips, the block write command issued before already
      contained the software protection sequence, so software protection is
      definitely enabled.
      
      This patch also removes two clones of protect_jedec
      
      Background: JEDEC Software Data Protection started as an optional
      feature, which was disabled on the first single-voltage-flash chips.
      The software data protection is the need to prefix a write with a magic
      "write enable" command, while without write protection every write
      access into the chip's address space modifies flash content. This magic
      write enable command also tells the flash chip that the programmer
      ...
      972cec28
  16. 02 Sep, 2009 1 commit
  17. 15 Jun, 2009 1 commit
  18. 05 Jun, 2009 1 commit
  19. 16 May, 2009 1 commit
  20. 06 Mar, 2009 1 commit
  21. 05 Mar, 2009 1 commit
    • Carl-Daniel Hailfinger's avatar
      Use helper functions to access flash chips · 61a8bd27
      Carl-Daniel Hailfinger authored
      
      Right now we perform direct pointer manipulation without any abstraction
      to read from and write to memory mapped flash chips. That makes it
      impossible to drive any flasher which does not mmap the whole chip.
      
      Using helper functions readb() and writeb() allows a driver for external
      flash programmers like Paraflasher to replace readb and writeb with
      calls to its own chip access routines.
      
      This patch has the additional advantage of removing lots of unnecessary
      casts to volatile uint8_t * and now-superfluous parentheses which caused
      poor readability.
      
      I used the semantic patcher Coccinelle to create this patch. The
      semantic patch follows:
      @@
      expression a;
      typedef uint8_t;
      volatile uint8_t *b;
      @@
      - *(b) = (a);
      + writeb(a, b);
      @@
      volatile uint8_t *b;
      @@
      - *(b)
      + readb(b)
      @@
      type T;
      T b;
      @@
      (
       readb
      |
       writeb
      )
       (...,
      - (T)
      - (b)
      + b
       )
      
      In contrast to a sed script, the semantic patch performs type checking
      before converting anything.
      
      Tested-by: Joe Julian
      
      Corresponding to flashrom svn r418 and coreboot v2 svn r3971.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      Acked-by: default avatarFENG Yu Ning <fengyuning1984@gmail.com>
      61a8bd27
  22. 25 Jan, 2009 1 commit
  23. 18 Jan, 2008 1 commit
  24. 31 Dec, 2007 1 commit
  25. 17 Oct, 2007 1 commit
  26. 09 Sep, 2007 1 commit
  27. 29 Aug, 2007 1 commit
  28. 23 Aug, 2007 4 commits
  29. 23 May, 2007 1 commit
  30. 09 May, 2007 1 commit
  31. 23 Aug, 2006 1 commit
  32. 26 Nov, 2005 1 commit
  33. 20 Mar, 2004 1 commit