sbsa_platform.h 1.3 KB

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