mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Anoop P.A" <anoop.pa@gmail.com>
To: ralf@linux-mips.org, linux-mips@linux-mips.org,
	linux-kernel@vger.kernel.org
Cc: Anoop P A <anoop.pa@gmail.com>
Subject: [PATCH 2/2] Fix pci id check.
Date: Tue, 15 Feb 2011 19:44:10 +0530	[thread overview]
Message-ID: <1297779250-26798-1-git-send-email-anoop.pa@gmail.com> (raw)
In-Reply-To: <1297779151-26595-1-git-send-email-anoop.pa@gmail.com>

From: Anoop P A <anoop.pa@gmail.com>

Pci id check was failing on most of the evaluation boards.

Signed-off-by: Anoop P A <anoop.pa@gmail.com>
---
 arch/mips/include/asm/pmc-sierra/msp71xx/msp_pci.h |    6 +++++-
 arch/mips/pci/ops-pmcmsp.c                         |    4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/mips/include/asm/pmc-sierra/msp71xx/msp_pci.h b/arch/mips/include/asm/pmc-sierra/msp71xx/msp_pci.h
index 4156069..c74daca 100644
--- a/arch/mips/include/asm/pmc-sierra/msp71xx/msp_pci.h
+++ b/arch/mips/include/asm/pmc-sierra/msp71xx/msp_pci.h
@@ -26,7 +26,11 @@
 #ifndef _MSP_PCI_H_
 #define _MSP_PCI_H_
 
-#define MSP_HAS_PCI(ID)	(((u32)(ID) <= 0x4236) && ((u32)(ID) >= 0x4220))
+#define MSP_HAS_PCI(ID)  ((((u32)(ID) <= (0x4236)) && \
+			((u32)(ID) >= (0x4220))) || \
+			((u32)(ID) == (0x7140)))
+#define MSP_PCI_READ_REG32(base, byte_offset) \
+	(*((volatile u32 *)((u8 *)(base) + (byte_offset))))
 
 /*
  * It is convenient to program the OATRAN register so that
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c
index caedf9a..8d5c2e6 100644
--- a/arch/mips/pci/ops-pmcmsp.c
+++ b/arch/mips/pci/ops-pmcmsp.c
@@ -966,9 +966,9 @@ void __init msp_pci_init(void)
 	u32 id;
 
 	/* Extract Device ID */
-	id = read_reg32(PCI_JTAG_DEVID_REG, 0xFFFF) >> 12;
+	id = (MSP_PCI_READ_REG32(PCI_JTAG_DEVID_REG, 0) >> 12) & 0x0FFFF;
 
-	/* Check if JTAG ID identifies MSP7120 */
+	/* Check if JTAG ID identifies MSP71xx */
 	if (!MSP_HAS_PCI(id)) {
 		printk(KERN_WARNING "PCI: No PCI; id reads as %x\n", id);
 		goto no_pci;
-- 
1.7.0.4


      parent reply	other threads:[~2011-02-15 13:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 14:12 [PATCH 0/2] Minor improvements to MSP pci support Anoop P.A
2011-02-15 14:13 ` [PATCH 1/2] Introduce MSP_HAS_PCI config option Anoop P.A
2011-02-15 14:14 ` Anoop P.A [this message]

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=1297779250-26798-1-git-send-email-anoop.pa@gmail.com \
    --to=anoop.pa@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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®