1 #include <console/console.h>
4 #include <boot/tables.h>
5 #include <boot/linuxbios_tables.h>
6 #include <arch/pirq_routing.h>
7 #include <arch/smp/mpspec.h>
8 #include "linuxbios_table.h"
10 #if CONFIG_SMP && CONFIG_MAX_PHYSICAL_CPUS && (CONFIG_MAX_PHYSICAL_CPUS < CONFIG_MAX_CPUS)
11 static void remove_logical_cpus(unsigned long *processor_map)
13 /* To turn off hyperthreading just remove the logical
14 * cpus from the processor map.
16 int disable_logical_cpus = !CONFIG_LOGICAL_CPUS;
17 if (get_option(&disable_logical_cpus,"hyper_threading")) {
18 disable_logical_cpus = !CONFIG_LOGICAL_CPUS;
20 if (disable_logical_cpus) {
21 /* disable logical cpus */
23 for(cnt=MAX_PHYSICAL_CPUS;cnt<MAX_CPUS;cnt++)
25 printk_debug("logical cpus disabled\n");
30 #define remove_logical_cpus(processor_map) do {} while(0)
32 #endif /* CONFIG_SMP && CONFIG_MAX_PHYSICAL_CPUS */
34 struct lb_memory *write_tables(struct mem_range *mem, unsigned long *processor_map)
36 unsigned long low_table_start, low_table_end;
37 unsigned long rom_table_start, rom_table_end;
39 rom_table_start = 0xf0000;
40 rom_table_end = 0xf0000;
41 /* Start low addr at 16 bytes instead of 0 because of a buglet
42 * in the generic linux unzip code, as it tests for the a20 line.
48 check_pirq_routing_table();
49 /* This table must be betweeen 0xf0000 & 0x100000 */
50 rom_table_end = copy_pirq_routing_table(rom_table_end);
51 rom_table_end = (rom_table_end + 1023) & ~1023;
53 /* copy the smp block to address 0 */
56 /* The smp table must be in 0-1K, 639K-640K, or 960K-1M */
57 remove_logical_cpus(processor_map);
58 low_table_end = write_smp_table(low_table_end, processor_map);
60 /* Don't write anything in the traditional x86 BIOS data segment */
61 if (low_table_end < 0x500) {
62 low_table_end = 0x500;
64 /* The linuxbios table must be in 0-4K or 960K-1M */
65 write_linuxbios_table(processor_map, mem,
66 low_table_start, low_table_end,
67 rom_table_start >> 10, rom_table_end >> 10);