From: David Gibson <david@gibson.dropbear.id.au>
To: Kumar Gala <galak@kernel.crashing.org>,
Tony Breeds <tony@bakeyournoodle.com>,
linuxppc-dev@ozlabs.org
Subject: Make mpc82xx use generic_calibrate_decr()
Date: Thu, 13 Sep 2007 16:22:01 +1000 [thread overview]
Message-ID: <20070913062201.GA24281@localhost.localdomain> (raw)
The only difference between m82xx_calibrate_decr() and
generic_calibrate_decr() is that the former computes the timebase
frequency from the cpu node's bus-frequency property, instead of
directly from the timebase-frequency property.
But there's no reason the timebase-frequency shouldn't be correct on
82xx like everything else. Certainly the 82xx bootwrapper in
arch/powerpc/boot/cuboot-pq2.c should get it right.
Therefore, this patch removes mpc82xx_calibrate_decr(), using
generic_calibrate_decr() instead.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
I've compiled this, but no booted it, since I don't have any 82xx
hardware. I'm hoping for an ack from someone who can test boot it.
Index: working-2.6/arch/powerpc/platforms/82xx/mpc82xx_ads.c
===================================================================
--- working-2.6.orig/arch/powerpc/platforms/82xx/mpc82xx_ads.c 2007-09-13 16:14:18.000000000 +1000
+++ working-2.6/arch/powerpc/platforms/82xx/mpc82xx_ads.c 2007-09-13 16:14:38.000000000 +1000
@@ -635,6 +635,6 @@ define_machine(mpc82xx_ads)
.init_IRQ = mpc82xx_ads_pic_init,
.show_cpuinfo = mpc82xx_ads_show_cpuinfo,
.get_irq = cpm2_get_irq,
- .calibrate_decr = m82xx_calibrate_decr,
+ .calibrate_decr = generic_calibrate_decr,
.restart = m82xx_restart,.halt = m82xx_halt,
};
Index: working-2.6/arch/powerpc/platforms/82xx/mpc82xx.c
===================================================================
--- working-2.6.orig/arch/powerpc/platforms/82xx/mpc82xx.c 2007-09-13 16:13:48.000000000 +1000
+++ working-2.6/arch/powerpc/platforms/82xx/mpc82xx.c 2007-09-13 16:15:13.000000000 +1000
@@ -51,42 +51,6 @@
#include "pq2ads.h"
-static int __init get_freq(char *name, unsigned long *val)
-{
- struct device_node *cpu;
- const unsigned int *fp;
- int found = 0;
-
- /* The cpu node should have timebase and clock frequency properties */
- cpu = of_find_node_by_type(NULL, "cpu");
-
- if (cpu) {
- fp = of_get_property(cpu, name, NULL);
- if (fp) {
- found = 1;
- *val = *fp;
- }
-
- of_node_put(cpu);
- }
-
- return found;
-}
-
-void __init m82xx_calibrate_decr(void)
-{
- ppc_tb_freq = 125000000;
- if (!get_freq("bus-frequency", &ppc_tb_freq)) {
- printk(KERN_ERR "WARNING: Estimating decrementer frequency "
- "(not found)\n");
- }
- ppc_tb_freq /= 4;
- ppc_proc_freq = 1000000000;
- if (!get_freq("clock-frequency", &ppc_proc_freq))
- printk(KERN_ERR "WARNING: Estimating processor frequency"
- "(not found)\n");
-}
-
void mpc82xx_ads_show_cpuinfo(struct seq_file *m)
{
uint pvid, svid, phid1;
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
next reply other threads:[~2007-09-13 6:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-13 6:22 David Gibson [this message]
2007-09-13 6:43 ` Make mpc82xx use generic_calibrate_decr() Kumar Gala
2007-09-13 6:42 ` David Gibson
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=20070913062201.GA24281@localhost.localdomain \
--to=david@gibson.dropbear.id.au \
--cc=galak@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=tony@bakeyournoodle.com \
/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.