Skip to contentSkip to conversation

MIPS: Fixup of the r4k timer

PATCH In review Wu Zhangjin 5 participants 7 messages Feb 1, 2010 – Feb 3, 2010 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: Fixup of the r4k timer

From: Wu Zhangjin <[email protected]>

As reported by Maxime Bizon, the commit "MIPS: PowerTV: Fix support for timer interrupts with > 64 external IRQs" have broken the r4k timer since it didn't initialize the cp0_compare_irq_shift variable used in c0_compare_int_pending() on the architectures whose cpu_has_mips_r2 is false.

This patch fixes it via initializing the cp0_compare_irq_shift as the cp0_compare_irq used in the old c0_compare_int_pending().

---
 arch/mips/kernel/traps.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/mips/kernel/traps.c +1 -0
index 338dfe8..31b204b 100644
@@ -1501,6 +1501,7 @@ void __cpuinit per_cpu_trap_init(void)
 			cp0_perfcount_irq = -1;
 	} else {
 		cp0_compare_irq = CP0_LEGACY_COMPARE_IRQ;
+		cp0_compare_irq_shift = cp0_compare_irq;
 		cp0_perfcount_irq = -1;
 	}
 
Signature · 1 line
1.6.6
Tested-by on v1 1/1
#1 lore raw
Quoted 9 lines · Wu Zhangjin

From: Wu Zhangjin <[email protected]>

As reported by Maxime Bizon, the commit "MIPS: PowerTV: Fix support for timer interrupts with > 64 external IRQs" have broken the r4k timer since it didn't initialize the cp0_compare_irq_shift variable used in c0_compare_int_pending() on the architectures whose cpu_has_mips_r2 is false.

Quoted 5 lines

This patch fixes it via initializing the cp0_compare_irq_shift as the cp0_compare_irq used in the old c0_compare_int_pending().

When applied to 2.6.33-rc6, this patch fixes the problem on my RM7035C-based system.

#2 lore raw
Quoted 13 lines · Shane McDonald
Quoted 12 lines · Wu Zhangjin

From: Wu Zhangjin <[email protected]>

As reported by Maxime Bizon, the commit "MIPS: PowerTV: Fix support for timer interrupts with > 64 external IRQs" have broken the r4k timer since it didn't initialize the cp0_compare_irq_shift variable used in c0_compare_int_pending() on the architectures whose cpu_has_mips_r2 is false.

This patch fixes it via initializing the cp0_compare_irq_shift as the cp0_compare_irq used in the old c0_compare_int_pending().

Quoted 7 lines
Quoted 2 lines

When applied to 2.6.33-rc6, this patch fixes the problem on my RM7035C-based system.

Thanks folks, applied.

Ralf

#4 lore raw

Re: Cached Base address difference.

Quoted 7 lines · Anoop P.A.

I am seeing a address conflict in asm-generic/spaces.h . in spaces.h ( 64 bit)CAC_BASE has been defined as 0x9800000000000000 however see mips run says it is 0x9000000000000000
http://books.google.co.in/books?id=kk8G2gK4Tw8C&lpg=PP1&dq=see%20mips%20
run&pg=PA51#v=onepage&q=&f=false

Is this intentional?

<asm/mach-generic/spaces.h> defines:

#ifndef CAC_BASE
#ifdef CONFIG_DMA_NONCOHERENT
#define CAC_BASE _AC(0x9800000000000000, UL)
#else
#define CAC_BASE _AC(0xa800000000000000, UL)
#endif
#endif

No 0x9000000000000000 anywhere - and it would be wrong because it stands for uncached.

Ralf

#5 lore raw

RE: Cached Base address difference.

Hi Ralf,

I am sorry if it is not clear from my last mail.

What I want to convey is,

"See MIPS Run" explains "window on physical memory (cached)" will start @ 0x9000_0000_0000_0000.

You can see "See MIPS Run" page under suspect from this link
http://books.google.co.in/books?id=kk8G2gK4Tw8C&lpg=PP1&dq=see%20mips%20
run&pg=PA51#v=onepage&q=&f=false

How ever as you mentioned Linux source defines CAC_BASE 0x98000000_00000000

Thanks
Anoop

Quoted 10 lines

-----Original Message-----
From: Ralf Baechle [mailto:[email protected]]
Sent: Wednesday, February 03, 2010 6:04 PM
To: Anoop P.A.
Cc: [email protected]
Subject: Re: Cached Base address difference.

Quoted 1 line · Anoop P.A.

I am seeing a address conflict in asm-generic/spaces.h . in

spaces.h (

Quoted 1 line
Quoted 1 line

64 bit)CAC_BASE has been defined as 0x9800000000000000 however see

mips

Quoted 2 lines
Quoted 2 lines

run says it is 0x9000000000000000

http://books.google.co.in/books?id=kk8G2gK4Tw8C&lpg=PP1&dq=see%20mips%20

Quoted 14 lines
Quoted 3 lines

run&pg=PA51#v=onepage&q=&f=false

Is this intentional?

<asm/mach-generic/spaces.h> defines:

#ifndef CAC_BASE
#ifdef CONFIG_DMA_NONCOHERENT
#define CAC_BASE _AC(0x9800000000000000, UL)
#else
#define CAC_BASE _AC(0xa800000000000000, UL)
#endif
#endif

Quoted 1 line

No 0x9000000000000000 anywhere - and it would be wrong because it

stands

Quoted 3 lines

for uncached.

Ralf

#6 lore raw

Re: Cached Base address difference.

Quoted 9 lines · Anoop P.A.

Hi Ralf,

I am sorry if it is not clear from my last mail.

What I want to convey is,

"See MIPS Run" explains "window on physical memory (cached)" will start @ 0x9000_0000_0000_0000.

Quoted 6 lines

You can see "See MIPS Run" page under suspect from this link
http://books.google.co.in/books?id=kk8G2gK4Tw8C&lpg=PP1&dq=see%20mips%20
run&pg=PA51#v=onepage&q=&f=false

How ever as you mentioned Linux source defines CAC_BASE 0x98000000_00000000

The Linux header file is correct; the cached and uncached regions are swapped in the "See MIPS Run" diagram.

The full MIPS64 memory map is documented in Volume III of the architecture manual which you can download from http://www.mips.com/products/architectures/mips64/

Chris

Signature · 2 lines
Chris Dearman               Desk: +1 408 530 5092  Cell: +1 408 398 5531
MIPS Technologies Inc            955 East Arques Ave, Sunnyvale CA 94085