1 /* 2 * Copyright (c) 2024-2025, Linaro Limited. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef SBSA_PLATFORM_H 8 #define SBSA_PLATFORM_H 9 10 #include <stdint.h> 11 12 #include <platform_def.h> 13 14 struct platform_cpu_data { 15 uint32_t nodeid; 16 uint32_t mpidr; 17 }; 18 19 struct platform_memory_data { 20 uint32_t nodeid; 21 uint64_t addr_base; 22 uint64_t addr_size; 23 }; 24 25 /* 26 * sockets: the number of sockets on sbsa-ref platform. 27 * clusters: the number of clusters in one socket. 28 * cores: the number of cores in one cluster. 29 * threads: the number of threads in one core. 30 */ 31 struct platform_cpu_topology { 32 uint32_t sockets; 33 uint32_t clusters; 34 uint32_t cores; 35 uint32_t threads; 36 }; 37 38 struct qemu_platform_info { 39 uint32_t num_cpus; 40 uint32_t num_memnodes; 41 struct platform_cpu_data cpu[PLATFORM_CORE_COUNT]; 42 struct platform_cpu_topology cpu_topo; 43 struct platform_memory_data memory[PLAT_MAX_MEM_NODES]; 44 }; 45 46 void sbsa_platform_init(void); 47 int sbsa_platform_version_major(void); 48 int sbsa_platform_version_minor(void); 49 uint32_t sbsa_platform_num_cpus(void); 50 uint32_t sbsa_platform_num_memnodes(void); 51 uint64_t sbsa_platform_gic_its_addr(void); 52 struct platform_cpu_data sbsa_platform_cpu_node(uint64_t index); 53 struct platform_memory_data sbsa_platform_memory_node(uint64_t index); 54 struct platform_cpu_topology sbsa_platform_cpu_topology(void); 55 56 #endif /* SBSA_PLATFORM_H */ 57