diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2005-11-06 22:27:33 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-07 19:17:34 -0500 |
commit | 4350147a816b9c5b40fa59e4fa23f17490630b79 (patch) | |
tree | c333986047de60aa90809d669895726610c0c3e5 /include/asm-powerpc/smu.h | |
parent | a82765b6eee3d1267ded3320ca67b39fe1844599 (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 'include/asm-powerpc/smu.h')
-rw-r--r-- | include/asm-powerpc/smu.h | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/include/asm-powerpc/smu.h b/include/asm-powerpc/smu.h index dee8eefe47bc..959bad660233 100644 --- a/include/asm-powerpc/smu.h +++ b/include/asm-powerpc/smu.h | |||
@@ -144,7 +144,11 @@ | |||
144 | * - lenght 8 ("VSLEWxyz") has 3 additional bytes appended, and is | 144 | * - lenght 8 ("VSLEWxyz") has 3 additional bytes appended, and is |
145 | * used to set the voltage slewing point. The SMU replies with "DONE" | 145 | * used to set the voltage slewing point. The SMU replies with "DONE" |
146 | * I yet have to figure out their exact meaning of those 3 bytes in | 146 | * I yet have to figure out their exact meaning of those 3 bytes in |
147 | * both cases. | 147 | * both cases. They seem to be: |
148 | * x = processor mask | ||
149 | * y = op. point index | ||
150 | * z = processor freq. step index | ||
151 | * I haven't yet decyphered result codes | ||
148 | * | 152 | * |
149 | */ | 153 | */ |
150 | #define SMU_CMD_POWER_COMMAND 0xaa | 154 | #define SMU_CMD_POWER_COMMAND 0xaa |
@@ -333,6 +337,60 @@ extern int smu_queue_i2c(struct smu_i2c_cmd *cmd); | |||
333 | 337 | ||
334 | #endif /* __KERNEL__ */ | 338 | #endif /* __KERNEL__ */ |
335 | 339 | ||
340 | |||
341 | /* | ||
342 | * - SMU "sdb" partitions informations - | ||
343 | */ | ||
344 | |||
345 | |||
346 | /* | ||
347 | * Partition header format | ||
348 | */ | ||
349 | struct smu_sdbp_header { | ||
350 | __u8 id; | ||
351 | __u8 len; | ||
352 | __u8 version; | ||
353 | __u8 flags; | ||
354 | }; | ||
355 | |||
356 | /* | ||
357 | * 32 bits integers are usually encoded with 2x16 bits swapped, | ||
358 | * this demangles them | ||
359 | */ | ||
360 | #define SMU_U32_MIX(x) ((((x) << 16) & 0xffff0000u) | (((x) >> 16) & 0xffffu)) | ||
361 | |||
362 | /* This is the definition of the SMU sdb-partition-0x12 table (called | ||
363 | * CPU F/V/T operating points in Darwin). The definition for all those | ||
364 | * SMU tables should be moved to some separate file | ||
365 | */ | ||
366 | #define SMU_SDB_FVT_ID 0x12 | ||
367 | |||
368 | struct smu_sdbp_fvt { | ||
369 | __u32 sysclk; /* Base SysClk frequency in Hz for | ||
370 | * this operating point | ||
371 | */ | ||
372 | __u8 pad; | ||
373 | __u8 maxtemp; /* Max temp. supported by this | ||
374 | * operating point | ||
375 | */ | ||
376 | |||
377 | __u16 volts[3]; /* CPU core voltage for the 3 | ||
378 | * PowerTune modes, a mode with | ||
379 | * 0V = not supported. | ||
380 | */ | ||
381 | }; | ||
382 | |||
383 | #ifdef __KERNEL__ | ||
384 | /* | ||
385 | * This returns the pointer to an SMU "sdb" partition data or NULL | ||
386 | * if not found. The data format is described below | ||
387 | */ | ||
388 | extern struct smu_sdbp_header *smu_get_sdb_partition(int id, | ||
389 | unsigned int *size); | ||
390 | |||
391 | #endif /* __KERNEL__ */ | ||
392 | |||
393 | |||
336 | /* | 394 | /* |
337 | * - Userland interface - | 395 | * - Userland interface - |
338 | */ | 396 | */ |