blob: 13370b95ea9481c32132961d2b804fd3d7ebea6b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Written by: Patricia Gaughen, IBM Corporation
3 *
4 * Copyright (C) 2002, IBM Corp.
5 *
Joe Perches5f4e4b72008-03-23 01:02:56 -07006 * All rights reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
16 * NON INFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 * Send feedback to <gone@us.ibm.com>
24 */
25
H. Peter Anvin1965aae2008-10-22 22:26:29 -070026#ifndef _ASM_X86_NUMAQ_H
27#define _ASM_X86_NUMAQ_H
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
29#ifdef CONFIG_X86_NUMAQ
30
Yinghai Luab530e12008-06-03 10:25:54 -070031extern int found_numaq;
Linus Torvalds1da177e2005-04-16 15:20:36 -070032extern int get_memcfg_numaq(void);
33
Ingo Molnar4f179d12009-02-01 11:25:57 +010034extern void *xquad_portio;
35
Brian Gerst5c64c702010-02-05 09:37:03 -050036#define XQUAD_PORTIO_BASE 0xfe400000
37#define XQUAD_PORTIO_QUAD 0x40000 /* 256k per quad. */
38#define XQUAD_PORT_ADDR(port, quad) (xquad_portio + (XQUAD_PORTIO_QUAD*quad) + port)
39
Linus Torvalds1da177e2005-04-16 15:20:36 -070040/*
41 * SYS_CFG_DATA_PRIV_ADDR, struct eachquadmem, and struct sys_cfg_data are the
42 */
Joe Perches5f4e4b72008-03-23 01:02:56 -070043#define SYS_CFG_DATA_PRIV_ADDR 0x0009d000 /* place for scd in private
44 quad space */
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
46/*
47 * Communication area for each processor on lynxer-processor tests.
48 *
49 * NOTE: If you change the size of this eachproc structure you need
50 * to change the definition for EACH_QUAD_SIZE.
51 */
52struct eachquadmem {
53 unsigned int priv_mem_start; /* Starting address of this */
54 /* quad's private memory. */
55 /* This is always 0. */
56 /* In MB. */
57 unsigned int priv_mem_size; /* Size of this quad's */
58 /* private memory. */
59 /* In MB. */
60 unsigned int low_shrd_mem_strp_start;/* Starting address of this */
61 /* quad's low shared block */
62 /* (untranslated). */
63 /* In MB. */
64 unsigned int low_shrd_mem_start; /* Starting address of this */
65 /* quad's low shared memory */
66 /* (untranslated). */
67 /* In MB. */
68 unsigned int low_shrd_mem_size; /* Size of this quad's low */
69 /* shared memory. */
70 /* In MB. */
71 unsigned int lmmio_copb_start; /* Starting address of this */
72 /* quad's local memory */
73 /* mapped I/O in the */
74 /* compatibility OPB. */
75 /* In MB. */
76 unsigned int lmmio_copb_size; /* Size of this quad's local */
77 /* memory mapped I/O in the */
78 /* compatibility OPB. */
79 /* In MB. */
80 unsigned int lmmio_nopb_start; /* Starting address of this */
81 /* quad's local memory */
82 /* mapped I/O in the */
83 /* non-compatibility OPB. */
84 /* In MB. */
85 unsigned int lmmio_nopb_size; /* Size of this quad's local */
86 /* memory mapped I/O in the */
87 /* non-compatibility OPB. */
88 /* In MB. */
89 unsigned int io_apic_0_start; /* Starting address of I/O */
90 /* APIC 0. */
91 unsigned int io_apic_0_sz; /* Size I/O APIC 0. */
92 unsigned int io_apic_1_start; /* Starting address of I/O */
93 /* APIC 1. */
94 unsigned int io_apic_1_sz; /* Size I/O APIC 1. */
95 unsigned int hi_shrd_mem_start; /* Starting address of this */
96 /* quad's high shared memory.*/
97 /* In MB. */
98 unsigned int hi_shrd_mem_size; /* Size of this quad's high */
99 /* shared memory. */
100 /* In MB. */
101 unsigned int mps_table_addr; /* Address of this quad's */
102 /* MPS tables from BIOS, */
103 /* in system space.*/
104 unsigned int lcl_MDC_pio_addr; /* Port-I/O address for */
105 /* local access of MDC. */
106 unsigned int rmt_MDC_mmpio_addr; /* MM-Port-I/O address for */
107 /* remote access of MDC. */
108 unsigned int mm_port_io_start; /* Starting address of this */
109 /* quad's memory mapped Port */
110 /* I/O space. */
111 unsigned int mm_port_io_size; /* Size of this quad's memory*/
112 /* mapped Port I/O space. */
113 unsigned int mm_rmt_io_apic_start; /* Starting address of this */
114 /* quad's memory mapped */
115 /* remote I/O APIC space. */
116 unsigned int mm_rmt_io_apic_size; /* Size of this quad's memory*/
117 /* mapped remote I/O APIC */
118 /* space. */
119 unsigned int mm_isa_start; /* Starting address of this */
120 /* quad's memory mapped ISA */
121 /* space (contains MDC */
122 /* memory space). */
123 unsigned int mm_isa_size; /* Size of this quad's memory*/
124 /* mapped ISA space (contains*/
125 /* MDC memory space). */
126 unsigned int rmt_qmi_addr; /* Remote addr to access QMI.*/
127 unsigned int lcl_qmi_addr; /* Local addr to access QMI. */
128};
129
130/*
131 * Note: This structure must be NOT be changed unless the multiproc and
132 * OS are changed to reflect the new structure.
133 */
134struct sys_cfg_data {
135 unsigned int quad_id;
136 unsigned int bsp_proc_id; /* Boot Strap Processor in this quad. */
137 unsigned int scd_version; /* Version number of this table. */
138 unsigned int first_quad_id;
139 unsigned int quads_present31_0; /* 1 bit for each quad */
140 unsigned int quads_present63_32; /* 1 bit for each quad */
141 unsigned int config_flags;
142 unsigned int boot_flags;
143 unsigned int csr_start_addr; /* Absolute value (not in MB) */
144 unsigned int csr_size; /* Absolute value (not in MB) */
145 unsigned int lcl_apic_start_addr; /* Absolute value (not in MB) */
146 unsigned int lcl_apic_size; /* Absolute value (not in MB) */
147 unsigned int low_shrd_mem_base; /* 0 or 512MB or 1GB */
148 unsigned int low_shrd_mem_quad_offset; /* 0,128M,256M,512M,1G */
149 /* may not be totally populated */
Joe Perches5f4e4b72008-03-23 01:02:56 -0700150 unsigned int split_mem_enbl; /* 0 for no low shared memory */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151 unsigned int mmio_sz; /* Size of total system memory mapped I/O */
152 /* (in MB). */
153 unsigned int quad_spin_lock; /* Spare location used for quad */
154 /* bringup. */
155 unsigned int nonzero55; /* For checksumming. */
156 unsigned int nonzeroaa; /* For checksumming. */
157 unsigned int scd_magic_number;
158 unsigned int system_type;
159 unsigned int checksum;
160 /*
161 * memory configuration area for each quad
162 */
Joe Perches5f4e4b72008-03-23 01:02:56 -0700163 struct eachquadmem eq[MAX_NUMNODES]; /* indexed by quad id */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164};
165
Yinghai Lu3d88cca2008-07-12 22:52:55 -0700166void numaq_tsc_disable(void);
167
Yinghai Lud49c4282008-06-08 18:31:54 -0700168#else
169static inline int get_memcfg_numaq(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170{
Yinghai Lud49c4282008-06-08 18:31:54 -0700171 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172}
173#endif /* CONFIG_X86_NUMAQ */
H. Peter Anvin1965aae2008-10-22 22:26:29 -0700174#endif /* _ASM_X86_NUMAQ_H */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175