1 #ifndef __ASM_MACH_LOONGSON64_BOOT_PARAM_H_
2 #define __ASM_MACH_LOONGSON64_BOOT_PARAM_H_
4 #define SYSTEM_RAM_LOW 1
5 #define SYSTEM_RAM_HIGH 2
9 #define LOONGSON_CFG_REG 6
13 #define SMBIOS_TABLE 10
14 #define MAX_MEMORY_TYPE 11
16 #define LOONGSON3_BOOT_MEM_MAP_MAX 128
17 struct efi_memory_map_loongson
{
18 u16 vers
; /* version of efi_memory_map */
19 u32 nr_map
; /* number of memory_maps */
20 u32 mem_freq
; /* memory frequence */
22 u32 node_id
; /* node_id which memory attached to */
23 u32 mem_type
; /* system memory, pci memory, pci io, etc. */
24 u64 mem_start
; /* memory map start address */
25 u32 mem_size
; /* each memory_map size, not the total size */
26 } map
[LOONGSON3_BOOT_MEM_MAP_MAX
];
29 enum loongson_cpu_type
{
39 * Capability and feature descriptor structure for MIPS CPU
41 struct efi_cpuinfo_loongson
{
42 u16 vers
; /* version of efi_cpuinfo_loongson */
43 u32 processor_id
; /* PRID, e.g. 6305, 6306 */
44 u32 cputype
; /* Loongson_3A/3B, etc. */
45 u32 total_node
; /* num of total numa nodes */
46 u16 cpu_startup_core_id
; /* Boot core id */
47 u16 reserved_cores_mask
;
48 u32 cpu_clock_freq
; /* cpu_clock */
54 u32 iotype
; /* see include/linux/serial_core.h */
60 #define MAX_SENSORS 64
61 #define SENSOR_TEMPER 0x00000001
62 #define SENSOR_VOLTAGE 0x00000002
63 #define SENSOR_FAN 0x00000004
64 struct sensor_device
{
65 char name
[32]; /* a formal name */
66 char label
[64]; /* a flexible description */
67 u32 type
; /* SENSOR_* */
68 u32 id
; /* instance id of a sensor-class */
69 u32 fan_policy
; /* see loongson_hwmon.h */
70 u32 fan_percent
;/* only for constant speed policy */
71 u64 base_addr
; /* base address of device registers */
74 struct system_loongson
{
75 u16 vers
; /* version of system_loongson */
76 u32 ccnuma_smp
; /* 0: no numa; 1: has numa */
77 u32 sing_double_channel
; /* 1:single; 2:double */
79 struct uart_device uarts
[MAX_UARTS
];
81 struct sensor_device sensors
[MAX_SENSORS
];
88 u64 workarounds
; /* see workarounds.h */
91 struct irq_source_routing_table
{
98 u32 PIC_type
; /* conform use HT or PCI to route to CPU-PIC */
99 u64 ht_int_bit
; /* 3A: 1<<24; 3B: 1<<16 */
100 u64 ht_enable
; /* irqs used in this PIC */
101 u32 node_id
; /* node id: 0x0-0; 0x1-1; 0x10-2; 0x11-3 */
102 u64 pci_mem_start_addr
;
103 u64 pci_mem_end_addr
;
104 u64 pci_io_start_addr
;
110 struct interface_info
{
111 u16 vers
; /* version of the specificition */
114 char description
[64];
117 #define MAX_RESOURCE_NUMBER 128
118 struct resource_loongson
{
119 u64 start
; /* resource start address */
120 u64 end
; /* resource end address */
125 struct archdev_data
{}; /* arch specific additions */
127 struct board_devices
{
128 char name
[64]; /* hold the device name */
129 u32 num_resources
; /* number of device_resource */
130 /* for each device's resource */
131 struct resource_loongson resource
[MAX_RESOURCE_NUMBER
];
132 /* arch specific additions */
133 struct archdev_data archdata
;
136 struct loongson_special_attribute
{
137 u16 vers
; /* version of this special */
138 char special_name
[64]; /* special_atribute_name */
139 u32 loongson_special_type
; /* type of special device */
140 /* for each device's resource */
141 struct resource_loongson resource
[MAX_RESOURCE_NUMBER
];
144 struct loongson_params
{
145 u64 memory_offset
; /* efi_memory_map_loongson struct offset */
146 u64 cpu_offset
; /* efi_cpuinfo_loongson struct offset */
147 u64 system_offset
; /* system_loongson struct offset */
148 u64 irq_offset
; /* irq_source_routing_table struct offset */
149 u64 interface_offset
; /* interface_info struct offset */
150 u64 special_offset
; /* loongson_special_attribute struct offset */
151 u64 boarddev_table_offset
; /* board_devices offset */
154 struct smbios_tables
{
155 u16 vers
; /* version of smbios */
156 u64 vga_bios
; /* vga_bios address */
157 struct loongson_params lp
;
160 struct efi_reset_system_t
{
165 u64 DoSuspend
; /* NULL if not support */
168 struct efi_loongson
{
169 u64 mps
; /* MPS table */
170 u64 acpi
; /* ACPI table (IA64 ext 0.71) */
171 u64 acpi20
; /* ACPI table (ACPI 2.0) */
172 struct smbios_tables smbios
; /* SM BIOS table */
173 u64 sal_systab
; /* SAL system table */
174 u64 boot_info
; /* boot info table */
178 struct efi_loongson efi
;
179 struct efi_reset_system_t reset_system
;
182 struct loongson_system_configuration
{
186 int cores_per_package
;
188 u16 reserved_cpus_mask
;
189 enum loongson_cpu_type cputype
;
191 u64 pci_mem_start_addr
;
192 u64 pci_mem_end_addr
;
201 struct uart_device uarts
[MAX_UARTS
];
203 struct sensor_device sensors
[MAX_SENSORS
];
207 extern struct efi_memory_map_loongson
*loongson_memmap
;
208 extern struct loongson_system_configuration loongson_sysconf
;