From: Paul M. <le...@us...> - 2002-03-10 08:17:44
|
Update of /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4122/common In directory usw-pr-cvs1:/tmp/cvs-serv32523/arch/mips/vr41xx/vr4122/common Modified Files: bcu.c Log Message: Implement workaround to calculate mips_counter_frequency properly on revs 2.0 and 2.1 of the Vr4131. Index: bcu.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4122/common/bcu.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- bcu.c 7 Mar 2002 03:16:54 -0000 1.1 +++ bcu.c 10 Mar 2002 08:17:40 -0000 1.2 @@ -32,6 +32,9 @@ */ /* * Changes: + * Paul Mundt <le...@ch...> + * - Calculate mips_counter_frequency properly on VR4131. + * * MontaVista Software Inc. <yy...@mv...> or <so...@mv...> * - New creation, NEC VR4122 and VR4131 are supported. */ @@ -76,5 +79,26 @@ tclock = calc_tclock(clksp, vr41xx_vtclock); printk(KERN_INFO "TClock: %ldHz\n", tclock); - mips_counter_frequency = tclock / 4; + /* + * The base clock divisor varies depending on which revision of the + * Vr4131 we happen to be dealing with .. + */ +#ifdef CONFIG_VR4131 + { + int prid = read_32bit_cp0_register(CP0_PRID); + + /* + * Revisions 2.0 and 2.1 use a value of (tclock / 2). + */ + if (prid == 0x0c81 || prid == 0x0c82) + mips_counter_frequency = tclock / 2; + } +#endif + + /* + * All other revisions of the Vr4131, as well as the Vr4122 use a + * value of (tclock / 4). + */ + if (!mips_counter_frequency) + mips_counter_frequency = tclock / 4; } |