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>
9 #include "linuxbios_table.h"
11 #if CONFIG_SMP && CONFIG_MAX_PHYSICAL_CPUS && (CONFIG_MAX_PHYSICAL_CPUS < CONFIG_MAX_CPUS)
12 static void remove_logical_cpus(unsigned long *processor_map)
14 /* To turn off hyperthreading just remove the logical
15 * cpus from the processor map.
17 int disable_logical_cpus = !CONFIG_LOGICAL_CPUS;
18 if (get_option(&disable_logical_cpus,"hyper_threading")) {
19 disable_logical_cpus = !CONFIG_LOGICAL_CPUS;
21 if (disable_logical_cpus) {
22 /* disable logical cpus */
24 for(cnt=CONFIG_MAX_PHYSICAL_CPUS;cnt<CONFIG_MAX_CPUS;cnt++)
26 printk_debug("logical cpus disabled\n");
31 #define remove_logical_cpus(processor_map) do {} while(0)
33 #endif /* CONFIG_SMP && CONFIG_MAX_PHYSICAL_CPUS */
35 struct lb_memory *write_tables(struct mem_range *mem, unsigned long *processor_map)
37 unsigned long low_table_start, low_table_end;
38 unsigned long rom_table_start, rom_table_end;
40 rom_table_start = 0xf0000;
41 rom_table_end = 0xf0000;
42 /* Start low addr at 16 bytes instead of 0 because of a buglet
43 * in the generic linux unzip code, as it tests for the a20 line.
49 check_pirq_routing_table();
51 /* This table must be betweeen 0xf0000 & 0x100000 */
52 rom_table_end = copy_pirq_routing_table(rom_table_end);
53 rom_table_end = (rom_table_end + 1023) & ~1023;
55 /* copy the smp block to address 0 */
58 /* The smp table must be in 0-1K, 639K-640K, or 960K-1M */
59 remove_logical_cpus(processor_map);
60 low_table_end = write_smp_table(low_table_end, processor_map);
62 /* Write ACPI tables */
63 low_table_end = write_acpi_tables(low_table_end);
65 /* Don't write anything in the traditional x86 BIOS data segment */
66 if (low_table_end < 0x500) {
67 low_table_end = 0x500;
70 /* The linuxbios table must be in 0-4K or 960K-1M */
71 write_linuxbios_table(processor_map, mem,
72 low_table_start, low_table_end,
73 rom_table_start >> 10, rom_table_end >> 10);