Factor out common mptable code to mptable_init().
authorUwe Hermann <uwe@hermann-uwe.de>
Mon, 25 Oct 2010 15:32:07 +0000 (15:32 +0000)
committerUwe Hermann <uwe@hermann-uwe.de>
Mon, 25 Oct 2010 15:32:07 +0000 (15:32 +0000)
 - Drop sig[], oem[], and productid[] fields in all mptable.c files, no
   longer needed. The sig[] is always the same ("PCMP"), the oem[] is
   currently also always the same ("COREBOOT"), and productid is being
   passed into mptable_init() directly as string now.

 - LAPIC_ADDR is passed in as parameter, too. While at the moment it's
   always the same value that is passed in, the LAPIC base address could
   also be relocated theoretically, so keep it as parameter for now.

 - Fix a few productid entries, they were (partially) incorrect:

   - DK8S2 (was "DK8X", copypaste)
   - 939A785GMH (was "MAHOGANY", copypaste)
   - X6DHE-G (was "X6DHE", incomplete board name)
   - H8DME-2 (was "H8DMR", copypaste)
   - H8QME-2+ (was "H8QME", incomplete board name)
   - X6DHE-G2 (was "X6DHE", incomplete board name)
   - X6DHR-iG2 (was "X6DHR-iG", incomplete board name)
   - GA-M57SLI-S4 (was "M57SLI", incomplete board name)
   - KINO-780AM2 (was "KINO", incomplete board name)
   - DL145 G1 (was "DL145G1", small fix as per vendor website)
   - DL145 G3 (was "TREX", wrong board name)
   - DL165 G6 (was "HP DL165 G6", drop vendor)
   - S2912 (was "S2895", copypaste)
   - VT8454c (was "VIA VT8454C", drop vendor, lower-case "c")
   - EPIA-N (was "P4DPE", copypaste)
   - pc2500e (was "PC2500", incorrect name)
   - S1850 (was "S2850", copy-paste)
   - MS-7135 (was "MS7135")
   - MS-9282 (was "MS9282")
   - MS-9185 (was "MS9185")
   - MS-9652 (was "K9ND MS-9652")
   - Ultra 40 (was "ultra40")
   - E326 (was "E325", copypaste)
   - M4A785-M (was "TILAPIA", copypaste)
   - P2B-D (was "ASUS P2B-D", drop vendor)
   - P2B-DS (was "ASUS P2B-DS", drop vendor)

 - Adapt the mptable utility to use mptable_init() too.

Abuild-tested.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5987 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

80 files changed:
src/arch/i386/boot/mpspec.c
src/arch/i386/include/arch/smp/mpspec.h
src/mainboard/amd/dbm690t/mptable.c
src/mainboard/amd/mahogany/mptable.c
src/mainboard/amd/mahogany_fam10/mptable.c
src/mainboard/amd/pistachio/mptable.c
src/mainboard/amd/serengeti_cheetah/mptable.c
src/mainboard/amd/serengeti_cheetah_fam10/mptable.c
src/mainboard/amd/tilapia_fam10/mptable.c
src/mainboard/arima/hdama/mptable.c
src/mainboard/asrock/939a785gmh/mptable.c
src/mainboard/asus/a8n_e/mptable.c
src/mainboard/asus/a8v-e_se/mptable.c
src/mainboard/asus/m4a785-m/mptable.c
src/mainboard/asus/p2b-d/mptable.c
src/mainboard/asus/p2b-ds/mptable.c
src/mainboard/broadcom/blast/mptable.c
src/mainboard/dell/s1850/mptable.c
src/mainboard/getac/p470/mptable.c
src/mainboard/gigabyte/ga_2761gxdk/mptable.c
src/mainboard/gigabyte/m57sli/mptable.c
src/mainboard/gigabyte/ma785gmt/mptable.c
src/mainboard/gigabyte/ma78gm/mptable.c
src/mainboard/hp/dl145_g1/mptable.c
src/mainboard/hp/dl145_g3/mptable.c
src/mainboard/hp/dl165_g6_fam10/mptable.c
src/mainboard/ibase/mb899/mptable.c
src/mainboard/ibm/e325/mptable.c
src/mainboard/ibm/e326/mptable.c
src/mainboard/iei/kino-780am2-fam10/mptable.c
src/mainboard/intel/d945gclf/mptable.c
src/mainboard/intel/eagleheights/mptable.c
src/mainboard/intel/jarrell/mptable.c
src/mainboard/intel/mtarvon/mptable.c
src/mainboard/intel/truxton/mptable.c
src/mainboard/intel/xe7501devkit/mptable.c
src/mainboard/iwill/dk8_htx/mptable.c
src/mainboard/iwill/dk8s2/mptable.c
src/mainboard/iwill/dk8x/mptable.c
src/mainboard/jetway/pa78vm5/mptable.c
src/mainboard/kontron/986lcd-m/mptable.c
src/mainboard/kontron/kt690/mptable.c
src/mainboard/msi/ms7135/mptable.c
src/mainboard/msi/ms7260/mptable.c
src/mainboard/msi/ms9185/mptable.c
src/mainboard/msi/ms9282/mptable.c
src/mainboard/msi/ms9652_fam10/mptable.c
src/mainboard/newisys/khepri/mptable.c
src/mainboard/nvidia/l1_2pvv/mptable.c
src/mainboard/roda/rk886ex/mptable.c
src/mainboard/sunw/ultra40/mptable.c
src/mainboard/supermicro/h8dme/mptable.c
src/mainboard/supermicro/h8dmr/mptable.c
src/mainboard/supermicro/h8dmr_fam10/mptable.c
src/mainboard/supermicro/h8qme_fam10/mptable.c
src/mainboard/supermicro/x6dai_g/mptable.c
src/mainboard/supermicro/x6dhe_g/mptable.c
src/mainboard/supermicro/x6dhe_g2/mptable.c
src/mainboard/supermicro/x6dhr_ig/mptable.c
src/mainboard/supermicro/x6dhr_ig2/mptable.c
src/mainboard/technexion/tim5690/mptable.c
src/mainboard/technexion/tim8690/mptable.c
src/mainboard/tyan/s2735/mptable.c
src/mainboard/tyan/s2850/mptable.c
src/mainboard/tyan/s2875/mptable.c
src/mainboard/tyan/s2880/mptable.c
src/mainboard/tyan/s2881/mptable.c
src/mainboard/tyan/s2882/mptable.c
src/mainboard/tyan/s2885/mptable.c
src/mainboard/tyan/s2891/mptable.c
src/mainboard/tyan/s2892/mptable.c
src/mainboard/tyan/s2895/mptable.c
src/mainboard/tyan/s2912/mptable.c
src/mainboard/tyan/s2912_fam10/mptable.c
src/mainboard/tyan/s4880/mptable.c
src/mainboard/tyan/s4882/mptable.c
src/mainboard/via/epia-n/mptable.c
src/mainboard/via/pc2500e/mptable.c
src/mainboard/via/vt8454c/mptable.c
util/mptable/mptable.c

index 031f326b640bf28062fd72b8765d34930119ec9c..c6946c2a98f1dba43e2c0bb4654a1ad84fb38ed3 100644 (file)
@@ -7,6 +7,30 @@
 #include <arch/cpu.h>
 #include <cpu/x86/lapic.h>
 
+/* Initialize the specified "mc" struct with initial values. */
+void mptable_init(struct mp_config_table *mc, const char *productid,
+                 u32 lapic_addr)
+{
+       /* Error out if 'product_id' length doesn't match exactly. */
+       if (strlen(productid) != 12)
+               die("ERROR: 'productid' must be 12 bytes long!");
+
+       memset(mc, 0, sizeof(*mc));
+       memcpy(mc->mpc_signature, MPC_SIGNATURE, 4);
+       mc->mpc_length = sizeof(*mc);   /* Initially just the header size. */
+       mc->mpc_spec = 0x04;            /* MultiProcessor specification 1.4 */
+       mc->mpc_checksum = 0;           /* Not yet computed. */
+       memcpy(mc->mpc_oem, "COREBOOT", 8);
+       memcpy(mc->mpc_productid, productid, 12);
+       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;
+}
+
 unsigned char smp_compute_checksum(void *v, int len)
 {
        unsigned char *bytes;
index 9b4a6281b7373a76c34397325d86ee84f23233e4..5dc164748ea48873cf95eb86959a5697476102f0 100644 (file)
@@ -232,6 +232,9 @@ struct mp_exten_compatibility_address_space {
 /* Default local apic addr */
 #define LAPIC_ADDR 0xFEE00000
 
+void mptable_init(struct mp_config_table *mc, const char *productid,
+                 u32 lapic_addr);
+
 void *smp_next_mpc_entry(struct mp_config_table *mc);
 void *smp_next_mpe_entry(struct mp_config_table *mc);
 
index daf7f0c9b56f707cf50758612d00d42349a288dc..d9a2e72cc890c70c71e35136d3cb4bd5aa056d95 100644 (file)
@@ -23,7 +23,6 @@
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern u8 bus_isa;
@@ -36,32 +35,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs690;
 extern u32 sbdn_sb600;
 
-
-
 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] = "DBM690T     ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "DBM690T     ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index fee3080ec6849db5ab290c226f35082fc642c4be..5d39dc49067139af2d47b3515b27c8b3b06b8e21 100644 (file)
@@ -24,7 +24,6 @@
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern u8 bus_isa;
@@ -37,32 +36,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs780;
 extern u32 sbdn_sb700;
 
-
-
 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] = "MAHOGANY    ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "MAHOGANY    ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 62e08f012eb90b7621816198ee431e9624960e6e..a0b47c5aa8b9e4996c6675cece34abb7ff973cdf 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
 #include <device/pci.h>
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdfam10_sysconf.h>
 
 extern u8 bus_isa;
@@ -37,32 +35,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs780;
 extern u32 sbdn_sb700;
 
-
-
 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] = "MAHOGANY    ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "MAHOGANY    ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 6b757c18b4a6380b9375d2ea64417c1228758889..f0075697657c00c7414b243d3a25ac59aa158730 100644 (file)
@@ -23,7 +23,6 @@
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern u8 bus_isa;
@@ -36,32 +35,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs690;
 extern u32 sbdn_sb600;
 
-
-
 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] = "PISTACHIO   ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "PISTACHIO   ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 855d2678a105fc3afa64ffe5216ac84365de962c..4f440ba1daec65d006bb7662c16f79c879009dfc 100644 (file)
@@ -7,39 +7,19 @@
 #if CONFIG_LOGICAL_CPUS==1
 #include <cpu/amd/multicore.h>
 #endif
-
 #include <cpu/amd/amdk8_sysconf.h>
 #include "mb_sysconf.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] = "SERENGETI   ";
         struct mp_config_table *mc;
-
         unsigned char bus_num;
        int i, j;
        struct mb_sysconf_t *m;
 
         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;
+
+       mptable_init(mc, "SERENGETI   ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 93c6bccd8c0560cfb161b2e612684dd472a8d7db..3121e76efa32d00311d93ce9d61ebaa95299a01e 100644 (file)
 #if CONFIG_LOGICAL_CPUS==1
 #include <cpu/amd/multicore.h>
 #endif
-
 #include <cpu/amd/amdfam10_sysconf.h>
 #include "mb_sysconf.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] = "SERENGETI    ";
+       int i, j;
        struct mp_config_table *mc;
-
-       int i;
-       int j;
        struct mb_sysconf_t *m;
 
        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;
+
+       mptable_init(mc, "SERENGETI   ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 9232973746b473f976db3a5467cdf3c23847a946..708816bd6a4823b5c26b7b207b485a00fa791af6 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
 #include <device/pci.h>
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdfam10_sysconf.h>
 
 extern u8 bus_isa;
@@ -37,32 +35,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs780;
 extern u32 sbdn_sb700;
 
-
-
 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] = "TILAPIA     ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "TILAPIA     ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 55c4440a691212100bfb56a1adac576b7eb12f33..f51abccac29d403988b5c04e488735ac9c81414a 100644 (file)
@@ -110,9 +110,6 @@ static unsigned max_apicid(void)
 
 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] = "HDAMA       ";
        struct mp_config_table *mc;
        unsigned char bus_num;
        unsigned char bus_isa;
@@ -126,21 +123,8 @@ static void *smp_write_config_table(void *v)
        unsigned apicid_8131_2;
 
        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;
+
+       mptable_init(mc, "HDAMA       ", LAPIC_ADDR);
 
        smp_write_processors_inorder(mc);
 
index b45f8e4219023ef94fc965207abd289fde98096b..1e4a8850dda1e7487332eff059e79ab1336ea623 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
 #include <device/pci.h>
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern u8 bus_isa;
@@ -37,32 +35,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs780;
 extern u32 sbdn_sb700;
 
-
-
 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] = "MAHOGANY    ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "939A785GMH  ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 7916d10982b0f9416bbb3c0b7faf8e269b6621da..5d80474c0813f83db4992929b80d7e7a542c7d55 100644 (file)
@@ -33,32 +33,15 @@ extern unsigned char bus_ck804[6];
 extern unsigned apicid_ck804;
 extern unsigned bus_type[256];
 
-
 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] = "A8N-E      ";
        struct mp_config_table *mc;
        unsigned sbdn;
        int bus_num;
 
        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;
+
+       mptable_init(mc, "A8N-E       ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 4260713ae57909c48ba0a0a373dee22cc894b676..e779799b19a2ccb8bc9d91cf98cd3c6379e9e859 100644 (file)
 
 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] = "A8V-E SE    ";
        struct mp_config_table *mc;
        int bus_isa = 42;
 
        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, "A8V-E SE    ", LAPIC_ADDR);
 
+       smp_write_processors(mc);
 
        /* Bus:         Bus ID  Type */
        smp_write_bus(mc, 0, "PCI   ");
index 9232973746b473f976db3a5467cdf3c23847a946..cb0954a46d0c80398bba8a02c672a5b79593fd66 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
 #include <device/pci.h>
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdfam10_sysconf.h>
 
 extern u8 bus_isa;
@@ -37,32 +35,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs780;
 extern u32 sbdn_sb700;
 
-
-
 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] = "TILAPIA     ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "M4A785-M    ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 6d3e4cc757a4be3bdcad87ec44f592dcdc5efb8d..49107c2216a364ea0a1720543a8f9fb082e4ecb7 100644 (file)
 
 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] = "ASUS P2B-D  ";
        struct mp_config_table *mc;
 
        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;
+       mptable_init(mc, "P2B-D       ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 4650c5912612533e2199b1d8935ea8000b8f6346..0fc6a138b0a963b0f5fbbdf0928a4dc4c6416e8e 100644 (file)
 
 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] = "ASUS P2B-DS ";
        struct mp_config_table *mc;
 
        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;
+       mptable_init(mc, "P2B-DS      ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 4dab1c53f75b09e7c6a86d94ddec7067d37a0ab5..97bce49ba619c9bd1ed40f969858a8264788e7bb 100644 (file)
@@ -7,7 +7,6 @@
 #if CONFIG_LOGICAL_CPUS==1
 #include <cpu/amd/multicore.h>
 #endif
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern  unsigned char bus_isa;
@@ -19,34 +18,15 @@ extern  unsigned apicid_bcm5785[3];
 
 extern  unsigned sbdn2;
 
-
-
 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] = "BLAST       ";
         struct mp_config_table *mc;
-
         unsigned char bus_num;
        int i;
 
         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;
+
+       mptable_init(mc, "BLAST       ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 48d2a2111c7521417e06f3491d38b07f5d3a4ed7..46f21c68cb59c43812d030754b66c08e9bb4987b 100644 (file)
@@ -7,9 +7,6 @@
 
 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] = "S2850       ";
        struct mp_config_table *mc;
        unsigned char bus_num;
        unsigned char bus_isa;
@@ -20,21 +17,8 @@ static void *smp_write_config_table(void *v)
        unsigned char bus_ich5r_1;
 
        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;
+
+       mptable_init(mc, "S1850       ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 014965b823083e9ba78f59c3dbde2fb47ef3f2f3..8bbe2f3016318b01f589a7f5a8b21001be5d4e36 100644 (file)
 
 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] = "P470        ";
         struct mp_config_table *mc;
        int i;
        int max_pci_bus, isa_bus;
 
         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;
+
+       mptable_init(mc, "P470        ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index fa5ae633d0cfeaaf5247d56a90855bcdc238ef2e..e87702753be6eea48e7e29d77e9259a353ed8c68 100644 (file)
@@ -26,8 +26,8 @@
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
+
 extern unsigned char bus_isa;
 extern unsigned char bus_sis966[8]; //1
 
@@ -37,30 +37,13 @@ extern unsigned bus_type[256];
 
 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] = "GA-2761GXDK ";
         struct mp_config_table *mc;
        unsigned sbdn;
-
        int i,j;
 
         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;
+
+       mptable_init(mc, "GA-2761GXDK ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 3223c042a1d7749356396af4838984426aaa2f27..212d65850b32c4a10e39ff05746658d198775da7 100644 (file)
@@ -25,8 +25,8 @@
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
+
 extern unsigned char bus_isa;
 extern unsigned char bus_mcp55[8]; //1
 
@@ -34,34 +34,15 @@ extern unsigned apicid_mcp55;
 
 extern unsigned bus_type[256];
 
-
-
 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] = "M57SLI      ";
         struct mp_config_table *mc;
        unsigned sbdn;
-
        int i,j,k;
 
         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;
+
+       mptable_init(mc, "GA-M57SLI-S4", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 1b95945f6fce35d290b64ed14d4d38aa86c73d4c..08dbb8f10e9798543b9f8baac66879eecada6ea5 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
 #include <device/pci.h>
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdfam10_sysconf.h>
 
 extern u8 bus_isa;
@@ -37,32 +35,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs780;
 extern u32 sbdn_sb700;
 
-
-
 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] = "MA785GMT    ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "MA785GMT    ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index f2cfd5498b52fbc270f345557fadfa27a08450f4..45acf601f38b25deb5fe8f0c8e169de25905296c 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
 #include <device/pci.h>
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdfam10_sysconf.h>
 
 extern u8 bus_isa;
@@ -37,32 +35,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs780;
 extern u32 sbdn_sb700;
 
-
-
 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] = "MA78GM-US2H ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "MA78GM-US2H ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 72c7c6245127efb8a8533a611297cb82b3472092..4e04211c453015d6dcfca39411ffd53a5edde600 100644 (file)
@@ -4,7 +4,6 @@
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern  unsigned char bus_isa;
@@ -19,39 +18,19 @@ extern  unsigned apicid_8131_2;
 
 extern  unsigned sbdn3;
 
-
-
 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] = "DL145G1     ";
         struct mp_config_table *mc;
-
         unsigned char bus_num;
 
         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;
+
+       mptable_init(mc, "DL145 G1    ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
        get_bus_conf();
 
-
 /*Bus:          Bus ID  Type*/
         /* define bus and isa numbers */
         for(bus_num = 0; bus_num < bus_isa; bus_num++) {
index a56822bb8c43796e6a9282e73d865f54545716a9..1ce37bd0c6606edc3ec6ad42f57056b43408900b 100644 (file)
 #if CONFIG_LOGICAL_CPUS==1
 #include <cpu/amd/multicore.h>
 #endif
-
 #include <cpu/amd/amdk8_sysconf.h>
-
 #include "mb_sysconf.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] = "TREX        ";
        struct mp_config_table *mc;
-
        struct mb_sysconf_t *m;
 
        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;
+
+       mptable_init(mc, "TREX        ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index f1e5f4087467eab777a235ed277da85d8da8bb17..8b07e36c8931f9465380081cc5a632b50d0445da 100644 (file)
 #if CONFIG_LOGICAL_CPUS==1
 #include <cpu/amd/multicore.h>
 #endif
-
 #include <cpu/amd/amdfam10_sysconf.h>
-
 #include "mb_sysconf.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] = "HP DL165 G6 ";
        struct mp_config_table *mc;
        int isa_bus;
 
        struct mb_sysconf_t *m;
 
        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;
+
+       mptable_init(mc, "DL165 G6    ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 4c6e9e4e1abf8eb49290065b71af1e41378ac600..056876149e115cb5cc69f0b64710acfda81536a0 100644 (file)
@@ -27,9 +27,6 @@
 
 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] = "MB899       ";
         struct mp_config_table *mc;
        struct device *riser = NULL, *firewire = NULL;
        int i;
@@ -37,21 +34,8 @@ static void *smp_write_config_table(void *v)
        int ioapic_id;
 
         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;
+
+       mptable_init(mc, "MB899       ", LAPIC_ADDR);
 
         smp_write_processors(mc);
        max_pci_bus=0;
index 7a6de7e3daac4b636d5e297e1b36f917ecb2161d..3c1312e399e38d6dca11dc27c247319f543818f5 100644 (file)
@@ -7,9 +7,6 @@
 
 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] = "E325        ";
        struct mp_config_table *mc;
 
        unsigned char bus_num;
@@ -20,21 +17,8 @@ static void *smp_write_config_table(void *v)
        unsigned char bus_8131_2;
 
        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;
+
+       mptable_init(mc, "E325        ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 1452c9900e8aea2c4b7d95b2a50045df4e9c41fc..0656be2a5bf6d1bde7c40e3bacefebf8bf25c015 100644 (file)
@@ -7,9 +7,6 @@
 
 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] = "E325        ";
        struct mp_config_table *mc;
 
        unsigned char bus_num;
@@ -20,21 +17,8 @@ static void *smp_write_config_table(void *v)
        unsigned char bus_8131_2;
 
        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;
+
+       mptable_init(mc, "E326        ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 0589027ec6e0f9937fdc5c7938673217b9b32587..b4dbf95d6029211f9ac3dca13c8375a8f60f4854 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
 #include <device/pci.h>
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdfam10_sysconf.h>
 
 extern u8 bus_isa;
@@ -37,32 +35,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs780;
 extern u32 sbdn_sb700;
 
-
-
 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] = "KINO        ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "KINO-780AM2 ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 5930d2f43040d0f3c9f3b18d5f0986b2eb4ba9bf..2f33d4cf00780f4d2737c0b5662eb5f68e26a586 100644 (file)
 
 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] = "D945GCLF    ";
         struct mp_config_table *mc;
        int i;
        int max_pci_bus, isa_bus;
 
         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;
+
+       mptable_init(mc, "D945GCLF    ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 33d7b014807813840a7dc05ff4a6d6aa8d0b9607..6562a5a582bafb3b663002c42adc69d39273c5fc 100644 (file)
@@ -20,7 +20,6 @@
  * MA 02110-1301 USA
  */
 
-
 #include <console/console.h>
 #include <arch/io.h>
 #include <arch/ioapic.h>
@@ -61,9 +60,6 @@
 
 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] = "EagleHeights";
         struct mp_config_table *mc;
        unsigned char bus_num, bus_chipset, bus_isa, bus_pci;
        unsigned char bus_pcie_a, bus_pcie_a1, bus_pcie_b;
@@ -81,21 +77,8 @@ static void *smp_write_config_table(void *v)
        rcba = res->base;
 
         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;
+
+       mptable_init(mc, "EagleHeights", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 7a2a5943ff7a63602b159395b24411eaa0f05e55..38528299dc1254561cb00d786a58fb26719edf4d 100644 (file)
@@ -7,9 +7,6 @@
 
 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] = "SE7520JR20  ";
        struct mp_config_table *mc;
        unsigned char bus_num;
        unsigned char bus_isa;
@@ -22,21 +19,8 @@ static void *smp_write_config_table(void *v)
        unsigned int bus_pxhd_id;
 
        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;
+
+       mptable_init(mc, "SE7520JR20  ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 2f3cd2793fc228e855c0d4a06c387c763cf66fe4..9dccf13e0f175c29ef54e411de33cdb276b67cba 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
- *
  */
 
 /* This code is based on src/mainboard/intel/jarrell/mptable.c */
 
 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] = "Mt. Arvon   ";
        struct mp_config_table *mc;
        u8 bus_isa = 7;
        u8 bus_pci = 6;
        u8 bus_pcie_a = 1;
 
        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;
+
+       mptable_init(mc, "Mt. Arvon   ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 6f0054d1e9a93599118bde4756d54f0a4144d43a..e691f836eefbcda1f07b0f9821d82c80f53e479e 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>
@@ -27,9 +26,6 @@
 
 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;
@@ -39,24 +35,10 @@ static void *smp_write_config_table(void *v)
        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, "Truxton     ", LAPIC_ADDR);
 
+       smp_write_processors(mc);
 
        /* AIOC bridge */
        dev = dev_find_slot(0, PCI_DEVFN(0x04,0));
index d39e754700781e862f057b8d7594458ef7e266d0..952fb6d978c15ca186fb8cc6b00c9163ce868ab3 100644 (file)
@@ -15,7 +15,6 @@
 #define INT_D  3
 #define PCI_IRQ(dev, intLine)  (((dev)<<2) | intLine)
 
-
 static void xe7501devkit_register_buses(struct mp_config_table *mc)
 {
        // Bus ID, Bus Type
@@ -132,19 +131,11 @@ static void xe7501devkit_register_interrupts(struct mp_config_table *mc)
 
 static void *smp_write_config_table(void* v)
 {
-       static const char sig[4] = MPC_SIGNATURE;
-       static const char oem[8] = "COREBOOT";
-       static const char productid[12] = "XE7501DEVKIT";
-       struct mp_config_table *mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
-       memset(mc, 0, sizeof(*mc));
-
-       memcpy(mc->mpc_signature, sig, sizeof(sig));
-       memcpy(mc->mpc_oem, oem, sizeof(oem));
-       memcpy(mc->mpc_productid, productid, sizeof(productid));
-
-       mc->mpc_length = sizeof(*mc);   // initially just the header
-       mc->mpc_spec = 0x04;            // Multiprocessing Spec V1.4
-       mc->mpc_lapic = LAPIC_ADDR;
+       struct mp_config_table *mc;
+
+       mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
+
+       mptable_init(mc, "XE7501DEVKIT", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 8bfaec8b70b9b958e42ef37de27b4682b1e1b1dc..0fab2ba9f1d3c7f95a6a94fce858d8db79582660 100644 (file)
@@ -7,39 +7,19 @@
 #if CONFIG_LOGICAL_CPUS==1
 #include <cpu/amd/multicore.h>
 #endif
-
 #include <cpu/amd/amdk8_sysconf.h>
 #include "mb_sysconf.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] = "DK8-HTX     ";
         struct mp_config_table *mc;
-
         unsigned char bus_num;
        int i, j;
        struct mb_sysconf_t *m;
 
         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;
+
+       mptable_init(mc, "DK8-HTX     ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 4938d766c6690c568bf1412238e5aeb346afeda6..382bf908f0c1e6137fe66c58c8ecef81797daa0c 100644 (file)
@@ -7,9 +7,6 @@
 
 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] = "DK8X        ";
        struct mp_config_table *mc;
        unsigned char bus_num;
        unsigned char bus_isa;
@@ -18,21 +15,8 @@ static void *smp_write_config_table(void *v)
        unsigned char bus_8111_1;
 
        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;
+
+       mptable_init(mc, "DK8S2       ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 4938d766c6690c568bf1412238e5aeb346afeda6..6c9b67294e0697a4447c1c199cd91c1213a38e01 100644 (file)
@@ -7,9 +7,6 @@
 
 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] = "DK8X        ";
        struct mp_config_table *mc;
        unsigned char bus_num;
        unsigned char bus_isa;
@@ -18,21 +15,8 @@ static void *smp_write_config_table(void *v)
        unsigned char bus_8111_1;
 
        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;
+
+       mptable_init(mc, "DK8X        ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index b74183a9362e6538395f070c93a6c78af34d8203..879dc24b07023dbe4bea545e9c52ba71d8679dca 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
 #include <device/pci.h>
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdfam10_sysconf.h>
 
 extern u8 bus_isa;
@@ -38,32 +36,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs780;
 extern u32 sbdn_sb700;
 
-
-
 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] = "PA78VM5     ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "PA78VM5     ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 2b1a90e647fe14f2076eea71ce1310c425214a74..acc72eeb6d9d6f233f568f202d103af12e646aca 100644 (file)
 
 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] = "986LCD-M    ";
         struct mp_config_table *mc;
        struct device *riser = NULL, *firewire = NULL;
        int firewire_bus = 0, riser_bus = 0, isa_bus;
        int ioapic_id;
 
         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;
+
+       mptable_init(mc, "986LCD-M    ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index f127567a26e9cb7afcd2df0a049f3c5fa2268cf0..b1b428bc1e325503e2178b6e62eba216da6d1ed4 100644 (file)
@@ -23,7 +23,6 @@
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern u8 bus_isa;
@@ -36,32 +35,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs690;
 extern u32 sbdn_sb600;
 
-
-
 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] = "KT690       ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "KT690       ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 9c87351a6e9d21db677cafca8525b1a27be5a736..74e811340e02a2205c7478c29fdd3e2f8250d66a 100644 (file)
@@ -27,7 +27,6 @@
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern unsigned char bus_ck804[6];
@@ -35,9 +34,6 @@ extern unsigned apicid_ck804;
 
 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] = "MS7135      ";
        struct mp_config_table *mc;
        int bus_isa;
        unsigned sbdn;
@@ -46,21 +42,8 @@ static void *smp_write_config_table(void *v)
        sbdn = sysconf.sbdn;
 
        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;
+
+       mptable_init(mc, "MS-7135     ", LAPIC_ADDR);
 
        smp_write_processors(mc);
        mptable_write_buses(mc, NULL, &bus_isa);
index c8fb0a6fa425a61c753fc86de7cb993e4b77f9c3..368eb69afe3fedd6afc4b665b2e65fdf8f5753bd 100644 (file)
@@ -31,33 +31,15 @@ extern unsigned char bus_mcp55[8];  // 1
 extern unsigned apicid_mcp55;
 extern unsigned bus_type[256];
 
-
-
 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] = "MS-7260     ";
        struct mp_config_table *mc;
        unsigned int sbdn;
        int i, j;
 
        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;
+
+       mptable_init(mc, "MS-7260     ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 49538d45de2b0b8c435f80d292bb4591c41c7ec5..ff4636b46559ce9c85d4021c6fec92b436d21799 100644 (file)
 #if CONFIG_LOGICAL_CPUS==1
 #include <cpu/amd/multicore.h>
 #endif
-
 #include <cpu/amd/amdk8_sysconf.h>
-
 #include "mb_sysconf.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] = "MS9185      ";
         struct mp_config_table *mc;
 
         unsigned char bus_num;
@@ -52,21 +45,8 @@ static void *smp_write_config_table(void *v)
        struct mb_sysconf_t *m;
 
         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;
+
+       mptable_init(mc, "MS-9185     ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index f11ff9d4c9493730c3638a1411cc79f8e5bb32dd..efd4cbd95cfde467abce7d70b4397f54d56e9d4b 100644 (file)
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
-
 #include "mb_sysconf.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] = "MS9282      ";
         struct mp_config_table *mc;
        struct mb_sysconf_t *m;
        unsigned sbdn;
@@ -46,21 +39,8 @@ static void *smp_write_config_table(void *v)
        int i,j;
 
         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;
+
+       mptable_init(mc, "MS-9282     ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 2aafccb1b5b81d073cce0944ac872fbd163efe4e..24846c244f3ef51975a166d851a430ce7140dfc4 100644 (file)
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdfam10_sysconf.h>
-
 #include "mb_sysconf.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] = "K9ND MS-9652";
        struct mp_config_table *mc;
        struct mb_sysconf_t *m;
        unsigned sbdn;
@@ -43,21 +36,8 @@ static void *smp_write_config_table(void *v)
        int i,j;
 
        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;
+
+       mptable_init(mc, "K9ND MS-9652", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 8f388d2ec95980afd9987685b60e4fd28561127d..2aa8fe5264ba82b71df7ae3e8291dc317d0a48c4 100644 (file)
@@ -7,9 +7,6 @@
 
 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] = "KHEPRI      ";
        struct mp_config_table *mc;
        unsigned char bus_num;
        unsigned char bus_isa;
@@ -18,21 +15,8 @@ static void *smp_write_config_table(void *v)
        unsigned char bus_8111_1;
 
        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;
+
+       mptable_init(mc, "KHEPRI      ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 6ba39a5884ac7650682d39132d1154ed82203193..42389f334ba0851964a5b9fcb5489be6addeb3d2 100644 (file)
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
-
 #include "mb_sysconf.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] = "L1_2PVV     ";
        struct mp_config_table *mc;
        struct mb_sysconf_t *m;
        unsigned sbdn;
-
        int i,j;
        unsigned char apicpin[4];
 
        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;
+
+       mptable_init(mc, "L1_2PVV     ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index bdf38fb5b0c4ee527aedc115e4de079ecbfd7bd9..d6deb5038088ee1ceea894d3f0a2dee3a168b69b 100644 (file)
 
 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] = "RK886EX     ";
         struct mp_config_table *mc;
        int i;
        int max_pci_bus, isa_bus;
 
         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;
+
+       mptable_init(mc, "RK886EX     ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 7df0eec16da6e6e3194aee614fd7aabcf5750815..fe7ca9148b3c6c9796c8fddd07f52c7543f9d440 100644 (file)
@@ -35,30 +35,13 @@ extern  unsigned sbdnb;
 
 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] = "ultra40     ";
         struct mp_config_table *mc;
-
         unsigned char bus_num;
        int i;
 
         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;
+
+       mptable_init(mc, "Ultra40     ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 68ff4ed353c1f3f19c061914fce22c82bf8ad1f1..838559b9e551846598fca4b5ef945414b3459725 100644 (file)
@@ -24,8 +24,8 @@
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
+
 extern unsigned char bus_isa;
 extern unsigned char bus_mcp55[8]; //1
 
@@ -33,35 +33,16 @@ extern unsigned apicid_mcp55;
 
 extern unsigned char bus_pcix[3]; // under bus_mcp55_2
 
-
-
 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] = "H8DMR       ";
         struct mp_config_table *mc;
        unsigned sbdn;
-
         unsigned char bus_num;
        int i,j;
 
         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;
+
+       mptable_init(mc, "H8DME-2     ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index e85cdfef153f5e5a0df2bb8ee789c9afce1f0def..feca4bff30278df85522c3c9c1ea6dc8ae8e77b5 100644 (file)
@@ -24,8 +24,8 @@
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
+
 extern unsigned char bus_isa;
 extern unsigned char bus_mcp55[8]; //1
 
@@ -33,35 +33,16 @@ extern unsigned apicid_mcp55;
 
 extern unsigned char bus_pcix[3]; // under bus_mcp55_2
 
-
-
 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] = "H8DMR       ";
         struct mp_config_table *mc;
        unsigned sbdn;
-
         unsigned char bus_num;
        int i,j;
 
         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;
+
+       mptable_init(mc, "H8DMR       ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 61a5e8156d819cf8b010553a4918adbde90d81e1..6b4f020ed0cf64cfecdd394bead7cd51b4314c1d 100644 (file)
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdfam10_sysconf.h>
-
 #include "mb_sysconf.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] = "H8DMR       ";
        struct mp_config_table *mc;
        struct mb_sysconf_t *m;
        unsigned sbdn;
-
        int i,j;
 
        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;
+
+       mptable_init(mc, "H8DMR       ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 7e1595b1ca2232ca94cf5b24de27315bf8d4dbb9..c82e4657960fbeb14df1061c399a91ff7e2bf4ef 100644 (file)
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdfam10_sysconf.h>
-
 #include "mb_sysconf.h"
 
-
 extern unsigned sbdn3;
 
 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] = "H8QME       ";
        struct mp_config_table *mc;
        struct mb_sysconf_t *m;
        unsigned sbdn;
-
        int i,j;
 
        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;
+
+       mptable_init(mc, "H8QME-2+    ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index d13c308597702d06be74509902030c88e019a65c..04598b9f2acb9d1f5cb3da83a62f576a046789ea 100644 (file)
@@ -7,30 +7,14 @@
 
 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] = "X6DAI-G     ";
        struct mp_config_table *mc;
        unsigned char bus_num;
        unsigned char bus_isa;
        unsigned char bus_6300;
 
        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;
+
+       mptable_init(mc, "X6DAI-G     ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index ba712d3fed0e9892ec5fccac19b8c13a237192b1..1f647aecb99491213d497bf92001ecd7a626fc4d 100644 (file)
@@ -7,9 +7,6 @@
 
 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] = "X6DHE       ";
        struct mp_config_table *mc;
        unsigned char bus_num;
        unsigned char bus_isa;
@@ -19,21 +16,8 @@ static void *smp_write_config_table(void *v)
        unsigned char bus_esb6300_2;
 
        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;
+
+       mptable_init(mc, "X6DHE-G     ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 50b6299b4fa7f201f80b9edd9feaf085d70fbbf1..4d073ef7a5d0681086e5613852696c83610c8ddb 100644 (file)
@@ -7,9 +7,6 @@
 
 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] = "X6DHE       ";
        struct mp_config_table *mc;
        unsigned char bus_num;
        unsigned char bus_isa;
@@ -19,21 +16,8 @@ static void *smp_write_config_table(void *v)
        unsigned char bus_esb6300_2;
 
        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;
+
+       mptable_init(mc, "X6DHE-G2    ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index c16017bf931fe25a5c35dd0a0c242f2d252aecca..fdf1689fe8d790a4e7bf413f73b439e6bb3a6e62 100644 (file)
@@ -7,9 +7,6 @@
 
 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] = "X6DHR-iG    ";
        struct mp_config_table *mc;
        unsigned char bus_num;
        unsigned char bus_isa;
@@ -20,21 +17,8 @@ static void *smp_write_config_table(void *v)
        unsigned char bus_ich5r_1;
 
        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;
+
+       mptable_init(mc, "X6DHR-iG    ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 146b40a1b2a8173b56c41d3b9c9e97087ee4af83..283b23e6e7d4b8bfcd61850f37e5dba7b81649de 100644 (file)
@@ -7,9 +7,6 @@
 
 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] = "X6DHR-iG    ";
        struct mp_config_table *mc;
        unsigned char bus_num;
        unsigned char bus_isa;
@@ -20,21 +17,8 @@ static void *smp_write_config_table(void *v)
        unsigned char bus_ich5r_1;
 
        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;
+
+       mptable_init(mc, "X6DHR-iG2   ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 0db321dca98485fce4744aa6293d029f4cbf7b15..6435e7ec94246c8c314eadf1e376efbe3fb34313 100644 (file)
@@ -23,7 +23,6 @@
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern u8 bus_isa;
@@ -36,32 +35,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs690;
 extern u32 sbdn_sb600;
 
-
-
 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] = "TIM5690     ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "TIM5690     ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index db640f9d091af41c9d55b5000d4d63bc802aa24e..b615d5c66af154e04adf62ecbfe571d378fece8f 100644 (file)
@@ -23,7 +23,6 @@
 #include <arch/io.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern u8 bus_isa;
@@ -36,32 +35,14 @@ extern u32 bus_type[256];
 extern u32 sbdn_rs690;
 extern u32 sbdn_sb600;
 
-
-
 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] = "TIM8690     ";
        struct mp_config_table *mc;
        int j;
 
        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;
+
+       mptable_init(mc, "TIM8690     ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 5e4afaee010e3f62e47ecade27f662c6a8007697..3e47388f0bc4ecb3ececcbb67e3e9c1b4333bb70 100644 (file)
@@ -7,28 +7,12 @@
 
 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] = "S2735       ";
         struct mp_config_table *mc;
         int isa_bus;
 
         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;
+       mptable_init(mc, "S2735       ", LAPIC_ADDR);
 
         smp_write_processors(mc);
        mptable_write_buses(mc, NULL, &isa_bus);
index d452dd9c3ad3717fbbd1594a4f40755aefbab2f2..bc61e8e4d6ca63010812bded71a0d7da457e780c 100644 (file)
@@ -8,7 +8,6 @@
 #include <cpu/amd/multicore.h>
 #endif
 
-
 static unsigned node_link_to_bus(unsigned node, unsigned link)
 {
         device_t dev;
@@ -43,14 +42,9 @@ static unsigned node_link_to_bus(unsigned node, unsigned link)
         return 0;
 }
 
-
 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] = "S2850       ";
         struct mp_config_table *mc;
-
         int bus_isa;
        unsigned char bus_chain_0;
         unsigned char bus_8111_1;
@@ -58,21 +52,8 @@ static void *smp_write_config_table(void *v)
         unsigned apicid_8111;
 
         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;
+
+       mptable_init(mc, "S2850       ", LAPIC_ADDR);
 
         smp_write_processors(mc);
         {
index a2aa275e34dd4a6499ceef9e2e9cb2cd821a61cb..db159d0a010720972958b56396147c6f9710b799 100644 (file)
@@ -44,11 +44,7 @@ static unsigned node_link_to_bus(unsigned node, unsigned link)
 
 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] = "S2875       ";
         struct mp_config_table *mc;
-
         int bus_isa;
        unsigned char bus_chain_0;
         unsigned char bus_8111_1;
@@ -57,21 +53,8 @@ static void *smp_write_config_table(void *v)
         unsigned apicid_8111;
 
         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;
+
+       mptable_init(mc, "S2875       ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 176aed2212ff81c3f73290e24af199322532265b..970b5a53eff3e2bab1f39f496a40c7276936ae82 100644 (file)
@@ -8,7 +8,6 @@
 #include <cpu/amd/multicore.h>
 #endif
 
-
 static unsigned node_link_to_bus(unsigned node, unsigned link)
 {
         device_t dev;
@@ -43,14 +42,9 @@ static unsigned node_link_to_bus(unsigned node, unsigned link)
         return 0;
 }
 
-
 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] = "S2880       ";
         struct mp_config_table *mc;
-
         int bus_isa;
        unsigned char bus_chain_0;
         unsigned char bus_8131_1;
@@ -62,21 +56,8 @@ static void *smp_write_config_table(void *v)
         unsigned apicid_8131_2;
 
         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;
+
+       mptable_init(mc, "S2880       ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index 3e9c55d5d437ab2666e4716202cb167cd5a2f61e..e7ffe14b8efa38a1d75327dacfe3965a5503a245 100644 (file)
@@ -4,7 +4,6 @@
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern  unsigned char bus_isa;
@@ -19,41 +18,20 @@ extern  unsigned apicid_8131_2;
 
 extern  unsigned sbdn3;
 
-
-
 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] = "S2881       ";
         struct mp_config_table *mc;
-
         unsigned char bus_num;
-
        int i;
 
         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;
+
+       mptable_init(mc, "S2881       ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
        get_bus_conf();
 
-
 /*Bus:          Bus ID  Type*/
         /* define bus and isa numbers */
         for(bus_num = 0; bus_num < bus_isa; bus_num++) {
index f824025cc88a47ecb34484cc29649b9e8e6bebf2..8c51e65e769ebed317a1ea6df2edf1d30ca5ec6b 100644 (file)
@@ -9,7 +9,6 @@
 #include <cpu/amd/multicore.h>
 #endif
 
-
 static unsigned node_link_to_bus(unsigned node, unsigned link)
 {
         device_t dev;
@@ -46,11 +45,7 @@ static unsigned node_link_to_bus(unsigned node, unsigned link)
 
 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] = "S2882       ";
         struct mp_config_table *mc;
-
         unsigned char bus_num;
         unsigned char bus_isa;
        unsigned char bus_chain_0;
@@ -63,21 +58,8 @@ static void *smp_write_config_table(void *v)
         unsigned apicid_8131_2;
 
        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;
+
+       mptable_init(mc, "S2882       ", LAPIC_ADDR);
 
         smp_write_processors(mc);
         {
index 3d2d5a939f9844f755b98d6ffb7000953c0d91e3..b918b354ed229833be27bbfc62f4ebab1e507aae 100644 (file)
@@ -4,7 +4,6 @@
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern  unsigned char bus_isa;
@@ -22,36 +21,15 @@ extern  unsigned apicid_8131_2;
 extern  unsigned sbdn3;
 extern  unsigned sbdn5;
 
-
-
-
 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] = "S2885       ";
         struct mp_config_table *mc;
-
         unsigned char bus_num;
        int i;
 
-
         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;
+
+       mptable_init(mc, "S2885       ", LAPIC_ADDR);
 
         smp_write_processors(mc);
 
index b2571b1a6d2e2f1f86d9e31149ab5dece9d4ec53..f641d9ef4e44fed60e8445e5f48ca724fdd8dada 100644 (file)
@@ -3,7 +3,6 @@
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern  unsigned char bus_isa;
@@ -22,35 +21,16 @@ extern  unsigned apicid_8131_2;
 
 extern  unsigned sbdn3;
 
-
-
 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] = "S2891       ";
        struct mp_config_table *mc;
        unsigned sbdn;
-
        unsigned char bus_num;
        int i;
 
        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;
+
+       mptable_init(mc, "S2891       ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index f30e0d737a2b56438f27224c07944f58cc2487aa..37737a792ec6cc84f77a0a12858145f172849eae 100644 (file)
@@ -3,7 +3,6 @@
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern  unsigned char bus_isa;
@@ -22,35 +21,16 @@ extern  unsigned apicid_8131_2;
 
 extern  unsigned sbdn3;
 
-
-
 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] = "S2892       ";
        struct mp_config_table *mc;
        unsigned sbdn;
-
        unsigned char bus_num;
        int i;
 
        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;
+
+       mptable_init(mc, "S2892       ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index 3c857ed8750c3235274c1e94a7155cd6dfc2fce0..4128cff7869797b5ca2030b7b489ea1150d71785 100644 (file)
@@ -3,7 +3,6 @@
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
 
 extern  unsigned char bus_isa;
@@ -30,35 +29,16 @@ extern  unsigned apicid_ck804b;
 extern  unsigned sbdn3;
 extern  unsigned sbdnb;
 
-
-
 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] = "S2895       ";
        struct mp_config_table *mc;
        unsigned sbdn;
-
        unsigned char bus_num;
        int i;
 
        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;
+
+       mptable_init(mc, "S2895       ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index ec1fea7ef87cecfdfd782d9010021e21a99ce30a..018ea90054b23b654d3f4b87475183d7912ee815 100644 (file)
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdk8_sysconf.h>
-
 #include "mb_sysconf.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] = "S2895       ";
        struct mp_config_table *mc;
        struct mb_sysconf_t *m;
        unsigned sbdn;
-
        int i,j;
 
        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;
+
+       mptable_init(mc, "S2912       ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index d8b6f8e31ca6bc7ba0df7bbabb50c261dc2bfbef..68c68555f4e4ee8164af7e3d505f9e0ebe45ca68 100644 (file)
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
-
 #include <cpu/amd/amdfam10_sysconf.h>
-
 #include "mb_sysconf.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] = "S2895       ";
        struct mp_config_table *mc;
        struct mb_sysconf_t *m;
        unsigned sbdn;
-
        int i,j;
 
        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;
+
+       mptable_init(mc, "S2895       ", LAPIC_ADDR);
 
        smp_write_processors(mc);
 
index edef047c9bb068610829bd2e7a82a2e17da38f89..b0952633e6cea1086b28d81bf2decff18a8dc637 100644 (file)
@@ -44,11 +44,7 @@ static unsigned node_link_to_bus(unsigned node, unsigned link)
 
 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] = "S4880       ";
         struct mp_config_table *mc;
-
         int bus_isa;
        unsigned char bus_chain_0;
         unsigned char bus_8131_1;
@@ -60,24 +56,10 @@ static void *smp_write_config_table(void *v)
         unsigned apicid_8131_2;
 
         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, "S4880       ", LAPIC_ADDR);
 
+        smp_write_processors(mc);
 
         {
                 device_t dev;
index 1c791fcfd23b75c33a9f32d03a9d343919cafd76..fb6f91e76f20b7b309469e38fb6617ac5a6d72c7 100644 (file)
@@ -8,7 +8,6 @@
 #include <cpu/amd/multicore.h>
 #endif
 
-
 static unsigned node_link_to_bus(unsigned node, unsigned link)
 {
         device_t dev;
@@ -45,11 +44,7 @@ static unsigned node_link_to_bus(unsigned node, unsigned link)
 
 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] = "S4882       ";
         struct mp_config_table *mc;
-
         int bus_isa;
        unsigned char bus_chain_0;
         unsigned char bus_8131_1;
@@ -61,24 +56,10 @@ static void *smp_write_config_table(void *v)
         unsigned apicid_8131_2;
 
         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, "S4882       ", LAPIC_ADDR);
 
+        smp_write_processors(mc);
 
         {
                 device_t dev;
index 676c7e19887f15e996b0039e87cc64cf20ce7b7c..1bcdcb211f7418f8c6ef0eba93572b31cff5bf1d 100644 (file)
@@ -9,28 +9,12 @@
 
 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] = "P4DPE       ";
         struct mp_config_table *mc;
         int isa_bus;
 
         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;
+       mptable_init(mc, "EPIA-N      ", LAPIC_ADDR);
 
         smp_write_processors(mc);
         mptable_write_buses(mc, NULL, &isa_bus);
index 3e31abfef29ba396c59f33b04094132db0f6a6db..3b6edaa6d5106cb9a9f73a85b0f962a63b398c51 100644 (file)
 
 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] = "PC2500      ";
        struct mp_config_table *mc;
-
        int isa_bus;
 
        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;
+
+       mptable_init(mc, "pc2500e     ", LAPIC_ADDR);
 
        smp_write_processors(mc);
        mptable_write_buses(mc, NULL, &isa_bus);
index 22a4769d3d51f42b356742043c59ca65184ac0b9..5f911c0334b1f25d67f6adc1b2f1586eb1af8b29 100644 (file)
 
 static void *smp_write_config_table(void *v)
 {
-       static const char sig[4] = MPC_SIGNATURE;
-       static const char oem[8] = "COREBOOT";
-       static const char productid[12] = "VIA VT8454C ";
        struct mp_config_table *mc;
        int isa_bus;
 
        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;
+       mptable_init(mc, "VT8454c     ", LAPIC_ADDR);
 
        smp_write_processors(mc);
        mptable_write_buses(mc, NULL, &isa_bus);
index 9457c3834ceb81efb52371b34d8216e96b05dfbf..ebdcb3070dd452c77d855c625d09eb60b4124d55 100644 (file)
@@ -307,27 +307,11 @@ char *preamble[] = {
 "",
 "static void *smp_write_config_table(void *v)",
 "{",
-"        static const char sig[4] = \"PCMP\";",
-"        static const char oem[8] = \"LNXI    \";",
-"        static const char productid[12] = \"P4DPE       \";",
 "        struct mp_config_table *mc;",
 "",
 "        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;",
+"        mptable_init(mc, \"TODO        \", LAPIC_ADDR);",
 "",
 "        smp_write_processors(mc);",
 "",