common_nxp.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2019-2021 NXP
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. ******************************************************************************/
  21. /*
  22. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  23. *
  24. ******************************************************************************/
  25. #ifndef _COMMON_QCOM_H_
  26. #define _COMMON_QCOM_H_
  27. #define NCI_RESET_CMD_LEN (4)
  28. #define NCI_RESET_RSP_LEN (4)
  29. #define NCI_CORE_RESET_CMD_OID (0x0)
  30. #define NCI_CORE_RESET_CMD_PAYLOAD_LEN (0x1)
  31. #define NCI_CORE_RESET_KEEP_CONFIG (0x0)
  32. #define NCI_RESET_NTF_LEN (13)
  33. /*command response timeout*/
  34. #define NCI_CMD_RSP_TIMEOUT_MS (2000) //2s
  35. #define SN1XX_ROM_VER 0x01
  36. #define SN1xx_MAJOR_VER 0x10
  37. #define SN220_ROM_VER 0x01
  38. #define SN220_MAJOR_VER 0x01
  39. #define FW_ROM_CODE_VER_OFFSET 4
  40. #define FW_MAJOR_VER_OFFSET 7
  41. #define GET_VERSION_RSP_CHIP_TYPE_OFFSET 3
  42. #define GET_VERSION_RSP_MINOR_VERSION_OFFSET 6
  43. #define DL_GET_VERSION_CMD_LEN (8)
  44. #define DL_GET_VERSION_RSP_LEN_1 (12) /* SN110 */
  45. #define DL_GET_VERSION_RSP_LEN_2 (20) /* SN220 */
  46. #define DL_GET_VERSION_CMD_PAYLOAD_LEN (4)
  47. #define DL_GET_VERSION_CMD_ID (0xF1)
  48. #define DL_GET_VERSION_CMD_CRC_1 (0x6E)
  49. #define DL_GET_VERSION_CMD_CRC_2 (0xEF)
  50. #define DL_RESET_CMD_LEN (8)
  51. #define DL_GET_SESSION_STATE_CMD_LEN (8)
  52. #define DL_GET_SESSION_STATE_RSP_LEN (8)
  53. #define DL_GET_SESSION_STATE_CMD_PAYLOAD_LEN (4)
  54. #define DL_GET_SESSION_CMD_ID (0xF2)
  55. #define DL_GET_SESSION_CMD_CRC_1 (0xF5)
  56. #define DL_GET_SESSION_CMD_CRC_2 (0x33)
  57. #define GET_SESSION_STS_OFF (3)
  58. #define NFCC_SESSION_STS_CLOSED (0x0)
  59. /* Below offsets should be subtracted from NCI header length + payload length */
  60. #define NFC_CHIP_TYPE_OFF (4)
  61. #define NFC_FW_MINOR_OFF (1)
  62. enum chip_types {
  63. CHIP_SN1XX = 0x01,
  64. CHIP_SN220 = 0x02,
  65. CHIP_UNKNOWN = 0xFF,
  66. };
  67. #endif //_COMMON_QCOM_H_