1. 15 4月, 2014 3 次提交
    • H
      mtd: spi-nor: add the framework for SPI NOR · b199489d
      Huang Shijie 提交于
      This patch cloned most of the m25p80.c. In theory, it adds a new spi-nor layer.
      
      Before this patch, the layer is like:
      
                         MTD
               ------------------------
                        m25p80
               ------------------------
      	       spi bus driver
               ------------------------
      	        SPI NOR chip
      
      After this patch, the layer is like:
                         MTD
               ------------------------
                        spi-nor
               ------------------------
                        m25p80
               ------------------------
      	       spi bus driver
               ------------------------
      	       SPI NOR chip
      
      With the spi-nor controller driver(Freescale Quadspi), it looks like:
                         MTD
               ------------------------
                        spi-nor
               ------------------------
                      fsl-quadspi
               ------------------------
      	       SPI NOR chip
      
      New APIs:
         spi_nor_scan: used to scan a spi-nor flash.
      Signed-off-by: NHuang Shijie <b32955@freescale.com>
      Acked-by: NMarek Vasut <marex@denx.de>
      [Brian: rebased to include additional m25p_ids[] entry]
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      b199489d
    • H
      mtd: spi-nor: add the basic data structures · 6e602ef7
      Huang Shijie 提交于
      The spi_nor{} is cloned from the m25p{}.
      The spi_nor{} can be used by both the m25p80 and spi-nor controller.
      
      We also add the spi_nor_xfer_cfg{} which can be used by the two
      fundamental primitives: read_xfer/write_xfer.
      
       1) the hooks for spi_nor{}:
          @prepare/unpreare: used to do some work before or after the
                   read/write/erase/lock/unlock.
          @read_xfer/write_xfer: We can use these two hooks to code all
                   the following hooks if the driver tries to implement them
                   by itself.
          @read_reg: used to read the registers, such as read status register,
                   read configure register.
          @write_reg: used to write the registers, such as write enable,
                   erase sector.
          @read_id: read out the ID info.
          @wait_till_ready: wait till the NOR becomes ready.
          @read: read out the data from the NOR.
          @write: write data to the NOR.
          @erase: erase a sector of the NOR.
      
       2) Add a new field sst_write_second for the SST NOR write.
      Signed-off-by: NHuang Shijie <b32955@freescale.com>
      Acked-by: NMarek Vasut <marex@denx.de>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      6e602ef7
    • H
      mtd: spi-nor: copy the SPI NOR commands to a new header file · f39d2fa0
      Huang Shijie 提交于
      This patch adds a new header :spi-nor.h,
      and copies all the SPI NOR commands and relative macros into this new header.
      
      This hearder can be used by the m25p80.c and other spi-nor controller,
      such as Freescale's Quadspi.
      Signed-off-by: NHuang Shijie <b32955@freescale.com>
      Acked-by: NMarek Vasut <marex@denx.de>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      f39d2fa0