I'm sorry for resurrecting this old thread, but I think I have some thoughts on the topic which you'll potentially find interesting.
First, however, I find myself in need of clearing up some things.
Datasheets and Misconceptions
I found the schematic here..
https://www.overclock.net/attachments/20270 from the fabled rabidz
Thank you! This schematic is useful for the non-2005 G5s, but it is, as is always the case, from an iMac G5. The system block diagram displays the U3lite SoC, not U3. There's also an integrated GPU die on the diagram, which wouldn't have been the case for the Power Mac G5. There are two SATA connectors, but one of them is marked as 'development only'. And, crucially, the schematic has 'IMG5' written all over it in various places, including the name of the file.
Wonder what that stands for.
(U3, as seen on the non-2005 Power Mac G5 board)
I've found an equivalent schematic for the 2005-style architecture iMac G5
here (although if anyone has an actual pdf version I would be very grateful if you linked it here, as the site it's on seems to only really allow zoom on mobile platforms and doesn't allow you to actually download the schematic), and it will no doubt reflect the internals of the Dual Core and the Quad Power Macs much better than the one linked earlier.
You can tell that the architecture is fundamentally similar to the architecture of the Late 2005 Power Mac G5 because it has the giant 'KODIAK' label across the northbridge chip in the block diagram, and not 'U3lite'. Kodiak is, in fact, the codename for the U4/CPC945 IBM chip used in the last Power Mac G5 models. And I know this because I removed a Power Mac G5 logic board from its case, detached all of the heatsinks, and found an IBM-produced package with a clear 'KODIAK' label under the largest of the heatsinks on the back of the board:
(You can see the faint 'KODIAK' lettering along the right side on the bottom, which is kinda brighter in person)
(The post in question includes the datasheet and the user manual for the 970MP processor)
This does indeed help. Thank you!
Here is the datasheet for the memory controller for the Power PC CPU.
6.2 Initializing HyperTransport Core in the CPC945 <...> However, the second stage of the initialization is driven by the system firmware. This stage is used to operate at the maximum clock frequency and link width. <...>
<...>
Our solution may well be a firmware mod.
Well, yes, but actually no, except yes. Let me explain.
The SPU, PLL1 and bus slewing
First things first, if you look at the system block diagram for the 2005 iMac G5, which I conveniently hung up on the metaphorical wall of our investigation all Chekhov's-gun-like about a minute ago, HyperTransport has little to nothing to do with processor speed or even processors themselves. It simply connects the Kodiak/U4 chip with the Shasta chip, or the
U3 chip with the same Shasta chip, on the older non-2005-style iMacs and PowerMacs. The Shasta chip is responsible for most of the IO, including SATA and the BootRom, which is chillin' on Shasta's little dedicated PCI bus, along with some other stuff and the AirPort card, if you have it.
(Shasta, with its heatsink and with the heatsink removed, on Late 2005 and non-2005 Power Mac G5 boards, respectively; NOTE: it's on the back side of the board in both versions, and is the only chip on the back of the board with that kind of heatsink)
"BootRom!?" you might exclaim. "But that's where the firmware sits! It must be responsible for setting clocks and stuff!" you might add.
I believe that that is, in fact, not the case.
Attached below is the 'IBM PowerPC 970MP Power On Reset Application Note', which goes into the entirety of the power-on sequence in
excrutiating detail. If you scroll to page 15 of the aforementioned note, you will see an overview drawing of the Kodiak and 970MP initialization sequence, which I duplicate here for your convenience:
Initialization is started and managed by a dark and mysterious entity which the note calls the 'SPU'. You might already suspect what this is all about, if you concentrate on the letters 'SPU', activate your innate pattern recognition abilities and let repressed memories enter your mind.
If you scroll back to the first section of the application note and read some more, you'll gain confirmation: the entirety of the system is initialized by a so-called 'service processor unit', or the SPU. Which, in the words of the note, is usually a low-cost microcontroller, which may also be responsible for some other functions,
like fans (which I feel like a terrible writer by explicitly saying that this will be relevant later):
1.2.1.2 Power On Reset SPU Hardware Considerations
It is assumed that 970MP systems will include a service processor, referred to herein as the SPU. The SPU
usually consists of a low cost microcontroller. This microcontroller is responsible for hardware initialization of
the 970MP and the North Bridge and can also be used to manage and supervise other system functions, like
fans.
<...>
The only question is, where is this microcontroller on the G5? The iMac G5 schematic doesn't contain anything called an 'SPU'. But what it does contain, is something called the '
system management unit' or the
SMU.
Yes, yes, yes. That magic thing you've been resetting with the 'SMU reset' button? Well, turns out it isn't magic after all.
If you find the thing on the 2005 iMac G5 schematic, it's labeled 'M30280F8', which is indeed a low-cost 16-bit microcontroller seemingly made by Renesas Electronics. Same for the non-2005 iMac G5. The power button and the power LED are connected to it, and
it is connected to Kodiak/U4 in turn using I2C. Moreover, it seems to have lots of
fans connected to it.
Wonder what this is all about...
In my eye, if it walks like an SPU, manages fans like an SPU, and talks to Kodiak like an SPU,
it is an SPU.
The non-2005 Power Mac G5 board that I have seems to be using an M3062MF8NGP IC as its SMU- sorry, I mean, PMU, of course. Non-2005 Power Macs have a different terminology. It's sitting on the back of the board, next to U3 and below Shasta, close to the edge of the board. It also has a pill-shaped oscillator right next to it, which is seemingly the only oscillator on the board.
(seems to be the SMU on non-2005 Power Macs)
The 2005 Power Mac G5 board that I have seems to be using an IC labeled 'M30280FAHP' as its SMU. It's roughly in the same place, but on the front side of the board rather than on the back, and has been moved upwards seemingly to make space for the bus bar connector thingamajigs Apple used in the 2005 Power Macs. It even has the same component designator as it does on the iMac G5 schematic, 'U2800' (which my marketing departmen tells me is at least 930 times better of a name than U3). Keep this designator in mind, because it will be relevant later.
(seems to be the SMU on Late 2005 Power Macs)
Now, why am I talking about the SPU? Weren't we supposed to be overclocking the G5? This is interesting and all, but what does any of this have to do with overclocking?
Well...
The CPC945 user manual contains a fair bit of references to the SPU in the "System Initialization Sequence" section, and it even has kind of the same-ish initialization sequence diagram as the note. But most interesting of all, it contains some info about processor speeds:
10.3.2 CPC945 Initialization
<..> the service processor begins initialization of the CPC945 through the I2C slave interface. This I2C interface can be used by the SPU to generate read or write cycles to any address in the system. The System Command Registers allow the I2C slave interface to provide read and write access to any 36-bit CPC945 physical address.
The initialization consists of the following steps:
1. First write the Clock Control Register for the appropriate core speed and then the PLL1 Control Register to reflect the proper configuration for the attached processors via the PI [processor interconnect] interface. Note that the CPC945 PLLs are preloaded at reset time to default values that are not necessarily optimized for a specific system configuration. The service processor (SPU) can adjust the PLL settings by writing to the PLLn Control Register.
<...>
Well well well... So the SPU/SMU seems to be somewhat in control of processor speed, at least during initialization. Because PLL1 is all about processor interconnect (also known as PI, advanced processor interconnect/API, elastic interface/EI, or simply backside bus) interface speed, which is a ratio of processor speed. Take a look at this section of the CPC945 user manual:
12.5.6 PLL1 Control Register
The PLL1 Control Register configures the PI PLL. It is set at reset to support a CPU running a 3:1 ratio between its core clock and the PI bit rate. The CPU core runs between 2400 MHz and 2664 MHz. The PLL1 Control Register is reloaded during processor reset by the SPU. Its value is initialized at that point to reflect the proper configuration for the CPUs attached to CPC945. <...>
When performing dynamic speed control of the processors, it might be necessary for system software to change the configuration of PLL1. This procedure guarantees a stable PLL1 transition:
1. Software naps or sleeps all but one processor.
2. The last processor loads a new value into PLL1Control, clearing PLLLoaded.
<...>
5. The last processor naps.
<...>
8. CPC945 sees the PI clocks stopped and EnablePLL1Shutdown set, so it stops PLL1 and loads the new configuration from PLL1Control.
<...>
11. When PLL1 is re-locked, CPC945 restarts clocks to the PI interface.
<...>
14. Last processor wakes other processors, if desired.
The values which go into the PLL1 Control Register depend upon the speed of the PI interface and the ratio between the reference clock input and the PI interface. The range of frequencies available for different processor and PI bus ratios are shown in Table 12-5 PLL1 Clock Settings. Table 12-5 documents the PLL settings for CPUs running between 600 MHz and 2700 MHz at all three ratios: 2:1, 3:1, and 4:1.
Table 12-5. PLL1 Clock Settings.
Well, ladies, gentlemen, and all in between, we seem to have found the 'bus slewing' thing. I always wondered how they did that. This whole table seems weird in terms of numbers, however. It seems like they would be changing CPU-to-Bus ratio by setting the PLL1 Control Register, but then it seemingly doesn't do anything, unless you're also changing the reference clock, but then also what's the point of it all, really?
Philosophical questions aside, though, it seems that processor interconnect reference clock is what
really sets the processor speed.
"Then why the whole SPU-related detour?" you might be wondering
calmly at this point.
Well...
The SPU Again, Pulsars and Headers
Let's look at the
datasheet (not the user manual this time) for CPC945, which is attached below. In section 3.5 'Clocks', it says that the processor interface reference clock is called 'PI_REFCLK' in the real world of schematics.
If we now go to the 2005 iMac G5 schematic and look up 'PI_REFCLK', we find four matches, all on the page titled 'KODIAK EI A', where 'EI' obviously stands for 'elastic interface', which is the same as 'processor interface' as discussed before. The pins in question are called 'API_REFCLK_P', 'API_REFCLK_N', 'API_REFCLK_AVDD' and 'API_REFCLK_AGND', where 'API' presumably means 'advanced processor interconnect', which is yet another name for the advanced elastic processor interface interconnect, because of course it is.
While ...VDD is obviously power and ...GND is obviously ground (duh), API_REFCLK_P and API_REFCLK_N are actual signal pins which we were looking for. They're connected to singals called 'EI_NB_SYSCLK_P' and 'EI_NB_SYSCLK_N', respectively, which are generated directly by an IC with a 'U2500' component designator. That is to say, two of U2500's pins (HCLKP_2 and HCLKN_2, respectively) are connected directly to Kodiak and nothing else (except test points), and all of this is called 'EI_NB_SYSCLK_P' and 'EI_NB_SYSCLK_N', respectively.
Unlike pretty much all other components, the U2500 doesn't seem to have a regular part number label above it. It does have a part number label, but the label reads 'PULSAR2'. I belive this is an in-house name for an Apple-specific IC, much like 'Shasta'. I'm gonna give it to Apple, calling an IC that generates regular electric pulses 'Pulsar'... I must say, we had
no chance of knowing what it does, until we looked through all the datasheets. Why is it specifically the second version? Well, that's because the non-2005 iMacs (and probably Power Macs) have a completely different 'U2600' IC, called 'Pulsar'. I'm yet to figure out what
this one does, but I think it might have something to do with pulses.
The Pulsar 2 IC itself is hard to locate on the board because I don't know the actual part number, but I
think it's the Apple-branded one between the CPU sockets under the black plastic sheet, at least on the 2005 Power Macs.
Remember I said about *checks watch* ten minutes ago that the SMU being 'U2800' on the iMac G5 schematic will be relevant later? Well, time has passed, and now later is now. Because the chip that I suspected of being an SMU on the Late 2005 Power Mac G5, was also labeled 'U2800' on the actual Power Mac G5 board. Which means that, at least between the Power Mac G5 and iMac G5, component designators seem to match to some extent. And the Apple-branded IC between the CPU sockets? U2500, just like the iMac G5 schematic.
(The Apple-branded IC, which I think is the Pulsar 2 IC; the circuit seems similar-ish to iMac G5 schematic)
All of this is important for one reason and one reason only: there seem to be no strap resistors next to it, neither on the Power Mac G5 board, nor in the iMac G5 schematic.
But not all hope is lost yet.
Now, the Pulsar 2 IC seems to be in charge of generating virtually all of the clocks for the system, except, I assume, for the SMU clock. But apart from the myriads of clock signal output pins, it has two pins that are of
great interest to us. SCLK and SDATA, which are the two pins that might allow us to control the Pulsar 2 IC, and thus set PI reference clocks. But where do they lead?
What's connected to them? Who's been pulling the strings behind the curtain this entire t-
It's the SPU.
It's always the SPU.
SCLK of Pulsar 2 is conencted to 'I2C_CLOCK_B_SCL', SDATA is connected to 'I2C_CLOCK_B_SDA', and these are both connected to SMU I2C 'B' bus, on which the SMU is the master.
And all of this is well and good, but what do we do now? I mean, it would obviously be extremely hard to gain access to the SMU. You'd probably need to solder tiny wires to the pins of the microcontroller just to gain any access to it. I mean... It's not like the SMU would just conveniently support communicating over UART... And surely,
surely there would be no convenient debug connector right there on the board, that's been there this entire time, labeled 'SMU'
right on the board and called
J2904 in the 2005 iMac G5 schematic and
J2900 on the Late 2005 Power Mac G5 board?
I mean, we can
check...
Fingers crossed......
HOLY **** IT'S ****ING THERE
Not Out of the Woods Yet
I haven't yet attempted to connect to the SMU via UART. Partly because the connector is different and I don't know the pinout. There's a procedure for distinguishing UART pins when you know that something's UART, but I haven't ever done that, and I'd like to make sure I know the theory first. But also partly because this is probably just the beggining, not the end:
- I'm not sure the thing will talk to me in plain English, so protocol reverse engineering might be in order.
- These microcontrollers apparently have some sort of flash protection, so I might need to brute-force that in order to access anything, and god knows how long that will take.
- Even assuming I can access the flash, right now I've no clue what to do with the resulting binary file, except try and find patterns and checksums, and hope something works.
Right now I don't really have time for this, so this is where I stop. If you want to continue this work, please do so. (Although it goes without saying, don't go sending random stuff into your SMU unless you understand that this can result in a bricked system, delicious medium-rare CPU daughtercards or even a deep-fried motherboard, and you're willing to accept this as a possible consequence of your actions)
There's also the problem of the non-2005 Power Mac G5, which does not, in fact, have a convenient connector like the Late 2005 Power Mac G5. I can see no 'SMU' label anywhere on the board.
Although the non-2005 G5 board might simply not have it soldered on or labeled. There are holes for a 20-pin header next to the IO. There are pads for what I assume is an FPC-style connector next to the big ATX-style power connector on the bottom of the board. And most interestingly, there are also pads like that next to the what seems to be the SMU itself, labeled 'J7'.
All in all, here's the main takeaway: it doesn't seem to me like OpenFirmware has anything to do with processor speed. It might do bus slewing or something, but it doesn't set reference clocks, which instead seem to be set by the SMU/PMU using the Apple-specific 'Pulsar' family chips.
It
may be the case that OpenFirmware can set the desired processor frequency after the fact. But this design option seems kinda dumb compared to just flashing it into the SMU. You'd seemingly have to bring up the whole system just to know your clocks when you absolutely don't have to do it that way. It's far easier and far more sane to keep system-specific stuff in the SMU, and then OpenFirmware is just the same for all models in a given year/period.
And with that, my work is done here.
Shasta la vesta, kodiak
(I've been keeping this joke in this whole time, I earned it)