Add APIs to read/write PGGS and GGS registers.
Unified · Split
| @@ -617,6 +617,72 @@ int zynqmp_pm_sd_dll_reset(u32 node_id, u32 type) · 616 unmodified lines | |||
| 617 | } | 617 | } |
| 618 | EXPORT_SYMBOL_GPL(zynqmp_pm_sd_dll_reset); | 618 | EXPORT_SYMBOL_GPL(zynqmp_pm_sd_dll_reset); |
| 619 | 619 | ||
| 620 | /** | ||
| 621 | * zynqmp_pm_write_ggs() - PM API for writing global general storage (ggs) | ||
| 622 | * @index GGS register index | ||
| 623 | * @value Register value to be written | ||
| 624 | * | ||
| 625 | * This function writes value to GGS register. | ||
| 626 | * | ||
| 627 | * @return Returns status, either success or error+reason | ||
| 628 | */ | ||
| 629 | int zynqmp_pm_write_ggs(u32 index, u32 value) | ||
| 630 | { | ||
| 631 | return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_WRITE_GGS, | ||
| 632 | index, value, NULL); | ||
| 633 | } | ||
| 634 | EXPORT_SYMBOL_GPL(zynqmp_pm_write_ggs); | ||
| 635 | |||
| 636 | /** | ||
| 637 | * zynqmp_pm_write_ggs() - PM API for reading global general storage (ggs) | ||
| 638 | * @index GGS register index | ||
| 639 | * @value Register value to be written | ||
| 640 | * | ||
| 641 | * This function returns GGS register value. | ||
| 642 | * | ||
| 643 | * @return Returns status, either success or error+reason | ||
| 644 | */ | ||
| 645 | int zynqmp_pm_read_ggs(u32 index, u32 *value) | ||
| 646 | { | ||
| 647 | return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_READ_GGS, | ||
| 648 | index, 0, value); | ||
| 649 | } | ||
| 650 | EXPORT_SYMBOL_GPL(zynqmp_pm_read_ggs); | ||
| 651 | |||
| 652 | /** | ||
| 653 | * zynqmp_pm_write_pggs() - PM API for writing persistent global general | ||
| 654 | * storage (pggs) | ||
| 655 | * @index PGGS register index | ||
| 656 | * @value Register value to be written | ||
| 657 | * | ||
| 658 | * This function writes value to PGGS register. | ||
| 659 | * | ||
| 660 | * @return Returns status, either success or error+reason | ||
| 661 | */ | ||
| 662 | int zynqmp_pm_write_pggs(u32 index, u32 value) | ||
| 663 | { | ||
| 664 | return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_WRITE_PGGS, index, value, | ||
| 665 | NULL); | ||
| 666 | } | ||
| 667 | EXPORT_SYMBOL_GPL(zynqmp_pm_write_pggs); | ||
| 668 | |||
| 669 | /** | ||
| 670 | * zynqmp_pm_write_pggs() - PM API for reading persistent global general | ||
| 671 | * storage (pggs) | ||
| 672 | * @index PGGS register index | ||
| 673 | * @value Register value to be written | ||
| 674 | * | ||
| 675 | * This function returns PGGS register value. | ||
| 676 | * | ||
| 677 | * @return Returns status, either success or error+reason | ||
| 678 | */ | ||
| 679 | int zynqmp_pm_read_pggs(u32 index, u32 *value) | ||
| 680 | { | ||
| 681 | return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_READ_PGGS, index, 0, | ||
| 682 | value); | ||
| 683 | } | ||
| 684 | EXPORT_SYMBOL_GPL(zynqmp_pm_read_pggs); | ||
| 685 | |||
| 620 | /** | 686 | /** |
| 621 | * zynqmp_pm_reset_assert - Request setting of reset (1 - assert, 0 - release) | 687 | * zynqmp_pm_reset_assert - Request setting of reset (1 - assert, 0 - release) |
| 622 | * @reset: Reset to be configured | 688 | * @reset: Reset to be configured |
| @@ -107,6 +107,10 @@ enum pm_ioctl_id { · 106 unmodified lines | |||
| 107 | IOCTL_GET_PLL_FRAC_MODE, | 107 | IOCTL_GET_PLL_FRAC_MODE, |
| 108 | IOCTL_SET_PLL_FRAC_DATA, | 108 | IOCTL_SET_PLL_FRAC_DATA, |
| 109 | IOCTL_GET_PLL_FRAC_DATA, | 109 | IOCTL_GET_PLL_FRAC_DATA, |
| 110 | IOCTL_WRITE_GGS = 12, | ||
| 111 | IOCTL_READ_GGS = 13, | ||
| 112 | IOCTL_WRITE_PGGS = 14, | ||
| 113 | IOCTL_READ_PGGS = 15, | ||
| 110 | }; | 114 | }; |
| 111 | 115 | ||
| 112 | enum pm_query_id { | 116 | enum pm_query_id { |
| @@ -330,6 +334,10 @@ int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, · 217 unmodified lines | |||
| 330 | int zynqmp_pm_aes_engine(const u64 address, u32 *out); | 334 | int zynqmp_pm_aes_engine(const u64 address, u32 *out); |
| 331 | int zynqmp_pm_fpga_load(const u64 address, const u32 size, const u32 flags); | 335 | int zynqmp_pm_fpga_load(const u64 address, const u32 size, const u32 flags); |
| 332 | int zynqmp_pm_fpga_get_status(u32 *value); | 336 | int zynqmp_pm_fpga_get_status(u32 *value); |
| 337 | int zynqmp_pm_write_ggs(u32 index, u32 value); | ||
| 338 | int zynqmp_pm_read_ggs(u32 index, u32 *value); | ||
| 339 | int zynqmp_pm_write_pggs(u32 index, u32 value); | ||
| 340 | int zynqmp_pm_read_pggs(u32 index, u32 *value); | ||
| 333 | #else | 341 | #else |
| 334 | static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) | 342 | static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) |
| 335 | { | 343 | { |
| @@ -456,6 +464,22 @@ static inline int zynqmp_pm_fpga_get_status(u32 *value) · 120 unmodified lines | |||
| 456 | { | 464 | { |
| 457 | return -ENODEV; | 465 | return -ENODEV; |
| 458 | } | 466 | } |
| 467 | static inline int zynqmp_pm_write_ggs(u32 index, u32 value) | ||
| 468 | { | ||
| 469 | return -ENODEV; | ||
| 470 | } | ||
| 471 | static inline int zynqmp_pm_read_ggs(u32 index, u32 *value) | ||
| 472 | { | ||
| 473 | return -ENODEV; | ||
| 474 | } | ||
| 475 | static inline int zynqmp_pm_write_pggs(u32 index, u32 value) | ||
| 476 | { | ||
| 477 | return -ENODEV; | ||
| 478 | } | ||
| 479 | static inline int zynqmp_pm_read_pggs(u32 index, u32 *value) | ||
| 480 | { | ||
| 481 | return -ENODEV; | ||
| 482 | } | ||
| 459 | #endif | 483 | #endif |
| 460 | 484 | ||
| 461 | #endif /* __FIRMWARE_ZYNQMP_H__ */ | 485 | #endif /* __FIRMWARE_ZYNQMP_H__ */ |