Path: blob/master/arch/powerpc/platforms/powermac/cpufreq_64.c
10818 views
/*1* Copyright (C) 2002 - 2005 Benjamin Herrenschmidt <[email protected]>2* and Markus Demleitner <[email protected]>3*4* This program is free software; you can redistribute it and/or modify5* it under the terms of the GNU General Public License version 2 as6* published by the Free Software Foundation.7*8* This driver adds basic cpufreq support for SMU & 970FX based G5 Macs,9* that is iMac G5 and latest single CPU desktop.10*/1112#undef DEBUG1314#include <linux/module.h>15#include <linux/types.h>16#include <linux/errno.h>17#include <linux/kernel.h>18#include <linux/delay.h>19#include <linux/sched.h>20#include <linux/cpufreq.h>21#include <linux/init.h>22#include <linux/completion.h>23#include <linux/mutex.h>24#include <asm/prom.h>25#include <asm/machdep.h>26#include <asm/irq.h>27#include <asm/sections.h>28#include <asm/cputable.h>29#include <asm/time.h>30#include <asm/smu.h>31#include <asm/pmac_pfunc.h>3233#define DBG(fmt...) pr_debug(fmt)3435/* see 970FX user manual */3637#define SCOM_PCR 0x0aa001 /* PCR scom addr */3839#define PCR_HILO_SELECT 0x80000000U /* 1 = PCR, 0 = PCRH */40#define PCR_SPEED_FULL 0x00000000U /* 1:1 speed value */41#define PCR_SPEED_HALF 0x00020000U /* 1:2 speed value */42#define PCR_SPEED_QUARTER 0x00040000U /* 1:4 speed value */43#define PCR_SPEED_MASK 0x000e0000U /* speed mask */44#define PCR_SPEED_SHIFT 1745#define PCR_FREQ_REQ_VALID 0x00010000U /* freq request valid */46#define PCR_VOLT_REQ_VALID 0x00008000U /* volt request valid */47#define PCR_TARGET_TIME_MASK 0x00006000U /* target time */48#define PCR_STATLAT_MASK 0x00001f00U /* STATLAT value */49#define PCR_SNOOPLAT_MASK 0x000000f0U /* SNOOPLAT value */50#define PCR_SNOOPACC_MASK 0x0000000fU /* SNOOPACC value */5152#define SCOM_PSR 0x408001 /* PSR scom addr */53/* warning: PSR is a 64 bits register */54#define PSR_CMD_RECEIVED 0x2000000000000000U /* command received */55#define PSR_CMD_COMPLETED 0x1000000000000000U /* command completed */56#define PSR_CUR_SPEED_MASK 0x0300000000000000U /* current speed */57#define PSR_CUR_SPEED_SHIFT (56)5859/*60* The G5 only supports two frequencies (Quarter speed is not supported)61*/62#define CPUFREQ_HIGH 063#define CPUFREQ_LOW 16465static struct cpufreq_frequency_table g5_cpu_freqs[] = {66{CPUFREQ_HIGH, 0},67{CPUFREQ_LOW, 0},68{0, CPUFREQ_TABLE_END},69};7071static struct freq_attr* g5_cpu_freqs_attr[] = {72&cpufreq_freq_attr_scaling_available_freqs,73NULL,74};7576/* Power mode data is an array of the 32 bits PCR values to use for77* the various frequencies, retrieved from the device-tree78*/79static int g5_pmode_cur;8081static void (*g5_switch_volt)(int speed_mode);82static int (*g5_switch_freq)(int speed_mode);83static int (*g5_query_freq)(void);8485static DEFINE_MUTEX(g5_switch_mutex);8687static unsigned long transition_latency;8889#ifdef CONFIG_PMAC_SMU9091static const u32 *g5_pmode_data;92static int g5_pmode_max;9394static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */95static int g5_fvt_count; /* number of op. points */96static int g5_fvt_cur; /* current op. point */9798/*99* SMU based voltage switching for Neo2 platforms100*/101102static void g5_smu_switch_volt(int speed_mode)103{104struct smu_simple_cmd cmd;105106DECLARE_COMPLETION_ONSTACK(comp);107smu_queue_simple(&cmd, SMU_CMD_POWER_COMMAND, 8, smu_done_complete,108&comp, 'V', 'S', 'L', 'E', 'W',1090xff, g5_fvt_cur+1, speed_mode);110wait_for_completion(&comp);111}112113/*114* Platform function based voltage/vdnap switching for Neo2115*/116117static struct pmf_function *pfunc_set_vdnap0;118static struct pmf_function *pfunc_vdnap0_complete;119120static void g5_vdnap_switch_volt(int speed_mode)121{122struct pmf_args args;123u32 slew, done = 0;124unsigned long timeout;125126slew = (speed_mode == CPUFREQ_LOW) ? 1 : 0;127args.count = 1;128args.u[0].p = &slew;129130pmf_call_one(pfunc_set_vdnap0, &args);131132/* It's an irq GPIO so we should be able to just block here,133* I'll do that later after I've properly tested the IRQ code for134* platform functions135*/136timeout = jiffies + HZ/10;137while(!time_after(jiffies, timeout)) {138args.count = 1;139args.u[0].p = &done;140pmf_call_one(pfunc_vdnap0_complete, &args);141if (done)142break;143msleep(1);144}145if (done == 0)146printk(KERN_WARNING "cpufreq: Timeout in clock slewing !\n");147}148149150/*151* SCOM based frequency switching for 970FX rev3152*/153static int g5_scom_switch_freq(int speed_mode)154{155unsigned long flags;156int to;157158/* If frequency is going up, first ramp up the voltage */159if (speed_mode < g5_pmode_cur)160g5_switch_volt(speed_mode);161162local_irq_save(flags);163164/* Clear PCR high */165scom970_write(SCOM_PCR, 0);166/* Clear PCR low */167scom970_write(SCOM_PCR, PCR_HILO_SELECT | 0);168/* Set PCR low */169scom970_write(SCOM_PCR, PCR_HILO_SELECT |170g5_pmode_data[speed_mode]);171172/* Wait for completion */173for (to = 0; to < 10; to++) {174unsigned long psr = scom970_read(SCOM_PSR);175176if ((psr & PSR_CMD_RECEIVED) == 0 &&177(((psr >> PSR_CUR_SPEED_SHIFT) ^178(g5_pmode_data[speed_mode] >> PCR_SPEED_SHIFT)) & 0x3)179== 0)180break;181if (psr & PSR_CMD_COMPLETED)182break;183udelay(100);184}185186local_irq_restore(flags);187188/* If frequency is going down, last ramp the voltage */189if (speed_mode > g5_pmode_cur)190g5_switch_volt(speed_mode);191192g5_pmode_cur = speed_mode;193ppc_proc_freq = g5_cpu_freqs[speed_mode].frequency * 1000ul;194195return 0;196}197198static int g5_scom_query_freq(void)199{200unsigned long psr = scom970_read(SCOM_PSR);201int i;202203for (i = 0; i <= g5_pmode_max; i++)204if ((((psr >> PSR_CUR_SPEED_SHIFT) ^205(g5_pmode_data[i] >> PCR_SPEED_SHIFT)) & 0x3) == 0)206break;207return i;208}209210/*211* Fake voltage switching for platforms with missing support212*/213214static void g5_dummy_switch_volt(int speed_mode)215{216}217218#endif /* CONFIG_PMAC_SMU */219220/*221* Platform function based voltage switching for PowerMac7,2 & 7,3222*/223224static struct pmf_function *pfunc_cpu0_volt_high;225static struct pmf_function *pfunc_cpu0_volt_low;226static struct pmf_function *pfunc_cpu1_volt_high;227static struct pmf_function *pfunc_cpu1_volt_low;228229static void g5_pfunc_switch_volt(int speed_mode)230{231if (speed_mode == CPUFREQ_HIGH) {232if (pfunc_cpu0_volt_high)233pmf_call_one(pfunc_cpu0_volt_high, NULL);234if (pfunc_cpu1_volt_high)235pmf_call_one(pfunc_cpu1_volt_high, NULL);236} else {237if (pfunc_cpu0_volt_low)238pmf_call_one(pfunc_cpu0_volt_low, NULL);239if (pfunc_cpu1_volt_low)240pmf_call_one(pfunc_cpu1_volt_low, NULL);241}242msleep(10); /* should be faster , to fix */243}244245/*246* Platform function based frequency switching for PowerMac7,2 & 7,3247*/248249static struct pmf_function *pfunc_cpu_setfreq_high;250static struct pmf_function *pfunc_cpu_setfreq_low;251static struct pmf_function *pfunc_cpu_getfreq;252static struct pmf_function *pfunc_slewing_done;253254static int g5_pfunc_switch_freq(int speed_mode)255{256struct pmf_args args;257u32 done = 0;258unsigned long timeout;259int rc;260261DBG("g5_pfunc_switch_freq(%d)\n", speed_mode);262263/* If frequency is going up, first ramp up the voltage */264if (speed_mode < g5_pmode_cur)265g5_switch_volt(speed_mode);266267/* Do it */268if (speed_mode == CPUFREQ_HIGH)269rc = pmf_call_one(pfunc_cpu_setfreq_high, NULL);270else271rc = pmf_call_one(pfunc_cpu_setfreq_low, NULL);272273if (rc)274printk(KERN_WARNING "cpufreq: pfunc switch error %d\n", rc);275276/* It's an irq GPIO so we should be able to just block here,277* I'll do that later after I've properly tested the IRQ code for278* platform functions279*/280timeout = jiffies + HZ/10;281while(!time_after(jiffies, timeout)) {282args.count = 1;283args.u[0].p = &done;284pmf_call_one(pfunc_slewing_done, &args);285if (done)286break;287msleep(1);288}289if (done == 0)290printk(KERN_WARNING "cpufreq: Timeout in clock slewing !\n");291292/* If frequency is going down, last ramp the voltage */293if (speed_mode > g5_pmode_cur)294g5_switch_volt(speed_mode);295296g5_pmode_cur = speed_mode;297ppc_proc_freq = g5_cpu_freqs[speed_mode].frequency * 1000ul;298299return 0;300}301302static int g5_pfunc_query_freq(void)303{304struct pmf_args args;305u32 val = 0;306307args.count = 1;308args.u[0].p = &val;309pmf_call_one(pfunc_cpu_getfreq, &args);310return val ? CPUFREQ_HIGH : CPUFREQ_LOW;311}312313314/*315* Common interface to the cpufreq core316*/317318static int g5_cpufreq_verify(struct cpufreq_policy *policy)319{320return cpufreq_frequency_table_verify(policy, g5_cpu_freqs);321}322323static int g5_cpufreq_target(struct cpufreq_policy *policy,324unsigned int target_freq, unsigned int relation)325{326unsigned int newstate = 0;327struct cpufreq_freqs freqs;328int rc;329330if (cpufreq_frequency_table_target(policy, g5_cpu_freqs,331target_freq, relation, &newstate))332return -EINVAL;333334if (g5_pmode_cur == newstate)335return 0;336337mutex_lock(&g5_switch_mutex);338339freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency;340freqs.new = g5_cpu_freqs[newstate].frequency;341freqs.cpu = 0;342343cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);344rc = g5_switch_freq(newstate);345cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);346347mutex_unlock(&g5_switch_mutex);348349return rc;350}351352static unsigned int g5_cpufreq_get_speed(unsigned int cpu)353{354return g5_cpu_freqs[g5_pmode_cur].frequency;355}356357static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy)358{359policy->cpuinfo.transition_latency = transition_latency;360policy->cur = g5_cpu_freqs[g5_query_freq()].frequency;361/* secondary CPUs are tied to the primary one by the362* cpufreq core if in the secondary policy we tell it that363* it actually must be one policy together with all others. */364cpumask_copy(policy->cpus, cpu_online_mask);365cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu);366367return cpufreq_frequency_table_cpuinfo(policy,368g5_cpu_freqs);369}370371372static struct cpufreq_driver g5_cpufreq_driver = {373.name = "powermac",374.owner = THIS_MODULE,375.flags = CPUFREQ_CONST_LOOPS,376.init = g5_cpufreq_cpu_init,377.verify = g5_cpufreq_verify,378.target = g5_cpufreq_target,379.get = g5_cpufreq_get_speed,380.attr = g5_cpu_freqs_attr,381};382383384#ifdef CONFIG_PMAC_SMU385386static int __init g5_neo2_cpufreq_init(struct device_node *cpus)387{388struct device_node *cpunode;389unsigned int psize, ssize;390unsigned long max_freq;391char *freq_method, *volt_method;392const u32 *valp;393u32 pvr_hi;394int use_volts_vdnap = 0;395int use_volts_smu = 0;396int rc = -ENODEV;397398/* Check supported platforms */399if (of_machine_is_compatible("PowerMac8,1") ||400of_machine_is_compatible("PowerMac8,2") ||401of_machine_is_compatible("PowerMac9,1"))402use_volts_smu = 1;403else if (of_machine_is_compatible("PowerMac11,2"))404use_volts_vdnap = 1;405else406return -ENODEV;407408/* Get first CPU node */409for (cpunode = NULL;410(cpunode = of_get_next_child(cpus, cpunode)) != NULL;) {411const u32 *reg = of_get_property(cpunode, "reg", NULL);412if (reg == NULL || (*reg) != 0)413continue;414if (!strcmp(cpunode->type, "cpu"))415break;416}417if (cpunode == NULL) {418printk(KERN_ERR "cpufreq: Can't find any CPU 0 node\n");419return -ENODEV;420}421422/* Check 970FX for now */423valp = of_get_property(cpunode, "cpu-version", NULL);424if (!valp) {425DBG("No cpu-version property !\n");426goto bail_noprops;427}428pvr_hi = (*valp) >> 16;429if (pvr_hi != 0x3c && pvr_hi != 0x44) {430printk(KERN_ERR "cpufreq: Unsupported CPU version\n");431goto bail_noprops;432}433434/* Look for the powertune data in the device-tree */435g5_pmode_data = of_get_property(cpunode, "power-mode-data",&psize);436if (!g5_pmode_data) {437DBG("No power-mode-data !\n");438goto bail_noprops;439}440g5_pmode_max = psize / sizeof(u32) - 1;441442if (use_volts_smu) {443const struct smu_sdbp_header *shdr;444445/* Look for the FVT table */446shdr = smu_get_sdb_partition(SMU_SDB_FVT_ID, NULL);447if (!shdr)448goto bail_noprops;449g5_fvt_table = (struct smu_sdbp_fvt *)&shdr[1];450ssize = (shdr->len * sizeof(u32)) -451sizeof(struct smu_sdbp_header);452g5_fvt_count = ssize / sizeof(struct smu_sdbp_fvt);453g5_fvt_cur = 0;454455/* Sanity checking */456if (g5_fvt_count < 1 || g5_pmode_max < 1)457goto bail_noprops;458459g5_switch_volt = g5_smu_switch_volt;460volt_method = "SMU";461} else if (use_volts_vdnap) {462struct device_node *root;463464root = of_find_node_by_path("/");465if (root == NULL) {466printk(KERN_ERR "cpufreq: Can't find root of "467"device tree\n");468goto bail_noprops;469}470pfunc_set_vdnap0 = pmf_find_function(root, "set-vdnap0");471pfunc_vdnap0_complete =472pmf_find_function(root, "slewing-done");473if (pfunc_set_vdnap0 == NULL ||474pfunc_vdnap0_complete == NULL) {475printk(KERN_ERR "cpufreq: Can't find required "476"platform function\n");477goto bail_noprops;478}479480g5_switch_volt = g5_vdnap_switch_volt;481volt_method = "GPIO";482} else {483g5_switch_volt = g5_dummy_switch_volt;484volt_method = "none";485}486487/*488* From what I see, clock-frequency is always the maximal frequency.489* The current driver can not slew sysclk yet, so we really only deal490* with powertune steps for now. We also only implement full freq and491* half freq in this version. So far, I haven't yet seen a machine492* supporting anything else.493*/494valp = of_get_property(cpunode, "clock-frequency", NULL);495if (!valp)496return -ENODEV;497max_freq = (*valp)/1000;498g5_cpu_freqs[0].frequency = max_freq;499g5_cpu_freqs[1].frequency = max_freq/2;500501/* Set callbacks */502transition_latency = 12000;503g5_switch_freq = g5_scom_switch_freq;504g5_query_freq = g5_scom_query_freq;505freq_method = "SCOM";506507/* Force apply current frequency to make sure everything is in508* sync (voltage is right for example). Firmware may leave us with509* a strange setting ...510*/511g5_switch_volt(CPUFREQ_HIGH);512msleep(10);513g5_pmode_cur = -1;514g5_switch_freq(g5_query_freq());515516printk(KERN_INFO "Registering G5 CPU frequency driver\n");517printk(KERN_INFO "Frequency method: %s, Voltage method: %s\n",518freq_method, volt_method);519printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Cur: %d MHz\n",520g5_cpu_freqs[1].frequency/1000,521g5_cpu_freqs[0].frequency/1000,522g5_cpu_freqs[g5_pmode_cur].frequency/1000);523524rc = cpufreq_register_driver(&g5_cpufreq_driver);525526/* We keep the CPU node on hold... hopefully, Apple G5 don't have527* hotplug CPU with a dynamic device-tree ...528*/529return rc;530531bail_noprops:532of_node_put(cpunode);533534return rc;535}536537#endif /* CONFIG_PMAC_SMU */538539540static int __init g5_pm72_cpufreq_init(struct device_node *cpus)541{542struct device_node *cpuid = NULL, *hwclock = NULL, *cpunode = NULL;543const u8 *eeprom = NULL;544const u32 *valp;545u64 max_freq, min_freq, ih, il;546int has_volt = 1, rc = 0;547548DBG("cpufreq: Initializing for PowerMac7,2, PowerMac7,3 and"549" RackMac3,1...\n");550551/* Get first CPU node */552for (cpunode = NULL;553(cpunode = of_get_next_child(cpus, cpunode)) != NULL;) {554if (!strcmp(cpunode->type, "cpu"))555break;556}557if (cpunode == NULL) {558printk(KERN_ERR "cpufreq: Can't find any CPU node\n");559return -ENODEV;560}561562/* Lookup the cpuid eeprom node */563cpuid = of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/cpuid@a0");564if (cpuid != NULL)565eeprom = of_get_property(cpuid, "cpuid", NULL);566if (eeprom == NULL) {567printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n");568rc = -ENODEV;569goto bail;570}571572/* Lookup the i2c hwclock */573for (hwclock = NULL;574(hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){575const char *loc = of_get_property(hwclock,576"hwctrl-location", NULL);577if (loc == NULL)578continue;579if (strcmp(loc, "CPU CLOCK"))580continue;581if (!of_get_property(hwclock, "platform-get-frequency", NULL))582continue;583break;584}585if (hwclock == NULL) {586printk(KERN_ERR "cpufreq: Can't find i2c clock chip !\n");587rc = -ENODEV;588goto bail;589}590591DBG("cpufreq: i2c clock chip found: %s\n", hwclock->full_name);592593/* Now get all the platform functions */594pfunc_cpu_getfreq =595pmf_find_function(hwclock, "get-frequency");596pfunc_cpu_setfreq_high =597pmf_find_function(hwclock, "set-frequency-high");598pfunc_cpu_setfreq_low =599pmf_find_function(hwclock, "set-frequency-low");600pfunc_slewing_done =601pmf_find_function(hwclock, "slewing-done");602pfunc_cpu0_volt_high =603pmf_find_function(hwclock, "set-voltage-high-0");604pfunc_cpu0_volt_low =605pmf_find_function(hwclock, "set-voltage-low-0");606pfunc_cpu1_volt_high =607pmf_find_function(hwclock, "set-voltage-high-1");608pfunc_cpu1_volt_low =609pmf_find_function(hwclock, "set-voltage-low-1");610611/* Check we have minimum requirements */612if (pfunc_cpu_getfreq == NULL || pfunc_cpu_setfreq_high == NULL ||613pfunc_cpu_setfreq_low == NULL || pfunc_slewing_done == NULL) {614printk(KERN_ERR "cpufreq: Can't find platform functions !\n");615rc = -ENODEV;616goto bail;617}618619/* Check that we have complete sets */620if (pfunc_cpu0_volt_high == NULL || pfunc_cpu0_volt_low == NULL) {621pmf_put_function(pfunc_cpu0_volt_high);622pmf_put_function(pfunc_cpu0_volt_low);623pfunc_cpu0_volt_high = pfunc_cpu0_volt_low = NULL;624has_volt = 0;625}626if (!has_volt ||627pfunc_cpu1_volt_high == NULL || pfunc_cpu1_volt_low == NULL) {628pmf_put_function(pfunc_cpu1_volt_high);629pmf_put_function(pfunc_cpu1_volt_low);630pfunc_cpu1_volt_high = pfunc_cpu1_volt_low = NULL;631}632633/* Note: The device tree also contains a "platform-set-values"634* function for which I haven't quite figured out the usage. It635* might have to be called on init and/or wakeup, I'm not too sure636* but things seem to work fine without it so far ...637*/638639/* Get max frequency from device-tree */640valp = of_get_property(cpunode, "clock-frequency", NULL);641if (!valp) {642printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n");643rc = -ENODEV;644goto bail;645}646647max_freq = (*valp)/1000;648649/* Now calculate reduced frequency by using the cpuid input freq650* ratio. This requires 64 bits math unless we are willing to lose651* some precision652*/653ih = *((u32 *)(eeprom + 0x10));654il = *((u32 *)(eeprom + 0x20));655656/* Check for machines with no useful settings */657if (il == ih) {658printk(KERN_WARNING "cpufreq: No low frequency mode available"659" on this model !\n");660rc = -ENODEV;661goto bail;662}663664min_freq = 0;665if (ih != 0 && il != 0)666min_freq = (max_freq * il) / ih;667668/* Sanity check */669if (min_freq >= max_freq || min_freq < 1000) {670printk(KERN_ERR "cpufreq: Can't calculate low frequency !\n");671rc = -ENXIO;672goto bail;673}674g5_cpu_freqs[0].frequency = max_freq;675g5_cpu_freqs[1].frequency = min_freq;676677/* Set callbacks */678transition_latency = CPUFREQ_ETERNAL;679g5_switch_volt = g5_pfunc_switch_volt;680g5_switch_freq = g5_pfunc_switch_freq;681g5_query_freq = g5_pfunc_query_freq;682683/* Force apply current frequency to make sure everything is in684* sync (voltage is right for example). Firmware may leave us with685* a strange setting ...686*/687g5_switch_volt(CPUFREQ_HIGH);688msleep(10);689g5_pmode_cur = -1;690g5_switch_freq(g5_query_freq());691692printk(KERN_INFO "Registering G5 CPU frequency driver\n");693printk(KERN_INFO "Frequency method: i2c/pfunc, "694"Voltage method: %s\n", has_volt ? "i2c/pfunc" : "none");695printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Cur: %d MHz\n",696g5_cpu_freqs[1].frequency/1000,697g5_cpu_freqs[0].frequency/1000,698g5_cpu_freqs[g5_pmode_cur].frequency/1000);699700rc = cpufreq_register_driver(&g5_cpufreq_driver);701bail:702if (rc != 0) {703pmf_put_function(pfunc_cpu_getfreq);704pmf_put_function(pfunc_cpu_setfreq_high);705pmf_put_function(pfunc_cpu_setfreq_low);706pmf_put_function(pfunc_slewing_done);707pmf_put_function(pfunc_cpu0_volt_high);708pmf_put_function(pfunc_cpu0_volt_low);709pmf_put_function(pfunc_cpu1_volt_high);710pmf_put_function(pfunc_cpu1_volt_low);711}712of_node_put(hwclock);713of_node_put(cpuid);714of_node_put(cpunode);715716return rc;717}718719static int __init g5_cpufreq_init(void)720{721struct device_node *cpus;722int rc = 0;723724cpus = of_find_node_by_path("/cpus");725if (cpus == NULL) {726DBG("No /cpus node !\n");727return -ENODEV;728}729730if (of_machine_is_compatible("PowerMac7,2") ||731of_machine_is_compatible("PowerMac7,3") ||732of_machine_is_compatible("RackMac3,1"))733rc = g5_pm72_cpufreq_init(cpus);734#ifdef CONFIG_PMAC_SMU735else736rc = g5_neo2_cpufreq_init(cpus);737#endif /* CONFIG_PMAC_SMU */738739of_node_put(cpus);740return rc;741}742743module_init(g5_cpufreq_init);744745746MODULE_LICENSE("GPL");747748749