From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Linux MIPS <linux-mips@linux-mips.org>
Cc: Jordan Crouse <jordan.crouse@amd.com>, ralf@linux-mips.org
Subject: Re: [PATCH] Save write-only Config.OD from being clobbered
Date: Fri, 26 May 2006 07:43:53 +0400 [thread overview]
Message-ID: <44767979.6020106@ru.mvista.com> (raw)
In-Reply-To: <442457A6.4080508@dev.rtsoft.ru>
[-- Attachment #1: Type: text/plain, Size: 356 bytes --]
Hello.
Save the Config.OD bit from being clobbered by coherency_setup(). This
bit, when set, fixes various errata in the early steppings of Au1x00 SOCs.
Unfortunately, the bit was write-only on the most early of them. In addition,
also restore the bit after a wakeup from sleep.
WBR, Sergei
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
[-- Attachment #2: Au1x00-retain-OD-bit.patch --]
[-- Type: text/plain, Size: 1779 bytes --]
Index: linux-mips/arch/mips/au1000/common/sleeper.S
===================================================================
--- linux-mips.orig/arch/mips/au1000/common/sleeper.S
+++ linux-mips/arch/mips/au1000/common/sleeper.S
@@ -112,6 +112,11 @@ sdsleep:
mtc0 k0, CP0_PAGEMASK
lw k0, 0x14(sp)
mtc0 k0, CP0_CONFIG
+
+ /* We need to catch the ealry Alchemy SOCs with
+ * the write-only Config[OD] bit and set it back to one...
+ */
+ jal au1x00_fixup_config_od
lw $1, PT_R1(sp)
lw $2, PT_R2(sp)
lw $3, PT_R3(sp)
Index: linux-mips/arch/mips/mm/c-r4k.c
===================================================================
--- linux-mips.orig/arch/mips/mm/c-r4k.c
+++ linux-mips/arch/mips/mm/c-r4k.c
@@ -1136,6 +1136,26 @@ static void __init setup_scache(void)
c->options |= MIPS_CPU_SUBSET_CACHES;
}
+void au1x00_fixup_config_od(void)
+{
+ /*
+ * c0_config.od (bit 19) was write only (and read as 0)
+ * on the early revisions of Alchemy SOCs. It disables the bus
+ * transaction overlapping and needs to be set to fix various errata.
+ */
+ switch (current_cpu_data.cputype) {
+ case CPU_AU1000: /* rev. DA, HA, HB */
+ case CPU_AU1100: /* rev. AB, BA, BC ?? */
+ if ((read_c0_prid() & 0xff) < 3)
+ set_c0_config(1 << 19);
+ break;
+ case CPU_AU1500: /* rev. AB */
+ if ((read_c0_prid() & 0xff) < 1)
+ set_c0_config(1 << 19);
+ break;
+ }
+}
+
static inline void coherency_setup(void)
{
change_c0_config(CONF_CM_CMASK, CONF_CM_DEFAULT);
@@ -1156,6 +1176,13 @@ static inline void coherency_setup(void)
case CPU_R4400MC:
clear_c0_config(CONF_CU);
break;
+ default:
+ /*
+ * We need to catch the ealry Alchemy SOCs with
+ * the write-only co_config.od bit and set it back to one...
+ */
+ au1x00_fixup_config_od();
+ break;
}
}
next prev parent reply other threads:[~2006-05-26 3:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-22 20:59 [PATCH] Retain the write-only OD from being clobbered Jordan Crouse
2005-11-22 21:10 ` Sergei Shtylylov
2005-12-28 22:25 ` Sergei Shtylylov
2006-03-24 20:33 ` Sergei Shtylyov
2006-05-26 3:43 ` Sergei Shtylyov [this message]
2006-05-26 15:44 ` [PATCH] Save write-only Config.OD from being clobbered (take 4) Sergei Shtylyov
2006-05-26 15:55 ` Martin Michlmayr
2006-05-26 16:02 ` Sergei Shtylyov
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=44767979.6020106@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=jordan.crouse@amd.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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