ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / ia64 / sn / fakeprom / fpmem.h
1 /* 
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) 2000-2003 Silicon Graphics, Inc.  All rights reserved.
8  */
9
10 #include <linux/config.h>
11
12 /*
13  * Structure of the mem config of the node as a SN MI reg
14  * Medusa supports this reg config.
15  *
16  * BankSize nibble to bank size mapping
17  *
18  *      1 - 64 MB
19  *      2 - 128 MB
20  *      3 - 256 MB
21  *      4 - 512 MB
22  *      5 - 1024 MB (1GB)
23  */
24
25 #define MBSHIFT                         20
26
27 #ifdef SGI_SN2
28 typedef struct node_memmap_s
29 {
30         unsigned int    b0size  :3,     /* 0-2   bank 0 size */
31                         b0dou   :1,     /* 3     bank 0 is 2-sided */
32                         ena0    :1,     /* 4     bank 0 enabled */
33                         r0      :3,     /* 5-7   reserved */
34                         b1size  :3,     /* 8-10  bank 1 size */
35                         b1dou   :1,     /* 11    bank 1 is 2-sided */
36                         ena1    :1,     /* 12    bank 1 enabled */
37                         r1      :3,     /* 13-15 reserved */
38                         b2size  :3,     /* 16-18 bank 2 size */
39                         b2dou   :1,     /* 19    bank 1 is 2-sided */
40                         ena2    :1,     /* 20    bank 2 enabled */
41                         r2      :3,     /* 21-23 reserved */
42                         b3size  :3,     /* 24-26 bank 3 size */
43                         b3dou   :1,     /* 27    bank 3 is 2-sided */
44                         ena3    :1,     /* 28    bank 3 enabled */
45                         r3      :3;     /* 29-31 reserved */
46 } node_memmap_t ;
47
48 #define SN2_BANK_SIZE_SHIFT             (MBSHIFT+6)     /* 64 MB */
49 #define BankPresent(bsize)              (bsize<6)
50 #define BankSizeBytes(bsize)            (BankPresent(bsize) ? 1UL<<((bsize)+SN2_BANK_SIZE_SHIFT) : 0)
51 #define MD_BANKS_PER_NODE 4
52 #define MD_BANKSIZE                     (1UL << 34)
53 #endif
54
55 typedef struct sn_memmap_s
56 {
57         short           nasid ;
58         short           cpuconfig;
59         node_memmap_t   node_memmap ;
60 } sn_memmap_t ;
61
62 typedef struct sn_config_s
63 {
64         int             cpus;
65         int             nodes;
66         sn_memmap_t     memmap[1];              /* start of array */
67 } sn_config_t;
68
69
70
71 extern void build_init(unsigned long);
72 extern int build_efi_memmap(void *, int);
73 extern int GetNumNodes(void);
74 extern int GetNumCpus(void);
75 extern int IsCpuPresent(int, int);
76 extern int GetNasid(int);