From: Valentine Barshak <vbarshak@ru.mvista.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH 2/4] PowerPC: update 440EP(x)/440GR(x) identical PVR issue workaround
Date: Fri, 21 Dec 2007 19:24:02 +0300 [thread overview]
Message-ID: <20071221162402.GA1673@ru.mvista.com> (raw)
In-Reply-To: <20071221160723.GA1430@ru.mvista.com>
Commit 3ee133269861dc449ad5be761aa8570b1b05571f introduced
a CPU "model" property and thus broke PowerPC 440EP(x)/440GR(x)
identical PVR workaround. The patch updates it to use the new
model property for CPU identification.
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
---
arch/powerpc/kernel/prom.c | 37 +++++++++++++++++++++++++------------
1 files changed, 25 insertions(+), 12 deletions(-)
diff -pruN linux-2.6.orig/arch/powerpc/kernel/prom.c linux-2.6/arch/powerpc/kernel/prom.c
--- linux-2.6.orig/arch/powerpc/kernel/prom.c 2007-12-21 17:14:17.000000000 +0300
+++ linux-2.6/arch/powerpc/kernel/prom.c 2007-12-21 18:42:09.000000000 +0300
@@ -614,6 +614,29 @@ static struct feature_property {
#endif /* CONFIG_PPC64 */
};
+#if defined(CONFIG_44x) && defined(CONFIG_PPC_FPU)
+static inline void identical_pvr_fixup(unsigned long node)
+{
+ unsigned int pvr;
+ char *model = of_get_flat_dt_prop(node, "model", NULL);
+
+ /*
+ * Since 440GR(x)/440EP(x) processors have the same pvr,
+ * we check the node path and set bit 28 in the cur_cpu_spec
+ * pvr for EP(x) processor version. This bit is always 0 in
+ * the "real" pvr. Then we call identify_cpu again with
+ * the new logical pvr to enable FPU support.
+ */
+ if (model && strstr(model, "440EP")) {
+ pvr = cur_cpu_spec->pvr_value | 0x8;
+ identify_cpu(0, pvr);
+ DBG("Using logical pvr %x for %s\n", pvr, model);
+ }
+}
+#else
+#define identical_pvr_fixup(node) do { } while(0)
+#endif
+
static void __init check_cpu_feature_properties(unsigned long node)
{
unsigned long i;
@@ -711,18 +734,8 @@ static int __init early_init_dt_scan_cpu
prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
if (prop && (*prop & 0xff000000) == 0x0f000000)
identify_cpu(0, *prop);
-#if defined(CONFIG_44x) && defined(CONFIG_PPC_FPU)
- /*
- * Since 440GR(x)/440EP(x) processors have the same pvr,
- * we check the node path and set bit 28 in the cur_cpu_spec
- * pvr for EP(x) processor version. This bit is always 0 in
- * the "real" pvr. Then we call identify_cpu again with
- * the new logical pvr to enable FPU support.
- */
- if (strstr(uname, "440EP")) {
- identify_cpu(0, cur_cpu_spec->pvr_value | 0x8);
- }
-#endif
+
+ identical_pvr_fixup(node);
}
check_cpu_feature_properties(node);
next prev parent reply other threads:[~2007-12-21 16:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-21 16:07 [PATCH 0/4] PowerPC: more Sequoia/Rainier updates for 2.6.25 Valentine Barshak
2007-12-21 16:22 ` [PATCH 1/4] PowerPC: Correct 440GRx machine_check callback Valentine Barshak
2007-12-21 16:24 ` Valentine Barshak [this message]
2007-12-21 16:43 ` [PATCH 2/4] PowerPC: update 440EP(x)/440GR(x) identical PVR issue workaround Josh Boyer
2007-12-21 19:47 ` Valentine Barshak
2007-12-21 19:56 ` Stefan Roese
2007-12-24 12:51 ` Valentine Barshak
2007-12-21 16:26 ` [PATCH 3/4] PowerPC: Add PCI entry to 440EPx Sequoia DTS Valentine Barshak
2007-12-21 21:21 ` Benjamin Herrenschmidt
2007-12-22 5:53 ` Stefan Roese
2008-04-05 16:30 ` Sergei Shtylyov
2008-04-07 13:01 ` Valentine Barshak
2008-04-07 13:30 ` Sergei Shtylyov
2007-12-21 16:27 ` [PATCH 4/4] PowerPC: Add PCI node to 440GRx Rainier DTS Valentine Barshak
2007-12-21 17:19 ` Valentine Barshak
2007-12-21 17:22 ` [PATCH 4/4] PowerPC: Add PCI entry " Valentine Barshak
2007-12-21 21:21 ` [PATCH 4/4] PowerPC: Add PCI node " Benjamin Herrenschmidt
2007-12-22 5:54 ` Stefan Roese
2007-12-22 5:58 ` Benjamin Herrenschmidt
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=20071221162402.GA1673@ru.mvista.com \
--to=vbarshak@ru.mvista.com \
--cc=linuxppc-dev@ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.