All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Korpilla <okorpil@fh-landshut.de>
To: "Heater, Daniel (GE Infrastructure)" <Daniel.Heater@gefanuc.com>
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: VME driver patch for PowerPC
Date: Wed, 09 Jun 2004 14:59:09 +0200	[thread overview]
Message-ID: <40C7099D.10206@fh-landshut.de> (raw)
In-Reply-To: <40C48A1C.30602@fh-landshut.de>


Hello!

Adding the patch below activated correct behaviour for vme_peek/poke, with
correct data width (tested VME_D8, VME_D16 and VME_D32), and without cache bursts.

It simply sets the cache-inhibited and guarded bits before remapping the pages
(these flags are PowerPC-specific, and the pci_mmap_page_range() function is
sadly no exported kernel symbol).

Would you again be so kind to run some "still works"-test on an Intel board?

Looks like a hack, but I guess it simply gets the job done... No need for a
larger rewrite here.

May take some time till I can again lay hands on a MVME5500 (PPC 7455 - 1Ghz) to
verify on another PPC board, though.

With kind regards,
Oliver Korpilla

Index: module/vme_main.c
===================================================================
--- module/vme_main.c   (revision 5)
+++ module/vme_main.c   (revision 6)
@@ -191,14 +191,18 @@
   */
  int vme_mmap(struct file *file_ptr, struct vm_area_struct *vma)
  {
-
         DPRINTF("Attempting to map %#lx bytes of memory at "
                 "physical address %#lx\n", vma->vm_end - vma->vm_start,
                 vma->vm_pgoff << PAGE_SHIFT);

+#ifdef CONFIG_PPC32
+       vma->vm_page_prot.pgprot |= _PAGE_NO_CACHE | _PAGE_GUARDED;
+       DPRINTF("PowerPC protection flags set.\n");
+#endif
+
         /* Don't swap these pages out
          */
-       vma->vm_flags |= VM_RESERVED;
+       vma->vm_flags |= VM_LOCKED | VM_IO | VM_SHM;

  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,3) || defined RH9BRAINDAMAGE
         return remap_page_range(vma, vma->vm_start, vma->vm_pgoff << PAGE_SHIFT,

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

  parent reply	other threads:[~2004-06-09 12:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-18 15:25 [Fwd: Memory layout question] Heater, Daniel (GE Infrastructure)
2004-05-19  6:51 ` Differing PCI layouts trigger porting driver problem [Was: " Oliver Korpilla
2004-05-25 13:56 ` [Fwd: " Oliver Korpilla
2004-05-26  8:37 ` Oliver Korpilla
2004-05-26 11:56 ` Oliver Korpilla
2004-06-02  7:42 ` Successful master window access Oliver Korpilla
2004-06-07 15:30 ` VME driver patch for PowerPC Oliver Korpilla
2004-06-08  9:05   ` VME driver patch for PowerPC [Continued] Oliver Korpilla
2004-06-08  9:59   ` VME driver change suggestion Oliver Korpilla
2004-06-09 11:25   ` VME driver patch for PowerPC Oliver Korpilla
2004-06-09 12:59   ` Oliver Korpilla [this message]
2004-06-09 13:14     ` Complete " Oliver Korpilla
  -- strict thread matches above, loose matches on Subject: below --
2004-06-09  2:55 Heater, Daniel (GE Infrastructure)
2004-06-09  6:40 ` Oliver Korpilla
2004-06-09 13:59 Heater, Daniel (GE Infrastructure)
2004-06-09 14:29 ` Oliver Korpilla
2004-06-09 20:01 Heater, Daniel (GE Infrastructure)

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=40C7099D.10206@fh-landshut.de \
    --to=okorpil@fh-landshut.de \
    --cc=Daniel.Heater@gefanuc.com \
    --cc=linuxppc-embedded@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.