aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/tyan
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2010-10-25 15:32:07 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2010-10-25 15:32:07 +0000
commit55dc223ccd0bb2a34ec46f36b36b658ecd677c2f (patch)
tree244c93a51dd27161c95c370814e0225138e21770 /src/mainboard/tyan
parent11abcc0ae529e1a5c562f439df65ac091a322683 (diff)
Factor out common mptable code to mptable_init().
- 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
Diffstat (limited to 'src/mainboard/tyan')
-rw-r--r--src/mainboard/tyan/s2735/mptable.c18
-rw-r--r--src/mainboard/tyan/s2850/mptable.c23
-rw-r--r--src/mainboard/tyan/s2875/mptable.c21
-rw-r--r--src/mainboard/tyan/s2880/mptable.c23
-rw-r--r--src/mainboard/tyan/s2881/mptable.c26
-rw-r--r--src/mainboard/tyan/s2882/mptable.c22
-rw-r--r--src/mainboard/tyan/s2885/mptable.c26
-rw-r--r--src/mainboard/tyan/s2891/mptable.c24
-rw-r--r--src/mainboard/tyan/s2892/mptable.c24
-rw-r--r--src/mainboard/tyan/s2895/mptable.c24
-rw-r--r--src/mainboard/tyan/s2912/mptable.c25
-rw-r--r--src/mainboard/tyan/s2912_fam10/mptable.c25
-rw-r--r--src/mainboard/tyan/s4880/mptable.c22
-rw-r--r--src/mainboard/tyan/s4882/mptable.c23
14 files changed, 27 insertions, 299 deletions
diff --git a/src/mainboard/tyan/s2735/mptable.c b/src/mainboard/tyan/s2735/mptable.c
index 5e4afaee01..3e47388f0b 100644
--- a/src/mainboard/tyan/s2735/mptable.c
+++ b/src/mainboard/tyan/s2735/mptable.c
@@ -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);
diff --git a/src/mainboard/tyan/s2850/mptable.c b/src/mainboard/tyan/s2850/mptable.c
index d452dd9c3a..bc61e8e4d6 100644
--- a/src/mainboard/tyan/s2850/mptable.c
+++ b/src/mainboard/tyan/s2850/mptable.c
@@ -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);
{
diff --git a/src/mainboard/tyan/s2875/mptable.c b/src/mainboard/tyan/s2875/mptable.c
index a2aa275e34..db159d0a01 100644
--- a/src/mainboard/tyan/s2875/mptable.c
+++ b/src/mainboard/tyan/s2875/mptable.c
@@ -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);
diff --git a/src/mainboard/tyan/s2880/mptable.c b/src/mainboard/tyan/s2880/mptable.c
index 176aed2212..970b5a53ef 100644
--- a/src/mainboard/tyan/s2880/mptable.c
+++ b/src/mainboard/tyan/s2880/mptable.c
@@ -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);
diff --git a/src/mainboard/tyan/s2881/mptable.c b/src/mainboard/tyan/s2881/mptable.c
index 3e9c55d5d4..e7ffe14b8e 100644
--- a/src/mainboard/tyan/s2881/mptable.c
+++ b/src/mainboard/tyan/s2881/mptable.c
@@ -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++) {
diff --git a/src/mainboard/tyan/s2882/mptable.c b/src/mainboard/tyan/s2882/mptable.c
index f824025cc8..8c51e65e76 100644
--- a/src/mainboard/tyan/s2882/mptable.c
+++ b/src/mainboard/tyan/s2882/mptable.c
@@ -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);
{
diff --git a/src/mainboard/tyan/s2885/mptable.c b/src/mainboard/tyan/s2885/mptable.c
index 3d2d5a939f..b918b354ed 100644
--- a/src/mainboard/tyan/s2885/mptable.c
+++ b/src/mainboard/tyan/s2885/mptable.c
@@ -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);
diff --git a/src/mainboard/tyan/s2891/mptable.c b/src/mainboard/tyan/s2891/mptable.c
index b2571b1a6d..f641d9ef4e 100644
--- a/src/mainboard/tyan/s2891/mptable.c
+++ b/src/mainboard/tyan/s2891/mptable.c
@@ -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);
diff --git a/src/mainboard/tyan/s2892/mptable.c b/src/mainboard/tyan/s2892/mptable.c
index f30e0d737a..37737a792e 100644
--- a/src/mainboard/tyan/s2892/mptable.c
+++ b/src/mainboard/tyan/s2892/mptable.c
@@ -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);
diff --git a/src/mainboard/tyan/s2895/mptable.c b/src/mainboard/tyan/s2895/mptable.c
index 3c857ed875..4128cff786 100644
--- a/src/mainboard/tyan/s2895/mptable.c
+++ b/src/mainboard/tyan/s2895/mptable.c
@@ -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);
diff --git a/src/mainboard/tyan/s2912/mptable.c b/src/mainboard/tyan/s2912/mptable.c
index ec1fea7ef8..018ea90054 100644
--- a/src/mainboard/tyan/s2912/mptable.c
+++ b/src/mainboard/tyan/s2912/mptable.c
@@ -24,40 +24,19 @@
#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);
diff --git a/src/mainboard/tyan/s2912_fam10/mptable.c b/src/mainboard/tyan/s2912_fam10/mptable.c
index d8b6f8e31c..68c68555f4 100644
--- a/src/mainboard/tyan/s2912_fam10/mptable.c
+++ b/src/mainboard/tyan/s2912_fam10/mptable.c
@@ -24,40 +24,19 @@
#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);
diff --git a/src/mainboard/tyan/s4880/mptable.c b/src/mainboard/tyan/s4880/mptable.c
index edef047c9b..b0952633e6 100644
--- a/src/mainboard/tyan/s4880/mptable.c
+++ b/src/mainboard/tyan/s4880/mptable.c
@@ -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;
diff --git a/src/mainboard/tyan/s4882/mptable.c b/src/mainboard/tyan/s4882/mptable.c
index 1c791fcfd2..fb6f91e76f 100644
--- a/src/mainboard/tyan/s4882/mptable.c
+++ b/src/mainboard/tyan/s4882/mptable.c
@@ -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;