diff options
author | Takashi Yamamoto <TakashiA.Yamamoto@jp.sony.com> | 2008-01-18 15:32:46 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-25 06:52:53 -0500 |
commit | 781749a46b34dc5c9e4000df7b9d37d675c17463 (patch) | |
tree | 98b51b049f48804978c9139db6427945a1186963 /include/asm-powerpc/ps3.h | |
parent | ed7570022a42a60ecb67c53f429bc96c7bc5597d (diff) |
[POWERPC] PS3: Add logical performance monitor driver support
Add PS3 logical performance monitor (lpm) device driver.
The PS3's LV1 hypervisor provides a Logical Performance Monitor that
abstracts the Cell processor's performance monitor features for use
by guest operating systems.
Signed-off-by: Takashi Yamamoto <TakashiA.Yamamoto@jp.sony.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/ps3.h')
-rw-r--r-- | include/asm-powerpc/ps3.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h index 001121b3eb1b..2b693673eff4 100644 --- a/include/asm-powerpc/ps3.h +++ b/include/asm-powerpc/ps3.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <linux/device.h> | 26 | #include <linux/device.h> |
27 | #include "cell-pmu.h" | ||
27 | 28 | ||
28 | union ps3_firmware_version { | 29 | union ps3_firmware_version { |
29 | u64 raw; | 30 | u64 raw; |
@@ -446,5 +447,66 @@ struct ps3_prealloc { | |||
446 | extern struct ps3_prealloc ps3fb_videomemory; | 447 | extern struct ps3_prealloc ps3fb_videomemory; |
447 | extern struct ps3_prealloc ps3flash_bounce_buffer; | 448 | extern struct ps3_prealloc ps3flash_bounce_buffer; |
448 | 449 | ||
450 | /* logical performance monitor */ | ||
451 | |||
452 | /** | ||
453 | * enum ps3_lpm_rights - Rigths granted by the system policy module. | ||
454 | * | ||
455 | * @PS3_LPM_RIGHTS_USE_LPM: The right to use the lpm. | ||
456 | * @PS3_LPM_RIGHTS_USE_TB: The right to use the internal trace buffer. | ||
457 | */ | ||
458 | |||
459 | enum ps3_lpm_rights { | ||
460 | PS3_LPM_RIGHTS_USE_LPM = 0x001, | ||
461 | PS3_LPM_RIGHTS_USE_TB = 0x100, | ||
462 | }; | ||
463 | |||
464 | /** | ||
465 | * enum ps3_lpm_tb_type - Type of trace buffer lv1 should use. | ||
466 | * | ||
467 | * @PS3_LPM_TB_TYPE_NONE: Do not use a trace buffer. | ||
468 | * @PS3_LPM_RIGHTS_USE_TB: Use the lv1 internal trace buffer. Must have | ||
469 | * rights @PS3_LPM_RIGHTS_USE_TB. | ||
470 | */ | ||
471 | |||
472 | enum ps3_lpm_tb_type { | ||
473 | PS3_LPM_TB_TYPE_NONE = 0, | ||
474 | PS3_LPM_TB_TYPE_INTERNAL = 1, | ||
475 | }; | ||
476 | |||
477 | int ps3_lpm_open(enum ps3_lpm_tb_type tb_type, void *tb_cache, | ||
478 | u64 tb_cache_size); | ||
479 | int ps3_lpm_close(void); | ||
480 | int ps3_lpm_copy_tb(unsigned long offset, void *buf, unsigned long count, | ||
481 | unsigned long *bytes_copied); | ||
482 | int ps3_lpm_copy_tb_to_user(unsigned long offset, void __user *buf, | ||
483 | unsigned long count, unsigned long *bytes_copied); | ||
484 | void ps3_set_bookmark(u64 bookmark); | ||
485 | void ps3_set_pm_bookmark(u64 tag, u64 incident, u64 th_id); | ||
486 | int ps3_set_signal(u64 rtas_signal_group, u8 signal_bit, u16 sub_unit, | ||
487 | u8 bus_word); | ||
488 | |||
489 | u32 ps3_read_phys_ctr(u32 cpu, u32 phys_ctr); | ||
490 | void ps3_write_phys_ctr(u32 cpu, u32 phys_ctr, u32 val); | ||
491 | u32 ps3_read_ctr(u32 cpu, u32 ctr); | ||
492 | void ps3_write_ctr(u32 cpu, u32 ctr, u32 val); | ||
493 | |||
494 | u32 ps3_read_pm07_control(u32 cpu, u32 ctr); | ||
495 | void ps3_write_pm07_control(u32 cpu, u32 ctr, u32 val); | ||
496 | u32 ps3_read_pm(u32 cpu, enum pm_reg_name reg); | ||
497 | void ps3_write_pm(u32 cpu, enum pm_reg_name reg, u32 val); | ||
498 | |||
499 | u32 ps3_get_ctr_size(u32 cpu, u32 phys_ctr); | ||
500 | void ps3_set_ctr_size(u32 cpu, u32 phys_ctr, u32 ctr_size); | ||
501 | |||
502 | void ps3_enable_pm(u32 cpu); | ||
503 | void ps3_disable_pm(u32 cpu); | ||
504 | void ps3_enable_pm_interrupts(u32 cpu, u32 thread, u32 mask); | ||
505 | void ps3_disable_pm_interrupts(u32 cpu); | ||
506 | |||
507 | u32 ps3_get_and_clear_pm_interrupts(u32 cpu); | ||
508 | void ps3_sync_irq(int node); | ||
509 | u32 ps3_get_hw_thread_id(int cpu); | ||
510 | u64 ps3_get_spe_id(void *arg); | ||
449 | 511 | ||
450 | #endif | 512 | #endif |