LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/2] Minor improvements to MSP pci support.
@ 2011-02-15 14:12 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 ` [PATCH 2/2] Fix pci id check Anoop P.A
0 siblings, 2 replies; 3+ messages in thread
From: Anoop P.A @ 2011-02-15 14:12 UTC (permalink / raw)
To: ralf, linux-mips, linux-kernel; +Cc: Anoop P A
From: Anoop P A <anoop.pa@gmail.com>
Following set of patch created againt linux-queue head .
Ignoring checkpatch warning (usage of volatile).
Anoop P A (2):
Introduce MSP_HAS_PCI config option.
Fix pci id check.
arch/mips/include/asm/pmc-sierra/msp71xx/msp_pci.h | 6 +++++-
arch/mips/pci/Makefile | 4 +---
arch/mips/pci/ops-pmcmsp.c | 16 +++++++++-------
arch/mips/pmc-sierra/Kconfig | 12 +++++++++---
4 files changed, 24 insertions(+), 14 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] Introduce MSP_HAS_PCI config option.
2011-02-15 14:12 [PATCH 0/2] Minor improvements to MSP pci support Anoop P.A
@ 2011-02-15 14:13 ` Anoop P.A
2011-02-15 14:14 ` [PATCH 2/2] Fix pci id check Anoop P.A
1 sibling, 0 replies; 3+ messages in thread
From: Anoop P.A @ 2011-02-15 14:13 UTC (permalink / raw)
To: ralf, linux-mips, linux-kernel; +Cc: Anoop P A
From: Anoop P A <anoop.pa@gmail.com>
Various chips in MSP family shares PCI block. Following patch introduce MSP_HAS_PCI config option
so that we can avoid adding seperate entries in arch/mips/pci/Makefile. Also getrid off SoC specific
flags from ops-pmcmsp.c
Signed-off-by: Anoop P A <anoop.pa@gmail.com>
---
arch/mips/pci/Makefile | 4 +---
arch/mips/pci/ops-pmcmsp.c | 12 +++++++-----
arch/mips/pmc-sierra/Kconfig | 12 +++++++++---
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index c9209ca..2dd8845 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -30,9 +30,7 @@ obj-$(CONFIG_SOC_PNX8550) += fixup-pnx8550.o ops-pnx8550.o
obj-$(CONFIG_LEMOTE_FULOONG2E) += fixup-fuloong2e.o ops-loongson2.o
obj-$(CONFIG_LEMOTE_MACH2F) += fixup-lemote2f.o ops-loongson2.o
obj-$(CONFIG_MIPS_MALTA) += fixup-malta.o
-obj-$(CONFIG_PMC_MSP7120_GW) += fixup-pmcmsp.o ops-pmcmsp.o
-obj-$(CONFIG_PMC_MSP7120_EVAL) += fixup-pmcmsp.o ops-pmcmsp.o
-obj-$(CONFIG_PMC_MSP7120_FPGA) += fixup-pmcmsp.o ops-pmcmsp.o
+obj-$(CONFIG_MSP_HAS_PCI) += fixup-pmcmsp.o ops-pmcmsp.o
obj-$(CONFIG_PMC_YOSEMITE) += fixup-yosemite.o ops-titan.o ops-titan-ht.o \
pci-yosemite.o
obj-$(CONFIG_SGI_IP27) += ops-bridge.o pci-ip27.o
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c
index 68798f8..caedf9a 100644
--- a/arch/mips/pci/ops-pmcmsp.c
+++ b/arch/mips/pci/ops-pmcmsp.c
@@ -31,7 +31,7 @@
#include <linux/init.h>
#include <asm/byteorder.h>
-#if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL)
+#ifdef CONFIG_MIPS_MT
#include <asm/mipsmtregs.h>
#endif
@@ -206,7 +206,9 @@ static void pci_proc_init(void)
}
#endif /* CONFIG_PROC_FS && PCI_COUNTERS */
+#ifndef CONFIG_MIPS_MT
static DEFINE_SPINLOCK(bpci_lock);
+#endif
/*****************************************************************************
*
@@ -386,7 +388,7 @@ int msp_pcibios_config_access(unsigned char access_type,
unsigned long value;
static char pciirqflag;
int ret;
-#if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL)
+#ifdef CONFIG_MIPS_MT
unsigned int vpe_status;
#endif
@@ -413,7 +415,7 @@ int msp_pcibios_config_access(unsigned char access_type,
pciirqflag = ~0;
}
-#if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL)
+#ifdef CONFIG_MIPS_MT
local_irq_save(flags);
vpe_status = dvpe();
#else
@@ -468,7 +470,7 @@ int msp_pcibios_config_access(unsigned char access_type,
/* Clear status bits */
preg->if_status = ~(BPCI_IFSTATUS_BC0F | BPCI_IFSTATUS_BC1F);
-#if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL)
+#ifdef CONFIG_MIPS_MT
evpe(vpe_status);
local_irq_restore(flags);
#else
@@ -478,7 +480,7 @@ int msp_pcibios_config_access(unsigned char access_type,
return -1;
}
-#if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL)
+#ifdef CONFIG_MIPS_MT
evpe(vpe_status);
local_irq_restore(flags);
#else
diff --git a/arch/mips/pmc-sierra/Kconfig b/arch/mips/pmc-sierra/Kconfig
index bbd7608..d4984c3 100644
--- a/arch/mips/pmc-sierra/Kconfig
+++ b/arch/mips/pmc-sierra/Kconfig
@@ -16,13 +16,13 @@ config PMC_MSP7120_EVAL
bool "PMC-Sierra MSP7120 Eval Board"
select SYS_SUPPORTS_MULTITHREADING
select IRQ_MSP_CIC
- select HW_HAS_PCI
+ select MSP_HAS_PCI
config PMC_MSP7120_GW
bool "PMC-Sierra MSP7120 Residential Gateway"
select SYS_SUPPORTS_MULTITHREADING
select IRQ_MSP_CIC
- select HW_HAS_PCI
+ select MSP_HAS_PCI
select MSP_HAS_USB
select MSP_ETH
@@ -30,7 +30,7 @@ config PMC_MSP7120_FPGA
bool "PMC-Sierra MSP7120 FPGA"
select SYS_SUPPORTS_MULTITHREADING
select IRQ_MSP_CIC
- select HW_HAS_PCI
+ select MSP_HAS_PCI
endchoice
@@ -50,3 +50,9 @@ config MSP_ETH
config MSP_HAS_MAC
boolean
depends on PMC_MSP
+
+config MSP_HAS_PCI
+ boolean
+ select HW_HAS_PCI
+ depends on PMC_MSP
+
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] Fix pci id check.
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
1 sibling, 0 replies; 3+ messages in thread
From: Anoop P.A @ 2011-02-15 14:14 UTC (permalink / raw)
To: ralf, linux-mips, linux-kernel; +Cc: Anoop P A
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-02-15 13:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/2] Fix pci id check Anoop P.A
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).