diff options
Diffstat (limited to 'arch/mips/include')
-rw-r--r-- | arch/mips/include/asm/addrspace.h | 2 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-loongson/boot_param.h | 3 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-loongson/kernel-entry-init.h | 52 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-loongson/mmzone.h | 53 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-loongson/topology.h | 23 | ||||
-rw-r--r-- | arch/mips/include/asm/sparsemem.h | 2 |
6 files changed, 133 insertions, 2 deletions
diff --git a/arch/mips/include/asm/addrspace.h b/arch/mips/include/asm/addrspace.h index 3f745459fdb5..3b0e51d5a613 100644 --- a/arch/mips/include/asm/addrspace.h +++ b/arch/mips/include/asm/addrspace.h | |||
@@ -52,7 +52,7 @@ | |||
52 | */ | 52 | */ |
53 | #define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff) | 53 | #define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff) |
54 | #define XPHYSADDR(a) ((_ACAST64_(a)) & \ | 54 | #define XPHYSADDR(a) ((_ACAST64_(a)) & \ |
55 | _CONST64_(0x000000ffffffffff)) | 55 | _CONST64_(0x0000ffffffffffff)) |
56 | 56 | ||
57 | #ifdef CONFIG_64BIT | 57 | #ifdef CONFIG_64BIT |
58 | 58 | ||
diff --git a/arch/mips/include/asm/mach-loongson/boot_param.h b/arch/mips/include/asm/mach-loongson/boot_param.h index 829a7ec185fb..8b06c96cce1f 100644 --- a/arch/mips/include/asm/mach-loongson/boot_param.h +++ b/arch/mips/include/asm/mach-loongson/boot_param.h | |||
@@ -146,6 +146,9 @@ struct boot_params { | |||
146 | 146 | ||
147 | struct loongson_system_configuration { | 147 | struct loongson_system_configuration { |
148 | u32 nr_cpus; | 148 | u32 nr_cpus; |
149 | u32 nr_nodes; | ||
150 | int cores_per_node; | ||
151 | int cores_per_package; | ||
149 | enum loongson_cpu_type cputype; | 152 | enum loongson_cpu_type cputype; |
150 | u64 ht_control_base; | 153 | u64 ht_control_base; |
151 | u64 pci_mem_start_addr; | 154 | u64 pci_mem_start_addr; |
diff --git a/arch/mips/include/asm/mach-loongson/kernel-entry-init.h b/arch/mips/include/asm/mach-loongson/kernel-entry-init.h new file mode 100644 index 000000000000..df5fca8eeb80 --- /dev/null +++ b/arch/mips/include/asm/mach-loongson/kernel-entry-init.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2005 Embedded Alley Solutions, Inc | ||
7 | * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) | ||
8 | * Copyright (C) 2009 Jiajie Chen (chenjiajie@cse.buaa.edu.cn) | ||
9 | * Copyright (C) 2012 Huacai Chen (chenhc@lemote.com) | ||
10 | */ | ||
11 | #ifndef __ASM_MACH_LOONGSON_KERNEL_ENTRY_H | ||
12 | #define __ASM_MACH_LOONGSON_KERNEL_ENTRY_H | ||
13 | |||
14 | /* | ||
15 | * Override macros used in arch/mips/kernel/head.S. | ||
16 | */ | ||
17 | .macro kernel_entry_setup | ||
18 | #ifdef CONFIG_CPU_LOONGSON3 | ||
19 | .set push | ||
20 | .set mips64 | ||
21 | /* Set LPA on LOONGSON3 config3 */ | ||
22 | mfc0 t0, $16, 3 | ||
23 | or t0, (0x1 << 7) | ||
24 | mtc0 t0, $16, 3 | ||
25 | /* Set ELPA on LOONGSON3 pagegrain */ | ||
26 | li t0, (0x1 << 29) | ||
27 | mtc0 t0, $5, 1 | ||
28 | _ehb | ||
29 | .set pop | ||
30 | #endif | ||
31 | .endm | ||
32 | |||
33 | /* | ||
34 | * Do SMP slave processor setup. | ||
35 | */ | ||
36 | .macro smp_slave_setup | ||
37 | #ifdef CONFIG_CPU_LOONGSON3 | ||
38 | .set push | ||
39 | .set mips64 | ||
40 | /* Set LPA on LOONGSON3 config3 */ | ||
41 | mfc0 t0, $16, 3 | ||
42 | or t0, (0x1 << 7) | ||
43 | mtc0 t0, $16, 3 | ||
44 | /* Set ELPA on LOONGSON3 pagegrain */ | ||
45 | li t0, (0x1 << 29) | ||
46 | mtc0 t0, $5, 1 | ||
47 | _ehb | ||
48 | .set pop | ||
49 | #endif | ||
50 | .endm | ||
51 | |||
52 | #endif /* __ASM_MACH_LOONGSON_KERNEL_ENTRY_H */ | ||
diff --git a/arch/mips/include/asm/mach-loongson/mmzone.h b/arch/mips/include/asm/mach-loongson/mmzone.h new file mode 100644 index 000000000000..37c08a27b4f0 --- /dev/null +++ b/arch/mips/include/asm/mach-loongson/mmzone.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Loongson Inc. & Lemote Inc. & | ||
3 | * Insititute of Computing Technology | ||
4 | * Author: Xiang Gao, gaoxiang@ict.ac.cn | ||
5 | * Huacai Chen, chenhc@lemote.com | ||
6 | * Xiaofu Meng, Shuangshuang Zhang | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | */ | ||
13 | #ifndef _ASM_MACH_MMZONE_H | ||
14 | #define _ASM_MACH_MMZONE_H | ||
15 | |||
16 | #include <boot_param.h> | ||
17 | #define NODE_ADDRSPACE_SHIFT 44 | ||
18 | #define NODE0_ADDRSPACE_OFFSET 0x000000000000UL | ||
19 | #define NODE1_ADDRSPACE_OFFSET 0x100000000000UL | ||
20 | #define NODE2_ADDRSPACE_OFFSET 0x200000000000UL | ||
21 | #define NODE3_ADDRSPACE_OFFSET 0x300000000000UL | ||
22 | |||
23 | #define pa_to_nid(addr) (((addr) & 0xf00000000000) >> NODE_ADDRSPACE_SHIFT) | ||
24 | |||
25 | #define LEVELS_PER_SLICE 128 | ||
26 | |||
27 | struct slice_data { | ||
28 | unsigned long irq_enable_mask[2]; | ||
29 | int level_to_irq[LEVELS_PER_SLICE]; | ||
30 | }; | ||
31 | |||
32 | struct hub_data { | ||
33 | cpumask_t h_cpus; | ||
34 | unsigned long slice_map; | ||
35 | unsigned long irq_alloc_mask[2]; | ||
36 | struct slice_data slice[2]; | ||
37 | }; | ||
38 | |||
39 | struct node_data { | ||
40 | struct pglist_data pglist; | ||
41 | struct hub_data hub; | ||
42 | cpumask_t cpumask; | ||
43 | }; | ||
44 | |||
45 | extern struct node_data *__node_data[]; | ||
46 | |||
47 | #define NODE_DATA(n) (&__node_data[(n)]->pglist) | ||
48 | #define hub_data(n) (&__node_data[(n)]->hub) | ||
49 | |||
50 | extern void setup_zero_pages(void); | ||
51 | extern void __init prom_init_numa_memory(void); | ||
52 | |||
53 | #endif /* _ASM_MACH_MMZONE_H */ | ||
diff --git a/arch/mips/include/asm/mach-loongson/topology.h b/arch/mips/include/asm/mach-loongson/topology.h new file mode 100644 index 000000000000..5598ba77d2ef --- /dev/null +++ b/arch/mips/include/asm/mach-loongson/topology.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef _ASM_MACH_TOPOLOGY_H | ||
2 | #define _ASM_MACH_TOPOLOGY_H | ||
3 | |||
4 | #ifdef CONFIG_NUMA | ||
5 | |||
6 | #define cpu_to_node(cpu) ((cpu) >> 2) | ||
7 | #define parent_node(node) (node) | ||
8 | #define cpumask_of_node(node) (&__node_data[(node)]->cpumask) | ||
9 | |||
10 | struct pci_bus; | ||
11 | extern int pcibus_to_node(struct pci_bus *); | ||
12 | |||
13 | #define cpumask_of_pcibus(bus) (cpu_online_mask) | ||
14 | |||
15 | extern unsigned char __node_distances[MAX_NUMNODES][MAX_NUMNODES]; | ||
16 | |||
17 | #define node_distance(from, to) (__node_distances[(from)][(to)]) | ||
18 | |||
19 | #endif | ||
20 | |||
21 | #include <asm-generic/topology.h> | ||
22 | |||
23 | #endif /* _ASM_MACH_TOPOLOGY_H */ | ||
diff --git a/arch/mips/include/asm/sparsemem.h b/arch/mips/include/asm/sparsemem.h index d2da53c2c2f8..b1071c1e54f5 100644 --- a/arch/mips/include/asm/sparsemem.h +++ b/arch/mips/include/asm/sparsemem.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #else | 11 | #else |
12 | # define SECTION_SIZE_BITS 28 | 12 | # define SECTION_SIZE_BITS 28 |
13 | #endif | 13 | #endif |
14 | #define MAX_PHYSMEM_BITS 35 | 14 | #define MAX_PHYSMEM_BITS 48 |
15 | 15 | ||
16 | #endif /* CONFIG_SPARSEMEM */ | 16 | #endif /* CONFIG_SPARSEMEM */ |
17 | #endif /* _MIPS_SPARSEMEM_H */ | 17 | #endif /* _MIPS_SPARSEMEM_H */ |