a_usb_defs.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Copyright (c) 2012, 2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /* USB definitions shared between host and target */
  27. #ifndef __A_USB_DEFS_H__
  28. #define __A_USB_DEFS_H__
  29. #ifndef ATH_TARGET
  30. #include "athstartpack.h"
  31. #endif
  32. /* USB endpoint definitions */
  33. #ifdef PLATFORM_GENOA
  34. #define USB_EP_ADDR_APP_CTRL_IN 0x88
  35. #define USB_EP_ADDR_APP_DATA_IN 0x89
  36. #define USB_EP_ADDR_APP_QMI_IN 0x8A
  37. #define USB_EP_ADDR_APP_DIAG_IN 0x8B
  38. #define USB_EP_ADDR_APP_CTRL_OUT 0x08
  39. #define USB_EP_ADDR_APP_DATA_OUT 0x09
  40. #define USB_EP_ADDR_APP_QMI_OUT 0x0A
  41. #define USB_EP_ADDR_APP_DIAG_OUT 0x0B
  42. #else /* PLATFORM_GENOA */
  43. #define USB_EP_ADDR_APP_CTRL_IN 0x81
  44. #define USB_EP_ADDR_APP_DATA_IN 0x82
  45. #define USB_EP_ADDR_APP_DATA2_IN 0x83
  46. #define USB_EP_ADDR_APP_INT_IN 0x84
  47. #define USB_EP_ADDR_APP_CTRL_OUT 0x01
  48. #define USB_EP_ADDR_APP_DATA_LP_OUT 0x02
  49. #define USB_EP_ADDR_APP_DATA_MP_OUT 0x03
  50. #define USB_EP_ADDR_APP_DATA_HP_OUT 0x04
  51. #endif /* PLATFORM_GENOA */
  52. #define USB_CONTROL_REQ_SEND_BMI_CMD 1
  53. #define USB_CONTROL_REQ_RECV_BMI_RESP 2
  54. #define USB_CONTROL_REQ_DIAG_CMD 3
  55. #define USB_CONTROL_REQ_DIAG_RESP 4
  56. //#define USB_CONTROL_MAX_BMI_TRANSFER_SIZE 64
  57. #define USB_CONTROL_MAX_BMI_TRANSFER_SIZE 252
  58. #define HIF_BMI_MAX_TRANSFER_SIZE USB_CONTROL_MAX_BMI_TRANSFER_SIZE
  59. #define USB_HS_BULK_MAXP_SIZE 0x200 //512 Bytes Maxp for High Speed for BULK EP
  60. #define USB_FS_BULK_MAXP_SIZE 0x40 //64 Bytes Maxp for Full Speed for BULK EP
  61. /* diagnostic command defnitions */
  62. #define USB_CTRL_DIAG_CC_READ 0
  63. #define USB_CTRL_DIAG_CC_WRITE 1
  64. #define USB_CTRL_DIAG_CC_WARM_RESET 2
  65. typedef PREPACK struct {
  66. A_UINT32 Cmd;
  67. A_UINT32 Address;
  68. A_UINT32 Value;
  69. A_UINT32 _pad[1];
  70. } POSTPACK USB_CTRL_DIAG_CMD_WRITE;
  71. typedef PREPACK struct {
  72. A_UINT32 Cmd;
  73. A_UINT32 Address;
  74. } POSTPACK USB_CTRL_DIAG_CMD_READ;
  75. typedef PREPACK struct {
  76. A_UINT32 ReadValue;
  77. } POSTPACK USB_CTRL_DIAG_RESP_READ;
  78. #define USB_CTRL_MAX_DIAG_CMD_SIZE (sizeof(USB_CTRL_DIAG_CMD_WRITE))
  79. #define USB_CTRL_MAX_DIAG_RESP_SIZE (sizeof(USB_CTRL_DIAG_RESP_READ))
  80. #ifndef ATH_TARGET
  81. #include "athendpack.h"
  82. #endif
  83. #endif