Skip to content
Snippets Groups Projects
  1. May 01, 2020
  2. Apr 25, 2020
  3. Apr 22, 2020
    • sibradzic's avatar
      flashchips: port S25FS(128S) chip from chromiumos · a3519561
      sibradzic authored
      This may seem too big just to support yet another flash chip, but in
      reality it brings support for whole new family of S25FS
      Spansion/Cypress flash chips. These chips require handling of some
      special status registers for erasing or writing, with very specific
      timing checks in place.
      
      For example, WIP status bit will remain being set to 1 if erase or
      programming errors occur, and in that case chip 'software reset' has
      to be performed otherwise the chip will remain unresponsive to all
      further commands. Also, special CR3NV register (Configuration Register
      3 Nonvolatile) status bits needs to be read and set by using RDAR
      (ReaD Any Register) and WRAR (WRite Any Register) OP commands, and
      these states are needed to determine which type of reset feature is
      enabled at the time (legacy or S25FS type) in the first place,
      determine whether Uniform or Hybrid sector architecture is used
      at the time, or set programming buffer address wrap point (256 or 512
      bytes). Furthermore, S25FS chip status register has to be restored to
      its original state (hence that ugly CHIP_RESTORE_CALLBACK) following
      erasing or writing, failing to do so may result in host being unable
      to access data on the chip at all.
      
      Finally, although this brings support for the whole family of chips,
      I only have one such chip to do the actual testing, S25FS128S (Small
      Sectors), which I had fully tested on ch341a and FT4232H programmers,
      with confirmed working probe, read, erase and write.
      
      Full summary of changes are here:
      
      flashchips:
        add new flashchip sctructure property:
          .reset
        add chip definitions:
          S25FS128S Large Sectors
          S25FS128S Small Sectors
      
      flash:
        add macro (chip_restore_func_data call-back):
          CHIP_RESTORE_CALLBACK
      
      flashrom:
        add struct:
          chip_restore_func_data
        add call-back function:
          register_chip_restore
      
      spi:
        add OP codes:
          CMD_RDAR, CMD_WRAR, CMD_WRAR_LEN, CMD_RSTEN, CMD_RST
        add register bit function definitions:
          CR3NV_ADDR, CR3NV_20H_NV
        add timers:
          T_W, T_RPH, T_SE
      
      spi25:
        refactor (based on chromiumos implementation) function:
          spi_poll_wip
        port these functions from chromiumos:
          probe_spi_big_spansion
          s25fs_software_reset
          s25f_legacy_software_reset
          s25fs_block_erase_d8
      
      spi25_statusreg:
        port these functions from chromiumos:
          spi_restore_status
          s25fs_read_cr
          s25fs_write_cr
          s25fs_restore_cr3nv
      
      Most of the ported functions are originally from s25f.c found at
      https://chromium.googlesource.com/chromiumos/third_party/flashrom
      
      
      with exception of spi_restore_status which is defined in
      spi25_statusreg.c. The rest of macros and OP codes are defined in
      same files as in this commit.
      
      Change-Id: If659290874a4b9db6e71256bdef382d31b288e72
      Signed-off-by: default avatarSamir Ibradzic <sibradzic@gmail.com>
      Reviewed-on: https://review.coreboot.org/c/flashrom/+/39822
      
      
      Tested-by: default avatarbuild bot (Jenkins) <no-reply@coreboot.org>
      Reviewed-by: default avatarEdward O'Callaghan <quasisec@chromium.org>
      a3519561
  4. Jul 19, 2019
  5. Jun 27, 2019
  6. Jun 23, 2019
  7. Jun 21, 2019
  8. Jun 04, 2019
  9. Feb 03, 2019
  10. Oct 03, 2018
  11. Apr 24, 2018
  12. Jan 02, 2018
  13. Dec 28, 2017
  14. Oct 15, 2017
    • Boris Baykov's avatar
      4BA: Flashrom integration for the 4-bytes addressing extensions · 9912718d
      Boris Baykov authored
      This patch integrates code of the previous patch into Flashrom's code.
      All the integrations is around 3 functions spi_nbyte_read, spi_nbyte_program
      and spi_byte_program. After this patch then are not static and can be called
      by their pointers saved in flashchips array. Also I added to flashrom.c some
      code to switch a chip to 4-bytes addressing mode. And one error message is
      corrected in spi.c because it's not suitable for 32-bit addresses.
      
      Patched files
      -------------
      flash.h
      + added set of 4-bytes address functions to flashchip structure definition
      
      flashrom.c
      + added switch to 4-bytes addressing more for chips which support it
      
      serprog.c
      + added 4-bytes addressing spi_nbyte_read call to serprog_spi_read
      
      spi.c
      + fixed flash chip size check in spi_chip_read
      
      spi25.c
      + added 4-bytes addressing spi_nbyte_read call to spi_read_chunked
      + added 4-bytes addressing spi_nbyte_program call to spi_write_chunked
      + added 4-bytes addressing spi_byte_program call to spi_chip_write_1
      
      Conflicts:
      	serprog.c
      
      Change-Id: Ib051cfc93bd4aa7580519e0e6206d025f3ca8049
      Signed-off-by: Boris Baykov <dev@borisbaykov.com>, Russia, Jan 2014
      [clg: ported from
            https://www.flashrom.org/pipermail/flashrom/2015-January/013205.html
      
       ]
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Reviewed-on: https://review.coreboot.org/20505
      
      
      Reviewed-by: default avatarNico Huber <nico.h@gmx.de>
      Tested-by: default avatarbuild bot (Jenkins) <no-reply@coreboot.org>
      9912718d
  15. Jul 13, 2017
  16. Jun 22, 2015
  17. Jul 19, 2014
  18. May 09, 2014
  19. Apr 26, 2014
  20. Jun 28, 2013
  21. May 01, 2013
  22. Apr 19, 2013
  23. Dec 29, 2012
    • Stefan Tauner's avatar
      Add support for Atmel's AT25F series of SPI flash chips · 57794ac1
      Stefan Tauner authored
      
      This adds support for the following chips:
       - AT25F512, AT25F512A, AT25F512B
       - AT25F1024, AT25F1024A
       - AT25F2048
       - AT25F4096
      
      Besides the definitions of the the chips in flashchips.c this includes
      - a dedicated probing method (probe_spi_at25f)
      - pretty printing methods (spi_prettyprint_status_register_at25f*), and
      - unlocking methods (spi_disable_blockprotect_at25f*)
      
      Corresponding to flashrom svn r1637.
      
      Signed-off-by: default avatarStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
      Acked-by: default avatarStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
      57794ac1
    • Stefan Tauner's avatar
      Improve SPI status register pretty printing · 6ee37e28
      Stefan Tauner authored
      
       - Move all functions related to SPI status registers to a new file
         spi25_statusreg.c. This includes the generic as well as the
         SST-specific functions from spi25.c and the chip-specific functions
         from a25.c and at25.c.
       - introduce helper functions
          * spi_prettyprint_status_register_hex()
          * spi_prettyprint_status_register_bpl()
          * spi_prettyprint_status_register_plain()
         Use the latter on every compatible flash chip that has no better printlock
         function set and get rid of the implicit pretty printing in the SPI probing
         functions.
       - remove
          * spi_prettyprint_status_register_common()
          * spi_prettyprint_status_register_amic_a25lq032() because it can be fully
            substituted with spi_prettyprint_status_register_amic_a25l032().
          * spi_prettyprint_status_register() (old switch, no longer needed)
       - promote and export
          * spi_prettyprint_status_register_amic_a25l05p() as spi_prettyprint_status_register_default_bp1().
          * spi_prettyprint_status_register_amic_a25l40p() as spi_prettyprint_status_register_default_bp2().
          * spi_prettyprint_status_register_st_m25p() as spi_prettyprint_status_register_default_bp3().
       - add #define TEST_BAD_REW and use it for a number of Atmel chips which
         had only TEST_BAD_READ set even though they dont have erasers or a write
         function set.
      
      Corresponding to flashrom svn r1634.
      
      Signed-off-by: default avatarStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
      Acked-by: default avatarStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
      6ee37e28
  24. Oct 27, 2012
    • Stefan Tauner's avatar
      Add support for Atmel AT26DF041 · 94b39b47
      Stefan Tauner authored
      
      Wicked chip: No WRSR, no write enable command (but swallows our
      default one without a problem), supports an auto-erasing page write
      (but even without that page writes are recommended to write the
      whole page i.e. operate on a completely erased page), mad
      requirements on block refreshments if only partly written.
      
      Found on my Intel D946GZIS and tested with my serprog in situ.
      Using the page write by setting JEDEC_BYTE_PROGRAM to 0x11 and using
      the spi_chip_write_256 command greatly improves performance and works
      flawlessly.
      
      Corresponding to flashrom svn r1616.
      
      Signed-off-by: default avatarStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
      Acked-by: default avatarStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
      94b39b47
  25. Sep 22, 2012
  26. Sep 21, 2012
  27. Aug 25, 2012
  28. Aug 02, 2012
Loading