linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: (allocating non-cachable memory) (or More on the i82596)
@ 2001-06-28 16:28 Paul White
  0 siblings, 0 replies; 24+ messages in thread
From: Paul White @ 2001-06-28 16:28 UTC (permalink / raw)
  To: Justin (Gus) Hurwitz, jtm; +Cc: linuxppc-embedded


Justin,

>From my recent experience, this does not work.   We have a device on our
PCI bus which is
DMAing to SDRAM, and so far I can't get anything to work without cache
coherency
support in the system controller.

If you find anything out, please let me know.  I may end up adding a new
memory queue
for non-cacheable memory, and just use another BAT entry for some
pre-defined amount
of memory for a non-cacheable pool.  A new flag to kmalloc() could then be
used to
get non-cacheable memory.  Does anyone know if anything like this already
exists, or
if theres a much easier way around this??  I should hopefully get cache
coherency
working, but we have been unable to so far.  If I end up doing the work,
I"ll post the patches
here.

Btw..  I attempted to disable cache, as well as simply set the RAM bat's to
PAGE_NO_CACHE,
however this does not work because the PowerPC will throw alignment
exceptions whenever a
cache instruction is called on either a non-cached memory region, or if
caching is disabled.
Just wanted to give you a heads up on this.

Paul W.


At 04:52 AM 6/28/2001 -0400, Justin (Gus) Hurwitz wrote:
>
>Did yo ever get a reply to this? That sounds like just what I want to do
>(well, it sounds just like what our vxworks code does to do what I want to
>do, which I guess is good enough).
>
>TIA,
>--Gus
>
>On Tue, 26 Jun 2001 jtm@smoothsmoothie.com wrote:
>
>>
>> I am looking for a solution to a similar problem. I am writing a
>> driver for an FCC on the 8260 in transparent mode, and need
>> to allocate buffer memory. The buffer memory will get filled
>> via DMA, and therefore must not be cached. Will the following work
>> correctly?
>>
>> 	vaddr = kmalloc(BUF_SIZE, GFP_DMA);
>> 	paddr = __pa(vaddr);
>>
>> Thanks.
>> --
>> Jay Monkman	    The truth knocks on the door and you say "Go away, I'm
>> monkman@jump.net    looking for the truth," and so it goes away. Puzzling.
>> 		     - from _Zen_and_the_Art_of_Motorcycle_Maintenance_
>
>
>
-------------------------------------------------------------
Network Robots, Inc.         /--\               Paul H. White
                           / ____ \
4695 Chabot Dr. #200      / ( oo ) \       Software Developer
Pleasanton, CA 94588     /   ----   \             Engineering
(925) 924-8600           \   ----   /          (925) 580-4883
                          \  V--V  /
                           \      /
                             \--/

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 24+ messages in thread
* (allocating non-cachable memory) (or More on the i82596)
@ 2001-06-26 10:22 Justin (Gus) Hurwitz
  2001-06-26 21:08 ` jtm
  0 siblings, 1 reply; 24+ messages in thread
From: Justin (Gus) Hurwitz @ 2001-06-26 10:22 UTC (permalink / raw)
  To: linuxppc-embedded


I've been looking at the code for the i82596 ethernet controller a bit
more and think that (thank god) it provides a better base for my board's
driver than I initially though.

But...

Our board is 603e based, with non functional hardware snooping. This is
not too much a problem for this chip- it supports writing to a block of
shared memory marked as non-cachable in lieu of using snooping. In fact,
our vxworks port for the board uses a whopping half meg memory region for
this purpose (seems a bit large to me, but I wasn't involved with that
port). What's more, the driver in the kernel seems to work using a shared
memory region as well. This is architecturally good. Unfortunately, I am
unable to figure out how to mark an area of memory as non-cachable.

The existing driver was written for 68k hardware, and therefore uses calls
that are non-existant in the ppc port:

#ifdef __mc68000__
        cache_push(virt_to_phys((void *)(dev->mem_start)), 4096);
        cache_clear(virt_to_phys((void *)(dev->mem_start)), 4096);
        kernel_set_cachemode((void *)(dev->mem_start), 4096,  IOMAP_NOCACHE_SER);
#endif

Therefore, my concise question is most likely: what are the equivalent
functions for a 603e based board? (I assume that the two cache_ functions
are comprable to flush_instruction_cache, but am probably wrong about
that, so I blatantly make the error hear so that someone will correct my
ignorance :)

Thanks,
--Gus


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2001-07-05 20:00 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200106281622.f5SGMW810376@stimpy.networkrobots.com>
2001-06-28 10:43 ` (allocating non-cachable memory) (or More on the i82596) Justin (Gus) Hurwitz
     [not found] ` <Pine.LNX.3.95.1010628062229.5112E-100000@november.bhjjh.er ols.com>
2001-06-29  0:13   ` Paul White
2001-06-29  9:16     ` Justin (Gus) Hurwitz
     [not found]     ` <Pine.LNX.3.95.1010629042746.5292E-100000@november.bhjjh.er ols.com>
2001-06-29 17:53       ` Paul White
2001-06-29 12:11         ` Justin (Gus) Hurwitz
2001-07-01  5:17           ` Dan Malek
2001-06-28 16:28 Paul White
  -- strict thread matches above, loose matches on Subject: below --
2001-06-26 10:22 Justin (Gus) Hurwitz
2001-06-26 21:08 ` jtm
2001-06-28  8:52   ` Justin (Gus) Hurwitz
2001-06-29  7:39   ` Dan Malek
2001-06-29  5:21     ` Justin (Gus) Hurwitz
2001-06-29  6:58     ` Justin (Gus) Hurwitz
2001-07-01  5:04       ` Dan Malek
2001-06-29 16:30     ` jtm
2001-06-29 17:55       ` Paul White
2001-06-29 17:45     ` Paul White
2001-06-29 17:48     ` Paul White
2001-06-29 15:41       ` Matt Porter
2001-07-01  5:07         ` Dan Malek
2001-07-05 10:11         ` Justin (Gus) Hurwitz
2001-07-05 20:00           ` Dan Malek
2001-07-01  5:09       ` Dan Malek
2001-07-01  6:45         ` Paul White

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).