plicsw.h 964 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2019 Andes Technology Corporation
  5. *
  6. * Authors:
  7. * Zong Li <zong@andestech.com>
  8. * Nylon Chen <nylon7@andestech.com>
  9. */
  10. #ifndef _AE350_PLICSW_H_
  11. #define _AE350_PLICSW_H_
  12. #define PLICSW_PRIORITY_BASE 0x4
  13. #define PLICSW_PENDING_BASE 0x1000
  14. #define PLICSW_PENDING_PER_HART 0x8
  15. #define PLICSW_ENABLE_BASE 0x2000
  16. #define PLICSW_ENABLE_PER_HART 0x80
  17. #define PLICSW_CONTEXT_BASE 0x200000
  18. #define PLICSW_CONTEXT_PER_HART 0x1000
  19. #define PLICSW_CONTEXT_CLAIM 0x4
  20. #define PLICSW_HART_MASK 0x80808080
  21. struct plicsw {
  22. u32 source_id;
  23. volatile uint32_t *plicsw_pending;
  24. volatile uint32_t *plicsw_enable;
  25. volatile uint32_t *plicsw_claim;
  26. };
  27. void plicsw_ipi_send(u32 target_hart);
  28. void plicsw_ipi_sync(u32 target_hart);
  29. void plicsw_ipi_clear(u32 target_hart);
  30. int plicsw_warm_ipi_init(void);
  31. int plicsw_cold_ipi_init(unsigned long base, u32 hart_count);
  32. #endif /* _AE350_PLICSW_H_ */