Recognize the Freescale G2 cores: initialize cache line size, and doze mode

While there, fix the way the major version of a PowerPC processor is computed
This commit is contained in:
aymeric 2007-06-25 11:16:47 +00:00
parent 6ebc93ac7f
commit 7340de8e08
2 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: spr.h,v 1.40 2006/08/05 21:26:49 sanjayl Exp $ */
/* $NetBSD: spr.h,v 1.41 2007/06/25 11:16:47 aymeric Exp $ */
#ifndef _POWERPC_SPR_H_
#define _POWERPC_SPR_H_
@ -97,6 +97,7 @@
#define MPC7410 0x800c
#define MPC5200 0x8011
#define MPC8245 0x8081
#define MPCG2 0x8082
#define IBM970 0x0039
#define IBM970FX 0x003c

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu_subr.c,v 1.30 2007/06/02 02:41:41 nisimura Exp $ */
/* $NetBSD: cpu_subr.c,v 1.31 2007/06/25 11:16:48 aymeric Exp $ */
/*-
* Copyright (c) 2001 Matt Thomas.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.30 2007/06/02 02:41:41 nisimura Exp $");
__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.31 2007/06/25 11:16:48 aymeric Exp $");
#include "opt_ppcparam.h"
#include "opt_multiprocessor.h"
@ -188,6 +188,7 @@ static const struct cputab models[] = {
{ "603", MPC603, REVFMT_MAJMIN },
{ "603e", MPC603e, REVFMT_MAJMIN },
{ "603ev", MPC603ev, REVFMT_MAJMIN },
{ "G2", MPCG2, REVFMT_MAJMIN },
{ "604", MPC604, REVFMT_MAJMIN },
{ "604e", MPC604e, REVFMT_MAJMIN },
{ "604ev", MPC604ev, REVFMT_MAJMIN },
@ -285,6 +286,7 @@ cpu_probe_cache(void)
case MPC604:
case MPC8240:
case MPC8245:
case MPCG2:
curcpu()->ci_ci.dcache_size = 16 K;
curcpu()->ci_ci.icache_size = 16 K;
assoc = 4;
@ -428,6 +430,7 @@ cpu_setup(self, ci)
case MPC7410:
case MPC8240:
case MPC8245:
case MPCG2:
/* Select DOZE mode. */
hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP);
hid0 |= HID0_DOZE | HID0_DPM;
@ -620,7 +623,7 @@ cpu_identify(char *str, size_t len)
major = minor <= 4 ? 1 : 2;
break;
default:
major = (pvr >> 8) & 0xf;
major = (pvr >> 4) & 0xf;
minor = (pvr >> 0) & 0xf;
}