linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Dan Malek <dan@embeddededge.com>
To: Eric.Oosterhof@radisys.com
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: I2C module problem on 8260
Date: Tue, 12 Feb 2002 18:10:36 -0500	[thread overview]
Message-ID: <3C69A0EC.2090400@embeddededge.com> (raw)
In-Reply-To: OFC97C91CA.1E7BB35E-ON88256B5E.007CD94A@radisys.com


Eric.Oosterhof@radisys.com wrote:

> .....  I discovered in so doing that the virtual address
> space that the module is placed in does not allow the use of __pa to get a
> virtual address.

Welcome to the wonderful world of Linux VM and the need for different
implementations depending upon how you use the driver.  The 8xx and 4xx
processors use the 'iopa()' function within the usual macros to do this.
Outside of those processors, you can call it directly.  Change the __pa()
to iopa() and you should be fine.

There are other things you must consider.  Loadable modules dynamically
allocate pages of memory, so they are likely not to be physically contiguous.
One of the programming techniques for modules is you must explicitly allocate
all objects subject to DMA such that they are known to be physically contiguous
if necessary.  The static buffers you allocate in a built-in driver won't work
for DMA in a module.

Finally, there isn't any deallocation function for CPM memory space.  I thought
someone else was going to contribute this, and I apologize if I misplaced a patch,
but this needs to be done or else your module loading/unloading will exhaust
the CPM dual port memory space.  I guess I can quickly do one that used the old
unix style map allocator, but I never got around to do it.  Due to the interactions
of the devices on the CPM for resource allocation and the configuration
interdependencies, I always found it easier to just build a static driver and
reboot the kernel.

Have fun!


	-- Dan


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

  reply	other threads:[~2002-02-12 23:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-12 22:49 I2C module problem on 8260 Eric.Oosterhof
2002-02-12 23:10 ` Dan Malek [this message]
2002-02-12 23:18   ` Wolfgang Denk
2002-02-13  6:43     ` Murray Jensen
2002-02-12 23:21   ` Dan Malek
  -- strict thread matches above, loose matches on Subject: below --
2002-02-20 19:26 Eric.Oosterhof

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C69A0EC.2090400@embeddededge.com \
    --to=dan@embeddededge.com \
    --cc=Eric.Oosterhof@radisys.com \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).