All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kumar Gala <galak@gate.crashing.org>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH] powerpc: Detect prefetchable windows in pci_process_bridge_OF_ranges
Date: Tue, 13 Dec 2005 14:46:29 -0600 (CST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0512131445410.6332-100000@gate.crashing.org> (raw)

Added the ability to determine if an outbound window in the PCI host
controller is for prefetchable memory and report it as such.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

---
commit 6a050a749ac14613057a2adec0e3dbaa7697a824
tree 254dedb89aac5444c6d387bd1b6ef20c954538a5
parent 761e102769add7e86d510f7605c06f4a82575015
author Kumar Gala <galak@kernel.crashing.org> Tue, 13 Dec 2005 14:46:34 -0600
committer Kumar Gala <galak@kernel.crashing.org> Tue, 13 Dec 2005 14:46:34 -0600

 arch/ppc/kernel/pci.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index df4b11c..8a58fe8 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -941,7 +941,7 @@ pci_process_bridge_OF_ranges(struct pci_
 	while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
 		res = NULL;
 		size = ranges[na+4];
-		switch (ranges[0] >> 24) {
+		switch ((ranges[0] >> 24) & 0x3) {
 		case 1:		/* I/O space */
 			if (ranges[2] != 0)
 				break;
@@ -955,6 +955,8 @@ pci_process_bridge_OF_ranges(struct pci_
 			res = &hose->io_resource;
 			res->flags = IORESOURCE_IO;
 			res->start = ranges[2];
+			DBG("PCI: IO 0x%lx -> 0x%lx\n",
+				    res->start, res->start + size - 1);
 			break;
 		case 2:		/* memory space */
 			memno = 0;
@@ -972,7 +974,11 @@ pci_process_bridge_OF_ranges(struct pci_
 			if (memno < 3) {
 				res = &hose->mem_resources[memno];
 				res->flags = IORESOURCE_MEM;
+				if(ranges[0] & 0x40000000)
+					res->flags |= IORESOURCE_PREFETCH;
 				res->start = ranges[na+2];
+				DBG("PCI: MEM[%d] 0x%lx -> 0x%lx\n", memno,
+					    res->start, res->start + size - 1);
 			}
 			break;
 		}

                 reply	other threads:[~2005-12-13 20:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Pine.LNX.4.44.0512131445410.6332-100000@gate.crashing.org \
    --to=galak@gate.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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.