summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2011-08-05 16:15:24 -0500
committerKumar Gala <galak@kernel.crashing.org>2011-09-29 19:01:05 -0500
commitfbb9ecf7493fbd6b8c8af7d52e90c915459f7040 (patch)
treeb19bce4d9c77be58fc1aba43bd73625222c99f8f /include/common.h
parent86df5142a14868ea0e24511f4293d43a611a2b39 (diff)
downloadu-boot-imx-fbb9ecf7493fbd6b8c8af7d52e90c915459f7040.zip
u-boot-imx-fbb9ecf7493fbd6b8c8af7d52e90c915459f7040.tar.gz
u-boot-imx-fbb9ecf7493fbd6b8c8af7d52e90c915459f7040.tar.bz2
powerpc/mp: add support for discontiguous cores
Some SOCs have discontiguously-numbered cores, and so we can't determine the valid core numbers via the FRR register any more. We define CPU_TYPE_ENTRY_MASK to specify a discontiguous core mask, and helper functions to process the mask and enumerate over the set of valid cores. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index d244bd4..05e2f72 100644
--- a/include/common.h
+++ b/include/common.h
@@ -485,7 +485,22 @@ void ddr_enable_ecc(unsigned int dram_size);
#endif
/* $(CPU)/cpu.c */
+static inline int cpumask_next(int cpu, unsigned int mask)
+{
+ for (cpu++; !((1 << cpu) & mask); cpu++)
+ ;
+
+ return cpu;
+}
+
+#define for_each_cpu(iter, cpu, num_cpus, mask) \
+ for (iter = 0, cpu = cpumask_next(-1, mask); \
+ iter < num_cpus; \
+ iter++, cpu = cpumask_next(cpu, mask)) \
+
int cpu_numcores (void);
+u32 cpu_mask (void);
+int is_core_valid (unsigned int);
int probecpu (void);
int checkcpu (void);
int checkicache (void);