Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/macppc/macppc Add 7450 recognization. 7450s use NA...
details: https://anonhg.NetBSD.org/src/rev/c81b3f9b7423
branches: trunk
changeset: 514103:c81b3f9b7423
user: matt <matt%NetBSD.org@localhost>
date: Wed Aug 22 21:09:05 2001 +0000
description:
Add 7450 recognization. 7450s use NAP mode. print out HID0 register
contents.
diffstat:
sys/arch/macppc/macppc/cpu.c | 31 ++++++++++++++++++++++++-------
1 files changed, 24 insertions(+), 7 deletions(-)
diffs (115 lines):
diff -r 08359d081643 -r c81b3f9b7423 sys/arch/macppc/macppc/cpu.c
--- a/sys/arch/macppc/macppc/cpu.c Wed Aug 22 21:05:25 2001 +0000
+++ b/sys/arch/macppc/macppc/cpu.c Wed Aug 22 21:09:05 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.22 2001/07/22 11:29:47 wiz Exp $ */
+/* $NetBSD: cpu.c,v 1.23 2001/08/22 21:09:05 matt Exp $ */
/*-
* Copyright (c) 2001 Tsubai Masanari.
@@ -127,6 +127,8 @@
#define MPC620 20
#define MPC750 8
#define MPC7400 12
+#define MPC7410 0x800c
+#define MPC7450 0x8000
void
cpuattach(parent, self, aux)
@@ -145,7 +147,7 @@
#endif
asm volatile ("mfpvr %0" : "=r"(pvr));
- vers = (pvr >> 16) & 0x0fff;
+ vers = (pvr >> 16) & 0xffff;
switch (id) {
case 0:
@@ -154,6 +156,8 @@
case MPC604:
case MPC604ev:
case MPC7400:
+ case MPC7410:
+ case MPC7450:
asm volatile ("mtspr 1023,%0" :: "r"(id));
}
identifycpu(model);
@@ -182,12 +186,20 @@
case MPC603ev:
case MPC750:
case MPC7400:
+ case MPC7410:
/* Select DOZE mode. */
hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP);
hid0 |= HID0_DOZE | HID0_DPM;
powersave = 1;
break;
+ case MPC7450:
+ /* Select NAP mode. */
+ hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP);
+ hid0 |= HID0_NAP | HID0_DPM;
+ powersave = 1;
+ break;
+
default:
/* No power-saving mode is available. */
}
@@ -209,6 +221,7 @@
hid0 |= HID0_EMCP | HID0_BTIC | HID0_SGE | HID0_BHT;
break;
case MPC7400:
+ case MPC7410:
hid0 &= ~HID0_SPD;
hid0 |= HID0_EMCP | HID0_BTIC | HID0_SGE | HID0_BHT;
hid0 |= HID0_EIEC;
@@ -217,10 +230,12 @@
asm volatile ("mtspr 1008,%0" :: "r"(hid0));
-#if 0
+#if 1
if (1) {
char hidbuf[128];
- bitmask_snprintf(hid0, HID0_BITMASK, hidbuf, sizeof hidbuf);
+ bitmask_snprintf(hid0,
+ vers == MPC7450 ? HID0_7450_BITMASK : HID0_BITMASK,
+ hidbuf, sizeof hidbuf);
printf("%s: HID0 %s\n", self->dv_xname, hidbuf);
}
#endif
@@ -241,7 +256,7 @@
int version;
char *name;
};
-static struct cputab models[] = {
+static const struct cputab models[] = {
{ MPC601, "601" },
{ MPC602, "602" },
{ MPC603, "603" },
@@ -252,6 +267,8 @@
{ MPC620, "620" },
{ MPC750, "750" },
{ MPC7400, "7400" },
+ { MPC7410, "7410" },
+ { MPC7450, "7450" },
{ 0, NULL }
};
@@ -260,14 +277,14 @@
char *cpu_model;
{
u_int pvr, vers, rev;
- struct cputab *cp = models;
+ const struct cputab *cp = models;
asm ("mfpvr %0" : "=r"(pvr));
vers = pvr >> 16;
rev = pvr & 0xffff;
while (cp->name) {
- if (cp->version == (vers & 0x0fff))
+ if (cp->version == vers)
break;
cp++;
}
Home |
Main Index |
Thread Index |
Old Index