• Pablo Bitton's avatar
    Add support for SPI in DaVinci DM6446 (and try to keep support for · 96836edc
    Pablo Bitton authored
    DM355/DM365/DM6467 and DA8xx).  Mostly the same as the patch by Sandeep
    Paulraj.
    
    This has been tested on the DM6446 by defining a spidev device and using a
    scope (to check correctness) and a hardware loopback.
    
    This was NOT tested on DM355, DM365 and DM6467 - in fact, it will probably
    not work "as is" because its default mode is CS low-inactive (default mode
    of SPI in kernel) - need to set CS_HIGH mode to work as in the previous
    patch.
    
    Changes from the patch by Sandeep Paulraj:
    
    Bug fixes:
     * Additional word written with chip select up after each transfer.
       Particulary problematic with NO_CS mode where this word can't be
       distiguished from correct words. Problem was in davinci_chip_select.
     * setup() for one chip select may interfere with transfer for another
     * Small nitpicks (bits that can be changed only on VERSION_2)
    
    Features added:
     * Support DM6446
     * Support CS_HIGH mode (using SPIDEF register). Note that CS low is default.
    
    Other:
     * Less accesses to registers used.
     * Once-per-device configuration is done only in probe(), not each transfer.
    
    Uglyness still there:
     * VERSION_X definitions for different SPI controllers - added VERSION_3
       for the dm6446, which is ugly.
    
    NOTE:
    This patch is based on following patches:
    
    SPI: DaVinci: Adding SPI driver for DM3xx/DM6467/DA8xx
    
     The patch adds support for SPI in DaVinci
     DM355/DM365/DM6467 and DA8xx.
    
     This has been tested on the DM355, DM365 and DM6467 EVMs using
     the EEPROM connected to SPI0
    Signed-off-by: default avatarSandeep Paulraj <s-paulraj@ti.com>
    
    DaVinci: DM646x: Adding Support for SPI
    
     The patch does the following
    
     1) Adds a clock for SPI
     2) Defines resources specific to DM646x SOC
    Signed-off-by: default avatarSandeep Paulraj <s-paulraj@ti.com>
    Signed-off-by: default avatarPablo Bitton <pablo.bitton@gmail.com>
    Cc: Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
    Cc: Russell King <rmk@arm.linux.org.uk>
    Cc: David Brownell <david-b@pacbell.net>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    96836edc
dm646x.h 1.42 KB