Get mptable OEM/product ID from kconfig variables.
[coreboot.git] / src / mainboard / intel / truxton / mptable.c
index 6f0054d1e9a93599118bde4756d54f0a4144d43a..67a73338bf063683f13193a69cc04e19b6fc0e07 100644 (file)
@@ -15,7 +15,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- *
  */
 
 #include <console/console.h>
 
 static void *smp_write_config_table(void *v)
 {
-       static const char sig[4] = "PCMP";
-       static const char oem[8] = "COREBOOT";
-       static const char productid[12] = "Truxton     ";
        struct mp_config_table *mc;
-       u8 bus_num;
-       u8 bus_isa;
+       int bus_isa;
        u8 bus_pea0 = 0;
        u8 bus_pea1 = 0;
        u8 bus_aioc;
        device_t dev;
 
        mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
-       memset(mc, 0, sizeof(*mc));
-
-       memcpy(mc->mpc_signature, sig, sizeof(sig));
-       mc->mpc_length = sizeof(*mc); /* initially just the header */
-       mc->mpc_spec = 0x04;
-       mc->mpc_checksum = 0; /* not yet computed */
-       memcpy(mc->mpc_oem, oem, sizeof(oem));
-       memcpy(mc->mpc_productid, productid, sizeof(productid));
-       mc->mpc_oemptr = 0;
-       mc->mpc_oemsize = 0;
-       mc->mpc_entry_count = 0; /* No entries yet... */
-       mc->mpc_lapic = LAPIC_ADDR;
-       mc->mpe_length = 0;
-       mc->mpe_checksum = 0;
-       mc->reserved = 0;
 
-       smp_write_processors(mc);
+       mptable_init(mc, LAPIC_ADDR);
 
+       smp_write_processors(mc);
 
        /* AIOC bridge */
        dev = dev_find_slot(0, PCI_DEVFN(0x04,0));
        if (dev) {
                bus_aioc = pci_read_config8(dev, PCI_SECONDARY_BUS);
-               bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-               bus_isa++;
        }
        else {
                printk(BIOS_DEBUG, "ERROR - could not find PCI 0:04.0\n");
                bus_aioc = 0;
-               bus_isa = 9;
        }
        /* PCIe A0 */
        dev = dev_find_slot(0, PCI_DEVFN(0x02,0));
@@ -89,11 +67,7 @@ static void *smp_write_config_table(void *v)
                bus_pea1 = 0;
        }
 
-       /* define bus and isa numbers */
-       for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-               smp_write_bus(mc, bus_num, "PCI   ");
-       }
-       smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
        /* IOAPIC handling */
        smp_write_ioapic(mc, 0x8, 0x20, IO_APIC_ADDR);