aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-11-06 22:27:33 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-07 19:17:34 -0500
commit4350147a816b9c5b40fa59e4fa23f17490630b79 (patch)
treec333986047de60aa90809d669895726610c0c3e5 /arch/ppc64
parenta82765b6eee3d1267ded3320ca67b39fe1844599 (diff)
[PATCH] ppc64: SMU based macs cpufreq support
CPU freq support using 970FX powertune facility for iMac G5 and SMU based single CPU desktop. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64')
-rw-r--r--arch/ppc64/Kconfig10
-rw-r--r--arch/ppc64/kernel/misc.S72
2 files changed, 81 insertions, 1 deletions
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
index 2130cc315957..94a81279deac 100644
--- a/arch/ppc64/Kconfig
+++ b/arch/ppc64/Kconfig
@@ -173,6 +173,16 @@ config KEXEC
173 support. As of this writing the exact hardware interface is 173 support. As of this writing the exact hardware interface is
174 strongly in flux, so no good recommendation can be made. 174 strongly in flux, so no good recommendation can be made.
175 175
176source "drivers/cpufreq/Kconfig"
177
178config CPU_FREQ_PMAC64
179 bool "Support for some Apple G5s"
180 depends on CPU_FREQ && PMAC_SMU && PPC64
181 select CPU_FREQ_TABLE
182 help
183 This adds support for frequency switching on Apple iMac G5,
184 and some of the more recent desktop G5 machines as well.
185
176config IBMVIO 186config IBMVIO
177 depends on PPC_PSERIES || PPC_ISERIES 187 depends on PPC_PSERIES || PPC_ISERIES
178 bool 188 bool
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index 077507ffbab8..914632ec587d 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -560,7 +560,7 @@ _GLOBAL(real_readb)
560 isync 560 isync
561 blr 561 blr
562 562
563 /* 563/*
564 * Do an IO access in real mode 564 * Do an IO access in real mode
565 */ 565 */
566_GLOBAL(real_writeb) 566_GLOBAL(real_writeb)
@@ -593,6 +593,76 @@ _GLOBAL(real_writeb)
593#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */ 593#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */
594 594
595/* 595/*
596 * SCOM access functions for 970 (FX only for now)
597 *
598 * unsigned long scom970_read(unsigned int address);
599 * void scom970_write(unsigned int address, unsigned long value);
600 *
601 * The address passed in is the 24 bits register address. This code
602 * is 970 specific and will not check the status bits, so you should
603 * know what you are doing.
604 */
605_GLOBAL(scom970_read)
606 /* interrupts off */
607 mfmsr r4
608 ori r0,r4,MSR_EE
609 xori r0,r0,MSR_EE
610 mtmsrd r0,1
611
612 /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits
613 * (including parity). On current CPUs they must be 0'd,
614 * and finally or in RW bit
615 */
616 rlwinm r3,r3,8,0,15
617 ori r3,r3,0x8000
618
619 /* do the actual scom read */
620 sync
621 mtspr SPRN_SCOMC,r3
622 isync
623 mfspr r3,SPRN_SCOMD
624 isync
625 mfspr r0,SPRN_SCOMC
626 isync
627
628 /* XXX: fixup result on some buggy 970's (ouch ! we lost a bit, bah
629 * that's the best we can do). Not implemented yet as we don't use
630 * the scom on any of the bogus CPUs yet, but may have to be done
631 * ultimately
632 */
633
634 /* restore interrupts */
635 mtmsrd r4,1
636 blr
637
638
639_GLOBAL(scom970_write)
640 /* interrupts off */
641 mfmsr r5
642 ori r0,r5,MSR_EE
643 xori r0,r0,MSR_EE
644 mtmsrd r0,1
645
646 /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits
647 * (including parity). On current CPUs they must be 0'd.
648 */
649
650 rlwinm r3,r3,8,0,15
651
652 sync
653 mtspr SPRN_SCOMD,r4 /* write data */
654 isync
655 mtspr SPRN_SCOMC,r3 /* write command */
656 isync
657 mfspr 3,SPRN_SCOMC
658 isync
659
660 /* restore interrupts */
661 mtmsrd r5,1
662 blr
663
664
665/*
596 * Create a kernel thread 666 * Create a kernel thread
597 * kernel_thread(fn, arg, flags) 667 * kernel_thread(fn, arg, flags)
598 */ 668 */