mp.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2014-2015, Freescale Semiconductor
  4. */
  5. #ifndef _FSL_LAYERSCAPE_MP_H
  6. #define _FSL_LAYERSCAPE_MP_H
  7. /*
  8. * Each spin table element is defined as
  9. * struct {
  10. * uint64_t entry_addr;
  11. * uint64_t status;
  12. * uint64_t lpid;
  13. * uint64_t arch_comp;
  14. * };
  15. * we pad this struct to 64 bytes so each entry is in its own cacheline
  16. * the actual spin table is an array of these structures
  17. */
  18. #define SPIN_TABLE_ELEM_ENTRY_ADDR_IDX 0
  19. #define SPIN_TABLE_ELEM_STATUS_IDX 1
  20. #define SPIN_TABLE_ELEM_LPID_IDX 2
  21. /* compare os arch and cpu arch */
  22. #define SPIN_TABLE_ELEM_ARCH_COMP_IDX 3
  23. #define WORDS_PER_SPIN_TABLE_ENTRY 8 /* pad to 64 bytes */
  24. #define SPIN_TABLE_ELEM_SIZE 64
  25. /* os arch is same as cpu arch */
  26. #define OS_ARCH_SAME 0
  27. /* os arch is different from cpu arch */
  28. #define OS_ARCH_DIFF 1
  29. #define id_to_core(x) ((x & 3) | (x >> 6))
  30. #ifndef __ASSEMBLY__
  31. extern u64 __spin_table[];
  32. extern u64 __real_cntfrq;
  33. extern u64 *secondary_boot_code;
  34. extern size_t __secondary_boot_code_size;
  35. #ifdef CONFIG_MP
  36. int fsl_layerscape_wake_seconday_cores(void);
  37. #else
  38. static inline int fsl_layerscape_wake_seconday_cores(void) { return 0; }
  39. #endif
  40. void *get_spin_tbl_addr(void);
  41. phys_addr_t determine_mp_bootpg(void);
  42. void secondary_boot_func(void);
  43. int is_core_online(u64 cpu_id);
  44. u32 cpu_pos_mask(void);
  45. #endif
  46. #endif /* _FSL_LAYERSCAPE_MP_H */