From: Guillaume Laurès <guillaume.laures@noos.fr>
To: "linuxppc-dev@lists.linuxppc.org" <linuxppc-dev@lists.linuxppc.org>
Subject: Re: progress on l2cr
Date: Tue, 18 Jul 2000 08:54:33 +0200 [thread overview]
Message-ID: <3973FF28.F9990DF9@noos.fr> (raw)
In-Reply-To: 3973882B.1C9A581E@noos.fr
[-- Attachment #1: Type: text/plain, Size: 4843 bytes --]
Guillaume Laurès a écrit :
[...]-
>
> Here are two patches against current stable tree,
Sorry, they didn't make trough, here there are in the body and in attachement
again :
l2cr-display-gom.diff---------------
--- linux-pmac-stable-orig/arch/ppc/kernel/ppc_htab.c Mon Jul 17 21:30:43
2000
+++ linux-pmac-stable/arch/ppc/kernel/ppc_htab.c Mon Jul 17 22:14:46 2000
@@ -536,8 +536,8 @@
"unknown size", "256KB", "512KB", "1MB"
};
static const char *clockstrings[8] = {
- "clock disabled", "+1 clock", "+1.5 clock", "reserved(3)",
- "+2 clock", "+2.5 clock", "+3 clock", "reserved(7)"
+ "clock disabled", "1 clock", "1.5 clock", "reserved(3)",
+ "2 clock", "2.5 clock", "3 clock", "reserved(7)"
};
static const char *typestrings[4] = {
"flow-through burst SRAM", "reserved SRAM",
@@ -547,6 +547,17 @@
"0.5", "1.0", "(reserved2)", "(reserved3)"
};
+ if ((_get_PVR() >> 16) == 12) {
+ /* update those values when CPU is a G4 */
+ sizestrings[0] = "2MB";
+ clockstrings[3] = "3.5 clock";
+ clockstrings[3] = "4 clock";
+ holdstrings[0] = "0.6";
+ holdstrings[1] = "1.0";
+ holdstrings[2] = "1.4";
+ holdstrings[3] = "1.8";
+ }
+
if ( ((_get_PVR() >> 16) != 8) && ((_get_PVR() >> 16) != 12))
return -EFAULT;
@@ -590,25 +601,43 @@
_set_L2CR(val);
while ( _get_L2CR() & 0x1 )
/* wait for invalidate to finish */;
-
+
} else {
p = buf;
if (!first)
*p++ = '\t';
val = _get_L2CR();
- p += sprintf(p, "%08x: ", val);
- p += sprintf(p, " %s",
- (val&0x80000000)?"enabled":"disabled");
- p += sprintf(p,",%sparity",(val&0x40000000)?"":"no ");
- p += sprintf(p, ",%s", sizestrings[(val >> 28) & 3]);
- p += sprintf(p, ",%s", clockstrings[(val >> 25) & 7]);
- p += sprintf(p, ",%s", typestrings[(val >> 23) & 0x2]);
- p += sprintf(p,"%s",(val>>22)&1?"":",data only");
- p += sprintf(p,"%s",(val>>20)&1?",ZZ enabled":"");
- p += sprintf(p,",%s",(val>>19)&1?"write-through":"copy-back");
- p += sprintf(p,",%sns hold", holdstrings[(val>>16)&3]);
+ p += sprintf(p, "0x%08x: ", val);
+ p += sprintf(p, " %s", (val >> 31) & 1 ? "enabled" :
+ "disabled");
+ p += sprintf(p, ", %sparity", (val>>30)&1 ? "" : "no ");
+ p += sprintf(p, ", %s", sizestrings[(val >> 28) & 3]);
+ p += sprintf(p, ", %s", clockstrings[(val >> 25) & 7]);
+ p += sprintf(p, ", %s", typestrings[(val >> 23) & 2]);
+ p += sprintf(p, "%s", (val>>22)&1 ? ", data only" : "");
+ p += sprintf(p, "%s", (val>>20)&1 ? ", ZZ enabled": "");
+ p += sprintf(p, ", %s", (val>>19)&1 ? "write-through" :
+ "copy-back");
+ p += sprintf(p, "%s", (val>>18)&1 ? ", testing" : "");
+ p += sprintf(p, ", %sns hold",holdstrings[(val>>16)&3]);
+ p += sprintf(p, "%s", (val>>15)&1 ? ", DLL slow" : "");
+ p += sprintf(p, "%s", (val>>14)&1 ? ", diff clock" :"");
+ p += sprintf(p, "%s", (val>>13)&1 ? ", DLL bypass" :"");
+ if ((_get_PVR() >> 16) == 12) {
+ /* G4 have more significant bits than G3 */
+ p += sprintf(p, "%s", (val>>12)&1 ? ",
+ flush assist" :"");
+ p += sprintf(p, "%s", (val>>11)&1 ? ",
+ hardware flush" :"");
+ p += sprintf(p, "%s", (val>>10)&1 ? ",
+ instruction-only" :"");
+ p += sprintf(p, "%s", (val>>9)&1 ? ",
+ clock stop" :"");
+ p += sprintf(p, "%s", (val>>8)&1 ? ",
+ rollover checkstop" :"");
+ }
- p += sprintf(p,"\n");
+ p += sprintf(p, "\n");
len = strlen(buf);
if (len > left)
l2cr-cmdline-gom.diff-----------------------
--- linux-pmac-stable-orig/arch/ppc/kernel/setup.c Mon Jul 17 21:30:43 2000
+++ linux/arch/ppc/kernel/setup.c Mon Jul 17 23:13:58 2000
@@ -549,15 +549,19 @@
return 0;
}
-/* Checks "l2cr=xxxx" command-line option */
+/* Takes care of "l2cr=xxxx" command-line option */
void ppc_setup_l2cr(char *str, int *ints)
{
if ( ((_get_PVR() >> 16) == 8) || ((_get_PVR() >> 16) == 12) )
+ /* Make sure cpu is G3 or G4 */
{
unsigned long val = simple_strtoul(str, NULL, 0);
printk(KERN_INFO "l2cr set to %lx\n", val);
- _set_L2CR(0);
- _set_L2CR(val);
+ val |= 0x00200000; /* perform global invalidate */
+ _set_L2CR(0); /* disable cache */
+ _set_L2CR(val); /* enable it */
+ } else {
+ printk(KERN_INFO "l2cr: cpu is not suitable\n");
}
}
--- linux-pmac-stable-orig/init/main.c Mon Jul 17 21:31:00 2000
+++ linux/init/main.c Mon Jul 17 21:04:15 2000
@@ -355,6 +355,9 @@
#ifdef CONFIG_ADBMOUSE
extern void adb_mouse_setup(char *str, int *ints);
#endif
+#ifdef CONFIG_PPC
+extern void ppc_setup_l2cr(char *str, int *ints);
+#endif
#ifdef CONFIG_WDT
extern void wdt_setup(char *str, int *ints);
#endif
@@ -1044,6 +1047,9 @@
#endif
#ifdef CONFIG_ADBMOUSE
{ "adb_buttons=", adb_mouse_setup },
+#endif
+#ifdef CONFIG_PPC
+ { "l2cr=", ppc_setup_l2cr },
#endif
#ifdef CONFIG_LTPC
{ "ltpc=", ltpc_setup },
@+
--
Guillaume
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Unknown Document --]
[-- Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="522A6368"; name="l2cr-display-gom.diff", Size: 3233 bytes --]
--- linux-pmac-stable-orig/arch/ppc/kernel/ppc_htab.c Mon Jul 17 21:30:43 2000
+++ linux-pmac-stable/arch/ppc/kernel/ppc_htab.c Mon Jul 17 22:14:46 2000
@@ -536,8 +536,8 @@
"unknown size", "256KB", "512KB", "1MB"
};
static const char *clockstrings[8] = {
- "clock disabled", "+1 clock", "+1.5 clock", "reserved(3)",
- "+2 clock", "+2.5 clock", "+3 clock", "reserved(7)"
+ "clock disabled", "ò1 clock", "ò1.5 clock", "reserved(3)",
+ "ò2 clock", "ò2.5 clock", "ò3 clock", "reserved(7)"
};
static const char *typestrings[4] = {
"flow-through burst SRAM", "reserved SRAM",
@@ -547,6 +547,17 @@
"0.5", "1.0", "(reserved2)", "(reserved3)"
};
+ if ((_get_PVR() >> 16) == 12) {
+ /* update those values when CPU is a G4 */
+ sizestrings[0] = "2MB";
+ clockstrings[3] = "ò3.5 clock";
+ clockstrings[3] = "ò4 clock";
+ holdstrings[0] = "0.6";
+ holdstrings[1] = "1.0";
+ holdstrings[2] = "1.4";
+ holdstrings[3] = "1.8";
+ }
+
if ( ((_get_PVR() >> 16) != 8) && ((_get_PVR() >> 16) != 12))
return -EFAULT;
@@ -590,25 +601,43 @@
_set_L2CR(val);
while ( _get_L2CR() & 0x1 )
/* wait for invalidate to finish */;
-
+
} else {
p = buf;
if (!first)
*p++ = '\t';
val = _get_L2CR();
- p += sprintf(p, "%08x: ", val);
- p += sprintf(p, " %s",
- (val&0x80000000)?"enabled":"disabled");
- p += sprintf(p,",%sparity",(val&0x40000000)?"":"no ");
- p += sprintf(p, ",%s", sizestrings[(val >> 28) & 3]);
- p += sprintf(p, ",%s", clockstrings[(val >> 25) & 7]);
- p += sprintf(p, ",%s", typestrings[(val >> 23) & 0x2]);
- p += sprintf(p,"%s",(val>>22)&1?"":",data only");
- p += sprintf(p,"%s",(val>>20)&1?",ZZ enabled":"");
- p += sprintf(p,",%s",(val>>19)&1?"write-through":"copy-back");
- p += sprintf(p,",%sns hold", holdstrings[(val>>16)&3]);
+ p += sprintf(p, "0x%08x: ", val);
+ p += sprintf(p, " %s", (val >> 31) & 1 ? "enabled" :
+ "disabled");
+ p += sprintf(p, ", %sparity", (val>>30)&1 ? "" : "no ");
+ p += sprintf(p, ", %s", sizestrings[(val >> 28) & 3]);
+ p += sprintf(p, ", %s", clockstrings[(val >> 25) & 7]);
+ p += sprintf(p, ", %s", typestrings[(val >> 23) & 2]);
+ p += sprintf(p, "%s", (val>>22)&1 ? ", data only" : "");
+ p += sprintf(p, "%s", (val>>20)&1 ? ", ZZ enabled": "");
+ p += sprintf(p, ", %s", (val>>19)&1 ? "write-through" :
+ "copy-back");
+ p += sprintf(p, "%s", (val>>18)&1 ? ", testing" : "");
+ p += sprintf(p, ", %sns hold",holdstrings[(val>>16)&3]);
+ p += sprintf(p, "%s", (val>>15)&1 ? ", DLL slow" : "");
+ p += sprintf(p, "%s", (val>>14)&1 ? ", diff clock" :"");
+ p += sprintf(p, "%s", (val>>13)&1 ? ", DLL bypass" :"");
+ if ((_get_PVR() >> 16) == 12) {
+ /* G4 have more significant bits than G3 */
+ p += sprintf(p, "%s", (val>>12)&1 ? ",
+ flush assist" :"");
+ p += sprintf(p, "%s", (val>>11)&1 ? ",
+ hardware flush" :"");
+ p += sprintf(p, "%s", (val>>10)&1 ? ",
+ instruction-only" :"");
+ p += sprintf(p, "%s", (val>>9)&1 ? ",
+ clock stop" :"");
+ p += sprintf(p, "%s", (val>>8)&1 ? ",
+ rollover checkstop" :"");
+ }
- p += sprintf(p,"\n");
+ p += sprintf(p, "\n");
len = strlen(buf);
if (len > left)
[-- Attachment #3: Unknown Document --]
[-- Type: text/plain, Size: 1330 bytes --]
--- linux-pmac-stable-orig/arch/ppc/kernel/setup.c Mon Jul 17 21:30:43 2000
+++ linux/arch/ppc/kernel/setup.c Mon Jul 17 23:13:58 2000
@@ -549,15 +549,19 @@
return 0;
}
-/* Checks "l2cr=xxxx" command-line option */
+/* Takes care of "l2cr=xxxx" command-line option */
void ppc_setup_l2cr(char *str, int *ints)
{
if ( ((_get_PVR() >> 16) == 8) || ((_get_PVR() >> 16) == 12) )
+ /* Make sure cpu is G3 or G4 */
{
unsigned long val = simple_strtoul(str, NULL, 0);
printk(KERN_INFO "l2cr set to %lx\n", val);
- _set_L2CR(0);
- _set_L2CR(val);
+ val |= 0x00200000; /* perform global invalidate */
+ _set_L2CR(0); /* disable cache */
+ _set_L2CR(val); /* enable it */
+ } else {
+ printk(KERN_INFO "l2cr: cpu is not suitable\n");
}
}
--- linux-pmac-stable-orig/init/main.c Mon Jul 17 21:31:00 2000
+++ linux/init/main.c Mon Jul 17 21:04:15 2000
@@ -355,6 +355,9 @@
#ifdef CONFIG_ADBMOUSE
extern void adb_mouse_setup(char *str, int *ints);
#endif
+#ifdef CONFIG_PPC
+extern void ppc_setup_l2cr(char *str, int *ints);
+#endif
#ifdef CONFIG_WDT
extern void wdt_setup(char *str, int *ints);
#endif
@@ -1044,6 +1047,9 @@
#endif
#ifdef CONFIG_ADBMOUSE
{ "adb_buttons=", adb_mouse_setup },
+#endif
+#ifdef CONFIG_PPC
+ { "l2cr=", ppc_setup_l2cr },
#endif
#ifdef CONFIG_LTPC
{ "ltpc=", ltpc_setup },
next prev parent reply other threads:[~2000-07-18 6:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-07-17 22:26 progress on l2cr Guillaume Laurès
2000-07-18 6:54 ` Guillaume Laurès [this message]
2000-07-18 8:03 ` Benjamin Herrenschmidt
2000-07-22 1:38 ` Giuliano Pochini
2000-07-22 20:13 ` Benjamin Herrenschmidt
2000-08-01 0:18 ` Giuliano Pochini
2000-07-31 18:42 ` Benjamin Herrenschmidt
2000-08-06 3:25 ` Giuliano Pochini
2000-08-06 9:33 ` Timothy A. Seufert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3973FF28.F9990DF9@noos.fr \
--to=guillaume.laures@noos.fr \
--cc=linuxppc-dev@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).