lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 15 Feb 2011 19:44:10 +0530
From:	"Anoop P.A" <anoop.pa@...il.com>
To:	ralf@...ux-mips.org, linux-mips@...ux-mips.org,
	linux-kernel@...r.kernel.org
Cc:	Anoop P A <anoop.pa@...il.com>
Subject: [PATCH 2/2] Fix pci id check.

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

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

Signed-off-by: Anoop P A <anoop.pa@...il.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ