sbi_ipi.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2019 Western Digital Corporation or its affiliates.
  5. *
  6. * Authors:
  7. * Anup Patel <anup.patel@wdc.com>
  8. */
  9. #ifndef __SBI_IPI_H__
  10. #define __SBI_IPI_H__
  11. #include <sbi/sbi_types.h>
  12. /* clang-format off */
  13. #define SBI_IPI_EVENT_SOFT 0x1
  14. #define SBI_IPI_EVENT_FENCE_I 0x2
  15. #define SBI_IPI_EVENT_SFENCE_VMA 0x4
  16. #define SBI_IPI_EVENT_SFENCE_VMA_ASID 0x8
  17. #define SBI_IPI_EVENT_HALT 0x10
  18. /* clang-format on */
  19. #define SBI_TLB_FIFO_NUM_ENTRIES 4
  20. enum sbi_tlb_info_types {
  21. SBI_TLB_FLUSH_VMA,
  22. SBI_TLB_FLUSH_VMA_ASID,
  23. SBI_TLB_FLUSH_VMA_VMID
  24. };
  25. struct sbi_scratch;
  26. struct sbi_ipi_data {
  27. unsigned long ipi_type;
  28. };
  29. struct sbi_tlb_info {
  30. unsigned long start;
  31. unsigned long size;
  32. unsigned long asid;
  33. unsigned long type;
  34. };
  35. #define SBI_TLB_INFO_SIZE sizeof(struct sbi_tlb_info)
  36. int sbi_ipi_send_many(struct sbi_scratch *scratch, ulong *pmask, u32 event,
  37. void *data);
  38. void sbi_ipi_clear_smode(struct sbi_scratch *scratch);
  39. void sbi_ipi_process(struct sbi_scratch *scratch);
  40. int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot);
  41. #endif