Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | * SGI specific setup. |
| 7 | * |
Dean Nelson | 2e34f07 | 2005-03-21 19:41:00 -0700 | [diff] [blame] | 8 | * Copyright (C) 1995-1997,1999,2001-2005 Silicon Graphics, Inc. All rights reserved. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) |
| 10 | */ |
| 11 | #ifndef _ASM_IA64_SN_ARCH_H |
| 12 | #define _ASM_IA64_SN_ARCH_H |
| 13 | |
Tony Luck | 8d7e351 | 2005-07-06 18:18:10 -0700 | [diff] [blame] | 14 | #include <linux/numa.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #include <asm/types.h> |
| 16 | #include <asm/percpu.h> |
| 17 | #include <asm/sn/types.h> |
| 18 | #include <asm/sn/sn_cpuid.h> |
| 19 | |
| 20 | /* |
Jack Steiner | 24ee0a6 | 2005-09-12 12:15:43 -0500 | [diff] [blame] | 21 | * This is the maximum number of NUMALINK nodes that can be part of a single |
| 22 | * SSI kernel. This number includes C-brick, M-bricks, and TIOs. Nodes in |
| 23 | * remote partitions are NOT included in this number. |
| 24 | * The number of compact nodes cannot exceed size of a coherency domain. |
| 25 | * The purpose of this define is to specify a node count that includes |
| 26 | * all C/M/TIO nodes in an SSI system. |
| 27 | * |
| 28 | * SGI system can currently support up to 256 C/M nodes plus additional TIO nodes. |
| 29 | * |
| 30 | * Note: ACPI20 has an architectural limit of 256 nodes. When we upgrade |
| 31 | * to ACPI3.0, this limit will be removed. The notion of "compact nodes" |
| 32 | * should be deleted and TIOs should be included in MAX_NUMNODES. |
| 33 | */ |
| 34 | #define MAX_COMPACT_NODES 512 |
| 35 | |
| 36 | /* |
| 37 | * Maximum number of nodes in all partitions and in all coherency domains. |
| 38 | * This is the total number of nodes accessible in the numalink fabric. It |
| 39 | * includes all C & M bricks, plus all TIOs. |
| 40 | * |
| 41 | * This value is also the value of the maximum number of NASIDs in the numalink |
| 42 | * fabric. |
| 43 | */ |
Jack Steiner | 59c4223 | 2005-09-27 08:25:32 -0500 | [diff] [blame] | 44 | #define MAX_NUMALINK_NODES 16384 |
Jack Steiner | 24ee0a6 | 2005-09-12 12:15:43 -0500 | [diff] [blame] | 45 | |
| 46 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | * The following defines attributes of the HUB chip. These attributes are |
| 48 | * frequently referenced. They are kept in the per-cpu data areas of each cpu. |
| 49 | * They are kept together in a struct to minimize cache misses. |
| 50 | */ |
| 51 | struct sn_hub_info_s { |
| 52 | u8 shub2; |
| 53 | u8 nasid_shift; |
| 54 | u8 as_shift; |
| 55 | u8 shub_1_1_found; |
| 56 | u16 nasid_bitmask; |
| 57 | }; |
| 58 | DECLARE_PER_CPU(struct sn_hub_info_s, __sn_hub_info); |
| 59 | #define sn_hub_info (&__get_cpu_var(__sn_hub_info)) |
| 60 | #define is_shub2() (sn_hub_info->shub2) |
| 61 | #define is_shub1() (sn_hub_info->shub2 == 0) |
| 62 | |
| 63 | /* |
| 64 | * Use this macro to test if shub 1.1 wars should be enabled |
| 65 | */ |
| 66 | #define enable_shub_wars_1_1() (sn_hub_info->shub_1_1_found) |
| 67 | |
| 68 | |
| 69 | /* |
Dean Nelson | 2e34f07 | 2005-03-21 19:41:00 -0700 | [diff] [blame] | 70 | * Compact node ID to nasid mappings kept in the per-cpu data areas of each |
| 71 | * cpu. |
| 72 | */ |
| 73 | DECLARE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]); |
| 74 | #define sn_cnodeid_to_nasid (&__get_cpu_var(__sn_cnodeid_to_nasid[0])) |
| 75 | |
| 76 | |
Dean Nelson | 7fbd2a5 | 2005-03-23 19:11:00 -0700 | [diff] [blame] | 77 | extern u8 sn_partition_id; |
| 78 | extern u8 sn_system_size; |
| 79 | extern u8 sn_sharing_domain_size; |
| 80 | extern u8 sn_region_size; |
| 81 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | extern void sn_flush_all_caches(long addr, long bytes); |
| 83 | |
| 84 | #endif /* _ASM_IA64_SN_ARCH_H */ |