Skip to content
  • Stefan Roese's avatar
    spi: kirkwood_spi.c: Some fixes and cleanup · c032174f
    Stefan Roese authored
    
    
    This patch introduces the clrsetbits_le32() accessor functions in the
    kirkwood SPI driver. Note that it also includes a fix:
    
    -	 writel(~KWSPI_CSN_ACT | KWSPI_SMEMRDY, &spireg->ctrl);
    +	 writel(KWSPI_SMEMRDY, &spireg->ctrl);
    
    Here the bit KWSPI_CSN_ACT (0x1) should have been cleared. Instead
    0xfffffffe is written into this control register. This is the main
    reason to use the clrsetbits() functions now. As they make clearing
    bits much less error prone.
    
    Additionally KWSPI_IRQUNMASK is not used in spi_cs_activate() and
    spi_cs_deactivate() any more. Its the wrong macro but has the same
    value as the correct one (KWSPI_CSN_ACT).
    
    This is in preparation for use of this driver on the Marvell Armada XP
    platform as well.
    
    Signed-off-by: default avatarStefan Roese <sr@denx.de>
    Acked-by: default avatarPrafulla Wadaskar <prafulla@marvell.com>
    Tested-by: default avatarLuka Perkov <luka@openwrt.org>
    Reviewed-by: default avatarJagannadha Sutradharudu Teki <jaganna@xilinx.com>
    c032174f