diff options
Diffstat (limited to 'include/asm-powerpc/ps3.h')
-rw-r--r-- | include/asm-powerpc/ps3.h | 74 |
1 files changed, 72 insertions, 2 deletions
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h index f577a16c6728..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; |
@@ -317,6 +318,7 @@ enum ps3_match_id { | |||
317 | PS3_MATCH_ID_STOR_FLASH = 8, | 318 | PS3_MATCH_ID_STOR_FLASH = 8, |
318 | PS3_MATCH_ID_SOUND = 9, | 319 | PS3_MATCH_ID_SOUND = 9, |
319 | PS3_MATCH_ID_GRAPHICS = 10, | 320 | PS3_MATCH_ID_GRAPHICS = 10, |
321 | PS3_MATCH_ID_LPM = 11, | ||
320 | }; | 322 | }; |
321 | 323 | ||
322 | #define PS3_MODULE_ALIAS_EHCI "ps3:1" | 324 | #define PS3_MODULE_ALIAS_EHCI "ps3:1" |
@@ -329,11 +331,13 @@ enum ps3_match_id { | |||
329 | #define PS3_MODULE_ALIAS_STOR_FLASH "ps3:8" | 331 | #define PS3_MODULE_ALIAS_STOR_FLASH "ps3:8" |
330 | #define PS3_MODULE_ALIAS_SOUND "ps3:9" | 332 | #define PS3_MODULE_ALIAS_SOUND "ps3:9" |
331 | #define PS3_MODULE_ALIAS_GRAPHICS "ps3:10" | 333 | #define PS3_MODULE_ALIAS_GRAPHICS "ps3:10" |
334 | #define PS3_MODULE_ALIAS_LPM "ps3:11" | ||
332 | 335 | ||
333 | enum ps3_system_bus_device_type { | 336 | enum ps3_system_bus_device_type { |
334 | PS3_DEVICE_TYPE_IOC0 = 1, | 337 | PS3_DEVICE_TYPE_IOC0 = 1, |
335 | PS3_DEVICE_TYPE_SB, | 338 | PS3_DEVICE_TYPE_SB, |
336 | PS3_DEVICE_TYPE_VUART, | 339 | PS3_DEVICE_TYPE_VUART, |
340 | PS3_DEVICE_TYPE_LPM, | ||
337 | }; | 341 | }; |
338 | 342 | ||
339 | /** | 343 | /** |
@@ -344,12 +348,17 @@ struct ps3_system_bus_device { | |||
344 | enum ps3_match_id match_id; | 348 | enum ps3_match_id match_id; |
345 | enum ps3_system_bus_device_type dev_type; | 349 | enum ps3_system_bus_device_type dev_type; |
346 | 350 | ||
347 | unsigned int bus_id; /* SB */ | 351 | u64 bus_id; /* SB */ |
348 | unsigned int dev_id; /* SB */ | 352 | u64 dev_id; /* SB */ |
349 | unsigned int interrupt_id; /* SB */ | 353 | unsigned int interrupt_id; /* SB */ |
350 | struct ps3_dma_region *d_region; /* SB, IOC0 */ | 354 | struct ps3_dma_region *d_region; /* SB, IOC0 */ |
351 | struct ps3_mmio_region *m_region; /* SB, IOC0*/ | 355 | struct ps3_mmio_region *m_region; /* SB, IOC0*/ |
352 | unsigned int port_number; /* VUART */ | 356 | unsigned int port_number; /* VUART */ |
357 | struct { /* LPM */ | ||
358 | u64 node_id; | ||
359 | u64 pu_id; | ||
360 | u64 rights; | ||
361 | } lpm; | ||
353 | 362 | ||
354 | /* struct iommu_table *iommu_table; -- waiting for BenH's cleanups */ | 363 | /* struct iommu_table *iommu_table; -- waiting for BenH's cleanups */ |
355 | struct device core; | 364 | struct device core; |
@@ -438,5 +447,66 @@ struct ps3_prealloc { | |||
438 | extern struct ps3_prealloc ps3fb_videomemory; | 447 | extern struct ps3_prealloc ps3fb_videomemory; |
439 | extern struct ps3_prealloc ps3flash_bounce_buffer; | 448 | extern struct ps3_prealloc ps3flash_bounce_buffer; |
440 | 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); | ||
441 | 511 | ||
442 | #endif | 512 | #endif |