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
8#include <linux/types.h>
9#include <asm/setup.h>
10
11const char *get_system_type(void);
12
13extern void init_environ(void);
14extern void memblock_init(void);
15extern void platform_init(void);
16extern int __init init_numa_memory(void);
17
18struct loongson_board_info {
19	int bios_size;
20	const char *bios_vendor;
21	const char *bios_version;
22	const char *bios_release_date;
23	const char *board_name;
24	const char *board_vendor;
25};
26
27#define NR_WORDS DIV_ROUND_UP(NR_CPUS, BITS_PER_LONG)
28
29struct loongson_system_configuration {
30	int nr_cpus;
31	int nr_nodes;
32	int boot_cpu_id;
33	int cores_per_node;
34	int cores_per_package;
35	unsigned long cores_io_master[NR_WORDS];
36	unsigned long suspend_addr;
37	const char *cpuname;
38};
39
40extern u64 efi_system_table;
41extern unsigned long fw_arg0, fw_arg1, fw_arg2;
42extern struct loongson_board_info b_info;
43extern struct loongson_system_configuration loongson_sysconf;
44
45static inline bool io_master(int cpu)
46{
47	return test_bit(cpu, loongson_sysconf.cores_io_master);
48}
49
50#endif /* _ASM_BOOTINFO_H */
51