mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Bahadir Balban" <bahadir.balban@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Enabling IO/MEM through pci bridge
Date: Fri, 19 Jan 2007 15:02:56 +0000	[thread overview]
Message-ID: <7ac1e90c0701190702l1ff833f6y141de58d9c0fb084@mail.gmail.com> (raw)

Hi,

On some ARM platform with multiple pci bridges, I had to add the below
patch in order to enable transactions through the bridges to devices
behind. I'm sure there are other platforms with similar pci setup so
why wouldn't it work without it?

Thanks,
Bahadir

Enable bus transactions behind bridges.

From: Bahadir Balban <bahadir.balban@arm.com>

When transactions (MEM/IO) are enabled for a device, this patch ensures
also the same transactions are enabled for the bridge that they sit behind.
---

 drivers/pci/setup-bus.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 8f7bcf5..a5c400e 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -150,0 +151 @@ EXPORT_SYMBOL(pci_setup_cardbus);
+	int i;
@@ -158,0 +160 @@ pci_setup_bridge(struct pci_bus *bus)
+	int i;
@@ -224,0 +227,15 @@ pci_setup_bridge(struct pci_bus *bus)
+
+	for (i = 0; i < 3; i++) {
+		u16 csr;
+		if ((bus->resource[i]->flags & IORESOURCE_MEM) ||
+		    (bus->resource[i]->flags & IORESOURCE_PREFETCH)) {
+			pci_read_config_word(bridge, PCI_COMMAND, &csr);
+			csr |= (1 << 1) | (1 << 2);
+			pci_write_config_word(bridge, PCI_COMMAND, csr);
+		}
+		if (bus->resource[i]->flags & IORESOURCE_IO) {
+			pci_read_config_word(bridge, PCI_COMMAND, &csr);
+			csr |= (1 << 0) | (1 << 2);
+			pci_write_config_word(bridge, PCI_COMMAND, csr);
+		}
+	}

                 reply	other threads:[~2007-01-19 15:02 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=7ac1e90c0701190702l1ff833f6y141de58d9c0fb084@mail.gmail.com \
    --to=bahadir.balban@gmail.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®