1/* $Id: arch.h,v 1.1.1.1 2008/10/15 03:29:03 james26_jang Exp $
2 *
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License.  See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved.
8 */
9#ifndef _ASM_IA64_SN_SN1_ARCH_H
10#define _ASM_IA64_SN_SN1_ARCH_H
11
12#if defined(N_MODE)
13#error "ERROR constants defined only for M-mode"
14#endif
15
16#include <linux/threads.h>
17#include <asm/types.h>
18
19#define CPUS_PER_NODE           4       /* CPUs on a single hub */
20#define CPUS_PER_SUBNODE        2       /* CPUs on a single hub PI */
21
22/*
23 * This is the maximum number of NASIDS that can be present in a system.
24 * This include ALL nodes in ALL partitions connected via NUMALINK.
25 * (Highest NASID plus one.)
26 */
27#define MAX_NASIDS              128
28
29/*
30 * This is the maximum number of nodes that can be part of a kernel.
31 * Effectively, it's the maximum number of compact node ids (cnodeid_t).
32 * This is not necessarily the same as MAX_NASIDS.
33 */
34#define MAX_COMPACT_NODES       128
35
36/*
37 * MAX_REGIONS refers to the maximum number of hardware partitioned regions.
38 */
39#define	MAX_REGIONS		64
40#define MAX_NONPREMIUM_REGIONS  16
41#define MAX_PREMIUM_REGIONS     MAX_REGIONS
42
43/*
44 * Slot constants for IP35
45 */
46
47#define MAX_MEM_SLOTS    8                     /* max slots per node */
48
49#if defined(N_MODE)
50#error "N-mode not supported"
51#endif
52
53#define SLOT_SHIFT              (30)
54#define SLOT_MIN_MEM_SIZE       (64*1024*1024)
55
56
57/*
58 * MAX_PARITIONS refers to the maximum number of logically defined
59 * partitions the system can support.
60 */
61#define MAX_PARTITIONS		MAX_REGIONS
62
63
64#define NASID_MASK_BYTES	((MAX_NASIDS + 7) / 8)
65
66/*
67 * New stuff in here from Irix sys/pfdat.h.
68 */
69#define SLOT_PFNSHIFT           (SLOT_SHIFT - PAGE_SHIFT)
70#define PFN_NASIDSHFT           (NASID_SHFT - PAGE_SHIFT)
71#define slot_getbasepfn(node,slot)  (mkpfn(COMPACT_TO_NASID_NODEID(node), slot<<SLOT_PFNSHIFT))
72#define mkpfn(nasid, off)       (((pfn_t)(nasid) << PFN_NASIDSHFT) | (off))
73
74
75
76/*
77 * two PIs per bedrock, two CPUs per PI
78 */
79#define NUM_SUBNODES	2
80#define SUBNODE_SHFT	1
81#define SUBNODE_MASK	(0x1 << SUBNODE_SHFT)
82#define LOCALCPU_SHFT	0
83#define LOCALCPU_MASK	(0x1 << LOCALCPU_SHFT)
84#define SUBNODE(slice)	(((slice) & SUBNODE_MASK) >> SUBNODE_SHFT)
85#define LOCALCPU(slice)	(((slice) & LOCALCPU_MASK) >> LOCALCPU_SHFT)
86#define TO_SLICE(subn, local)	(((subn) << SUBNODE_SHFT) | \
87				 ((local) << LOCALCPU_SHFT))
88
89#endif /* _ASM_IA64_SN_SN1_ARCH_H */
90