[U-Boot] [PATCH] ARC: add macro to get CPU id
Eugeniy Paltsev
Eugeniy.Paltsev at synopsys.com
Tue Nov 28 13:48:40 UTC 2017
ARCNUM [15:8] field in ARC_AUX_IDENTITY register allows you to
uniquely identify each core in a multi-core system.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev at synopsys.com>
---
arch/arc/include/asm/arcregs.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index 54a9b00..2a1bfc7 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -72,6 +72,9 @@
/* gcc builtin sr needs reg param to be long immediate */
#define write_aux_reg(reg_immed, val) \
__builtin_arc_sr((unsigned int)val, reg_immed)
+
+/* ARCNUM [15:8] - field to identify each core in a multi-core system */
+#define CPU_ID_GET() ((read_aux_reg(ARC_AUX_IDENTITY) & 0xFF00) >> 8)
#endif /* __ASSEMBLY__ */
#endif /* _ASM_ARC_ARCREGS_H */
--
2.9.3
More information about the U-Boot
mailing list