Module Name:    src
Committed By:   phx
Date:           Sun Dec 19 11:05:06 UTC 2010

Modified Files:
        src/sys/arch/amigappc/amigappc: machdep.c

Log Message:
The 604e User's Manual states that the PLL_CFG settings are compatible with
the 603e, so we just need a single pll-table. Also, the PLL_CFG settings in
the 603e manual seem to be partly wrong, leading to some misdetected cpu
clocks for the BPPC cards.
Patch by Radoslaw Kujawa.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amigappc/amigappc/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amigappc/amigappc/machdep.c
diff -u src/sys/arch/amigappc/amigappc/machdep.c:1.45 src/sys/arch/amigappc/amigappc/machdep.c:1.46
--- src/sys/arch/amigappc/amigappc/machdep.c:1.45	Sun Dec 19 08:32:33 2010
+++ src/sys/arch/amigappc/amigappc/machdep.c	Sun Dec 19 11:05:06 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.45 2010/12/19 08:32:33 jandberg Exp $ */
+/* $NetBSD: machdep.c,v 1.46 2010/12/19 11:05:06 phx Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.45 2010/12/19 08:32:33 jandberg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.46 2010/12/19 11:05:06 phx Exp $");
 
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -243,15 +243,10 @@
 
 	/* handlers for all 6 Amiga interrupt levels */
 	intr_establish(1, IST_LEVEL, IPL_BIO, lev1_intr, NULL);
-
 	intr_establish(2, IST_LEVEL, IPL_BIO, ports_intr, &isr_ports);
-
 	intr_establish(3, IST_LEVEL, IPL_TTY, lev3_intr, NULL);
-
 	intr_establish(4, IST_LEVEL, IPL_AUDIO, lev4_intr, NULL);
-
 	intr_establish(5, IST_LEVEL, IPL_SERIAL, lev5_intr, NULL);
-
 	intr_establish(6, IST_LEVEL, IPL_SERIAL, exter_intr, &isr_exter);
 }
 
@@ -259,17 +254,12 @@
 amigappc_identify(void)
 {
 	extern u_long ns_per_tick, ticks_per_sec;
-	static const unsigned char pll603[] = {
-		10, 10, 10, 10, 20, 20, 25, 00,
-		30, 00, 40, 00, 15, 00, 35, 00
-	};
-	static const unsigned char pll604[] = {
+	static const unsigned char pll[] = {
 		10, 10, 70, 10, 20, 65, 25, 45,
 		30, 55, 40, 50, 15, 60, 35, 00
 	};
 	const char *cpuname, *mach, *p5type_p, *pup;
 	u_long busclock, cpuclock;
-	int cpu;
 	register int pvr, hid1;
 
 	/* PowerUp ROM id location */
@@ -289,32 +279,26 @@
 	else
 		mach = "Amiga 1200";
 
-	/* find CPU type - BlizzardPPC has 603e, CyberstormPPC has 604e */
+	/* find CPU type - BlizzardPPC has 603e/603ev, CyberstormPPC has 604e */
 	switch (pvr >> 16) {
 	case 3:
 		cpuname = "603";
-		cpu = 603;
 		break;
 	case 4:
 		cpuname = "604";
-		cpu = 604;
 		break;
 	case 6:
 		cpuname = "603e";
-		cpu = 603;
 		break;
 	case 7:
 		cpuname = "603ev";
-		cpu = 603;
 		break;
 	case 9:
 	case 10:
 		cpuname = "604e";
-		cpu = 604;
 		break;
 	default:
 		cpuname = "unknown";
-		cpu = 604;
 		break;
 	}
 
@@ -349,10 +333,7 @@
 	}
 
 	/* compute cpuclock based on PLL configuration */
-	if (cpu == 603)
-		cpuclock = busclock * pll603[hid1>>28 & 0xf] / 10;
-	else /* 604 */
-		cpuclock = busclock * pll604[hid1>>28 & 0xf] / 10;
+	cpuclock = busclock * pll[hid1>>28 & 0xf] / 10;
 
 	snprintf(model, sizeof(model),
 	    "%s %s (%s v%d.%d %lu MHz, busclk %lu MHz)",

Reply via email to