Skip to contentSkip to conversation

Port changes from linux-mti

PATCH In review Raghu Gandham 3 participants 23 messages Jul 2, 2009 – Oct 12, 2009 MIPS

lore
Share & tools
lore
#0 lore raw

cover Port changes from linux-mti

The following series of patches port the changes in linux-mti.git repository to the head of tree.
---

Chris Dearman (9):
Added coherentio command line option for DMA_NONCOHERENT kernel Add missing memory barriers for correct operation of amon_cpu_start Port of GIC related changes from MTI branch.
Add debug prints during CPU intialization.
APRP Patch04: Propagate final value of max_low_pfn to max_pfn [MTI] Enable PIIX4 PCI2.1 compliancy on Malta
[MTI] MIPS secondary cache supports 64 byte line size. Fix accesses to device registers on MIPS boards
[MTI] Clean up SPRAM support a little

Jaidev Patwardhan (2):
Avoid queing multiple reschedule IPI's in SMTC Avoid accessing GCMP registers when they are not present

Kurt Martin (1):
Do not rely on the initial state of TC/VPE bindings when doing cross VPE writes

Raghu Gandham (1):
Fix compiler warning in vpe.c

Robin Randhawa (2):
Fix absd emulation
Due to some broken bitfiles, we can't trust IntCtl

 arch/mips/Kconfig                 |    1 
 arch/mips/include/asm/gcmpregs.h  |   18 ++--
 arch/mips/include/asm/gic.h       |  188 ++++---------------------------------
 arch/mips/include/asm/irq.h       |    1 
 arch/mips/include/asm/smtc_ipi.h  |    5 +
 arch/mips/include/asm/spram.h     |   10 ++
 arch/mips/kernel/cpu-probe.c      |    8 --
 arch/mips/kernel/irq-gic.c        |  116 +++++++++--------------
 arch/mips/kernel/setup.c          |    3 -
 arch/mips/kernel/smp-mt.c         |   10 ++
 arch/mips/kernel/smtc.c           |   45 ++++++++-
 arch/mips/kernel/spram.c          |    5 -
 arch/mips/kernel/traps.c          |    4 +
 arch/mips/kernel/vpe.c            |    3 -
 arch/mips/math-emu/dp_simple.c    |   11 +-
 arch/mips/math-emu/sp_simple.c    |    3 -
 arch/mips/mti-malta/malta-amon.c  |    7 +
 arch/mips/mti-malta/malta-int.c   |  115 ++++++++++++++---------
 arch/mips/mti-malta/malta-pci.c   |   14 ++-
 arch/mips/mti-malta/malta-setup.c |  111 ++++++++++++++++++++++
 20 files changed, 351 insertions(+), 327 deletions(-)
 create mode 100644 arch/mips/include/asm/spram.h
#1 lore raw

PATCH 1/15 Due to some broken bitfiles, we can't trust IntCtl

From: Robin Randhawa <[email protected]>

---

 arch/mips/include/asm/irq.h |    1 +
 arch/mips/kernel/traps.c    |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
arch/mips/include/asm/irq.h +1 -0
index 09b08d0..ca0b5ed 100644
@@ -158,6 +158,7 @@ extern void free_irqno(unsigned int irq);
  * IE7.  Since R2 their number has to be read from the c0_intctl register.
  */
 #define CP0_LEGACY_COMPARE_IRQ 7
+#define CP0_LEGACY_PERFCNT_IRQ 7
 
 extern int cp0_compare_irq;
 extern int cp0_perfcount_irq;
arch/mips/kernel/traps.c +4 -0
index 08f1edf..0b6e328 100644
@@ -1538,7 +1538,11 @@ void __cpuinit per_cpu_trap_init(void)
 	 */
 	if (cpu_has_mips_r2) {
 		cp0_compare_irq = (read_c0_intctl() >> 29) & 7;
+		if (!cp0_compare_irq)
+			cp0_compare_irq = CP0_LEGACY_COMPARE_IRQ;
 		cp0_perfcount_irq = (read_c0_intctl() >> 26) & 7;
+		if (!cp0_perfcount_irq)
+			cp0_perfcount_irq = CP0_LEGACY_PERFCNT_IRQ;
 		if (cp0_perfcount_irq == cp0_compare_irq)
 			cp0_perfcount_irq = -1;
 	} else {
#2 lore raw

PATCH 2/15 Fix absd emulation

In reply to Raghu Gandham

From: Robin Randhawa <[email protected]>

---

 arch/mips/math-emu/dp_simple.c |   11 ++++-------
 arch/mips/math-emu/sp_simple.c |    3 ---
 2 files changed, 4 insertions(+), 10 deletions(-)
arch/mips/math-emu/dp_simple.c +4 -7
index 1c555e6..6ff4655 100644
@@ -76,15 +76,12 @@ ieee754dp ieee754dp_abs(ieee754dp x)
 	CLEARCX;
 	FLUSHXDP;
 
+	/* Clear sign ALWAYS, irrespective of NaN */
+	DPSIGN(x) = 0;
+
 	if (xc == IEEE754_CLASS_SNAN) {
 		SETCX(IEEE754_INVALID_OPERATION);
-		return ieee754dp_nanxcpt(ieee754dp_indef(), "neg");
+		return ieee754dp_nanxcpt(ieee754dp_indef(), "abs");
 	}
-
-	if (ieee754dp_isnan(x))	/* but not infinity */
-		return ieee754dp_nanxcpt(x, "abs", x);
-
-	/* quick fix up */
-	DPSIGN(x) = 0;
 	return x;
 }
arch/mips/math-emu/sp_simple.c +0 -3
index 770f0f4..cdec1a2 100644
@@ -61,9 +61,6 @@ ieee754sp ieee754sp_neg(ieee754sp x)
 		SPSIGN(y) = SPSIGN(x);
 		return ieee754sp_nanxcpt(y, "neg");
 	}
-
-	if (ieee754sp_isnan(x))	/* but not infinity */
-		return ieee754sp_nanxcpt(x, "neg", x);
 	return x;
 }
 
#3 lore raw

PATCH 3/15 Clean up SPRAM support a little

In reply to Raghu Gandham

From: Chris Dearman <[email protected]>

---

 arch/mips/include/asm/spram.h |   10 ++++++++++
 arch/mips/kernel/cpu-probe.c  |    8 +-------
 arch/mips/kernel/spram.c      |    5 ++---
 3 files changed, 13 insertions(+), 10 deletions(-)
 create mode 100644 arch/mips/include/asm/spram.h
arch/mips/include/asm/spram.h new file +10 -0
new file mode 100644
index 0000000..0b89006
@@ -0,0 +1,10 @@
+#ifndef _MIPS_SPRAM_H
+#define _MIPS_SPRAM_H
+
+#ifdef CONFIG_CPU_MIPSR2
+extern __init void spram_config(void);
+#else
+static inline void spram_config(void) { };
+#endif /* CONFIG_CPU_MIPSR2 */
+
+#endif /* _MIPS_SPRAM_H */
arch/mips/kernel/cpu-probe.c +1 -7
index 1abe990..2d35217 100644
@@ -23,7 +23,7 @@
 #include <asm/mipsregs.h>
 #include <asm/system.h>
 #include <asm/watch.h>
-
+#include <asm/spram.h>
 /*
  * Not all of the MIPS CPUs have the "wait" instruction available. Moreover,
  * the implementation of the "wait" feature differs between CPU families. This
@@ -711,12 +711,6 @@ static void __cpuinit decode_configs(struct cpuinfo_mips *c)
 	mips_probe_watch_registers(c);
 }
 
-#ifdef CONFIG_CPU_MIPSR2
-extern void spram_config(void);
-#else
-static inline void spram_config(void) {}
-#endif
-
 static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
 {
 	decode_configs(c);
arch/mips/kernel/spram.c +2 -3
index 6ddb507..1821d12 100644
@@ -13,7 +13,6 @@
 #include <linux/ptrace.h>
 #include <linux/stddef.h>
 
-#include <asm/cpu.h>
 #include <asm/fpu.h>
 #include <asm/mipsregs.h>
 #include <asm/system.h>
@@ -198,8 +197,7 @@ static __cpuinit void probe_spram(char *type,
 		offset += 2 * SPRAM_TAG_STRIDE;
 	}
 }
-
-__cpuinit void spram_config(void)
+void __cpuinit spram_config(void)
 {
 	struct cpuinfo_mips *c = &current_cpu_data;
 	unsigned int config0;
@@ -208,6 +206,7 @@ __cpuinit void spram_config(void)
 	case CPU_24K:
 	case CPU_34K:
 	case CPU_74K:
+	case CPU_1004K:
 		config0 = read_c0_config();
 		/* FIXME: addresses are Malta specific */
 		if (config0 & (1<<24)) {
#4 lore raw

PATCH 4/15 Fix accesses to device registers on MIPS boards

In reply to Raghu Gandham

From: Chris Dearman <[email protected]>

This fixes the remaining problems introduced by f197465384bf7ef1af184c2ed1a4e268911a91e3 (incorrect access length & byteswapping in bigendian mode)

---

 arch/mips/mti-malta/malta-int.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/mti-malta/malta-int.c +1 -1
index a8756f8..e9ba8b3 100644
@@ -87,7 +87,7 @@ static inline int mips_pcibios_iack(void)
 		dummy = BONITO_PCIMAP_CFG;
 		iob();    /* sync */
 
-		irq = readl((u32 *)_pcictrl_bonito_pcicfg);
+		irq = __raw_readl((u32 *)_pcictrl_bonito_pcicfg);
 		iob();    /* sync */
 		irq &= 0xff;
 		BONITO_PCIMAP_CFG = 0;
#5 lore raw

PATCH 5/15 MIPS secondary cache supports 64 byte line size.

In reply to Raghu Gandham

From: Chris Dearman <[email protected]>

---

 arch/mips/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/mips/Kconfig +1 -0
index df1a92a..60c7235 100644
@@ -1012,6 +1012,7 @@ config MIPS_L1_CACHE_SHIFT
 	int
 	default "4" if MACH_DECSTATION || MIKROTIK_RB532
 	default "7" if SGI_IP22 || SGI_IP27 || SGI_IP28 || SNI_RM || CPU_CAVIUM_OCTEON
+	default "6" if MIPS_CPU_SCACHE
 	default "4" if PMC_MSP4200_EVAL
 	default "5"
 
#6 lore raw

PATCH 6/15 Enable PIIX4 PCI2.1 compliancy on Malta

In reply to Raghu Gandham

From: Chris Dearman <[email protected]>

---

 arch/mips/mti-malta/malta-setup.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
arch/mips/mti-malta/malta-setup.c +11 -0
index dc78b89..69f5f9c 100644
@@ -223,3 +223,14 @@ void __init plat_mem_setup(void)
 	board_be_init = malta_be_init;
 	board_be_handler = malta_be_handler;
 }
+/* Enable PCI 2.1 compatibility in PIIX4 */
+static void __init quirk_dlcsetup(struct pci_dev *dev)
+{
+	u8 odlc, ndlc;
+	(void) pci_read_config_byte(dev, 0x82, &odlc);
+	/* Enable passive releases and delayed transaction */
+	ndlc = odlc | 7;
+	(void) pci_write_config_byte(dev, 0x82, ndlc);
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0,
+		quirk_dlcsetup);
#7 lore raw

PATCH 7/15 APRP Patch04: Propagate final value of max_low_pfn to max_pfn

In reply to Raghu Gandham

From: Chris Dearman <[email protected]>

---

 arch/mips/kernel/setup.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/mips/kernel/setup.c +2 -1
index 2950b97..1e9862d 100644
@@ -326,7 +326,6 @@ static void __init bootmem_init(void)
 	/*
 	 * Determine low and high memory ranges
 	 */
-	max_pfn = max_low_pfn;
 	if (max_low_pfn > PFN_DOWN(HIGHMEM_START)) {
 #ifdef CONFIG_HIGHMEM
 		highstart_pfn = PFN_DOWN(HIGHMEM_START);
@@ -334,6 +333,8 @@ static void __init bootmem_init(void)
 #endif
 		max_low_pfn = PFN_DOWN(HIGHMEM_START);
 	}
+	/* Propagate final value of max_low_pfn to max_pfn */
+	max_pfn = max_low_pfn;
 
 	/*
 	 * Initialize the boot-time allocator with low memory only.
#8 lore raw

PATCH 8/15 Fix compiler warning in vpe.c

In reply to Raghu Gandham

---

 arch/mips/kernel/vpe.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/mips/kernel/vpe.c +2 -1
index 07b9ec2..3d4ef84 100644
@@ -327,7 +327,8 @@ static void layout_sections(struct module *mod, const Elf_Ehdr * hdr,
 			    || (s->sh_flags & masks[m][1])
 			    || s->sh_entsize != ~0UL)
 				continue;
-			s->sh_entsize = get_offset(&mod->core_size, s);
+			s->sh_entsize =
+				get_offset((unsigned long *)&mod->core_size, s);
 		}
 
 		if (m == 0)
#9 lore raw

PATCH 9/15 Add debug prints during CPU intialization.

In reply to Raghu Gandham

From: Chris Dearman <[email protected]>

---

 arch/mips/kernel/smp-mt.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
arch/mips/kernel/smp-mt.c +9 -1
index 6f7ee5a..c6c7b54 100644
@@ -152,7 +152,7 @@ static void vsmp_send_ipi_mask(cpumask_t mask, unsigned int action)
 static void __cpuinit vsmp_init_secondary(void)
 {
 	extern int gic_present;
-
+	pr_debug("SMPMT: CPU%d: vsmp_init_secondary\n", smp_processor_id());
 	/* This is Malta specific: IPI,performance and timer inetrrupts */
 	if (gic_present)
 		change_c0_status(ST0_IM, STATUSF_IP3 | STATUSF_IP4 |
@@ -164,6 +164,8 @@ static void __cpuinit vsmp_init_secondary(void)
 
 static void __cpuinit vsmp_smp_finish(void)
 {
+	pr_debug("SMPMT: CPU%d: vsmp_smp_finish\n", smp_processor_id());
+
 	/* CDFIXME: remove this? */
 	write_c0_compare(read_c0_count() + (8* mips_hpt_frequency/HZ));
 
@@ -178,6 +180,7 @@ static void __cpuinit vsmp_smp_finish(void)
 
 static void vsmp_cpus_done(void)
 {
+	pr_debug("SMPMT: CPU%d: vsmp_cpus_done\n", smp_processor_id());
 }
 
 /*
@@ -191,6 +194,8 @@ static void vsmp_cpus_done(void)
 static void __cpuinit vsmp_boot_secondary(int cpu, struct task_struct *idle)
 {
 	struct thread_info *gp = task_thread_info(idle);
+	pr_debug("SMPMT: CPU%d: vsmp_boot_secondary cpu %d\n",
+		smp_processor_id(), cpu);
 	dvpe();
 	set_c0_mvpcontrol(MVPCONTROL_VPC);
 
@@ -232,6 +237,7 @@ static void __init vsmp_smp_setup(void)
 	unsigned int mvpconf0, ntc, tc, ncpu = 0;
 	unsigned int nvpe;
 
+	pr_debug("SMPMT: CPU%d: vsmp_smp_setup\n", smp_processor_id());
 #ifdef CONFIG_MIPS_MT_FPAFF
 	/* If we have an FPU, enroll ourselves in the FPU-full mask */
 	if (cpu_has_fpu)
@@ -272,6 +278,8 @@ static void __init vsmp_smp_setup(void)
 
 static void __init vsmp_prepare_cpus(unsigned int max_cpus)
 {
+	pr_debug("SMPMT: CPU%d: vsmp_prepare_cpus %d\n",
+		smp_processor_id(), max_cpus);
 	mips_mt_set_cpuoptions();
 }
 
#10 lore raw

PATCH 10/15 Port of GIC related changes from MTI branch.

In reply to Raghu Gandham

From: Chris Dearman <[email protected]>

---

 arch/mips/include/asm/gcmpregs.h |   18 ++--
 arch/mips/include/asm/gic.h      |  188 ++++----------------------------------
 arch/mips/kernel/irq-gic.c       |  116 +++++++++--------------
 arch/mips/mti-malta/malta-int.c  |   97 ++++++++++++--------
 arch/mips/mti-malta/malta-pci.c  |   14 ++-
 5 files changed, 142 insertions(+), 291 deletions(-)
arch/mips/include/asm/gcmpregs.h +12 -6
index 36fd969..c0cf76a 100644
@@ -19,15 +19,20 @@
 #define GCMP_GDB_OFS		0x8000 /* Global Debug Block */
 
 /* Offsets to individual GCMP registers from GCMP base */
-#define GCMPOFS(block, tag, reg)	(GCMP_##block##_OFS + GCMP_##tag##_##reg##_OFS)
+#define GCMPOFS(block, tag, reg)	\
+	(GCMP_##block##_OFS + GCMP_##tag##_##reg##_OFS)
+#define GCMPOFSn(block, tag, reg, n) \
+	(GCMP_##block##_OFS + GCMP_##tag##_##reg##_OFS(n))
 
 #define GCMPGCBOFS(reg)		GCMPOFS(GCB, GCB, reg)
+#define GCMPGCBOFSn(reg, n)	GCMPOFSn(GCB, GCB, reg, n)
 #define GCMPCLCBOFS(reg)	GCMPOFS(CLCB, CCB, reg)
 #define GCMPCOCBOFS(reg)	GCMPOFS(COCB, CCB, reg)
 #define GCMPGDBOFS(reg)		GCMPOFS(GDB, GDB, reg)
 
 /* GCMP register access */
 #define GCMPGCB(reg)			REGP(_gcmp_base, GCMPGCBOFS(reg))
+#define GCMPGCBn(reg, n)               REGP(_gcmp_base, GCMPGCBOFSn(reg, n))
 #define GCMPCLCB(reg)			REGP(_gcmp_base, GCMPCLCBOFS(reg))
 #define GCMPCOCB(reg)			REGP(_gcmp_base, GCMPCOCBOFS(reg))
 #define GCMPGDB(reg)			REGP(_gcmp_base, GCMPGDBOFS(reg))
@@ -49,10 +54,10 @@
 #define  GCMP_GCB_GCMPB_GCMPBASE_MSK	GCMPGCBMSK(GCMPB_GCMPBASE, 17)
 #define  GCMP_GCB_GCMPB_CMDEFTGT_SHF	0
 #define  GCMP_GCB_GCMPB_CMDEFTGT_MSK	GCMPGCBMSK(GCMPB_CMDEFTGT, 2)
-#define  GCMP_GCB_GCMPB_CMDEFTGT_MEM	0
-#define  GCMP_GCB_GCMPB_CMDEFTGT_MEM1	1
-#define  GCMP_GCB_GCMPB_CMDEFTGT_IOCU1 2
-#define  GCMP_GCB_GCMPB_CMDEFTGT_IOCU2 3
+#define  GCMP_GCB_GCMPB_CMDEFTGT_DISABLED	0
+#define  GCMP_GCB_GCMPB_CMDEFTGT_MEM		1
+#define  GCMP_GCB_GCMPB_CMDEFTGT_IOCU1		2
+#define  GCMP_GCB_GCMPB_CMDEFTGT_IOCU2		3
 #define GCMP_GCB_CCMC_OFS		0x0010	/* Global CM Control */
 #define GCMP_GCB_GCSRAP_OFS		0x0020	/* Global CSR Access Privilege */
 #define  GCMP_GCB_GCSRAP_CMACCESS_SHF	0
@@ -115,5 +120,6 @@
 #define GCMP_CCB_DBGGROUP_OFS		0x0100		/* DebugBreak Group */
 
 extern int __init gcmp_probe(unsigned long, unsigned long);
-
+extern int __init gcmp_niocu(void);
+extern void __init gcmp_setregion(int, unsigned long, unsigned long, int);
 #endif /* _ASM_GCMPREGS_H */
arch/mips/include/asm/gic.h +18 -170

246 lines not on this page · raw message

arch/mips/kernel/irq-gic.c +44 -72

213 lines not on this page · raw message

arch/mips/mti-malta/malta-int.c +57 -40

165 lines not on this page · raw message

arch/mips/mti-malta/malta-pci.c +11 -3
index b974319..25994e6 100644
@@ -27,7 +27,7 @@
 #include <linux/init.h>
 
 #include <asm/gt64120.h>
-
+#include <asm/gcmpregs.h>
 #include <asm/mips-boards/generic.h>
 #include <asm/mips-boards/bonito64.h>
 #include <asm/mips-boards/msc01_pci.h>
@@ -201,7 +201,11 @@ void __init mips_pcibios_init(void)
 		msc_mem_resource.start = start & mask;
 		msc_mem_resource.end = (start & mask) | ~mask;
 		msc_controller.mem_offset = (start & mask) - (map & mask);
-
+#ifdef CONFIG_MIPS_CMP
+		if (gcmp_niocu())
+			gcmp_setregion(0, start, mask,
+				GCMP_GCB_GCMPB_CMDEFTGT_IOCU1);
+#endif
 		MSC_READ(MSC01_PCI_SC2PIOBASL, start);
 		MSC_READ(MSC01_PCI_SC2PIOMSKL, mask);
 		MSC_READ(MSC01_PCI_SC2PIOMAPL, map);
@@ -209,7 +213,11 @@ void __init mips_pcibios_init(void)
 		msc_io_resource.end = (map & mask) | ~mask;
 		msc_controller.io_offset = 0;
 		ioport_resource.end = ~mask;
-
+#ifdef CONFIG_MIPS_CMP
+		if (gcmp_niocu())
+			gcmp_setregion(1, start, mask,
+				GCMP_GCB_GCMPB_CMDEFTGT_IOCU1);
+#endif
 		/* If ranges overlap I/O takes precedence.  */
 		start = start & mask;
 		end = start | ~mask;
#11 lore raw

PATCH 11/15 Add missing memory barriers for correct operation of amon_cpu_start

In reply to Raghu Gandham

From: Chris Dearman <[email protected]>

---

 arch/mips/mti-malta/malta-amon.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
arch/mips/mti-malta/malta-amon.c +4 -3
index df9e526..469d9b0 100644
@@ -70,11 +70,12 @@ void amon_cpu_start(int cpu,
 	launch->sp = sp;
 	launch->a0 = a0;
 
-	/* Make sure target sees parameters before the go bit */
-	smp_mb();
-
+	smp_wmb();              /* Target must see parameters before go */
 	launch->flags |= LAUNCH_FGO;
+	smp_wmb();              /* Target must see go before we poll  */
+
 	while ((launch->flags & LAUNCH_FGONE) == 0)
 		;
+	smp_rmb();      /* Target will be updating flags soon */
 	pr_debug("launch: cpu%d gone!\n", cpu);
 }
#12 lore raw

PATCH 12/15 Added coherentio command line option for DMA_NONCOHERENT kernel

In reply to Raghu Gandham

From: Chris Dearman <[email protected]>

---

 arch/mips/mti-malta/malta-setup.c |  100 +++++++++++++++++++++++++++++++++++++
 1 files changed, 100 insertions(+), 0 deletions(-)
arch/mips/mti-malta/malta-setup.c +100 -0
index 69f5f9c..3f52c31 100644
@@ -32,6 +32,7 @@
 #include <asm/mips-boards/maltaint.h>
 #include <asm/dma.h>
 #include <asm/traps.h>
+#include <asm/gcmpregs.h>
 #ifdef CONFIG_VT
 #include <linux/console.h>
 #endif
@@ -105,6 +106,103 @@ static void __init fd_activate(void)
 }
 #endif
 
+int coherentio = -1;
+static int __init setcoherentio(char *str)
+{
+	if (coherentio < 0)
+		pr_info("Command line checking done before"
+				" plat_setup_iocoherency!!\n");
+	if (coherentio == 0)
+		pr_info("Command line enabling coherentio"
+				" (this will break...)!!\n");
+
+	coherentio = 1;
+	pr_info("Hardware DMA cache coherency (command line)\n");
+	return 1;
+}
+__setup("coherentio", setcoherentio);
+
+static int __init setnocoherentio(char *str)
+{
+	if (coherentio < 0)
+		pr_info("Command line checking done before"
+				" plat_setup_iocoherency!!\n");
+	if (coherentio == 1)
+		pr_info("Command line disabling coherentio\n");
+
+	coherentio = 0;
+	pr_info("Software DMA cache coherency (command line)\n");
+	return 1;
+}
+__setup("nocoherentio", setnocoherentio);
+
+static int __init
+plat_enable_iocoherency(void)
+{
+	int supported = 0;
+	if (mips_revision_sconid == MIPS_REVISION_SCON_BONITO) {
+		if (BONITO_PCICACHECTRL & BONITO_PCICACHECTRL_CPUCOH_PRES) {
+			BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_CPUCOH_EN;
+			pr_info("Enabled Bonito CPU coherency\n");
+			supported = 1;
+		}
+		if (strstr(prom_getcmdline(), "iobcuncached")) {
+			BONITO_PCICACHECTRL &= ~BONITO_PCICACHECTRL_IOBCCOH_EN;
+			BONITO_PCIMEMBASECFG = BONITO_PCIMEMBASECFG &
+				~(BONITO_PCIMEMBASECFG_MEMBASE0_CACHED |
+				  BONITO_PCIMEMBASECFG_MEMBASE1_CACHED);
+			pr_info("Disabled Bonito IOBC coherency\n");
+		} else {
+			BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_IOBCCOH_EN;
+			BONITO_PCIMEMBASECFG |=
+				(BONITO_PCIMEMBASECFG_MEMBASE0_CACHED |
+				 BONITO_PCIMEMBASECFG_MEMBASE1_CACHED);
+			pr_info("Enabled Bonito IOBC coherency\n");
+		}
+	} else if (gcmp_niocu() != 0) {
+		/* Nothing special needs to be done to enable coherency */
+		pr_info("CMP IOCU detected\n");
+		if ((*(unsigned int *)0xbf403000 & 0x81) != 0x81) {
+			pr_crit("IOCU OPERATION DISABLED BY SWITCH"
+				" - DEFAULTING TO SW IO COHERENCY\n");
+			return 0;
+		}
+		supported = 1;
+	}
+	return supported;
+}
+
+static void __init
+plat_setup_iocoherency(void)
+{
+#ifdef CONFIG_DMA_NONCOHERENT
+	/*
+	 * Kernel has been configured with software coherency
+	 * but we might choose to turn it off
+	 */
+	if (plat_enable_iocoherency()) {
+		if (coherentio == 0)
+			pr_info("Hardware DMA cache coherency supported"
+					" but disabled from command line\n");
+		else {
+			coherentio = 1;
+			printk(KERN_INFO "Hardware DMA cache coherency\n");
+		}
+	} else {
+		if (coherentio == 1)
+			pr_info("Hardware DMA cache coherency not supported"
+				" but enabled from command line\n");
+		else {
+			coherentio = 0;
+			pr_info("Software DMA cache coherency\n");
+		}
+	}
+#else
+	if (!plat_enable_iocoherency())
+		panic("Hardware DMA cache coherency not supported");
+#endif
+}
+
 #ifdef CONFIG_BLK_DEV_IDE
 static void __init pci_clock_check(void)
 {
@@ -207,6 +305,8 @@ void __init plat_mem_setup(void)
 	if (mips_revision_sconid == MIPS_REVISION_SCON_BONITO)
 		bonito_quirks_setup();
 
+	plat_setup_iocoherency();
+
 #ifdef CONFIG_BLK_DEV_IDE
 	pci_clock_check();
 #endif
#13 lore raw

PATCH 13/15 Avoid accessing GCMP registers when they are not present

In reply to Raghu Gandham

From: Jaidev Patwardhan <[email protected]>

---

 arch/mips/mti-malta/malta-int.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
arch/mips/mti-malta/malta-int.c +13 -3
index 92e3b56..63e7161 100644
@@ -413,6 +413,11 @@ static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = {
  */
 int __init gcmp_probe(unsigned long addr, unsigned long size)
 {
+	if (mips_revision_sconid != MIPS_REVISION_SCON_ROCIT) {
+		gcmp_present = 0;
+		return gcmp_present;
+	}
+
 	if (gcmp_present >= 0)
 		return gcmp_present;
 
@@ -481,9 +486,14 @@ void __init arch_init_irq(void)
 		GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK;
 		gic_present = 1;
 	} else {
-		_msc01_biu_base = (unsigned long) ioremap_nocache(MSC01_BIU_REG_BASE, MSC01_BIU_ADDRSPACE_SZ);
-		gic_present = (REG(_msc01_biu_base, MSC01_SC_CFG) &
-		MSC01_SC_CFG_GICPRES_MSK) >> MSC01_SC_CFG_GICPRES_SHF;
+		if (mips_revision_sconid == MIPS_REVISION_SCON_ROCIT) {
+			_msc01_biu_base = (unsigned long)
+					ioremap_nocache(MSC01_BIU_REG_BASE,
+						MSC01_BIU_ADDRSPACE_SZ);
+			gic_present = (REG(_msc01_biu_base, MSC01_SC_CFG) &
+					MSC01_SC_CFG_GICPRES_MSK) >>
+					MSC01_SC_CFG_GICPRES_SHF;
+		}
 	}
 	if (gic_present)
 		pr_debug("GIC present\n");
#14 lore raw

PATCH 14/15 Avoid queing multiple reschedule IPI's in SMTC

In reply to Raghu Gandham

From: Jaidev Patwardhan <[email protected]>

---

 arch/mips/include/asm/smtc_ipi.h |    5 +++--
 arch/mips/kernel/smtc.c          |   33 +++++++++++++++++++++++++++++----
 2 files changed, 32 insertions(+), 6 deletions(-)
arch/mips/include/asm/smtc_ipi.h +3 -2
index 8ce5175..832b8be 100644
@@ -23,8 +23,8 @@ struct smtc_ipi {
 	void *arg;
 	int dest;
 #ifdef	SMTC_IPI_DEBUG
-	int sender;
-	long stamp;
+	unsigned sender;
+	unsigned long long stamp;
 #endif /* SMTC_IPI_DEBUG */
 };
 
@@ -45,6 +45,7 @@ struct smtc_ipi_q {
 	spinlock_t lock;
 	struct smtc_ipi *tail;
 	int depth;
+	int resched_flag;	/* reschedule already queued */
 };
 
 static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p)
arch/mips/kernel/smtc.c +29 -4
index 8a0626c..69240c4 100644
@@ -75,7 +75,6 @@ unsigned long irq_hwmask[NR_IRQS];
 
 asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
 
-
 /*
  * Number of InterProcessor Interrupt (IPI) message buffers to allocate
  */
@@ -388,6 +387,7 @@ void smtc_prepare_cpus(int cpus)
 		IPIQ[i].head = IPIQ[i].tail = NULL;
 		spin_lock_init(&IPIQ[i].lock);
 		IPIQ[i].depth = 0;
+		IPIQ[i].resched_flag = 0; /* No reschedules queued initially */
 	}
 
 	/* cpu_data index starts at zero */
@@ -738,11 +738,24 @@ void smtc_forward_irq(unsigned int irq)
 static void smtc_ipi_qdump(void)
 {
 	int i;
+	struct smtc_ipi *temp;
 
 	for (i = 0; i < NR_CPUS ;i++) {
-		printk("IPIQ[%d]: head = 0x%x, tail = 0x%x, depth = %d\n",
+		pr_info("IPIQ[%d]: head = 0x%x, tail = 0x%x, depth = %d\n",
 			i, (unsigned)IPIQ[i].head, (unsigned)IPIQ[i].tail,
 			IPIQ[i].depth);
+		temp = IPIQ[i].head;
+
+		while (temp != IPIQ[i].tail) {
+			pr_debug("%d %d %d: ", temp->type, temp->dest,
+			       (int)temp->arg);
+#ifdef	SMTC_IPI_DEBUG
+		    pr_debug("%u %lu\n", temp->sender, temp->stamp);
+#else
+		    pr_debug("\n");
+#endif
+		    temp = temp->flink;
+		}
 	}
 }
 
@@ -781,11 +794,15 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
 	int mtflags;
 	unsigned long tcrestart;
 	extern void r4k_wait_irqoff(void), __pastwait(void);
+	int set_resched_flag = (type == LINUX_SMP_IPI &&
+				action == SMP_RESCHEDULE_YOURSELF);
 
 	if (cpu == smp_processor_id()) {
 		printk("Cannot Send IPI to self!\n");
 		return;
 	}
+	if (set_resched_flag && IPIQ[cpu].resched_flag != 0)
+		return; /* There is a reschedule queued already */
 	/* Set up a descriptor, to be delivered either promptly or queued */
 	pipi = smtc_ipi_dq(&freeIPIq);
 	if (pipi == NULL) {
@@ -798,6 +815,7 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
 	pipi->dest = cpu;
 	if (cpu_data[cpu].vpe_id != cpu_data[smp_processor_id()].vpe_id) {
 		/* If not on same VPE, enqueue and send cross-VPE interrupt */
+		IPIQ[cpu].resched_flag |= set_resched_flag;
 		smtc_ipi_nq(&IPIQ[cpu], pipi);
 		LOCK_CORE_PRA();
 		settc(cpu_data[cpu].tc_id);
@@ -844,6 +862,7 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
 			 */
 			write_tc_c0_tchalt(0);
 			UNLOCK_CORE_PRA();
+			IPIQ[cpu].resched_flag |= set_resched_flag;
 			smtc_ipi_nq(&IPIQ[cpu], pipi);
 		} else {
 postdirect:
@@ -993,12 +1012,15 @@ void deferred_smtc_ipi(void)
 		 * already enabled.
 		 */
 		local_irq_save(flags);
-
 		spin_lock(&q->lock);
 		pipi = __smtc_ipi_dq(q);
 		spin_unlock(&q->lock);
-		if (pipi != NULL)
+		if (pipi != NULL) {
+			if (pipi->type == LINUX_SMP_IPI &&
+			    (int)pipi->arg == SMP_RESCHEDULE_YOURSELF)
+				IPIQ[q].resched_flag = 0;
 			ipi_decode(pipi);
+		}
 		/*
 		 * The use of the __raw_local restore isn't
 		 * as obviously necessary here as in smtc_ipi_replay(),
@@ -1079,6 +1101,9 @@ static irqreturn_t ipi_interrupt(int irq, void *dev_idm)
 				 * with interrupts off
 				 */
 				local_irq_save(flags);
+				if (pipi->type == LINUX_SMP_IPI &&
+				    (int)pipi->arg == SMP_RESCHEDULE_YOURSELF)
+					IPIQ[cpu].resched_flag = 0;
 				ipi_decode(pipi);
 				local_irq_restore(flags);
 			}
#15 lore raw

PATCH 15/15 Do not rely on the initial state of TC/VPE bindings when doing cross VPE writes

In reply to Raghu Gandham

From: Kurt Martin <[email protected]>

---

 arch/mips/kernel/smtc.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
arch/mips/kernel/smtc.c +12 -0
index 69240c4..3498b82 100644
@@ -481,6 +481,18 @@ void smtc_prepare_cpus(int cpus)
 			 */
 			if (tc != 0) {
 				smtc_tc_setup(vpe, tc, cpu);
+				if (vpe != 0) {
+					/*
+					 * Set MVP bit (possibly again).  Do it
+					 * here to catch CPUs that have no TCs
+					 * bound to the VPE at reset.  In that
+					 * case, a TC must be bound to the VPE
+					 * before we can set VPEControl[MVP]
+					 */
+					write_vpe_c0_vpeconf0(
+						read_vpe_c0_vpeconf0() |
+						VPECONF0_MVP);
+				}
 				cpu++;
 			}
 			printk(" %d", tc);
#16 lore raw

Re: [PATCH 15/15] Do not rely on the initial state of TC/VPE bindings when doing cross VPE writes

Note that, regardless of the reset state, smtc_configure_tlb() should have at least temporarily bound TC 1 to VPE1, which may be why this never seemed to be a problem on the 34K. If one wants to support designs with more than 2 VPEs, then this is probably one of the things that needs to be fixed. That having been said, rather than adding a usually-redundant write_vpe_c0_vpeconf0() in that clause, wouldn't it be cleaner to just move the MVP setting from the top of the loop to the point in the loop just after the TCs have been bound to the VPE in question, i.e.,

454 if (slop) {
455 if (tc != 0) {
456 smtc_tc_setup(vpe,tc, cpu);
457 cpu++;

458                         }
459                         printk(" %d", tc);
460                         tc++;
461                         slop--;

462 }

                       write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | 

VPECONF0_MVP);

463 if (vpe != 0) {
464 /*
465 * Clear any stale software interrupts from VPE's Cause
466 */

This should definitely be OK for a 34K, because it's being executed by TC0 in VPE0 and the reset state of VPE0 has MVP set. If it weren't, smtc_configure_tlb() would have failed.

Regards,

Kevin K.

Quoted 35 lines · Raghu Gandham

From: Kurt Martin <[email protected]>

---

 arch/mips/kernel/smtc.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
arch/mips/kernel/smtc.c +12 -0
index 69240c4..3498b82 100644
@@ -481,6 +481,18 @@ void smtc_prepare_cpus(int cpus)
 			 */
 			if (tc != 0) {
 				smtc_tc_setup(vpe, tc, cpu);
+				if (vpe != 0) {
+					/*
+					 * Set MVP bit (possibly again).  Do it
+					 * here to catch CPUs that have no TCs
+					 * bound to the VPE at reset.  In that
+					 * case, a TC must be bound to the VPE
+					 * before we can set VPEControl[MVP]
+					 */
+					write_vpe_c0_vpeconf0(
+						read_vpe_c0_vpeconf0() |
+						VPECONF0_MVP);
+				}
 				cpu++;
 			}
 			printk(" %d", tc);
#17 lore raw

RE: [PATCH 15/15] Do not rely on the initial state of TC/VPE bindings when doing cross VPE writes

Quoted 10 lines

-----Original Message-----
From: Kevin D. Kissell [mailto:[email protected]]
Sent: Wednesday, July 01, 2009 9:02 PM
To: Gandham, Raghu
Cc: [email protected]; Dearman, Chris
Subject: Re: [PATCH 15/15] Do not rely on the initial state of TC/VPE bindings when doing cross VPE writes

Quoted 6 lines

Note that, regardless of the reset state, smtc_configure_tlb() should have at least temporarily bound TC 1 to VPE1, which may be why this never seemed to be a problem on the 34K. If one wants to support designs with more than 2 VPEs, then this is probably one of the things that needs to be fixed. That having been said, rather than adding a usually-redundant write_vpe_c0_vpeconf0() in that clause, wouldn't it

be

Quoted 12 lines

cleaner to just move the MVP setting from the top of the loop to the point in the loop just after the TCs have been bound to the VPE in question, i.e.,

454 if (slop) {
455 if (tc != 0) {
456 smtc_tc_setup(vpe,tc, cpu);
457 cpu++;

 458                         }
 459                         printk(" %d", tc);
 460                         tc++;
 461                         slop--;
Quoted 8 lines

462 }

                        write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() |

VPECONF0_MVP);

463 if (vpe != 0) {
464 /*
465 * Clear any stale software interrupts

from

Quoted 10 lines

VPE's Cause
466 */

This should definitely be OK for a 34K, because it's being executed by TC0 in VPE0 and the reset state of VPE0 has MVP set. If it weren't, smtc_configure_tlb() would have failed.

Regards,

Kevin K.

I will resend this patch with your suggestion.

Thanks,
Raghu

Quoted 11 lines
Quoted 9 lines · Raghu Gandham

From: Kurt Martin <[email protected]>

---

 arch/mips/kernel/smtc.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
Quoted 11 lines

arch/mips/kernel/smtc.c void smtc_prepare_cpus(int cpus) · line 486

Quoted 11 lines
arch/mips/kernel/smtc.c +3 -0
index 69240c4..3498b82 100644
@@ -481,6 +481,18 @@ void smtc_prepare_cpus(int cpus)
 			 */
 			if (tc != 0) {
 				smtc_tc_setup(vpe, tc, cpu);
+				if (vpe != 0) {
+					/*
+					 * Set MVP bit (possibly again).

Do it

Quoted 1 line

arch/mips/kernel/smtc.c void smtc_prepare_cpus(int cpus) · line 487

Quoted 1 line
arch/mips/kernel/smtc.c +1 -0
+					 * here to catch CPUs that have

no TCs

Quoted 1 line

arch/mips/kernel/smtc.c void smtc_prepare_cpus(int cpus) · line 488

Quoted 1 line
arch/mips/kernel/smtc.c +1 -0
+					 * bound to the VPE at reset.

In that

Quoted 1 line

arch/mips/kernel/smtc.c void smtc_prepare_cpus(int cpus) · line 489

Quoted 1 line
arch/mips/kernel/smtc.c +1 -0
+					 * case, a TC must be bound to

the VPE

Quoted 1 line

arch/mips/kernel/smtc.c void smtc_prepare_cpus(int cpus) · line 490

Quoted 1 line
arch/mips/kernel/smtc.c +1 -0
+					 * before we can set

VPEControl[MVP]

Quoted 11 lines
Quoted 11 lines
arch/mips/kernel/smtc.c +5 -0
+					 */
+					write_vpe_c0_vpeconf0(
+						read_vpe_c0_vpeconf0() |
+						VPECONF0_MVP);
+				}
 				cpu++;
 			}
 			printk(" %d", tc);
#18 lore raw

Re: [PATCH 15/15] Do not rely on the initial state of TC/VPE bindings when doing cross VPE writes

Quoted 50 lines · Raghu
Quoted 9 lines

-----Original Message-----
From: Kevin D. Kissell [mailto:[email protected]]
Sent: Wednesday, July 01, 2009 9:02 PM
To: Gandham, Raghu
Cc: [email protected]; Dearman, Chris
Subject: Re: [PATCH 15/15] Do not rely on the initial state of TC/VPE bindings when doing cross VPE writes

Quoted 7 lines

Note that, regardless of the reset state, smtc_configure_tlb() should have at least temporarily bound TC 1 to VPE1, which may be why this never seemed to be a problem on the 34K. If one wants to support designs with more than 2 VPEs, then this is probably one of the things that needs to be fixed. That having been said, rather than adding a usually-redundant write_vpe_c0_vpeconf0() in that clause, wouldn't it

be

Quoted 12 lines

cleaner to just move the MVP setting from the top of the loop to the point in the loop just after the TCs have been bound to the VPE in question, i.e.,

454 if (slop) {
455 if (tc != 0) {
456 smtc_tc_setup(vpe,tc, cpu);
457 cpu++;

 458                         }
 459                         printk(" %d", tc);
 460                         tc++;
 461                         slop--;
Quoted 9 lines

462 }

                        write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() |

VPECONF0_MVP);

463 if (vpe != 0) {
464 /*
465 * Clear any stale software interrupts

from

Quoted 9 lines

VPE's Cause
466 */

This should definitely be OK for a 34K, because it's being executed by TC0 in VPE0 and the reset state of VPE0 has MVP set. If it weren't, smtc_configure_tlb() would have failed.

Regards,

Quoted 9 lines
Quoted 2 lines

Kevin K.

I will resend this patch with your suggestion.

Thanks,
Raghu

Just make sure it works, first! ;o) I'm thousands of miles away from my build/test systems.

Regards,

Kevn K.

#19 lore raw

Re: [PATCH 15/15] Do not rely on the initial state of TC/VPE bindings when doing cross VPE writes

In reply to Gandham, Raghu
Quoted 42 lines · Raghu
Quoted 7 lines

From: Kevin D. Kissell [mailto:[email protected]]
Sent: Wednesday, July 01, 2009 9:02 PM
To: Gandham, Raghu
Cc: [email protected]; Dearman, Chris
Subject: Re: [PATCH 15/15] Do not rely on the initial state of TC/VPE bindings when doing cross VPE writes

Quoted 6 lines

Note that, regardless of the reset state, smtc_configure_tlb() should have at least temporarily bound TC 1 to VPE1, which may be why this never seemed to be a problem on the 34K. If one wants to support designs with more than 2 VPEs, then this is probably one of the things that needs to be fixed. That having been said, rather than adding a usually-redundant write_vpe_c0_vpeconf0() in that clause, wouldn't it

be

Quoted 12 lines

cleaner to just move the MVP setting from the top of the loop to the point in the loop just after the TCs have been bound to the VPE in question, i.e.,

454 if (slop) {
455 if (tc != 0) {
456 smtc_tc_setup(vpe,tc, cpu);
457 cpu++;

 458                         }
 459                         printk(" %d", tc);
 460                         tc++;
 461                         slop--;
Quoted 8 lines

462 }

                        write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() |

VPECONF0_MVP);

463 if (vpe != 0) {
464 /*
465 * Clear any stale software interrupts

from

Quoted 7 lines

VPE's Cause
466 */

This should definitely be OK for a 34K, because it's being executed by TC0 in VPE0 and the reset state of VPE0 has MVP set. If it weren't, smtc_configure_tlb() would have failed.

Quoted 6 lines
Quoted 3 lines

Regards,

Kevin K.

I will resend this patch with your suggestion.

Ping? Don't think I ever received that, if you sent it.

Ralf

#20 lore raw

RE: [PATCH 15/15] Do not rely on the initial state of TC/VPEbindings when doing cross VPE writes

Quoted 63 lines

-----Original Message-----
From: Ralf Baechle [mailto:[email protected]]
Sent: Monday, October 12, 2009 9:18 AM
To: Gandham, Raghu
Cc: Kevin D. Kissell; [email protected]; Dearman, Chris
Subject: Re: [PATCH 15/15] Do not rely on the initial state of TC/VPEbindings when doing cross VPE writes

Quoted 10 lines · Raghu
Quoted 10 lines

From: Kevin D. Kissell [mailto:[email protected]]
Sent: Wednesday, July 01, 2009 9:02 PM
To: Gandham, Raghu
Cc: [email protected]; Dearman, Chris
Subject: Re: [PATCH 15/15] Do not rely on the initial state of TC/VPE bindings when doing cross VPE writes

Note that, regardless of the reset state, smtc_configure_tlb() should have at least temporarily bound TC 1 to VPE1, which may be why this never seemed to be a problem on the 34K. If one

wants to

Quoted 1 line
Quoted 1 line

support designs with more than 2 VPEs, then this is

probably one of

Quoted 5 lines
Quoted 3 lines

the things that needs to be fixed. That having been said, rather than adding a usually-redundant write_vpe_c0_vpeconf0() in that clause, wouldn't it

be

Quoted 1 line

cleaner to just move the MVP setting from the top of the

loop to the

Quoted 1 line
Quoted 1 line

point in the loop just after the TCs have been bound to

the VPE in

Quoted 13 lines
Quoted 6 lines

question, i.e.,

454 if (slop) {
455 if (tc != 0) {
456 smtc_tc_setup(vpe,tc, cpu);
457 cpu++;

Quoted 7 lines
 458                         }
 459                         printk(" %d", tc);
 460                         tc++;
 461                         slop--;

462 }

write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0()

Quoted 5 lines
Quoted 5 lines

| VPECONF0_MVP);

463 if (vpe != 0) {
464 /*
465 * Clear any stale software

interrupts

Quoted 5 lines

from

Quoted 4 lines

VPE's Cause
466 */

This should definitely be OK for a 34K, because it's

being executed

Quoted 4 lines
Quoted 4 lines

by TC0 in VPE0 and the reset state of VPE0 has MVP set. If it weren't,
smtc_configure_tlb() would have failed.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Regards,

Kevin K.

I will resend this patch with your suggestion.

Ping? Don't think I ever received that, if you sent it.

I resent the patch and it got checked-in. It is not appended to this mail thread though.
http://www.linux-mips.org/git?p=linux.git;a=commitdiff;h=d8e5f9fe5dab0e0
7985f2456cb6cc57788f53131

Thanks,
Raghu

Quoted 3 lines

Ralf

#21 lore raw

Re: [PATCH 15/15] Do not rely on the initial state of TC/VPEbindings when doing cross VPE writes

Quoted 66 lines · Raghu
Quoted 66 lines

-----Original Message-----
From: Ralf Baechle [mailto:[email protected]]
Sent: Monday, October 12, 2009 9:18 AM
To: Gandham, Raghu
Cc: Kevin D. Kissell; [email protected]; Dearman, Chris
Subject: Re: [PATCH 15/15] Do not rely on the initial state of TC/VPEbindings when doing cross VPE writes

Quoted 10 lines · Raghu
Quoted 10 lines

From: Kevin D. Kissell [mailto:[email protected]]
Sent: Wednesday, July 01, 2009 9:02 PM
To: Gandham, Raghu
Cc: [email protected]; Dearman, Chris
Subject: Re: [PATCH 15/15] Do not rely on the initial state of TC/VPE bindings when doing cross VPE writes

Note that, regardless of the reset state, smtc_configure_tlb() should have at least temporarily bound TC 1 to VPE1, which may be why this never seemed to be a problem on the 34K. If one

wants to

Quoted 1 line
Quoted 1 line

support designs with more than 2 VPEs, then this is

probably one of

Quoted 5 lines
Quoted 3 lines

the things that needs to be fixed. That having been said, rather than adding a usually-redundant write_vpe_c0_vpeconf0() in that clause, wouldn't it

be

Quoted 1 line

cleaner to just move the MVP setting from the top of the

loop to the

Quoted 1 line
Quoted 1 line

point in the loop just after the TCs have been bound to

the VPE in

Quoted 13 lines
Quoted 6 lines

question, i.e.,

454 if (slop) {
455 if (tc != 0) {
456 smtc_tc_setup(vpe,tc, cpu);
457 cpu++;

Quoted 7 lines
 458                         }
 459                         printk(" %d", tc);
 460                         tc++;
 461                         slop--;

462 }

write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0()

Quoted 5 lines
Quoted 5 lines

| VPECONF0_MVP);

463 if (vpe != 0) {
464 /*
465 * Clear any stale software

interrupts

Quoted 5 lines

from

Quoted 4 lines

VPE's Cause
466 */

This should definitely be OK for a 34K, because it's

being executed

Quoted 9 lines
Quoted 7 lines

by TC0 in VPE0 and the reset state of VPE0 has MVP set. If it weren't,
smtc_configure_tlb() would have failed.

Regards,

Kevin K.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

I will resend this patch with your suggestion.

Ping? Don't think I ever received that, if you sent it.

I resent the patch and it got checked-in. It is not appended to this mail thread though.
http://www.linux-mips.org/git?p=linux.git;a=commitdiff;h=d8e5f9fe5dab0e0
7985f2456cb6cc57788f53131

Ah, ok. Thanks!

Ralf

#22 lore raw
In reply to Raghu Gandham
Quoted 54 lines

The following series of patches port the changes in linux-mti.git repository to the head of tree.
---

Chris Dearman (9):
Added coherentio command line option for DMA_NONCOHERENT kernel Add missing memory barriers for correct operation of
amon_cpu_start
Port of GIC related changes from MTI branch.
Add debug prints during CPU intialization.
APRP Patch04: Propagate final value of max_low_pfn to max_pfn [MTI] Enable PIIX4 PCI2.1 compliancy on Malta
[MTI] MIPS secondary cache supports 64 byte line size. Fix accesses to device registers on MIPS boards [MTI] Clean up SPRAM support a little

Jaidev Patwardhan (2):
Avoid queing multiple reschedule IPI's in SMTC Avoid accessing GCMP registers when they are not present

Kurt Martin (1):
Do not rely on the initial state of TC/VPE bindings
when doing cross VPE writes

Raghu Gandham (1):
Fix compiler warning in vpe.c

Robin Randhawa (2):
Fix absd emulation
Due to some broken bitfiles, we can't trust IntCtl

 arch/mips/Kconfig                 |    1 
 arch/mips/include/asm/gcmpregs.h  |   18 ++--
 arch/mips/include/asm/gic.h       |  188 
++++---------------------------------
 arch/mips/include/asm/irq.h       |    1 
 arch/mips/include/asm/smtc_ipi.h  |    5 +
 arch/mips/include/asm/spram.h     |   10 ++
 arch/mips/kernel/cpu-probe.c      |    8 --
 arch/mips/kernel/irq-gic.c        |  116 +++++++++--------------
 arch/mips/kernel/setup.c          |    3 -
 arch/mips/kernel/smp-mt.c         |   10 ++
 arch/mips/kernel/smtc.c           |   45 ++++++++-
 arch/mips/kernel/spram.c          |    5 -
 arch/mips/kernel/traps.c          |    4 +
 arch/mips/kernel/vpe.c            |    3 -
 arch/mips/math-emu/dp_simple.c    |   11 +-
 arch/mips/math-emu/sp_simple.c    |    3 -
 arch/mips/mti-malta/malta-amon.c  |    7 +
 arch/mips/mti-malta/malta-int.c   |  115 ++++++++++++++---------
 arch/mips/mti-malta/malta-pci.c   |   14 ++-
 arch/mips/mti-malta/malta-setup.c |  111 
Quoted 2 lines

++++++++++++++++++++++ 20 files changed, 351 insertions(+), 327 deletions(-) create mode 100644 arch/mips/include/asm/spram.h

I am resending the series as smaller patches after fixing a couple of typos.

Thanks,
Raghu