Chirag Sharma | a257693 | 2020-12-05 23:17:41 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <libipl.H> |
| 4 | |
Andrew Geissler | 5c3f925 | 2021-06-10 10:53:05 -0500 | [diff] [blame] | 5 | extern "C" |
| 6 | { |
| 7 | #include <libpdbg.h> |
| 8 | } |
| 9 | |
Chirag Sharma | a257693 | 2020-12-05 23:17:41 -0600 | [diff] [blame] | 10 | namespace openpower |
| 11 | { |
| 12 | namespace phal |
| 13 | { |
| 14 | |
| 15 | /** |
| 16 | * @brief This function will initialize required phal |
| 17 | * libraries. |
| 18 | * Throws an exception on error. |
| 19 | * |
| 20 | * @param[in] mode - IPL mode, default IPL_AUTOBOOT |
| 21 | * |
| 22 | */ |
| 23 | void phal_init(enum ipl_mode mode = IPL_AUTOBOOT); |
| 24 | |
Andrew Geissler | 5c3f925 | 2021-06-10 10:53:05 -0500 | [diff] [blame] | 25 | /** |
| 26 | * @brief Check if primary processor or not |
| 27 | * |
Andrew Geissler | 65c0101 | 2021-06-15 14:03:34 -0500 | [diff] [blame^] | 28 | * @param[in] procTarget - Target to check if primary or not |
Andrew Geissler | 5c3f925 | 2021-06-10 10:53:05 -0500 | [diff] [blame] | 29 | * |
| 30 | * @return True/False |
| 31 | */ |
| 32 | bool isPrimaryProc(struct pdbg_target* procTarget); |
| 33 | |
Andrew Geissler | 65c0101 | 2021-06-15 14:03:34 -0500 | [diff] [blame^] | 34 | /** |
| 35 | * @brief Read the input CFAM register |
| 36 | * |
| 37 | * @param[in] procTarget - The Target to perform the operation on |
| 38 | * @param[in] reg - The register address to read |
| 39 | * @param[out] val - The value read from the register |
| 40 | * |
| 41 | * @return 0 on success, non-0 on failure |
| 42 | */ |
| 43 | uint32_t getCFAM(struct pdbg_target* procTarget, const uint32_t reg, |
| 44 | uint32_t& val); |
| 45 | |
Chirag Sharma | a257693 | 2020-12-05 23:17:41 -0600 | [diff] [blame] | 46 | } // namespace phal |
| 47 | } // namespace openpower |