On Thu, 23 Jun 2011 11:01:25 +0800
Dirk Brandewie <[email protected]> wrote:


> >> -  /*
> >> -   * Try to detect the FIFO depth if not set by interface
> >> driver,
> >> -   * the depth could be from 2 to 256 from HW spec
> >> -   */
> >> -  if (!dws->fifo_len) {
> >> -          u32 fifo;
> >> -          for (fifo = 2; fifo<= 257; fifo++) {
> >> -                  dw_writew(dws, txfltr, fifo);
> >> -                  if (fifo != dw_readw(dws, txfltr))
> >> -                          break;
> >> -          }
> >> -
> >> -          dws->fifo_len = (fifo == 257) ? 0 : fifo;
> >> -          dw_writew(dws, txfltr, 0);
> >> -  }
> >>   }
> >
> > This code is requested by other community developers, the FIFO
> > length is adjustable for the dw_spi core when deployed on
> > different platforms, for those who are not certain about the
> > FIFO len, they can use this code to probe the FIFO len.
> >
> > So we need to keep it.
> >
> 
> Then I have bad documentation because document I have says that you
> can NOt write to txfltr while the controller is enabled.  The sizing
> routine as it stands can't work for the implementation in Moorsetown
> and Medfield.
> 
> If there are other SOC's that are implementing different semantics
> for txfltr we will need to handle this differently and do some
> runtime detection of how the fifo should be sized.
> 
> Can you give ne a reference to the person that requiested the sizing
> code so I can follow-up

Git-show c587b6fa0510

commit c587b6fa05106606053fc5e8e344f07cd34ace23
Author: Feng Tang <[email protected]>
Date:   Thu Jan 21 10:41:10 2010 +0800

    spi/dw_spi: add a FIFO depth detection

    FIFO depth is configurable for each implementation of DW core,
    so add a depth detection for those interface drivers who don't set
    the fifo_len explicitly

    Signed-off-by: Feng Tang <[email protected]>
    Acked-by: Jean-Hugues Deschenes <[email protected]>
    Signed-off-by: Grant Likely <[email protected]>

I added the code per request from Jean-Hugues Deschenes.

Recently Alek Du has tested this code on his Medfield platform.

Thanks,
Feng

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to