diff options
| author | Sivaram Nair <sivaramn@nvidia.com> | 2020-05-28 17:59:00 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2020-09-30 11:09:23 -0400 |
| commit | 5b845b3af56d76b1306ad9d86effb25fde93f850 (patch) | |
| tree | cbed60ec5cdb154835a42e8caf7e1a63c63710cc /include | |
| parent | b722658b31e1dc622870a9d5f38a8418ef8493ca (diff) | |
bpmp: ABI headers update
abi@c3b11f4
e15b212 [abi] update documentation of BPMP_MAIL_DO_ACK
31c6fca [abi] add clarification to clk and powerdomain state
f886c34 [abi] add BPMP_EPERM error code
9348d1d [abi] Add BPMP_ENOTSUP error with description
bf3a839 [abi] Add MRQ_RESET subcommands error description
13d42df [abi] add 'U' suffix to some defines
84a2d41 [abi] update mrq_request::flags documentation
a61188d [abi] document MRQ_I2C error codes
e40ce9c [abi] add BPMP_EAGAIN and BPMP_ENXIO error codes
4b2e0ee [abi] make MRQ_I2C flags unsigned constants
6327960 [abi] fix EC related misra violations
05f0ace [abi] Update references to s/w-detected error IDs
11df254 [abi] fix MISRA violations in TEGRA_I2C_IPC_MAX_*
39a89c5 [abi] Update doxygen references for misc EC ids
Bug 200541450
Bug 3128306
Jira BPMP-5909
Change-Id: Iaf9ef5f730c518db89e185151fd96a9921541704
Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2352510
(cherry picked from commit 1466fa6e646d1320c0f937144fd02fd4082000c0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2420800
Tested-by: Karthik Mantravadi <mkarthik@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Karthik Mantravadi <mkarthik@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'include')
| -rw-r--r-- | include/soc/tegra/bpmp_abi.h | 156 |
1 files changed, 129 insertions, 27 deletions
diff --git a/include/soc/tegra/bpmp_abi.h b/include/soc/tegra/bpmp_abi.h index b1bf44b4c..80125a269 100644 --- a/include/soc/tegra/bpmp_abi.h +++ b/include/soc/tegra/bpmp_abi.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2014-2020, NVIDIA CORPORATION |
| 3 | * | 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
| 5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
| @@ -85,6 +85,23 @@ | |||
| 85 | 85 | ||
| 86 | /** | 86 | /** |
| 87 | * @ingroup MRQ_Format | 87 | * @ingroup MRQ_Format |
| 88 | * Request an answer from the peer. | ||
| 89 | * This should be set in mrq_request::flags for all requests targetted | ||
| 90 | * at BPMP. For requests originating in BPMP, this flag is optional. | ||
| 91 | * When this flag is not set, the remote peer must not send a response | ||
| 92 | * back. | ||
| 93 | */ | ||
| 94 | #define BPMP_MAIL_DO_ACK (1U << 0U) | ||
| 95 | |||
| 96 | /** | ||
| 97 | * @ingroup MRQ_Format | ||
| 98 | * Ring the sender's doorbell when responding. | ||
| 99 | * An optional direction that can be specified in mrq_request::flags. | ||
| 100 | */ | ||
| 101 | #define BPMP_MAIL_RING_DB (1U << 1U) | ||
| 102 | |||
| 103 | /** | ||
| 104 | * @ingroup MRQ_Format | ||
| 88 | * @brief Header for an MRQ message | 105 | * @brief Header for an MRQ message |
| 89 | * | 106 | * |
| 90 | * Provides the MRQ number for the MRQ message: #mrq. The remainder of | 107 | * Provides the MRQ number for the MRQ message: #mrq. The remainder of |
| @@ -94,13 +111,12 @@ | |||
| 94 | struct mrq_request { | 111 | struct mrq_request { |
| 95 | /** @brief MRQ number of the request */ | 112 | /** @brief MRQ number of the request */ |
| 96 | uint32_t mrq; | 113 | uint32_t mrq; |
| 114 | |||
| 97 | /** | 115 | /** |
| 98 | * @brief Flags providing follow up directions to the receiver | 116 | * @brief Flags providing follow up directions to the receiver |
| 99 | * | 117 | * |
| 100 | * | Bit | Description | | 118 | * A combination of #BPMP_MAIL_DO_ACK and #BPMP_MAIL_RING_DB. |
| 101 | * |-----|--------------------------------------------| | 119 | * #BPMP_MAIL_DO_ACK must be always set for requests targeting BPMP. |
| 102 | * | 1 | ring the sender's doorbell when responding | | ||
| 103 | * | 0 | should be 1 | | ||
| 104 | */ | 120 | */ |
| 105 | uint32_t flags; | 121 | uint32_t flags; |
| 106 | } BPMP_ABI_PACKED; | 122 | } BPMP_ABI_PACKED; |
| @@ -708,14 +724,41 @@ struct mrq_debugfs_response { | |||
| 708 | */ | 724 | */ |
| 709 | 725 | ||
| 710 | enum mrq_reset_commands { | 726 | enum mrq_reset_commands { |
| 711 | /** @brief Assert module reset */ | 727 | /** |
| 728 | * @brief Assert module reset | ||
| 729 | * | ||
| 730 | * mrq_response::err is 0 if the operation was successful, or @n | ||
| 731 | * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n | ||
| 732 | * -#BPMP_EACCES if mrq master is not an owner of target domain reset @n | ||
| 733 | * -#BPMP_ENOTSUP if target domain h/w state does not allow reset | ||
| 734 | */ | ||
| 712 | CMD_RESET_ASSERT = 1, | 735 | CMD_RESET_ASSERT = 1, |
| 713 | /** @brief Deassert module reset */ | 736 | /** |
| 737 | * @brief Deassert module reset | ||
| 738 | * | ||
| 739 | * mrq_response::err is 0 if the operation was successful, or @n | ||
| 740 | * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n | ||
| 741 | * -#BPMP_EACCES if mrq master is not an owner of target domain reset @n | ||
| 742 | * -#BPMP_ENOTSUP if target domain h/w state does not allow reset | ||
| 743 | */ | ||
| 714 | CMD_RESET_DEASSERT = 2, | 744 | CMD_RESET_DEASSERT = 2, |
| 715 | /** @brief Assert and deassert the module reset */ | 745 | /** |
| 746 | * @brief Assert and deassert the module reset | ||
| 747 | * | ||
| 748 | * mrq_response::err is 0 if the operation was successful, or @n | ||
| 749 | * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n | ||
| 750 | * -#BPMP_EACCES if mrq master is not an owner of target domain reset @n | ||
| 751 | * -#BPMP_ENOTSUP if target domain h/w state does not allow reset | ||
| 752 | */ | ||
| 716 | CMD_RESET_MODULE = 3, | 753 | CMD_RESET_MODULE = 3, |
| 717 | /** @brief Get the highest reset ID */ | 754 | /** |
| 755 | * @brief Get the highest reset ID | ||
| 756 | * | ||
| 757 | * mrq_response::err is 0 if the operation was successful, or @n | ||
| 758 | * -#BPMP_ENODEV if no reset domains are supported (number of IDs is 0) | ||
| 759 | */ | ||
| 718 | CMD_RESET_GET_MAX_ID = 4, | 760 | CMD_RESET_GET_MAX_ID = 4, |
| 761 | |||
| 719 | /** @brief Not part of ABI and subject to change */ | 762 | /** @brief Not part of ABI and subject to change */ |
| 720 | CMD_RESET_MAX, | 763 | CMD_RESET_MAX, |
| 721 | }; | 764 | }; |
| @@ -779,17 +822,17 @@ struct mrq_reset_response { | |||
| 779 | * @addtogroup I2C | 822 | * @addtogroup I2C |
| 780 | * @{ | 823 | * @{ |
| 781 | */ | 824 | */ |
| 782 | #define TEGRA_I2C_IPC_MAX_IN_BUF_SIZE (MSG_DATA_MIN_SZ - 12) | 825 | #define TEGRA_I2C_IPC_MAX_IN_BUF_SIZE (MSG_DATA_MIN_SZ - 12U) |
| 783 | #define TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE (MSG_DATA_MIN_SZ - 4) | 826 | #define TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE (MSG_DATA_MIN_SZ - 4U) |
| 784 | 827 | ||
| 785 | #define SERIALI2C_TEN 0x0010 | 828 | #define SERIALI2C_TEN 0x0010U |
| 786 | #define SERIALI2C_RD 0x0001 | 829 | #define SERIALI2C_RD 0x0001U |
| 787 | #define SERIALI2C_STOP 0x8000 | 830 | #define SERIALI2C_STOP 0x8000U |
| 788 | #define SERIALI2C_NOSTART 0x4000 | 831 | #define SERIALI2C_NOSTART 0x4000U |
| 789 | #define SERIALI2C_REV_DIR_ADDR 0x2000 | 832 | #define SERIALI2C_REV_DIR_ADDR 0x2000U |
| 790 | #define SERIALI2C_IGNORE_NAK 0x1000 | 833 | #define SERIALI2C_IGNORE_NAK 0x1000U |
| 791 | #define SERIALI2C_NO_RD_ACK 0x0800 | 834 | #define SERIALI2C_NO_RD_ACK 0x0800U |
| 792 | #define SERIALI2C_RECV_LEN 0x0400 | 835 | #define SERIALI2C_RECV_LEN 0x0400U |
| 793 | 836 | ||
| 794 | enum { | 837 | enum { |
| 795 | CMD_I2C_XFER = 1 | 838 | CMD_I2C_XFER = 1 |
| @@ -861,6 +904,17 @@ struct mrq_i2c_request { | |||
| 861 | 904 | ||
| 862 | /** | 905 | /** |
| 863 | * @brief Response to #MRQ_I2C | 906 | * @brief Response to #MRQ_I2C |
| 907 | * | ||
| 908 | * mrq_response:err is | ||
| 909 | * 0: Success | ||
| 910 | * -#BPMP_EBADCMD: if mrq_i2c_request::cmd is other than 1 | ||
| 911 | * -#BPMP_EINVAL: if cmd_i2c_xfer_request does not contain correctly formatted request | ||
| 912 | * -#BPMP_ENODEV: if cmd_i2c_xfer_request::bus_id is not supported by BPMP | ||
| 913 | * -#BPMP_EACCES: if i2c transaction is not allowed due to firewall rules | ||
| 914 | * -#BPMP_ETIMEDOUT: if i2c transaction times out | ||
| 915 | * -#BPMP_ENXIO: if i2c slave device does not reply with ACK to the transaction | ||
| 916 | * -#BPMP_EAGAIN: if ARB_LOST condition is detected by the i2c controller | ||
| 917 | * -#BPMP_EIO: any other i2c controller error code than NO_ACK or ARB_LOST | ||
| 864 | */ | 918 | */ |
| 865 | struct mrq_i2c_response { | 919 | struct mrq_i2c_response { |
| 866 | struct cmd_i2c_xfer_response xfer; | 920 | struct cmd_i2c_xfer_response xfer; |
| @@ -901,8 +955,8 @@ enum { | |||
| 901 | #define BPMP_CLK_HAS_SET_RATE (1U << 1U) | 955 | #define BPMP_CLK_HAS_SET_RATE (1U << 1U) |
| 902 | #define BPMP_CLK_IS_ROOT (1U << 2U) | 956 | #define BPMP_CLK_IS_ROOT (1U << 2U) |
| 903 | 957 | ||
| 904 | #define MRQ_CLK_NAME_MAXLEN 40 | 958 | #define MRQ_CLK_NAME_MAXLEN 40U |
| 905 | #define MRQ_CLK_MAX_PARENTS 16 | 959 | #define MRQ_CLK_MAX_PARENTS 16U |
| 906 | 960 | ||
| 907 | /** @private */ | 961 | /** @private */ |
| 908 | struct cmd_clk_get_rate_request { | 962 | struct cmd_clk_get_rate_request { |
| @@ -953,7 +1007,21 @@ struct cmd_clk_is_enabled_request { | |||
| 953 | BPMP_ABI_EMPTY | 1007 | BPMP_ABI_EMPTY |
| 954 | } BPMP_ABI_PACKED; | 1008 | } BPMP_ABI_PACKED; |
| 955 | 1009 | ||
| 1010 | /** | ||
| 1011 | * @brief Response data to #MRQ_CLK sub-command CMD_CLK_IS_ENABLED | ||
| 1012 | */ | ||
| 956 | struct cmd_clk_is_enabled_response { | 1013 | struct cmd_clk_is_enabled_response { |
| 1014 | /** | ||
| 1015 | * @brief The state of the clock that has been succesfully | ||
| 1016 | * requested with CMD_CLK_ENABLE or CMD_CLK_DISABLE by the | ||
| 1017 | * master invoking the command earlier. | ||
| 1018 | * | ||
| 1019 | * The state may not reflect the physical state of the clock | ||
| 1020 | * if there are some other masters requesting it to be | ||
| 1021 | * enabled. | ||
| 1022 | * | ||
| 1023 | * Value 0 is disabled, all other values indicate enabled. | ||
| 1024 | */ | ||
| 957 | int32_t state; | 1025 | int32_t state; |
| 958 | } BPMP_ABI_PACKED; | 1026 | } BPMP_ABI_PACKED; |
| 959 | 1027 | ||
| @@ -1335,8 +1403,21 @@ struct cmd_pg_set_state_request { | |||
| 1335 | uint32_t state; | 1403 | uint32_t state; |
| 1336 | } BPMP_ABI_PACKED; | 1404 | } BPMP_ABI_PACKED; |
| 1337 | 1405 | ||
| 1406 | /** | ||
| 1407 | * @brief Response data to #MRQ_PG sub command #CMD_PG_GET_STATE | ||
| 1408 | */ | ||
| 1338 | struct cmd_pg_get_state_response { | 1409 | struct cmd_pg_get_state_response { |
| 1339 | /** @ref pg_states */ | 1410 | /** |
| 1411 | * @brief The state of the power partition that has been | ||
| 1412 | * succesfuly requested by the master earlier using #MRQ_PG | ||
| 1413 | * command #CMD_PG_SET_STATE. | ||
| 1414 | * | ||
| 1415 | * The state may not reflect the physical state of the power | ||
| 1416 | * partition if there are some other masters requesting it to | ||
| 1417 | * be enabled. | ||
| 1418 | * | ||
| 1419 | * See @ref pg_states for possible values | ||
| 1420 | */ | ||
| 1340 | uint32_t state; | 1421 | uint32_t state; |
| 1341 | } BPMP_ABI_PACKED; | 1422 | } BPMP_ABI_PACKED; |
| 1342 | 1423 | ||
| @@ -2585,6 +2666,21 @@ struct ec_err_reg_parity_desc { | |||
| 2585 | } BPMP_ABI_PACKED; | 2666 | } BPMP_ABI_PACKED; |
| 2586 | 2667 | ||
| 2587 | /** | 2668 | /** |
| 2669 | * |error type | err_source_id values | | ||
| 2670 | * |--------------------------------- |--------------------------| | ||
| 2671 | * |@ref EC_ERR_TYPE_SW_CORRECTABLE | @ref bpmp_ec_ce_swd_ids | | ||
| 2672 | * |@ref EC_ERR_TYPE_SW_UNCORRECTABLE | @ref bpmp_ec_ue_swd_ids | | ||
| 2673 | */ | ||
| 2674 | struct ec_err_sw_error_desc { | ||
| 2675 | /** @brief Bitmask of @ref bpmp_ec_desc_flags */ | ||
| 2676 | uint16_t desc_flags; | ||
| 2677 | /** @brief Error source id */ | ||
| 2678 | uint16_t err_source_id; | ||
| 2679 | /** @brief Sw error data */ | ||
| 2680 | uint32_t sw_error_data; | ||
| 2681 | } BPMP_ABI_PACKED; | ||
| 2682 | |||
| 2683 | /** | ||
| 2588 | * |error type | err_source_id values | | 2684 | * |error type | err_source_id values | |
| 2589 | * |----------------------------------------|---------------------------| | 2685 | * |----------------------------------------|---------------------------| |
| 2590 | * |@ref EC_ERR_TYPE_PARITY_INTERNAL |@ref bpmp_ec_ipath_ids | | 2686 | * |@ref EC_ERR_TYPE_PARITY_INTERNAL |@ref bpmp_ec_ipath_ids | |
| @@ -2592,10 +2688,8 @@ struct ec_err_reg_parity_desc { | |||
| 2592 | * |@ref EC_ERR_TYPE_ECC_DED_INTERNAL |@ref bpmp_ec_ipath_ids | | 2688 | * |@ref EC_ERR_TYPE_ECC_DED_INTERNAL |@ref bpmp_ec_ipath_ids | |
| 2593 | * |@ref EC_ERR_TYPE_COMPARATOR |@ref bpmp_ec_comparator_ids| | 2689 | * |@ref EC_ERR_TYPE_COMPARATOR |@ref bpmp_ec_comparator_ids| |
| 2594 | * |@ref EC_ERR_TYPE_PARITY_SRAM |@ref bpmp_clock_ids | | 2690 | * |@ref EC_ERR_TYPE_PARITY_SRAM |@ref bpmp_clock_ids | |
| 2595 | * |@ref EC_ERR_TYPE_SW_CORRECTABLE |@ref bpmp_ec_misc_ids | | 2691 | * |@ref EC_ERR_TYPE_OTHER_HW_CORRECTABLE |@ref bpmp_ec_misc_hwd_ids | |
| 2596 | * |@ref EC_ERR_TYPE_SW_UNCORRECTABLE |@ref bpmp_ec_misc_ids | | 2692 | * |@ref EC_ERR_TYPE_OTHER_HW_UNCORRECTABLE |@ref bpmp_ec_misc_hwd_ids | |
| 2597 | * |@ref EC_ERR_TYPE_OTHER_HW_CORRECTABLE |@ref bpmp_ec_misc_ids | | ||
| 2598 | * |@ref EC_ERR_TYPE_OTHER_HW_UNCORRECTABLE |@ref bpmp_ec_misc_ids | | ||
| 2599 | */ | 2693 | */ |
| 2600 | struct ec_err_simple_desc { | 2694 | struct ec_err_simple_desc { |
| 2601 | /** @brief Bitmask of @ref bpmp_ec_desc_flags */ | 2695 | /** @brief Bitmask of @ref bpmp_ec_desc_flags */ |
| @@ -2618,7 +2712,7 @@ struct cmd_ec_status_get_request { | |||
| 2618 | } BPMP_ABI_PACKED; | 2712 | } BPMP_ABI_PACKED; |
| 2619 | 2713 | ||
| 2620 | /** EC status maximum number of descriptors */ | 2714 | /** EC status maximum number of descriptors */ |
| 2621 | #define EC_ERR_STATUS_DESC_MAX_NUM 4 | 2715 | #define EC_ERR_STATUS_DESC_MAX_NUM 4U |
| 2622 | 2716 | ||
| 2623 | struct cmd_ec_status_get_response { | 2717 | struct cmd_ec_status_get_response { |
| 2624 | /** @brief Target EC id (the same id received with request). */ | 2718 | /** @brief Target EC id (the same id received with request). */ |
| @@ -2723,6 +2817,8 @@ struct mrq_fbvolt_status_response { | |||
| 2723 | * @{ | 2817 | * @{ |
| 2724 | */ | 2818 | */ |
| 2725 | 2819 | ||
| 2820 | /** @brief Operation not permitted */ | ||
| 2821 | #define BPMP_EPERM 1 | ||
| 2726 | /** @brief No such file or directory */ | 2822 | /** @brief No such file or directory */ |
| 2727 | #define BPMP_ENOENT 2 | 2823 | #define BPMP_ENOENT 2 |
| 2728 | /** @brief No MRQ handler */ | 2824 | /** @brief No MRQ handler */ |
| @@ -2731,6 +2827,8 @@ struct mrq_fbvolt_status_response { | |||
| 2731 | #define BPMP_EIO 5 | 2827 | #define BPMP_EIO 5 |
| 2732 | /** @brief Bad sub-MRQ command */ | 2828 | /** @brief Bad sub-MRQ command */ |
| 2733 | #define BPMP_EBADCMD 6 | 2829 | #define BPMP_EBADCMD 6 |
| 2830 | /** @brief Resource temporarily unavailable */ | ||
| 2831 | #define BPMP_EAGAIN 11 | ||
| 2734 | /** @brief Not enough memory */ | 2832 | /** @brief Not enough memory */ |
| 2735 | #define BPMP_ENOMEM 12 | 2833 | #define BPMP_ENOMEM 12 |
| 2736 | /** @brief Permission denied */ | 2834 | /** @brief Permission denied */ |
| @@ -2751,6 +2849,10 @@ struct mrq_fbvolt_status_response { | |||
| 2751 | #define BPMP_ENOSYS 38 | 2849 | #define BPMP_ENOSYS 38 |
| 2752 | /** @brief Invalid slot */ | 2850 | /** @brief Invalid slot */ |
| 2753 | #define BPMP_EBADSLT 57 | 2851 | #define BPMP_EBADSLT 57 |
| 2852 | /** @brief Not supported */ | ||
| 2853 | #define BPMP_ENOTSUP 134 | ||
| 2854 | /** @brief No such device or address */ | ||
| 2855 | #define BPMP_ENXIO 140 | ||
| 2754 | 2856 | ||
| 2755 | /** @} */ | 2857 | /** @} */ |
| 2756 | 2858 | ||
