aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/mach-loongson/mmzone.h
diff options
context:
space:
mode:
authorHuacai Chen <chenhc@lemote.com>2014-06-25 23:41:28 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-07-30 15:46:19 -0400
commitc46173183657bbdbe0d54a981c28807581648422 (patch)
tree554d75cfc577d82c043b3e2fca17819abd63033b /arch/mips/include/asm/mach-loongson/mmzone.h
parent140e39c1e3d29f50e161f55cca60f60b80408c2a (diff)
MIPS: Add NUMA support for Loongson-3
Multiple Loongson-3A chips can be interconnected with HT0-bus. This is a CC-NUMA system that every chip (node) has its own local memory and cache coherency is maintained by hardware. The 64-bit physical memory address format is as follows: 0x-0000-YZZZ-ZZZZ-ZZZZ The high 16 bits should be 0, which means the real physical address supported by Loongson-3 is 48-bit. The "Y" bits is the base address of each node, which can be also considered as the node-id. The "Z" bits is the address offset within a node, which means every node has a 44 bits address space. Macros XPHYSADDR and MAX_PHYSMEM_BITS are modified unconditionally, because many other MIPS CPUs have also extended their address spaces. Signed-off-by: Huacai Chen <chenhc@lemote.com> Cc: John Crispin <john@phrozen.org> Cc: Steven J. Hill <Steven.Hill@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: linux-mips@linux-mips.org Cc: Fuxin Zhang <zhangfx@lemote.com> Cc: Zhangjin Wu <wuzhangjin@gmail.com> Patchwork: https://patchwork.linux-mips.org/patch/7187/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm/mach-loongson/mmzone.h')
-rw-r--r--arch/mips/include/asm/mach-loongson/mmzone.h53
1 files changed, 53 insertions, 0 deletions
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
27struct slice_data {
28 unsigned long irq_enable_mask[2];
29 int level_to_irq[LEVELS_PER_SLICE];
30};
31
32struct 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
39struct node_data {
40 struct pglist_data pglist;
41 struct hub_data hub;
42 cpumask_t cpumask;
43};
44
45extern 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
50extern void setup_zero_pages(void);
51extern void __init prom_init_numa_memory(void);
52
53#endif /* _ASM_MACH_MMZONE_H */