123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- /*
- * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
- #ifndef FVP_DEFS_DYNAMIQ_DTSI
- #define FVP_DEFS_DYNAMIQ_DTSI
- /* Set default topology values if not passed from platform's makefile */
- #ifdef FVP_CLUSTER_COUNT
- #define CLUSTER_COUNT FVP_CLUSTER_COUNT
- #else
- #define CLUSTER_COUNT 1
- #endif
- #ifdef FVP_MAX_CPUS_PER_CLUSTER
- #define CPUS_PER_CLUSTER FVP_MAX_CPUS_PER_CLUSTER
- #else
- #define CPUS_PER_CLUSTER 8
- #endif
- #define CONCAT(x, y) x##y
- #define CONC(x, y) CONCAT(x, y)
- /*
- * n - CPU number
- * r - MPID
- */
- #define CPU(n, r) \
- CPU##n:cpu@r## { \
- device_type = "cpu"; \
- compatible = "arm,armv8"; \
- reg = <0x0 0x##r>; \
- enable-method = "psci"; \
- cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>; \
- next-level-cache = <&L2_0>; \
- };
- #if (PE_PER_CPU == 2)
- #define THREAD(n) \
- thread##n { \
- cpu = <&CONC(CPU, __COUNTER__)>; \
- };
- #define CORE(n) \
- core##n { \
- THREAD(0) \
- THREAD(1) \
- };
- #else /* PE_PER_CPU == 1 */
- #define CORE(n) \
- core##n { \
- cpu = <&CPU##n>;\
- };
- #endif /* PE_PER_CORE */
- #if (CPUS_PER_CLUSTER == 1)
- #if (PE_PER_CPU == 1)
- #define CPUS \
- CPU(0, 0)
- #else
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 1)
- #endif
- #define CLUSTER(n) \
- cluster##n { \
- CORE(0) \
- };
- #elif (CPUS_PER_CLUSTER == 2)
- #if (PE_PER_CPU == 1)
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 100)
- #else
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 1) \
- CPU(2, 100) \
- CPU(3, 101)
- #endif
- #define CLUSTER(n) \
- cluster##n { \
- CORE(0) \
- CORE(1) \
- };
- #elif (CPUS_PER_CLUSTER == 3)
- #if (PE_PER_CPU == 1)
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 100) \
- CPU(2, 200)
- #else
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 1) \
- CPU(2, 100) \
- CPU(3, 101) \
- CPU(4, 200) \
- CPU(5, 201)
- #endif
- #define CLUSTER(n) \
- cluster##n { \
- CORE(0) \
- CORE(1) \
- CORE(2) \
- };
- #elif (CPUS_PER_CLUSTER == 4)
- #if (PE_PER_CPU == 1)
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 100) \
- CPU(2, 200) \
- CPU(3, 300)
- #else
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 1) \
- CPU(2, 100) \
- CPU(3, 101) \
- CPU(4, 200) \
- CPU(5, 201) \
- CPU(6, 300) \
- CPU(7, 301)
- #endif
- #define CLUSTER(n) \
- cluster##n { \
- CORE(0) \
- CORE(1) \
- CORE(2) \
- CORE(3) \
- };
- #elif (CPUS_PER_CLUSTER == 5)
- #if (PE_PER_CPU == 1)
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 100) \
- CPU(2, 200) \
- CPU(3, 300) \
- CPU(4, 400)
- #else
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 1) \
- CPU(2, 100) \
- CPU(3, 101) \
- CPU(4, 200) \
- CPU(5, 201) \
- CPU(6, 300) \
- CPU(7, 301) \
- CPU(8, 400) \
- CPU(9, 401)
- #endif
- #define CLUSTER(n) \
- cluster##n { \
- CORE(0) \
- CORE(1) \
- CORE(2) \
- CORE(3) \
- CORE(4) \
- };
- #elif (CPUS_PER_CLUSTER == 6)
- #if (PE_PER_CPU == 1)
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 100) \
- CPU(2, 200) \
- CPU(3, 300) \
- CPU(4, 400) \
- CPU(5, 500)
- #else
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 1) \
- CPU(2, 100) \
- CPU(3, 101) \
- CPU(4, 200) \
- CPU(5, 201) \
- CPU(6, 300) \
- CPU(7, 301) \
- CPU(8, 400) \
- CPU(9, 401) \
- CPU(10, 500) \
- CPU(11, 501)
- #endif
- #define CLUSTER(n) \
- cluster##n { \
- CORE(0) \
- CORE(1) \
- CORE(2) \
- CORE(3) \
- CORE(4) \
- CORE(5) \
- };
- #elif (CPUS_PER_CLUSTER == 7)
- #if (PE_PER_CPU == 1)
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 100) \
- CPU(2, 200) \
- CPU(3, 300) \
- CPU(4, 400) \
- CPU(5, 500) \
- CPU(6, 600)
- #else
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 1) \
- CPU(2, 100) \
- CPU(3, 101) \
- CPU(4, 200) \
- CPU(5, 201) \
- CPU(6, 300) \
- CPU(7, 301) \
- CPU(8, 400) \
- CPU(9, 401) \
- CPU(10, 500) \
- CPU(11, 501) \
- CPU(12, 600) \
- CPU(13, 601)
- #endif
- #define CLUSTER(n) \
- cluster##n { \
- CORE(0) \
- CORE(1) \
- CORE(2) \
- CORE(3) \
- CORE(4) \
- CORE(5) \
- CORE(6) \
- };
- #else
- #if (PE_PER_CPU == 1)
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 100) \
- CPU(2, 200) \
- CPU(3, 300) \
- CPU(4, 400) \
- CPU(5, 500) \
- CPU(6, 600) \
- CPU(7, 700)
- #else
- #define CPUS \
- CPU(0, 0) \
- CPU(1, 1) \
- CPU(2, 100) \
- CPU(3, 101) \
- CPU(4, 200) \
- CPU(5, 201) \
- CPU(6, 300) \
- CPU(7, 301) \
- CPU(8, 400) \
- CPU(9, 401) \
- CPU(10, 500) \
- CPU(11, 501) \
- CPU(12, 600) \
- CPU(13, 601) \
- CPU(14, 700) \
- CPU(15, 701)
- #endif
- #define CLUSTER(n) \
- cluster##n { \
- CORE(0) \
- CORE(1) \
- CORE(2) \
- CORE(3) \
- CORE(4) \
- CORE(5) \
- CORE(6) \
- CORE(7) \
- };
- #endif /* CPUS_PER_CLUSTER */
- #define CPU_MAP \
- cpu-map { \
- CLUSTER(0) \
- };
- #endif /* FVP_DEFS_DYNAMIQ_DTSI */
|