dpio-cmd.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
  2. /*
  3. * Copyright 2013-2016 Freescale Semiconductor Inc.
  4. * Copyright 2016 NXP
  5. *
  6. */
  7. #ifndef _FSL_DPIO_CMD_H
  8. #define _FSL_DPIO_CMD_H
  9. /* DPIO Version */
  10. #define DPIO_VER_MAJOR 4
  11. #define DPIO_VER_MINOR 2
  12. /* Command Versioning */
  13. #define DPIO_CMD_ID_OFFSET 4
  14. #define DPIO_CMD_BASE_VERSION 1
  15. #define DPIO_CMD(id) (((id) << DPIO_CMD_ID_OFFSET) | DPIO_CMD_BASE_VERSION)
  16. /* Command IDs */
  17. #define DPIO_CMDID_CLOSE DPIO_CMD(0x800)
  18. #define DPIO_CMDID_OPEN DPIO_CMD(0x803)
  19. #define DPIO_CMDID_GET_API_VERSION DPIO_CMD(0xa03)
  20. #define DPIO_CMDID_ENABLE DPIO_CMD(0x002)
  21. #define DPIO_CMDID_DISABLE DPIO_CMD(0x003)
  22. #define DPIO_CMDID_GET_ATTR DPIO_CMD(0x004)
  23. #define DPIO_CMDID_RESET DPIO_CMD(0x005)
  24. #define DPIO_CMDID_SET_STASHING_DEST DPIO_CMD(0x120)
  25. struct dpio_cmd_open {
  26. __le32 dpio_id;
  27. };
  28. #define DPIO_CHANNEL_MODE_MASK 0x3
  29. struct dpio_rsp_get_attr {
  30. /* cmd word 0 */
  31. __le32 id;
  32. __le16 qbman_portal_id;
  33. u8 num_priorities;
  34. u8 channel_mode;
  35. /* cmd word 1 */
  36. __le64 qbman_portal_ce_addr;
  37. /* cmd word 2 */
  38. __le64 qbman_portal_ci_addr;
  39. /* cmd word 3 */
  40. __le32 qbman_version;
  41. };
  42. struct dpio_stashing_dest {
  43. u8 sdest;
  44. };
  45. #endif /* _FSL_DPIO_CMD_H */