ACPI: Disable the C2C3_FFH access mode HW has no MWAIT support
[linux-2.6/mini2440.git] / arch / x86 / kernel / numaq_32.c
blob5b20a5e7ac28933e8200c269880cc167603cafeb
1 /*
2 * Written by: Patricia Gaughen, IBM Corporation
4 * Copyright (C) 2002, IBM Corp.
6 * All rights reserved.
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.
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.
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.
23 * Send feedback to <gone@us.ibm.com>
26 #include <linux/mm.h>
27 #include <linux/bootmem.h>
28 #include <linux/mmzone.h>
29 #include <linux/module.h>
30 #include <linux/nodemask.h>
31 #include <asm/numaq.h>
32 #include <asm/topology.h>
33 #include <asm/processor.h>
34 #include <asm/mpspec.h>
35 #include <asm/e820.h>
37 #define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT))
40 * Function: smp_dump_qct()
42 * Description: gets memory layout from the quad config table. This
43 * function also updates node_online_map with the nodes (quads) present.
45 static void __init smp_dump_qct(void)
47 int node;
48 struct eachquadmem *eq;
49 struct sys_cfg_data *scd =
50 (struct sys_cfg_data *)__va(SYS_CFG_DATA_PRIV_ADDR);
52 nodes_clear(node_online_map);
53 for_each_node(node) {
54 if (scd->quads_present31_0 & (1 << node)) {
55 node_set_online(node);
56 eq = &scd->eq[node];
57 /* Convert to pages */
58 node_start_pfn[node] = MB_TO_PAGES(
59 eq->hi_shrd_mem_start - eq->priv_mem_size);
60 node_end_pfn[node] = MB_TO_PAGES(
61 eq->hi_shrd_mem_start + eq->hi_shrd_mem_size);
63 e820_register_active_regions(node, node_start_pfn[node],
64 node_end_pfn[node]);
65 memory_present(node,
66 node_start_pfn[node], node_end_pfn[node]);
67 node_remap_size[node] = node_memmap_size_bytes(node,
68 node_start_pfn[node],
69 node_end_pfn[node]);
74 static __init void early_check_numaq(void)
77 * Find possible boot-time SMP configuration:
79 early_find_smp_config();
81 * get boot-time SMP configuration:
83 if (smp_found_config)
84 early_get_smp_config();
87 int __init get_memcfg_numaq(void)
89 early_check_numaq();
90 if (!found_numaq)
91 return 0;
92 smp_dump_qct();
93 return 1;
96 void __init numaq_tsc_disable(void)
98 if (!found_numaq)
99 return -1;
101 if (num_online_nodes() > 1) {
102 printk(KERN_DEBUG "NUMAQ: disabling TSC\n");
103 setup_clear_cpu_cap(X86_FEATURE_TSC);