bootinfo.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
  4. */
  5. #ifndef _ASM_BOOTINFO_H
  6. #define _ASM_BOOTINFO_H
  7. #include <linux/types.h>
  8. #include <asm/setup.h>
  9. const char *get_system_type(void);
  10. extern void init_environ(void);
  11. extern void memblock_init(void);
  12. extern void platform_init(void);
  13. extern int __init init_numa_memory(void);
  14. struct loongson_board_info {
  15. int bios_size;
  16. const char *bios_vendor;
  17. const char *bios_version;
  18. const char *bios_release_date;
  19. const char *board_name;
  20. const char *board_vendor;
  21. };
  22. #define NR_WORDS DIV_ROUND_UP(NR_CPUS, BITS_PER_LONG)
  23. /*
  24. * The "core" of cores_per_node and cores_per_package stands for a
  25. * logical core, which means in a SMT system it stands for a thread.
  26. */
  27. struct loongson_system_configuration {
  28. int nr_cpus;
  29. int nr_nodes;
  30. int boot_cpu_id;
  31. int cores_per_node;
  32. int cores_per_package;
  33. unsigned long cores_io_master[NR_WORDS];
  34. unsigned long suspend_addr;
  35. const char *cpuname;
  36. };
  37. extern u64 efi_system_table;
  38. extern unsigned long fw_arg0, fw_arg1, fw_arg2;
  39. extern struct loongson_board_info b_info;
  40. extern struct loongson_system_configuration loongson_sysconf;
  41. static inline bool io_master(int cpu)
  42. {
  43. return test_bit(cpu, loongson_sysconf.cores_io_master);
  44. }
  45. #endif /* _ASM_BOOTINFO_H */