arm-cci.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * CCI cache coherent interconnect support
  4. *
  5. * Copyright (C) 2013 ARM Ltd.
  6. */
  7. #ifndef __LINUX_ARM_CCI_H
  8. #define __LINUX_ARM_CCI_H
  9. #include <linux/errno.h>
  10. #include <linux/types.h>
  11. #include <asm/arm-cci.h>
  12. struct device_node;
  13. #ifdef CONFIG_ARM_CCI
  14. extern bool cci_probed(void);
  15. #else
  16. static inline bool cci_probed(void) { return false; }
  17. #endif
  18. #ifdef CONFIG_ARM_CCI400_PORT_CTRL
  19. extern int cci_ace_get_port(struct device_node *dn);
  20. extern int cci_disable_port_by_cpu(u64 mpidr);
  21. extern int __cci_control_port_by_device(struct device_node *dn, bool enable);
  22. extern int __cci_control_port_by_index(u32 port, bool enable);
  23. #else
  24. static inline int cci_ace_get_port(struct device_node *dn)
  25. {
  26. return -ENODEV;
  27. }
  28. static inline int cci_disable_port_by_cpu(u64 mpidr) { return -ENODEV; }
  29. static inline int __cci_control_port_by_device(struct device_node *dn,
  30. bool enable)
  31. {
  32. return -ENODEV;
  33. }
  34. static inline int __cci_control_port_by_index(u32 port, bool enable)
  35. {
  36. return -ENODEV;
  37. }
  38. #endif
  39. #define cci_disable_port_by_device(dev) \
  40. __cci_control_port_by_device(dev, false)
  41. #define cci_enable_port_by_device(dev) \
  42. __cci_control_port_by_device(dev, true)
  43. #define cci_disable_port_by_index(dev) \
  44. __cci_control_port_by_index(dev, false)
  45. #define cci_enable_port_by_index(dev) \
  46. __cci_control_port_by_index(dev, true)
  47. #endif