Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Indy R4000PC problems
@ 2004-02-02 16:07 Markus Dahms
  2004-02-05 17:49 ` Steven J. Hill
  2004-02-05 17:51 ` Ralf Baechle
  0 siblings, 2 replies; 6+ messages in thread
From: Markus Dahms @ 2004-02-02 16:07 UTC (permalink / raw)
  To: linux-mips

Hi,

I had problems getting the 2.4 kernel to work on an Indy with
a R4000PC (100MHz) processor (very old PROM, too).
The solution I found yesterday is to change an entry in
arch/mips/kernel/cpu-probe.c from CPU_R4000SC to CPU_R4000PC.
Is there a reason why only the SC version is thought to be
there, or is it believed to be compatible?
Without this change the machine locks up after loading the
kernel, linux hasn't switched to the black background, yet.

I also changed the compiler flags from -m{arch,tune}=r4600 to
*r4000, but this I also tried before without success.

greetings,

	Markus Dahms

-- 
A bug in the code is worth two in the documentation.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Indy R4000PC problems
  2004-02-02 16:07 Indy R4000PC problems Markus Dahms
@ 2004-02-05 17:49 ` Steven J. Hill
  2004-02-05 17:51 ` Ralf Baechle
  1 sibling, 0 replies; 6+ messages in thread
From: Steven J. Hill @ 2004-02-05 17:49 UTC (permalink / raw)
  To: Markus Dahms; +Cc: linux-mips

Markus Dahms wrote:
> 
> I had problems getting the 2.4 kernel to work on an Indy with
> a R4000PC (100MHz) processor (very old PROM, too).
> The solution I found yesterday is to change an entry in
> arch/mips/kernel/cpu-probe.c from CPU_R4000SC to CPU_R4000PC.
> Is there a reason why only the SC version is thought to be
> there, or is it believed to be compatible?
>
The SC stands for secondary cache. So one would expect that if
your Indy only has a primary cache (PC) and you are detecting
as an Indy with SC, you will crash since there is no secondary
cache.

-Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Indy R4000PC problems
  2004-02-02 16:07 Indy R4000PC problems Markus Dahms
  2004-02-05 17:49 ` Steven J. Hill
@ 2004-02-05 17:51 ` Ralf Baechle
  2004-02-05 18:10   ` Ralf Baechle
  2004-02-06 10:21   ` Markus Dahms
  1 sibling, 2 replies; 6+ messages in thread
From: Ralf Baechle @ 2004-02-05 17:51 UTC (permalink / raw)
  To: Markus Dahms; +Cc: linux-mips

On Mon, Feb 02, 2004 at 05:07:29PM +0100, Markus Dahms wrote:

> I had problems getting the 2.4 kernel to work on an Indy with
> a R4000PC (100MHz) processor (very old PROM, too).
> The solution I found yesterday is to change an entry in
> arch/mips/kernel/cpu-probe.c from CPU_R4000SC to CPU_R4000PC.
> Is there a reason why only the SC version is thought to be
> there, or is it believed to be compatible?

The PC and SC versions are basically identical except the second level
cache which is missing in the PC version.

> Without this change the machine locks up after loading the
> kernel, linux hasn't switched to the black background, yet.
> 
> I also changed the compiler flags from -m{arch,tune}=r4600 to
> *r4000, but this I also tried before without success.

Do you know which version of the processor this is exactly?  IRIX's hinv
command or the "CPU revision is: ..." line of bootup messages contain
that information.

The PC version have become pretty rare, didn't recall anymore it was in
use in Indys at all.  Anyway, please try the patch below and let me know.

  Ralf

Index: arch/mips/mm/c-r4k.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/mm/c-r4k.c,v
retrieving revision 1.3.2.65
diff -u -r1.3.2.65 c-r4k.c
--- arch/mips/mm/c-r4k.c	2 Feb 2004 22:24:37 -0000	1.3.2.65
+++ arch/mips/mm/c-r4k.c	5 Feb 2004 17:50:37 -0000
@@ -965,10 +965,8 @@
 	 * Linux memory managment.
 	 */
 	switch (c->cputype) {
-	case CPU_R4000PC:
 	case CPU_R4000SC:
 	case CPU_R4000MC:
-	case CPU_R4400PC:
 	case CPU_R4400SC:
 	case CPU_R4400MC:
 		probe_scache_kseg1 = (probe_func_t) (KSEG1ADDR(&probe_scache));
Index: arch/mips/kernel/cpu-probe.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/kernel/cpu-probe.c,v
retrieving revision 1.1.2.31
diff -u -r1.1.2.31 cpu-probe.c
--- arch/mips/kernel/cpu-probe.c	19 Jan 2004 18:32:05 -0000	1.1.2.31
+++ arch/mips/kernel/cpu-probe.c	5 Feb 2004 17:50:39 -0000
@@ -192,10 +192,18 @@
 		c->tlbsize = 64;
 		break;
 	case PRID_IMP_R4000:
-		if ((c->processor_id & 0xff) >= PRID_REV_R4400)
-			c->cputype = CPU_R4400SC;
-		else
-			c->cputype = CPU_R4000SC;
+		if (read_c0_config() & CONF_SC) {
+			if ((c->processor_id & 0xff) >= PRID_REV_R4400)
+				c->cputype = CPU_R4400SC;
+			else
+				c->cputype = CPU_R4000SC;
+		} else {
+			if ((c->processor_id & 0xff) >= PRID_REV_R4400)
+				c->cputype = CPU_R4400SC;
+			else
+				c->cputype = CPU_R4000SC;
+		}
+
 		c->isa_level = MIPS_CPU_ISA_III;
 		c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
 		             MIPS_CPU_WATCH | MIPS_CPU_VCE |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Indy R4000PC problems
  2004-02-05 17:51 ` Ralf Baechle
@ 2004-02-05 18:10   ` Ralf Baechle
  2004-02-06 10:21   ` Markus Dahms
  1 sibling, 0 replies; 6+ messages in thread
From: Ralf Baechle @ 2004-02-05 18:10 UTC (permalink / raw)
  To: Markus Dahms; +Cc: linux-mips

On Thu, Feb 05, 2004 at 06:51:46PM +0100, Ralf Baechle wrote:

> The PC version have become pretty rare, didn't recall anymore it was in
> use in Indys at all.  Anyway, please try the patch below and let me know.

Argh...  Famous class of bugs when one is about to run out of the door.
The CONF_SC bit is inverted so the test for it needs to be inverted.
WIll post a new patch later.

  Ralf

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Indy R4000PC problems
  2004-02-05 17:51 ` Ralf Baechle
  2004-02-05 18:10   ` Ralf Baechle
@ 2004-02-06 10:21   ` Markus Dahms
  2004-02-06 13:46     ` Markus Dahms
  1 sibling, 1 reply; 6+ messages in thread
From: Markus Dahms @ 2004-02-06 10:21 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips

Hallo Ralf Baechle,

[R4000PC]
> Do you know which version of the processor this is exactly?  IRIX's hinv
> command or the "CPU revision is: ..." line of bootup messages contain
> that information.

R4000 V3.0 I believe. I'll check it, when I'm at home again.

> The PC version have become pretty rare, didn't recall anymore it was in
> use in Indys at all.  Anyway, please try the patch below and let me know.

I checked the cvs version from yesterday (20040205), which contained
some changes in cpu-probe.c; it worked!

Greetings, Markus

PS: sorry for the response times, our mail system is totally overloaded
    at the moment.

-- 
Disc space -- the final frontier!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Indy R4000PC problems
  2004-02-06 10:21   ` Markus Dahms
@ 2004-02-06 13:46     ` Markus Dahms
  0 siblings, 0 replies; 6+ messages in thread
From: Markus Dahms @ 2004-02-06 13:46 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips

> [R4000PC]
>> Do you know which version of the processor this is exactly?  IRIX's hinv
>> command or the "CPU revision is: ..." line of bootup messages contain
>> that information.
> R4000 V3.0 I believe. I'll check it, when I'm at home again.

checked it:

[dmesg]
| CPU revision is: 00000430
| FPU revision is: 00000500

[/proc/cpuinfo]
| cpu model               : R4000PC V3.0  FPU V0.0

Markus

-- 
Any given program will expand to fill available memory.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-02-06 14:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-02 16:07 Indy R4000PC problems Markus Dahms
2004-02-05 17:49 ` Steven J. Hill
2004-02-05 17:51 ` Ralf Baechle
2004-02-05 18:10   ` Ralf Baechle
2004-02-06 10:21   ` Markus Dahms
2004-02-06 13:46     ` Markus Dahms

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox