#include <console/console.h>
-#include <device/device.h>
#include <device/path.h>
#include <device/pci_ids.h>
#include <cpu/cpu.h>
void *smp_write_floating_table(unsigned long addr)
{
- struct intel_mp_floating *mf;
- void *v;
-
/* 16 byte align the table address */
addr = (addr + 0xf) & (~0xf);
- v = (void *)addr;
-
- mf = v;
- mf->mpf_signature[0] = '_';
- mf->mpf_signature[1] = 'M';
- mf->mpf_signature[2] = 'P';
- mf->mpf_signature[3] = '_';
- mf->mpf_physptr = (unsigned long)(((char *)v) + SMP_FLOATING_TABLE_LEN);
- mf->mpf_length = 1;
- mf->mpf_specification = 4;
- mf->mpf_checksum = 0;
- mf->mpf_feature1 = 0;
- mf->mpf_feature2 = 0;
- mf->mpf_feature3 = 0;
- mf->mpf_feature4 = 0;
- mf->mpf_feature5 = 0;
- mf->mpf_checksum = smp_compute_checksum(mf, mf->mpf_length*16);
- return v;
+ return smp_write_floating_table_physaddr(addr, addr + SMP_FLOATING_TABLE_LEN);
}
void *smp_write_floating_table_physaddr(unsigned long addr, unsigned long mpf_physptr)
continue;
}
cpu_flag = MPC_CPU_ENABLED;
- if (boot_apic_id == cpu->path.u.apic.apic_id) {
+ if (boot_apic_id == cpu->path.apic.apic_id) {
cpu_flag = MPC_CPU_ENABLED | MPC_CPU_BOOTPROCESSOR;
}
smp_write_processor(mc,
- cpu->path.u.apic.apic_id, apic_version,
+ cpu->path.apic.apic_id, apic_version,
cpu_flag, cpu_features, cpu_feature_flags
);
}
}
void smp_write_bus(struct mp_config_table *mc,
- unsigned char id, char *bustype)
+ unsigned char id, const char *bustype)
{
struct mpc_config_bus *mpc;
mpc = smp_next_mpc_entry(mc);
mpc->mpc_dstapic = dstapic;
mpc->mpc_dstirq = dstirq;
smp_add_mpc_entry(mc, sizeof(*mpc));
-#if CONFIG_DEBUG_MPTABLE == 1
- printk_info("add intsrc srcbus 0x%x srcbusirq 0x%x, dstapic 0x%x, dstirq 0x%x\n",
+#ifdef DEBUG_MPTABLE
+ printk(BIOS_DEBUG, "add intsrc srcbus 0x%x srcbusirq 0x%x, dstapic 0x%x, dstirq 0x%x\n",
srcbus, srcbusirq, dstapic, dstirq);
hexdump(__func__, mpc, sizeof(*mpc));
#endif
if (child->path.type != DEVICE_PATH_PCI)
goto next;
- slot = (child->path.u.pci.devfn >> 3);
+ slot = (child->path.pci.devfn >> 3);
/* round pins */
for (i = 0; i < 4; i++)
dstirq_x[i] = dstirq[(i + slot) % 4];
if ((child->class >> 16) != PCI_BASE_CLASS_BRIDGE) {
/* pci device */
- printk_debug("route irq: %s\n", dev_path(child));
+ printk(BIOS_DEBUG, "route irq: %s\n", dev_path(child));
for (i = 0; i < 4; i++)
smp_write_intsrc(mc, irqtype, irqflag, srcbus, (slot<<2)|i, dstapic, dstirq_x[i]);
goto next;
case PCI_CLASS_BRIDGE_PCI:
case PCI_CLASS_BRIDGE_PCMCIA:
case PCI_CLASS_BRIDGE_CARDBUS:
- printk_debug("route irq bridge: %s\n", dev_path(child));
+ printk(BIOS_DEBUG, "route irq bridge: %s\n", dev_path(child));
smp_write_intsrc_pci_bridge(mc, irqtype, irqflag, child, dstapic, dstirq_x);
}