1 #ifndef __ASM_MACH_LOONGSON_BOOT_PARAM_H_
2 #define __ASM_MACH_LOONGSON_BOOT_PARAM_H_
4 #define SYSTEM_RAM_LOW 1
5 #define SYSTEM_RAM_HIGH 2
9 #define LOONGSON_CFG_REG 6
13 #define MAX_MEMORY_TYPE 10
15 #define LOONGSON3_BOOT_MEM_MAP_MAX 128
16 struct efi_memory_map_loongson {
17 u16 vers; /* version of efi_memory_map */
18 u32 nr_map; /* number of memory_maps */
19 u32 mem_freq; /* memory frequence */
21 u32 node_id; /* node_id which memory attached to */
22 u32 mem_type; /* system memory, pci memory, pci io, etc. */
23 u64 mem_start; /* memory map start address */
24 u32 mem_size; /* each memory_map size, not the total size */
25 } map[LOONGSON3_BOOT_MEM_MAP_MAX];
28 enum loongson_cpu_type {
38 * Capability and feature descriptor structure for MIPS CPU
40 struct efi_cpuinfo_loongson {
41 u16 vers; /* version of efi_cpuinfo_loongson */
42 u32 processor_id; /* PRID, e.g. 6305, 6306 */
43 u32 cputype; /* Loongson_3A/3B, etc. */
44 u32 total_node; /* num of total numa nodes */
45 u32 cpu_startup_core_id; /* Core id */
46 u32 cpu_clock_freq; /* cpu_clock */
50 struct system_loongson {
51 u16 vers; /* version of system_loongson */
52 u32 ccnuma_smp; /* 0: no numa; 1: has numa */
53 u32 sing_double_channel; /* 1:single; 2:double */
56 struct irq_source_routing_table {
63 u32 PIC_type; /* conform use HT or PCI to route to CPU-PIC */
64 u64 ht_int_bit; /* 3A: 1<<24; 3B: 1<<16 */
65 u64 ht_enable; /* irqs used in this PIC */
66 u32 node_id; /* node id: 0x0-0; 0x1-1; 0x10-2; 0x11-3 */
67 u64 pci_mem_start_addr;
69 u64 pci_io_start_addr;
75 struct interface_info {
76 u16 vers; /* version of the specificition */
82 #define MAX_RESOURCE_NUMBER 128
83 struct resource_loongson {
84 u64 start; /* resource start address */
85 u64 end; /* resource end address */
90 struct archdev_data {}; /* arch specific additions */
92 struct board_devices {
93 char name[64]; /* hold the device name */
94 u32 num_resources; /* number of device_resource */
95 /* for each device's resource */
96 struct resource_loongson resource[MAX_RESOURCE_NUMBER];
97 /* arch specific additions */
98 struct archdev_data archdata;
101 struct loongson_special_attribute {
102 u16 vers; /* version of this special */
103 char special_name[64]; /* special_atribute_name */
104 u32 loongson_special_type; /* type of special device */
105 /* for each device's resource */
106 struct resource_loongson resource[MAX_RESOURCE_NUMBER];
109 struct loongson_params {
110 u64 memory_offset; /* efi_memory_map_loongson struct offset */
111 u64 cpu_offset; /* efi_cpuinfo_loongson struct offset */
112 u64 system_offset; /* system_loongson struct offset */
113 u64 irq_offset; /* irq_source_routing_table struct offset */
114 u64 interface_offset; /* interface_info struct offset */
115 u64 special_offset; /* loongson_special_attribute struct offset */
116 u64 boarddev_table_offset; /* board_devices offset */
119 struct smbios_tables {
120 u16 vers; /* version of smbios */
121 u64 vga_bios; /* vga_bios address */
122 struct loongson_params lp;
125 struct efi_reset_system_t {
130 u64 DoSuspend; /* NULL if not support */
133 struct efi_loongson {
134 u64 mps; /* MPS table */
135 u64 acpi; /* ACPI table (IA64 ext 0.71) */
136 u64 acpi20; /* ACPI table (ACPI 2.0) */
137 struct smbios_tables smbios; /* SM BIOS table */
138 u64 sal_systab; /* SAL system table */
139 u64 boot_info; /* boot info table */
143 struct efi_loongson efi;
144 struct efi_reset_system_t reset_system;
147 struct loongson_system_configuration {
151 int cores_per_package;
152 enum loongson_cpu_type cputype;
154 u64 pci_mem_start_addr;
155 u64 pci_mem_end_addr;
164 extern struct efi_memory_map_loongson *loongson_memmap;
165 extern struct loongson_system_configuration loongson_sysconf;
166 extern int cpuhotplug_workaround;