Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-29 Thread Gerhard Pircher
> --- Ursprüngliche Nachricht --- > Von: Benjamin Herrenschmidt <[EMAIL PROTECTED]> > An: "Mark A. Greer" <[EMAIL PROTECTED]> > Kopie: [EMAIL PROTECTED], debian-powerpc@lists.debian.org > Betreff: Re: Not coherent cache DMA for G3/G4 CPUs: clarification need

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-27 Thread Mark A. Greer
On Fri, Apr 28, 2006 at 07:53:29AM +1000, Benjamin Herrenschmidt wrote: > > > There are many mv64x60 based platforms working just fine today with > > CONFIG_NOT_COHERENT_CACHE defined. The reason for turning coherency off > > is that there is a bug in the bridge requiring a hardware workaround. >

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-27 Thread Benjamin Herrenschmidt
> There are many mv64x60 based platforms working just fine today with > CONFIG_NOT_COHERENT_CACHE defined. The reason for turning coherency off > is that there is a bug in the bridge requiring a hardware workaround. > Unfortunately, not all of the hardware vendors have implemented that > workarou

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-27 Thread Mark A. Greer
On Fri, Apr 21, 2006 at 02:38:05PM +1000, Benjamin Herrenschmidt wrote: > On Thu, 2006-04-20 at 14:55 -0700, Eugene Surovegin wrote: > > On Thu, Apr 20, 2006 at 11:10:55PM +0200, Gerhard Pircher wrote: > > > Well, Freescale's PPC programming environment manual clearly states that > > > this will no

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-24 Thread Mark A. Greer
On Fri, Apr 21, 2006 at 12:08:18AM +0200, Gerhard Pircher wrote: > > --- Ursprüngliche Nachricht --- > > Von: Eugene Surovegin <[EMAIL PROTECTED]> > > An: Gerhard Pircher <[EMAIL PROTECTED]> > > Kopie: [EMAIL PROTECTED], debian-powerpc@lists.debian.org > &g

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-21 Thread Brent Cook
On Thursday 20 April 2006 23:38, Benjamin Herrenschmidt wrote: > On Thu, 2006-04-20 at 14:55 -0700, Eugene Surovegin wrote: > > On Thu, Apr 20, 2006 at 11:10:55PM +0200, Gerhard Pircher wrote: > > > Well, Freescale's PPC programming environment manual clearly states > > > that this will not work on

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-21 Thread Benjamin Herrenschmidt
> not claiming to understand all of the issues here, but I have some > MV64460 / MPC7448-based systems, and they only boot if > CONFIG_NOT_COHERENT_CACHE=y That is strange... Pegasos uses a Marvell bridge and it works with coherent cache. Do you have some kernel patches in addition to what is i

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-21 Thread Eugene Surovegin
On Thu, Apr 20, 2006 at 11:10:55PM +0200, Gerhard Pircher wrote: > Well, Freescale's PPC programming environment manual clearly states that > this will not work on G4 CPUs (74xx). Also Benjamin Herrenschmidt told me, > that this implementation will not work for the reasons I mentioned before. > Th

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-21 Thread Eugene Surovegin
On Fri, Apr 21, 2006 at 07:06:13AM +1000, Benjamin Herrenschmidt wrote: > (On 6xx this is deadly even if you don't access those cacheable pages > because the CPU prefetch may do it for you). Here is another thought if this "prefetch" theory is correct. You guys seems to focus on dma_alloc_cohere

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-21 Thread Eugene Surovegin
On Thu, Apr 20, 2006 at 02:13:21PM -0700, Eugene Surovegin wrote: > On Fri, Apr 21, 2006 at 07:06:13AM +1000, Benjamin Herrenschmidt wrote: > > Unfortunately, he has to do things a bit differently. He can't afford to > > have the kernel BAT mapping cover his non-cacheable pages. Thus he needs > > a

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-21 Thread Eugene Surovegin
On Fri, Apr 21, 2006 at 07:06:13AM +1000, Benjamin Herrenschmidt wrote: > Unfortunately, he has to do things a bit differently. He can't afford to > have the kernel BAT mapping cover his non-cacheable pages. Thus he needs > a reserved pool. Last I looked at our coherent code, it didn't reserve > me

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-21 Thread Eugene Surovegin
On Thu, Apr 20, 2006 at 10:56:33PM +0200, Gerhard Pircher wrote: > > --- Urspr?ngliche Nachricht --- > > Von: Eugene Surovegin <[EMAIL PROTECTED]> > > An: Gerhard Pircher <[EMAIL PROTECTED]> > > Kopie: [EMAIL PROTECTED], debian-powerpc@lists.debian.org > &g

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-21 Thread Eugene Surovegin
On Thu, Apr 20, 2006 at 08:57:46PM +0200, Gerhard Pircher wrote: > Hi, > > I try to implement not coherent cache/DMA support for G3/G4 processors, by > reserving some physical memory for DMA operations. The memory used for > consistent allocations (removed from the top of the physical memory below

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-21 Thread Gerhard Pircher
> --- Ursprüngliche Nachricht --- > Von: Benjamin Herrenschmidt <[EMAIL PROTECTED]> > An: Eugene Surovegin <[EMAIL PROTECTED]> > Kopie: Gerhard Pircher <[EMAIL PROTECTED]>, > [EMAIL PROTECTED], debian-powerpc@lists.debian.org > Betreff: Re: Not coherent cac

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-21 Thread Gerhard Pircher
> --- Ursprüngliche Nachricht --- > Von: Benjamin Herrenschmidt <[EMAIL PROTECTED]> > An: Eugene Surovegin <[EMAIL PROTECTED]> > Kopie: Gerhard Pircher <[EMAIL PROTECTED]>, > [EMAIL PROTECTED], debian-powerpc@lists.debian.org > Betreff: Re: Not coherent cac

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Benjamin Herrenschmidt
On Thu, 2006-04-20 at 14:55 -0700, Eugene Surovegin wrote: > On Thu, Apr 20, 2006 at 11:10:55PM +0200, Gerhard Pircher wrote: > > Well, Freescale's PPC programming environment manual clearly states that > > this will not work on G4 CPUs (74xx). Also Benjamin Herrenschmidt told me, > > that this imp

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Benjamin Herrenschmidt
> In this case the problem is double mapping with inconsistent attributes > (through BAT and page tables I assume). Yes. > > On POWER4, 970 and later, the chip guys confirmed that the problem is > > real though. Not only bcs of prefetch but also speculative execution > > which can cause the ch

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Gabriel Paubert
On Fri, Apr 21, 2006 at 08:39:29AM +1000, Benjamin Herrenschmidt wrote: > On Thu, 2006-04-20 at 14:13 -0700, Eugene Surovegin wrote: > > On Fri, Apr 21, 2006 at 07:06:13AM +1000, Benjamin Herrenschmidt wrote: > > > Unfortunately, he has to do things a bit differently. He can't afford to > > > have

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Benjamin Herrenschmidt
On Thu, 2006-04-20 at 14:33 -0700, Eugene Surovegin wrote: > On Fri, Apr 21, 2006 at 07:06:13AM +1000, Benjamin Herrenschmidt wrote: > > (On 6xx this is deadly even if you don't access those cacheable pages > > because the CPU prefetch may do it for you). > > Here is another thought if this "prefe

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Benjamin Herrenschmidt
On Thu, 2006-04-20 at 14:19 -0700, Eugene Surovegin wrote: > On Thu, Apr 20, 2006 at 02:13:21PM -0700, Eugene Surovegin wrote: > > On Fri, Apr 21, 2006 at 07:06:13AM +1000, Benjamin Herrenschmidt wrote: > > > Unfortunately, he has to do things a bit differently. He can't afford to > > > have the ke

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Benjamin Herrenschmidt
On Thu, 2006-04-20 at 14:13 -0700, Eugene Surovegin wrote: > On Fri, Apr 21, 2006 at 07:06:13AM +1000, Benjamin Herrenschmidt wrote: > > Unfortunately, he has to do things a bit differently. He can't afford to > > have the kernel BAT mapping cover his non-cacheable pages. Thus he needs > > a reserv

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Gerhard Pircher
> --- Ursprüngliche Nachricht --- > Von: Gabriel Paubert <[EMAIL PROTECTED]> > An: Gerhard Pircher <[EMAIL PROTECTED]> > Kopie: [EMAIL PROTECTED], debian-powerpc@lists.debian.org > Betreff: Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed > Datum: F

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Gerhard Pircher
> --- Ursprüngliche Nachricht --- > Von: Eugene Surovegin <[EMAIL PROTECTED]> > An: Gerhard Pircher <[EMAIL PROTECTED]> > Kopie: [EMAIL PROTECTED], debian-powerpc@lists.debian.org > Betreff: Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed > Datum: T

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Gabriel Paubert
On Thu, Apr 20, 2006 at 08:57:46PM +0200, Gerhard Pircher wrote: > Hi, > > I try to implement not coherent cache/DMA support for G3/G4 processors, by > reserving some physical memory for DMA operations. The memory used for > consistent allocations (removed from the top of the physical memory below

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Gerhard Pircher
> --- Ursprüngliche Nachricht --- > Von: Benjamin Herrenschmidt <[EMAIL PROTECTED]> > An: Gerhard Pircher <[EMAIL PROTECTED]> > Kopie: [EMAIL PROTECTED], debian-powerpc@lists.debian.org > Betreff: Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed > Da

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Gerhard Pircher
> --- Ursprüngliche Nachricht --- > Von: Eugene Surovegin <[EMAIL PROTECTED]> > An: Gerhard Pircher <[EMAIL PROTECTED]> > Kopie: [EMAIL PROTECTED], debian-powerpc@lists.debian.org > Betreff: Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed > Datum: T

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Benjamin Herrenschmidt
> > 3. How are DMA buffers used outside the kernel? Do user programs get a > > pointer to the DMA buffer (in theory) from the device driver or is the data > > copied to another buffer allocated by an user program? > > > There are already non-coherent cache PPC archs (8xx, 4xx) just look > how a

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Benjamin Herrenschmidt
On Thu, 2006-04-20 at 20:57 +0200, Gerhard Pircher wrote: > 1. The AmigaOne is similar to the PREP platform, i.e. DMA can only be > performed in the first 16MB for ISA devices (there's only a VIA southbridge, > no other SuperI/O IC with 32bit capable DMA controller). I guess the first > 16MB canno

Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Gerhard Pircher
> --- Ursprüngliche Nachricht --- > Von: Eugene Surovegin <[EMAIL PROTECTED]> > An: Gerhard Pircher <[EMAIL PROTECTED]> > Kopie: [EMAIL PROTECTED], debian-powerpc@lists.debian.org > Betreff: Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed > Datum: T

Not coherent cache DMA for G3/G4 CPUs: clarification needed

2006-04-20 Thread Gerhard Pircher
Hi, I try to implement not coherent cache/DMA support for G3/G4 processors, by reserving some physical memory for DMA operations. The memory used for consistent allocations (removed from the top of the physical memory below 896MB) is excluded from the BAT mapping and the pages are marked as reserv