linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Moorestown SPI
@ 2011-05-27 14:52 Tom
       [not found] ` <BANLkTikaHBL_+_vCc=ow2E9QzWK-58Pq0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Tom @ 2011-05-27 14:52 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

The MRST dw_spi in Transmit & receive mode running on kernel 2.6.35,
stepping A3, is unable to receive data properly.
The slave is sending the data as expected, but the spi controller is not
reading it properly.

If i insert the messages or the delay equivalent as shown below it works.
Any clue ?

static int u8_writer(struct dw_spi *dws)
{
if (!(dw_readw(dws, sr) & SR_TF_NOT_FULL)
|| (dws->tx == dws->tx_end))
return 0;

dw_writew(dws, dr, *(u8 *)(dws->tx));
// printk("dw write %x ",*(u8 *)(dws->tx));
 udelay(50);
++dws->tx;

wait_till_not_busy(dws);
return 1;
}

static int u8_reader(struct dw_spi *dws)
{//printk("dw spi %s ",__func__);
while ((dw_readw(dws, sr) & SR_RF_NOT_EMPT)
&& (dws->rx < dws->rx_end)) {
*(u8 *)(dws->rx) = dw_readw(dws, dr);
// printk("dw read %x ",*(u8 *)(dws->rx));
udelay(50);
++dws->rx;
}

wait_till_not_busy(dws);
return dws->rx == dws->rx_end;
}
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-09  6:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-27 14:52 Moorestown SPI Tom
     [not found] ` <BANLkTikaHBL_+_vCc=ow2E9QzWK-58Pq0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-09  6:16   ` Tom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).