* [PATCH] powerpc: Fix clock spreading setting on some powermacs
@ 2005-12-12 2:13 Benjamin Herrenschmidt
2005-12-12 2:45 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2005-12-12 2:13 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Andrew Morton, linuxppc-dev list
The code that sets the clock spreading feature of the Intrepid ASIC
must not be run on some machine models or those won't boot. This
fixes it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
This is 2.6.15 material.
Index: linux-work/arch/powerpc/platforms/powermac/feature.c
===================================================================
--- linux-work.orig/arch/powerpc/platforms/powermac/feature.c 2005-11-19 10:56:07.000000000 +1100
+++ linux-work/arch/powerpc/platforms/powermac/feature.c 2005-12-12 12:17:02.000000000 +1100
@@ -1650,11 +1650,19 @@
*/
if (macio->type == macio_intrepid) {
- if (enable)
- UN_OUT(UNI_N_CLOCK_SPREADING, 2);
- else
- UN_OUT(UNI_N_CLOCK_SPREADING, 0);
- mdelay(40);
+ struct device_node *clock =
+ of_find_node_by_path("/uni-n@f8000000/hw-clock");
+ if (clock && get_property(clock, "platform-do-clockspreading",
+ NULL)) {
+ printk(KERN_INFO "%sabling clock spreading on Intrepid"
+ " ASIC\n", enable ? "En" : "Dis");
+ if (enable)
+ UN_OUT(UNI_N_CLOCK_SPREADING, 2);
+ else
+ UN_OUT(UNI_N_CLOCK_SPREADING, 0);
+ mdelay(40);
+ }
+ of_node_put(clock);
}
while (machine_is_compatible("PowerBook5,2") ||
@@ -1724,6 +1732,9 @@
pmac_low_i2c_close(ui2c);
break;
}
+ printk(KERN_INFO "%sabling clock spreading on i2c clock chip\n",
+ enable ? "En" : "Dis");
+
pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_stdsub);
rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_write, 0x80, buffer, 9);
DBG("write result: %d,", rc);
Index: linux-work/arch/ppc/platforms/pmac_feature.c
===================================================================
--- linux-work.orig/arch/ppc/platforms/pmac_feature.c 2005-11-14 20:32:16.000000000 +1100
+++ linux-work/arch/ppc/platforms/pmac_feature.c 2005-12-12 12:16:38.000000000 +1100
@@ -1606,11 +1606,19 @@
*/
if (macio->type == macio_intrepid) {
- if (enable)
- UN_OUT(UNI_N_CLOCK_SPREADING, 2);
- else
- UN_OUT(UNI_N_CLOCK_SPREADING, 0);
- mdelay(40);
+ struct device_node *clock =
+ of_find_node_by_path("/uni-n@f8000000/hw-clock");
+ if (clock && get_property(clock, "platform-do-clockspreading",
+ NULL)) {
+ printk(KERN_INFO "%sabling clock spreading on Intrepid"
+ " ASIC\n", enable ? "En" : "Dis");
+ if (enable)
+ UN_OUT(UNI_N_CLOCK_SPREADING, 2);
+ else
+ UN_OUT(UNI_N_CLOCK_SPREADING, 0);
+ mdelay(40);
+ }
+ of_node_put(clock);
}
while (machine_is_compatible("PowerBook5,2") ||
@@ -1680,6 +1688,8 @@
pmac_low_i2c_close(ui2c);
break;
}
+ printk(KERN_INFO "%sabling clock spreading on i2c clock chip\n",
+ enable ? "En" : "Dis");
pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_stdsub);
rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_write, 0x80, buffer, 9);
DBG("write result: %d,", rc);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] powerpc: Fix clock spreading setting on some powermacs
2005-12-12 2:13 [PATCH] powerpc: Fix clock spreading setting on some powermacs Benjamin Herrenschmidt
@ 2005-12-12 2:45 ` Andrew Morton
2005-12-12 3:27 ` Paul Mackerras
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2005-12-12 2:45 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> The code that sets the clock spreading feature of the Intrepid ASIC
> must not be run on some machine models or those won't boot. This
> fixes it.
I have a bunch of powerpc fixes for 2.6.15, some of which are in Paul's
tree. I presently have:
powerpc-fix-a-huge-page-bug.patch
powerpc-remove-debug-code-in-hash-path.patch
fix-windfarm-model-id-table.patch
powerpc-set-cache-info-defaults.patch
powerpc-fix-slb-flushing-path-in-hugepage.patch
powerpc-add-missing-icache-flushes-for-hugepages.patch
ppc32-set-smp_tb_synchronized-on-up-with-smp-kernel.patch
Linus is back online now. Paul, do you intend to send a batch to Linus?
If so, please do so asap so I can merge up anything that's left over.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-12-12 3:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-12 2:13 [PATCH] powerpc: Fix clock spreading setting on some powermacs Benjamin Herrenschmidt
2005-12-12 2:45 ` Andrew Morton
2005-12-12 3:27 ` Paul Mackerras
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).