mp.h 1.3 KB

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