2018-05-06 17:58:06 -04:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2014-09-08 12:20:00 -07:00
|
|
|
/*
|
2015-10-26 19:47:50 +08:00
|
|
|
* Copyright 2014-2015, Freescale Semiconductor
|
2014-09-08 12:20:00 -07:00
|
|
|
*/
|
|
|
|
|
2015-10-26 19:47:50 +08:00
|
|
|
#ifndef _FSL_LAYERSCAPE_MP_H
|
|
|
|
#define _FSL_LAYERSCAPE_MP_H
|
2014-09-08 12:20:00 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Each spin table element is defined as
|
|
|
|
* struct {
|
|
|
|
* uint64_t entry_addr;
|
|
|
|
* uint64_t status;
|
|
|
|
* uint64_t lpid;
|
2017-06-08 16:15:14 +08:00
|
|
|
* uint64_t arch_comp;
|
2014-09-08 12:20:00 -07:00
|
|
|
* };
|
|
|
|
* we pad this struct to 64 bytes so each entry is in its own cacheline
|
|
|
|
* the actual spin table is an array of these structures
|
|
|
|
*/
|
|
|
|
#define SPIN_TABLE_ELEM_ENTRY_ADDR_IDX 0
|
|
|
|
#define SPIN_TABLE_ELEM_STATUS_IDX 1
|
|
|
|
#define SPIN_TABLE_ELEM_LPID_IDX 2
|
2017-06-08 16:15:14 +08:00
|
|
|
/* compare os arch and cpu arch */
|
|
|
|
#define SPIN_TABLE_ELEM_ARCH_COMP_IDX 3
|
2014-09-08 12:20:00 -07:00
|
|
|
#define WORDS_PER_SPIN_TABLE_ENTRY 8 /* pad to 64 bytes */
|
|
|
|
#define SPIN_TABLE_ELEM_SIZE 64
|
|
|
|
|
2017-06-08 16:15:14 +08:00
|
|
|
/* os arch is same as cpu arch */
|
|
|
|
#define OS_ARCH_SAME 0
|
|
|
|
/* os arch is different from cpu arch */
|
|
|
|
#define OS_ARCH_DIFF 1
|
|
|
|
|
2014-09-08 12:20:00 -07:00
|
|
|
#define id_to_core(x) ((x & 3) | (x >> 6))
|
|
|
|
#ifndef __ASSEMBLY__
|
2015-03-20 19:28:08 -07:00
|
|
|
extern u64 __real_cntfrq;
|
2020-06-01 21:53:34 +02:00
|
|
|
extern void *secondary_boot_addr;
|
|
|
|
extern void *secondary_boot_code_start;
|
|
|
|
extern size_t secondary_boot_code_size;
|
2017-04-19 13:27:39 +08:00
|
|
|
#ifdef CONFIG_MP
|
2015-10-26 19:47:50 +08:00
|
|
|
int fsl_layerscape_wake_seconday_cores(void);
|
2017-04-19 13:27:39 +08:00
|
|
|
#else
|
|
|
|
static inline int fsl_layerscape_wake_seconday_cores(void) { return 0; }
|
|
|
|
#endif
|
2014-09-08 12:20:00 -07:00
|
|
|
void *get_spin_tbl_addr(void);
|
2015-01-06 13:18:41 -08:00
|
|
|
int is_core_online(u64 cpu_id);
|
2016-09-13 12:40:30 -07:00
|
|
|
u32 cpu_pos_mask(void);
|
2014-09-08 12:20:00 -07:00
|
|
|
#endif
|
2016-11-10 10:49:03 +08:00
|
|
|
|
2015-10-26 19:47:50 +08:00
|
|
|
#endif /* _FSL_LAYERSCAPE_MP_H */
|