misc.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2016 Freescale Semiconductor, Inc.
  4. * Copyright 2017~2018 NXP
  5. *
  6. * Header file containing the public API for the System Controller (SC)
  7. * Miscellaneous (MISC) function.
  8. *
  9. * MISC_SVC (SVC) Miscellaneous Service
  10. *
  11. * Module for the Miscellaneous (MISC) service.
  12. */
  13. #ifndef _SC_MISC_API_H
  14. #define _SC_MISC_API_H
  15. #include <linux/firmware/imx/sci.h>
  16. /*
  17. * This type is used to indicate RPC MISC function calls.
  18. */
  19. enum imx_misc_func {
  20. IMX_SC_MISC_FUNC_UNKNOWN = 0,
  21. IMX_SC_MISC_FUNC_SET_CONTROL = 1,
  22. IMX_SC_MISC_FUNC_GET_CONTROL = 2,
  23. IMX_SC_MISC_FUNC_SET_MAX_DMA_GROUP = 4,
  24. IMX_SC_MISC_FUNC_SET_DMA_GROUP = 5,
  25. IMX_SC_MISC_FUNC_SECO_IMAGE_LOAD = 8,
  26. IMX_SC_MISC_FUNC_SECO_AUTHENTICATE = 9,
  27. IMX_SC_MISC_FUNC_DEBUG_OUT = 10,
  28. IMX_SC_MISC_FUNC_WAVEFORM_CAPTURE = 6,
  29. IMX_SC_MISC_FUNC_BUILD_INFO = 15,
  30. IMX_SC_MISC_FUNC_UNIQUE_ID = 19,
  31. IMX_SC_MISC_FUNC_SET_ARI = 3,
  32. IMX_SC_MISC_FUNC_BOOT_STATUS = 7,
  33. IMX_SC_MISC_FUNC_BOOT_DONE = 14,
  34. IMX_SC_MISC_FUNC_OTP_FUSE_READ = 11,
  35. IMX_SC_MISC_FUNC_OTP_FUSE_WRITE = 17,
  36. IMX_SC_MISC_FUNC_SET_TEMP = 12,
  37. IMX_SC_MISC_FUNC_GET_TEMP = 13,
  38. IMX_SC_MISC_FUNC_GET_BOOT_DEV = 16,
  39. IMX_SC_MISC_FUNC_GET_BUTTON_STATUS = 18,
  40. };
  41. /*
  42. * Control Functions
  43. */
  44. #ifdef CONFIG_IMX_SCU
  45. int imx_sc_misc_set_control(struct imx_sc_ipc *ipc, u32 resource,
  46. u8 ctrl, u32 val);
  47. int imx_sc_misc_get_control(struct imx_sc_ipc *ipc, u32 resource,
  48. u8 ctrl, u32 *val);
  49. int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource,
  50. bool enable, u64 phys_addr);
  51. #else
  52. static inline int imx_sc_misc_set_control(struct imx_sc_ipc *ipc,
  53. u32 resource, u8 ctrl, u32 val)
  54. {
  55. return -ENOTSUPP;
  56. }
  57. static inline int imx_sc_misc_get_control(struct imx_sc_ipc *ipc,
  58. u32 resource, u8 ctrl, u32 *val)
  59. {
  60. return -ENOTSUPP;
  61. }
  62. static inline int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource,
  63. bool enable, u64 phys_addr)
  64. {
  65. return -ENOTSUPP;
  66. }
  67. #endif
  68. #endif /* _SC_MISC_API_H */