Rhapsody DR2 PowerPC 750 ("G3") Cache Enabler Driver Version 1.2 LICENSE ------- /* * Copyright 1998 by Kenneth C. Dyke * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and * that both the copyright notice and this permission notice appear in * supporting documentation. * * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT, OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ DRIVER INSTALLATION (G3CacheEnabler) ------------------------------------ Unfortunately since there isn't a great way to build .pkg files on Rhapsody (that I've found), you'll just have to do this yourself by hand. I'm going to assume that you know enough about using Terminal.app that you can do the following steps yourself. This software is probably for hardcore fringe users anyway, so some of this may be obvious. You will need to be logged in as root to perform all of the following operations. G3Control will also need to be run as root in order to make configuration changes. AppOpener is useful for this. The first thing to do is copy the G3CacheEnabler.config directory to the /private/Devices directory on your system. The next step depends on whether or not a .model description file exisits for your particular card. Since I have a MAXpowr G3 300/300 1MB, I have provided a sample .model file for that configuration. If a model file exists for your card, skip down to APPLICATION INSTALLATION. If there is no configuration file for your card, then you will have to create one by hand. Your best bet is to copy one of the provided .model files to a new file. One important thing to do is make sure that you set the Title key in the file to something unique, otherwise G3Control will probably not do what you expect. A list of all the keys you may have to change and their meanings are described below under CONFIGURATION. I strongly recommend that you leave the CacheEnable key set to NO in your .model file until things are verified to be working properly. APPLICATION INSTALLATION AND USAGE (G3Control) ---------------------------------------------- You may place G3Control.app anywhere that you'd like. One reasonable place is probably /Local/Administration. G3Control is a simple little application that lets you play with some of the cache settings on your card. It also does neat stuff like tell you your current CPU clock speed (approximate), bus speed, L2 cache speed, and even the current temperature of the CPU. Note that if you do not run G3Control as root, you will not be able to change any of the cache configuration. The CPU speed and temperature monitor stuff will still work, though. I'm not going to go into major detail into using the control panel since most of it is self-explanatory and I hate writing documentation. The firt time you run G3Control, you should choose which model G3 card you have using the Model: popup. Once that is done you may change any of the other settings if you don't like the defaults provided in the .model file. However, doing things like trying to specify more cache than you have or seriously overclocking your cache speed are likely to result in much unhappiness when you try to start the driver. As a suggestion, I would probably leave the box marked "Enable cache on restart" turned off until you are satisfied everything is working properly. This will prevent the cache from being turned on when the driver starts up. Exit from G3Control before performing the next step. STARTING THE DRIVER FOR THE FIRST TIME -------------------------------------- What *I* would do at this point is issue the UNIX 'sync' command a few times in a Terminal window just in case you blow up your machine during the next step. If you lock up your system you'll have to hard reset it, and I'd rather have the filesystem at least *somewhat* in sync before that happens. Start up the driver by entering "driverLoader D=G3CacheEnabler" in a UNIX shell. If all goes well the command should return with no error messages, and your system won't have just locked up. At this point, restart G3Control. Verify that the right model has been chosen and that the settings you chose before are all correct. G3Control should be reporting your CPU speed, system bus speed and the CPU temperature. The L2 cache speed should not be reported since the L2 cache should still be off at this point. Now might be a good time for that 'sync' command again. ;) Press the 'Enable Now' button. If all goes well, the L2 cache will be enabled and almost nothing interesting will happen, which in this case is good. If something 'interesting' happens, then there is probably something wrong with your configuration file or one of your settings. Double-check everything and try again. Until you are convinced that your system is stable, I would suggest that you manually start the driver up via driverLoader and enable it with G3Control. Once you are convinced that your system is stable with the L2 cache turned on, you can add the "driverLoader D=G3CacheEnabler" line to the /etc/startup/0300_Devices file so that the L2 cache is turned on by default when you boot up your machine. I placed it first in line since I'm a geek and want the cache turned on as early as possible. ;) You can then also check the "Enable Cache on Restart" box in G3Control so that the L2 cache is enabled as soon as the driver is loaded. MODEL FILE CONFIGURATION ------------------------ This is the tricky part. There are unfortunately a LOT of things that can be configured on the 750s L2 cache controller. What I had to do was pull the heatsink off of my card and get the part number for the SRAM. Then I went to the vendor's web site and downloaded the data sheets for that part. If it helps, the following settings are what I'm using for my NewerTech MaxPower G3 300/300 1MB that's using IBM 43641 SRAMs. I can't guarantee that different revisions of the card won't require different settings, though. "CacheEnable" = "YES"; This can be YES or NO. During initial installation, set this to NO. "CacheParityEnable" = "YES"; This should be YES if your L2 cache ram supports parity, and NO if it doesn't. "CacheRAMSize" = "3"; Options: "0" - Reserved, don't pick this. "1" - 256K "2" - 512K "3" - 1024K (1MB) "CacheClockRatio" = "1"; This option controls the clock speed ratio between the CPU internal clock speed and the L2 clock speed. For cards like the G3 300/300's, you'll want to use "1". For cards like a G3 300/150, you'll want to use a setting of "4". Options: "0" - Clock disable, probably not a good idea. "1" - 1:1 "2" - 1:1.5 "3" - Reserved. "4" - 1:2 "5" - 1:2.5 "6" - 1:3 "7" - Reserved. "CacheRAMType" = "3"; This configures the type of SRAM used on your card. Options: "0" - Flow-through (regsiter-buffer) synchronous burst SRAM "1" - Reserved. "2" - Pipelined (register-register) synchronous burst SRAM "3" - Pipelined (register-register) synchronous late-write SRAM "CacheControl" = "YES"; This is named funny, but it controls the low-power mode available on some L2 cache RAMS. Options are "YES" to enable low-power mode control from the CPU, and "NO" to disable it. "CacheWriteThrough" = "NO"; This controls whether your L2 cache operates in write-through mode rather than the (usually) faster write-back mode. Options are "YES" to force write-through, and "NO" to use write-back mode. "CacheOutputHold" = "1"; The controls the hold time of the L2 cache signals from the CPU. These depend on the type of SRAM in your system. Options: "0" - 0.5nS "1" - 1.0nS "CacheDLLSlow" = "NO"; This is used to increase the delay tap of the DLL delay line in the CPU. This should generally be set to "YES" if your SRAM speed is going to run below 100Mhz (probably not likely). "CacheDifferentialClock" = "YES"; This controls whether the 750 uses it's L2 clock signals as a differential clock. According to the 750 documentation, this should generally be used for late-write SRAMs. (I have to have it turned on, even though the documentation for my SRAMS seems to indicate it isn't needed - I could be reading the documentation wrong, though.) "CacheDLLBypass" = "NO"; Don't mess with this. It probably shouldn't even be a configuration option, but it's here just in case. Read the 750 docs from Motorola if you need to know what this option is for. If anyone knows of an automatic way to do any of this, *PLEASE* let me know and I'll add support for it. I'd MUCH rather have the configuration be as simple as it is for the GUI G3 Configuration utils that exist for MacOS. If any hardware vendors would be willing to provide this information for their particular cards, I'll consider building up a database of settings to be used. COMPILING --------- In order to compile G3CacheEnabler (the DriverKit driver) on DR2, you have to fix the kernserv/kern_server_types.h include file so that it #includes and not . Other than that everything should "just work". -Ken TODO / FUTURE WORK ------------------ The only thing I'd really like to do is provide a better database of known hardware configuration files so users don't have to muck about with nasty cache settings. Unfortunately I can't do this by myself. I will be more than happy to add .model files if I get configuration information from hardware vendors. Oh, I'd like to rewrite the documentation at some point too. CHANGES ------- 1.0a - Initial release 1.0b - Minor update to Default.table. No code changes. 1.1 - Added many new features to G3CacheEnabler: Added G3Control.app Cache configuration can be changed on the fly Dynamic Power Management is now enabled on the 750 CPU Junction temperature monitoring CPU and bus clock calculations (needed for thermal management stuff) 1.2 - Minor update to the kernel driver. There is now a timeout on the temperature calculation code to prevent it from ever spinning forever just in case something goes wrong. I also started distributing the source code with a newer license agreement. SUGGESTIONS, SUCCESS STORIES, HATE MAIL --------------------------------------- I'd love to hear suggestions on how to improve this driver, especially if you know ways to auto-detect any of the SRAM settings. I suspect that the invidual card vendors may have some way to do it that I'm not aware of, and I don't want to go and reverse-engineer their MacOS apps to figure it out. If you need to contact me, please send email to kcd@jumpgate.com. NeXTMail is acceptable. -Kenneth