iMac G5 Revision A under Linux

Introduction

The iMac G5 is indeed a cool machine. Unfortunately, if you want to use it under Linux, there are chances that you will face problems. Linux distributions for the Mac generally work well for certain hardware, and not so well for other hardware. They are not as polished as the distributions for the PC. With the iMac G5, you might face difficulties to boot, to shut the fans down or to turn the sound on.

iMac G5

Before we start

The solutions below implies that you know how to pass parameters to the Linux kernel, modify configuration files, and recompile your kernel. This is advanced Linux know-how, and I'm sure you understand that I cannot provide you with this knowledge in such a small document. If you can't accomplish those tasks, I'm sorry, but you'll have to stop reading here...

For the same reasons, I won't teach you how to partition your hard disk and install Linux. We'll have to assume that you managed installing the system in the first place.

My configuration

I am running Yellow Dog Linux 4.1, which is a Red Hat-based distribution with a 2.6.15-rc5 kernel. If you are under Ubuntu or some other Linux distribution, you might need to adapt the methods described below, but the principle will remain the same.

The hardware plays a more important role. I have one of the very first iMac G5, the so-called Revision A, that appeared in September 2004. The KDE information center reports a "Power Mac 8.1", with a "PPC 970 FX" processor. If you have not the same hardware, stop reading here, as the rest won't probably work for you.

Credits

A million thanks to Benjamin Herrenschmidt for his kind help. Thanks to Frédéric Grosshans for his fan control script who helped me a lot to understand what was going on. Thanks everyone on the Ubuntu forums for the productive discussions.


Booting your iMac G5 under Linux

The problem

Most users running Linux on a iMac G5 have reported that their system was freezing when pressing on the "Test sound" during the installation, or while the login screen was being displayed.

The solution: disable the sound drivers

This has to do with problems with the sound drivers. To solve the problem under Yellow Dog:


Fan control

The problem

One of the major problems with running Linux on a Macintosh is the noise of the fans. The fans are used to reduce the temperature of the processor and of the computer in general. They are normally stopped when that temperature is acceptable. When the temperature raises again, the fans start. That's called "fan control". Unfortunately, most prepackaged distributions do not provide such fan control "out of the box" and the fans are on all the time, making quite a lot of noise.

The symptom: the /sys tree

The Linux system needs to get information about the processor temperature, and has to be able to act upon the fans. If you have a directory /sys/devices/platform/windfarm.0 with only two files, bus and uevent, then there are chances that the kernel is unable of doing that.

The solution: correct kernel options

The solution to that problem is to recompile a kernel with the correct options for the iMac G5 Revision A. I suggest you do not recompile the kernel provided with your Linux distribution, although it would certainly work with respect to fan control. Instead, pick up the 2.6.17 kernel and patch it with the 2.6.18-rc5 prepatch. That will allow you to have sound output, as we will see later on.

To do that, take the .config file delivered with your distribution as a starting point, and change the options as on the screenshots below:

CPU frequency settings
Macintosh drivers settings

Reboot with the new kernel and load the new windfarm_* modules. Now /sys/devices/platform/windfarm.0 is populated with quite a lot of files, including cpu-temp (the temperature), cpu-fan (the state of the processor's fan), system-fan (the state of the computer's fan), etc. And one of the modules, windfarm_pm81.ko, takes care of shutting down the fans when the temperature is acceptable.

Making the solution permanent

To have the modules loaded automatically on startup, add to /etc/rc.sysinit the following lines:

# Fan control
for module in windfarm_core windfarm_cpufreq_clamp \
  windfarm_lm75_sensor windfarm_pid windfarm_smu_controls \
  windfarm_smu_sensors windfarm_pm81; do
      load_module $module
done


Sound

The problem

Now that the fans are off, the machine is too silent. We would like it to play sounds and music.

The problem comes (again) from the old PowerMac sound driver, the one whose modules we commented out at the very beginning, in order to be able to boot the machine.

The solution: the new Apple Onboard Audio drivers

If you have a 2.6.18-rc5 kernel as adviced above, you have nothing more to download, as the new driver is in the 2.6.18 series.

Ugly hack note: With older kernels, you can still download the new driver snd-aoa-version.tar.bz2, for instance from here. Uncompress it and install it in kernel build tree in sound/aoa, Remove sound/ppc directory and its contents, and dig in the Makefiles to have sound/aoa compiled instead of sound/ppc.

Now set the kernel compilation options as on the screenshot below:

New Apple Onboard Audio driver options

After compiling and installing the new kernel, make the new modules load automatically, again by modifying /etc/rc.sysinit:

# Sound
for module in snd-aoa snd-aoa-fabric-layout \
              snd-aoa-codec-onyx snd-aoa-i2sbus; do
        load_module $module
done
It seems that KDE sounds work only if you choose in the KDE Control Center, in the section Sound and multimedia -> Sound system, to use the Enhanced sound daemon.


Last updated: 2006-09-01. Maintained by webmaster@bureau-cornavin.com.