Patchwork workaround for "An unexpected error (805262864) occurred at line 1768 of d:\xpclient\base\boot\setup\arcdisp.c"

login
register
about
Submitter Scott
Date 2011-05-18 06:40:08
Message ID <EA29AB5623234450BF6A861986753B34@asusp67>
Download mbox | patch
Permalink /patch/2974/
State New
Headers show

Comments

Scott - 2011-05-18 06:40:08
The attached patch works around a Windows XP or Server 2003 setup
failure where an error message such as:
"An unexpected error (805262864) occurred at line 1768 of
d:\xpclient\base\boot\setup\arcdisp.c"
The value 805262864 varies, and is the physical address, in decimal,
of one of the ACPI tables.

Tested on Persimmon. Others abuild tested only.
Signed-off-by: Scott Duplichan <scott@notabs.org>

Detailed explanation: The error message is displayed when a 1024 dword
page table array used by setupldr runs out of space. This table is used
for mapping various physical addresses, such as those of ACPI tables
(a separate table identity maps the lower 16MB used by setupldr code
and data). Setupldr only looks at ACPI tables (FACP) to determine make
and model of the system. The make and model of the system is needed when
setupldr scans the good/bad bios lists contained in txtsetup.sif. The
good/bad bios lists are used to bypass installation of the ACPI enabled
kernel on certain systems known to have ACPI problems. The code loop
that scans the lists creates a new mapping each time it reads an ACPI
table, and never frees mappings. The code uses FACP OEM ID to determine
the system model. The code sequentially reads tables listed in the RSDT
array until the FACP is found. Each read consumes one page table entry.
If more that 4 tables precede the FACP in the RSDT array, the 1024
entry page table array will run out of space before the good/bad bios
list processing completes. BIOS can work around this Windows XP/Server
2003 limitation by placing the FACP early in the RSDT array.

Thanks,
Scott
Marc Jones - 2011-05-18 21:29:06
On Wed, May 18, 2011 at 12:40 AM, Scott Duplichan <scott@notabs.org> wrote:
> The attached patch works around a Windows XP or Server 2003 setup
> failure where an error message such as:
> "An unexpected error (805262864) occurred at line 1768 of
> d:\xpclient\base\boot\setup\arcdisp.c"
> The value 805262864 varies, and is the physical address, in decimal,
> of one of the ACPI tables.
>
> Tested on Persimmon. Others abuild tested only.
> Signed-off-by: Scott Duplichan <scott@notabs.org>
>
> Detailed explanation: The error message is displayed when a 1024 dword
> page table array used by setupldr runs out of space. This table is used
> for mapping various physical addresses, such as those of ACPI tables
> (a separate table identity maps the lower 16MB used by setupldr code
> and data). Setupldr only looks at ACPI tables (FACP) to determine make
> and model of the system. The make and model of the system is needed when
> setupldr scans the good/bad bios lists contained in txtsetup.sif. The
> good/bad bios lists are used to bypass installation of the ACPI enabled
> kernel on certain systems known to have ACPI problems. The code loop
> that scans the lists creates a new mapping each time it reads an ACPI
> table, and never frees mappings. The code uses FACP OEM ID to determine
> the system model. The code sequentially reads tables listed in the RSDT
> array until the FACP is found. Each read consumes one page table entry.
> If more that 4 tables precede the FACP in the RSDT array, the 1024
> entry page table array will run out of space before the good/bad bios
> list processing completes. BIOS can work around this Windows XP/Server
> 2003 limitation by placing the FACP early in the RSDT array.
>
> Thanks,
> Scott

Hi Scott,

Good find. This must have been a difficult debug.

It looks like src/mainboard/amd/mahogany/acpi_tables.c has a double
paste issue. Fix that and it looks good.

Acked-by: Marc Jones <marcj303@gmail.com>


Marc
Paul Menzel - 2011-05-18 22:14:49
Dear Scott and coreboot folks,


Am Mittwoch, den 18.05.2011, 01:40 -0500 schrieb Scott Duplichan:

[…]

looking at the change

> Index: src/mainboard/amd/bimini_fam10/acpi_tables.c
> ===================================================================
> --- src/mainboard/amd/bimini_fam10/acpi_tables.c        (revision 6599)
> +++ src/mainboard/amd/bimini_fam10/acpi_tables.c        (working copy)
> @@ -127,6 +127,31 @@
>         acpi_write_rsdp(rsdp, rsdt, NULL);
>         acpi_write_rsdt(rsdt);
>  
> +       /* DSDT */
> +       current   = ( current + 0x07) & -0x08;
> +       printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
> +       dsdt = (acpi_header_t *)current; // it will used by fadt
> +       memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
> +       current += dsdt->length;
> +       memcpy(dsdt, &AmlCode, dsdt->length);
> +       printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n",dsdt,dsdt->length);
> +
> +       /* FACS */ // it needs 64 bit alignment
> +       current   = ( current + 0x07) & -0x08;
> +       printk(BIOS_DEBUG, "ACPI:       * FACS at %lx\n", current);
> +       facs = (acpi_facs_t *) current; // it will be used by fadt
> +       current += sizeof(acpi_facs_t);
> +       acpi_create_facs(facs);
> +
> +       /* FADT */
> +       current   = ( current + 0x07) & -0x08;
> +       printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
> +       fadt = (acpi_fadt_t *) current;
> +       current += sizeof(acpi_fadt_t);
> +
> +       acpi_create_fadt(fadt, facs, dsdt);
> +       acpi_add_table(rsdp, fadt);

[…]

the contents seems to very similar. Besides some comments even
identical.

Can `acpi_tables.c` be shared between certain families or even all new
boards?

If yes, maybe that could be put on a todo list.


Thanks,

Paul
Peter Stuge - 2011-05-18 22:21:35
Paul Menzel wrote:
> Can `acpi_tables.c` be shared between certain families or even all
> new boards?
> 
> If yes, maybe that could be put on a todo list.

Yeah, I ranted about this a bit on IRC. Will take a look in Prague.


//Peter
Stefan Reinauer - 2011-05-19 00:52:00
On 5/18/11 3:21 PM, Peter Stuge wrote:
> Paul Menzel wrote:
>> Can `acpi_tables.c` be shared between certain families or even all
>> new boards?
>>
>> If yes, maybe that could be put on a todo list.
> Yeah, I ranted about this a bit on IRC. Will take a look in Prague.
>
I read a nice quote today:

"Why rant when you can also send a patch? "

Thanks for looking into this. :-)
Peter Stuge - 2011-05-19 00:56:04
Stefan Reinauer wrote:
> "Why rant when you can also send a patch? "

Because design is also important, not only implementation.

(Matter at hand requires no great feat of design. If someone else
sends a patch before me I will ack with a smile. :)


//Peter
Vikram Narayanan - 2011-05-19 02:38:27
On Thu, May 19, 2011 at 2:59 AM, Marc Jones <marcj303@gmail.com> wrote:
> On Wed, May 18, 2011 at 12:40 AM, Scott Duplichan <scott@notabs.org> wrote:
>> The attached patch works around a Windows XP or Server 2003 setup
>> failure where an error message such as:
>> "An unexpected error (805262864) occurred at line 1768 of
>> d:\xpclient\base\boot\setup\arcdisp.c"
>> The value 805262864 varies, and is the physical address, in decimal,
>> of one of the ACPI tables.
>>
>> Tested on Persimmon. Others abuild tested only.
>> Signed-off-by: Scott Duplichan <scott@notabs.org>
>>
>> Detailed explanation: The error message is displayed when a 1024 dword
>> page table array used by setupldr runs out of space. This table is used
>> for mapping various physical addresses, such as those of ACPI tables
>> (a separate table identity maps the lower 16MB used by setupldr code
>> and data). Setupldr only looks at ACPI tables (FACP) to determine make
>> and model of the system. The make and model of the system is needed when
>> setupldr scans the good/bad bios lists contained in txtsetup.sif. The
>> good/bad bios lists are used to bypass installation of the ACPI enabled
>> kernel on certain systems known to have ACPI problems. The code loop
>> that scans the lists creates a new mapping each time it reads an ACPI
>> table, and never frees mappings. The code uses FACP OEM ID to determine
>> the system model. The code sequentially reads tables listed in the RSDT
>> array until the FACP is found. Each read consumes one page table entry.
>> If more that 4 tables precede the FACP in the RSDT array, the 1024
>> entry page table array will run out of space before the good/bad bios
>> list processing completes. BIOS can work around this Windows XP/Server
>> 2003 limitation by placing the FACP early in the RSDT array.
>>
>> Thanks,
>> Scott
>
> Hi Scott,
>
> Good find. This must have been a difficult debug.
>
> It looks like src/mainboard/amd/mahogany/acpi_tables.c has a double
> paste issue. Fix that and it looks good.

Seems to be an issue with the line endings. He could have edited
something in windows and made the patch.

-
Thanks,
Vikram
Scott - 2011-05-20 00:10:20
Marc Jones wrote:

> The attached patch works around a Windows XP or Server 2003 setup
> failure where an error message such as:
> "An unexpected error (805262864) occurred at line 1768 of
> d:\xpclient\base\boot\setup\arcdisp.c"
> The value 805262864 varies, and is the physical address, in decimal,
> of one of the ACPI tables.
>
> Tested on Persimmon. Others abuild tested only.
> Signed-off-by: Scott Duplichan <scott@notabs.org>
>

]It looks like src/mainboard/amd/mahogany/acpi_tables.c has a double
]paste issue. Fix that and it looks good.
]
]Acked-by: Marc Jones <marcj303@gmail.com>
]
]
]Marc

Hello Marc,

Thanks for finding the double paste problem in mahogany.
This change is revision 6600.

Thanks,
Scott

Patch

Index: src/mainboard/amd/bimini_fam10/acpi_tables.c
===================================================================
--- src/mainboard/amd/bimini_fam10/acpi_tables.c	(revision 6599)
+++ src/mainboard/amd/bimini_fam10/acpi_tables.c	(working copy)
@@ -127,6 +127,31 @@ 
 	acpi_write_rsdp(rsdp, rsdt, NULL);
 	acpi_write_rsdt(rsdt);
 
+	/* DSDT */
+	current	  = ( current + 0x07) & -0x08;
+	printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
+	dsdt = (acpi_header_t *)current; // it will used by fadt
+	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
+	current += dsdt->length;
+	memcpy(dsdt, &AmlCode, dsdt->length);
+	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n",dsdt,dsdt->length);
+
+	/* FACS */ // it needs 64 bit alignment
+	current	  = ( current + 0x07) & -0x08;
+	printk(BIOS_DEBUG, "ACPI:	* FACS at %lx\n", current);
+	facs = (acpi_facs_t *) current; // it will be used by fadt
+	current += sizeof(acpi_facs_t);
+	acpi_create_facs(facs);
+
+	/* FADT */
+	current	  = ( current + 0x07) & -0x08;
+	printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
+	fadt = (acpi_fadt_t *) current;
+	current += sizeof(acpi_fadt_t);
+
+	acpi_create_fadt(fadt, facs, dsdt);
+	acpi_add_table(rsdp, fadt);
+
 	/*
 	 * We explicitly add these tables later on:
 	 */
@@ -219,31 +244,6 @@ 
 	}
 #endif
 
-	/* DSDT */
-	current	  = ( current + 0x07) & -0x08;
-	printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
-	dsdt = (acpi_header_t *)current; // it will used by fadt
-	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-	current += dsdt->length;
-	memcpy(dsdt, &AmlCode, dsdt->length);
-	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n",dsdt,dsdt->length);
-
-	/* FACS */ // it needs 64 bit alignment
-	current	  = ( current + 0x07) & -0x08;
-	printk(BIOS_DEBUG, "ACPI:	* FACS at %lx\n", current);
-	facs = (acpi_facs_t *) current; // it will be used by fadt
-	current += sizeof(acpi_facs_t);
-	acpi_create_facs(facs);
-
-	/* FADT */
-	current	  = ( current + 0x07) & -0x08;
-	printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
-	fadt = (acpi_fadt_t *) current;
-	current += sizeof(acpi_fadt_t);
-
-	acpi_create_fadt(fadt, facs, dsdt);
-	acpi_add_table(rsdp, fadt);
-
 #if DUMP_ACPI_TABLES == 1
 	printk(BIOS_DEBUG, "rsdp\n");
 	dump_mem(rsdp, ((void *)rsdp) + sizeof(acpi_rsdp_t));
Index: src/mainboard/amd/dbm690t/acpi_tables.c
===================================================================
--- src/mainboard/amd/dbm690t/acpi_tables.c	(revision 6599)
+++ src/mainboard/amd/dbm690t/acpi_tables.c	(working copy)
@@ -129,6 +129,27 @@ 
 	acpi_write_rsdp(rsdp, rsdt, NULL);
 	acpi_write_rsdt(rsdt);
 
+	/* FACS */
+	printk(BIOS_DEBUG, "ACPI:    * FACS\n");
+	facs = (acpi_facs_t *) current;
+	current += sizeof(acpi_facs_t);
+	acpi_create_facs(facs);
+
+	/* DSDT */
+	printk(BIOS_DEBUG, "ACPI:    * DSDT\n");
+	dsdt = (acpi_header_t *)current;
+	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
+	current += dsdt->length;
+	memcpy(dsdt, &AmlCode, dsdt->length);
+	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n", dsdt, dsdt->length);
+	/* FADT */
+	printk(BIOS_DEBUG, "ACPI:    * FADT\n");
+	fadt = (acpi_fadt_t *) current;
+	current += sizeof(acpi_fadt_t);
+
+	acpi_create_fadt(fadt, facs, dsdt);
+	acpi_add_table(rsdp, fadt);
+
 	/*
 	 * We explicitly add these tables later on:
 	 */
@@ -153,27 +174,6 @@ 
 	current += ssdt->length;
 	acpi_add_table(rsdp, ssdt);
 
-	/* FACS */
-	printk(BIOS_DEBUG, "ACPI:    * FACS\n");
-	facs = (acpi_facs_t *) current;
-	current += sizeof(acpi_facs_t);
-	acpi_create_facs(facs);
-
-	/* DSDT */
-	printk(BIOS_DEBUG, "ACPI:    * DSDT\n");
-	dsdt = (acpi_header_t *)current;
-	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-	current += dsdt->length;
-	memcpy(dsdt, &AmlCode, dsdt->length);
-	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n", dsdt, dsdt->length);
-	/* FADT */
-	printk(BIOS_DEBUG, "ACPI:    * FADT\n");
-	fadt = (acpi_fadt_t *) current;
-	current += sizeof(acpi_fadt_t);
-
-	acpi_create_fadt(fadt, facs, dsdt);
-	acpi_add_table(rsdp, fadt);
-
 #if DUMP_ACPI_TABLES == 1
 	printk(BIOS_DEBUG, "rsdp\n");
 	dump_mem(rsdp, ((void *)rsdp) + sizeof(acpi_rsdp_t));
Index: src/mainboard/amd/inagua/acpi_tables.c
===================================================================
--- src/mainboard/amd/inagua/acpi_tables.c	(revision 6599)
+++ src/mainboard/amd/inagua/acpi_tables.c	(working copy)
@@ -133,6 +133,31 @@ 
   acpi_write_rsdp(rsdp, rsdt, NULL);
   acpi_write_rsdt(rsdt);
 
+  /* DSDT */
+  current   = ( current + 0x07) & -0x08;
+  printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
+  dsdt = (acpi_header_t *)current; // it will used by fadt
+  memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
+  current += dsdt->length;
+  memcpy(dsdt, &AmlCode, dsdt->length);
+  printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n",dsdt,dsdt->length);
+
+  /* FACS */ // it needs 64 bit alignment
+  current   = ( current + 0x07) & -0x08;
+  printk(BIOS_DEBUG, "ACPI: * FACS at %lx\n", current);
+  facs = (acpi_facs_t *) current; // it will be used by fadt
+  current += sizeof(acpi_facs_t);
+  acpi_create_facs(facs);
+
+  /* FADT */
+  current   = ( current + 0x07) & -0x08;
+  printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
+  fadt = (acpi_fadt_t *) current;
+  current += sizeof(acpi_fadt_t);
+
+  acpi_create_fadt(fadt, facs, dsdt);
+  acpi_add_table(rsdp, fadt);
+
   /*
    * We explicitly add these tables later on:
    */
@@ -199,31 +224,6 @@ 
 
   printk(BIOS_DEBUG, "ACPI:    * SSDT for PState at %lx\n", current);
 
-  /* DSDT */
-  current   = ( current + 0x07) & -0x08;
-  printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
-  dsdt = (acpi_header_t *)current; // it will used by fadt
-  memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-  current += dsdt->length;
-  memcpy(dsdt, &AmlCode, dsdt->length);
-  printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n",dsdt,dsdt->length);
-
-  /* FACS */ // it needs 64 bit alignment
-  current   = ( current + 0x07) & -0x08;
-  printk(BIOS_DEBUG, "ACPI: * FACS at %lx\n", current);
-  facs = (acpi_facs_t *) current; // it will be used by fadt
-  current += sizeof(acpi_facs_t);
-  acpi_create_facs(facs);
-
-  /* FADT */
-  current   = ( current + 0x07) & -0x08;
-  printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
-  fadt = (acpi_fadt_t *) current;
-  current += sizeof(acpi_fadt_t);
-
-  acpi_create_fadt(fadt, facs, dsdt);
-  acpi_add_table(rsdp, fadt);
-
 #if DUMP_ACPI_TABLES == 1
   printk(BIOS_DEBUG, "rsdp\n");
   dump_mem(rsdp, ((void *)rsdp) + sizeof(acpi_rsdp_t));
Index: src/mainboard/amd/mahogany/acpi_tables.c
===================================================================
--- src/mainboard/amd/mahogany/acpi_tables.c	(revision 6599)
+++ src/mainboard/amd/mahogany/acpi_tables.c	(working copy)
@@ -140,6 +140,48 @@ 
 	acpi_write_rsdp(rsdp, rsdt, NULL);
 	acpi_write_rsdt(rsdt);
 
+	/* FACS */
+	printk(BIOS_DEBUG, "ACPI:    * FACS\n");
+	facs = (acpi_facs_t *) current;
+	current += sizeof(acpi_facs_t);
+	acpi_create_facs(facs);
+
+	/* DSDT */
+	printk(BIOS_DEBUG, "ACPI:    * DSDT\n");
+	dsdt = (acpi_header_t *)current;
+	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
+	current += dsdt->length;
+	memcpy(dsdt, &AmlCode, dsdt->length);
+	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n", dsdt, dsdt->length);
+	/* FADT */
+	printk(BIOS_DEBUG, "ACPI:    * FADT\n");
+	fadt = (acpi_fadt_t *) current;
+	current += sizeof(acpi_fadt_t);
+
+	acpi_create_fadt(fadt, facs, dsdt);
+	acpi_add_table(rsdp, fadt);
+
+	/* FACS */
+	printk(BIOS_DEBUG, "ACPI:    * FACS\n");
+	facs = (acpi_facs_t *) current;
+	current += sizeof(acpi_facs_t);
+	acpi_create_facs(facs);
+
+	/* DSDT */
+	printk(BIOS_DEBUG, "ACPI:    * DSDT\n");
+	dsdt = (acpi_header_t *)current;
+	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
+	current += dsdt->length;
+	memcpy(dsdt, &AmlCode, dsdt->length);
+	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n", dsdt, dsdt->length);
+	/* FADT */
+	printk(BIOS_DEBUG, "ACPI:    * FADT\n");
+	fadt = (acpi_fadt_t *) current;
+	current += sizeof(acpi_fadt_t);
+
+	acpi_create_fadt(fadt, facs, dsdt);
+	acpi_add_table(rsdp, fadt);
+
 	/*
 	 * We explicitly add these tables later on:
 	 */
@@ -205,27 +247,6 @@ 
 	}
 #endif
 
-	/* FACS */
-	printk(BIOS_DEBUG, "ACPI:    * FACS\n");
-	facs = (acpi_facs_t *) current;
-	current += sizeof(acpi_facs_t);
-	acpi_create_facs(facs);
-
-	/* DSDT */
-	printk(BIOS_DEBUG, "ACPI:    * DSDT\n");
-	dsdt = (acpi_header_t *)current;
-	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-	current += dsdt->length;
-	memcpy(dsdt, &AmlCode, dsdt->length);
-	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n", dsdt, dsdt->length);
-	/* FADT */
-	printk(BIOS_DEBUG, "ACPI:    * FADT\n");
-	fadt = (acpi_fadt_t *) current;
-	current += sizeof(acpi_fadt_t);
-
-	acpi_create_fadt(fadt, facs, dsdt);
-	acpi_add_table(rsdp, fadt);
-
 #if DUMP_ACPI_TABLES == 1
 	printk(BIOS_DEBUG, "rsdp\n");
 	dump_mem(rsdp, ((void *)rsdp) + sizeof(acpi_rsdp_t));
Index: src/mainboard/amd/mahogany_fam10/acpi_tables.c
===================================================================
--- src/mainboard/amd/mahogany_fam10/acpi_tables.c	(revision 6599)
+++ src/mainboard/amd/mahogany_fam10/acpi_tables.c	(working copy)
@@ -126,6 +126,31 @@ 
 	acpi_write_rsdp(rsdp, rsdt, NULL);
 	acpi_write_rsdt(rsdt);
 
+	/* DSDT */
+	current	  = ( current + 0x07) & -0x08;
+	printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
+	dsdt = (acpi_header_t *)current; // it will used by fadt
+	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
+	current += dsdt->length;
+	memcpy(dsdt, &AmlCode, dsdt->length);
+	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n",dsdt,dsdt->length);
+
+	/* FACS */ // it needs 64 bit alignment
+	current	  = ( current + 0x07) & -0x08;
+	printk(BIOS_DEBUG, "ACPI:	* FACS at %lx\n", current);
+	facs = (acpi_facs_t *) current; // it will be used by fadt
+	current += sizeof(acpi_facs_t);
+	acpi_create_facs(facs);
+
+	/* FADT */
+	current	  = ( current + 0x07) & -0x08;
+	printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
+	fadt = (acpi_fadt_t *) current;
+	current += sizeof(acpi_fadt_t);
+
+	acpi_create_fadt(fadt, facs, dsdt);
+	acpi_add_table(rsdp, fadt);
+
 	/*
 	 * We explicitly add these tables later on:
 	 */
@@ -218,31 +243,6 @@ 
 	}
 #endif
 
-	/* DSDT */
-	current	  = ( current + 0x07) & -0x08;
-	printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
-	dsdt = (acpi_header_t *)current; // it will used by fadt
-	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-	current += dsdt->length;
-	memcpy(dsdt, &AmlCode, dsdt->length);
-	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n",dsdt,dsdt->length);
-
-	/* FACS */ // it needs 64 bit alignment
-	current	  = ( current + 0x07) & -0x08;
-	printk(BIOS_DEBUG, "ACPI:	* FACS at %lx\n", current);
-	facs = (acpi_facs_t *) current; // it will be used by fadt
-	current += sizeof(acpi_facs_t);
-	acpi_create_facs(facs);
-
-	/* FADT */
-	current	  = ( current + 0x07) & -0x08;
-	printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
-	fadt = (acpi_fadt_t *) current;
-	current += sizeof(acpi_fadt_t);
-
-	acpi_create_fadt(fadt, facs, dsdt);
-	acpi_add_table(rsdp, fadt);
-
 #if DUMP_ACPI_TABLES == 1
 	printk(BIOS_DEBUG, "rsdp\n");
 	dump_mem(rsdp, ((void *)rsdp) + sizeof(acpi_rsdp_t));
Index: src/mainboard/amd/persimmon/acpi_tables.c
===================================================================
--- src/mainboard/amd/persimmon/acpi_tables.c	(revision 6599)
+++ src/mainboard/amd/persimmon/acpi_tables.c	(working copy)
@@ -129,6 +129,31 @@ 
   acpi_write_rsdp(rsdp, rsdt, NULL);
   acpi_write_rsdt(rsdt);
 
+  /* DSDT */
+  current   = ( current + 0x07) & -0x08;
+  printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
+  dsdt = (acpi_header_t *)current; // it will used by fadt
+  memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
+  current += dsdt->length;
+  memcpy(dsdt, &AmlCode, dsdt->length);
+  printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n",dsdt,dsdt->length);
+
+  /* FACS */ // it needs 64 bit alignment
+  current   = ( current + 0x07) & -0x08;
+  printk(BIOS_DEBUG, "ACPI: * FACS at %lx\n", current);
+  facs = (acpi_facs_t *) current; // it will be used by fadt
+  current += sizeof(acpi_facs_t);
+  acpi_create_facs(facs);
+
+  /* FDAT */
+  current   = ( current + 0x07) & -0x08;
+  printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
+  fadt = (acpi_fadt_t *) current;
+  current += sizeof(acpi_fadt_t);
+
+  acpi_create_fadt(fadt, facs, dsdt);
+  acpi_add_table(rsdp, fadt);
+
   /*
    * We explicitly add these tables later on:
    */
@@ -193,31 +218,6 @@ 
 
   printk(BIOS_DEBUG, "ACPI:    * SSDT for PState at %lx\n", current);
 
-  /* DSDT */
-  current   = ( current + 0x07) & -0x08;
-  printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
-  dsdt = (acpi_header_t *)current; // it will used by fadt
-  memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-  current += dsdt->length;
-  memcpy(dsdt, &AmlCode, dsdt->length);
-  printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n",dsdt,dsdt->length);
-
-  /* FACS */ // it needs 64 bit alignment
-  current   = ( current + 0x07) & -0x08;
-  printk(BIOS_DEBUG, "ACPI: * FACS at %lx\n", current);
-  facs = (acpi_facs_t *) current; // it will be used by fadt
-  current += sizeof(acpi_facs_t);
-  acpi_create_facs(facs);
-
-  /* FDAT */
-  current   = ( current + 0x07) & -0x08;
-  printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
-  fadt = (acpi_fadt_t *) current;
-  current += sizeof(acpi_fadt_t);
-
-  acpi_create_fadt(fadt, facs, dsdt);
-  acpi_add_table(rsdp, fadt);
-
 #if DUMP_ACPI_TABLES == 1
   printk(BIOS_DEBUG, "rsdp\n");
   dump_mem(rsdp, ((void *)rsdp) + sizeof(acpi_rsdp_t));
Index: src/mainboard/amd/pistachio/acpi_tables.c
===================================================================
--- src/mainboard/amd/pistachio/acpi_tables.c	(revision 6599)
+++ src/mainboard/amd/pistachio/acpi_tables.c	(working copy)
@@ -129,6 +129,28 @@ 
 	acpi_write_rsdp(rsdp, rsdt, NULL);
 	acpi_write_rsdt(rsdt);
 
+	/* FACS */
+	printk(BIOS_DEBUG, "ACPI:    * FACS\n");
+	facs = (acpi_facs_t *) current;
+	current += sizeof(acpi_facs_t);
+	acpi_create_facs(facs);
+
+	/* DSDT */
+	printk(BIOS_DEBUG, "ACPI:    * DSDT\n");
+	dsdt = (acpi_header_t *) current;
+	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
+	current += dsdt->length;
+	memcpy(dsdt, &AmlCode, dsdt->length);
+
+	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n", dsdt, dsdt->length);
+	/* FADT */
+	printk(BIOS_DEBUG, "ACPI:    * FADT\n");
+	fadt = (acpi_fadt_t *) current;
+	current += sizeof(acpi_fadt_t);
+
+	acpi_create_fadt(fadt, facs, dsdt);
+	acpi_add_table(rsdp, fadt);
+
 	/*
 	 * We explicitly add these tables later on:
 	 */
@@ -153,28 +175,6 @@ 
 	current += ssdt->length;
 	acpi_add_table(rsdp, ssdt);
 
-	/* FACS */
-	printk(BIOS_DEBUG, "ACPI:    * FACS\n");
-	facs = (acpi_facs_t *) current;
-	current += sizeof(acpi_facs_t);
-	acpi_create_facs(facs);
-
-	/* DSDT */
-	printk(BIOS_DEBUG, "ACPI:    * DSDT\n");
-	dsdt = (acpi_header_t *) current;
-	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-	current += dsdt->length;
-	memcpy(dsdt, &AmlCode, dsdt->length);
-
-	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n", dsdt, dsdt->length);
-	/* FADT */
-	printk(BIOS_DEBUG, "ACPI:    * FADT\n");
-	fadt = (acpi_fadt_t *) current;
-	current += sizeof(acpi_fadt_t);
-
-	acpi_create_fadt(fadt, facs, dsdt);
-	acpi_add_table(rsdp, fadt);
-
 #if DUMP_ACPI_TABLES == 1
 	printk(BIOS_DEBUG, "rsdp\n");
 	dump_mem(rsdp, ((void *)rsdp) + sizeof(acpi_rsdp_t));
Index: src/mainboard/amd/serengeti_cheetah/acpi_tables.c
===================================================================
--- src/mainboard/amd/serengeti_cheetah/acpi_tables.c	(revision 6599)
+++ src/mainboard/amd/serengeti_cheetah/acpi_tables.c	(working copy)
@@ -191,6 +191,28 @@ 
 	acpi_write_rsdp(rsdp, rsdt, NULL);
 	acpi_write_rsdt(rsdt);
 
+	/* FACS */
+	printk(BIOS_DEBUG, "ACPI:    * FACS\n");
+	facs = (acpi_facs_t *) current;
+	current += sizeof(acpi_facs_t);
+	acpi_create_facs(facs);
+
+	/* DSDT */
+	printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
+	dsdt = (acpi_header_t *)current;
+	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
+	current += dsdt->length;
+	memcpy(dsdt, &AmlCode, dsdt->length);
+	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n", dsdt, dsdt->length);
+
+	/* FADT */
+	printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
+	fadt = (acpi_fadt_t *) current;
+	current += sizeof(acpi_fadt_t);
+
+	acpi_create_fadt(fadt, facs, dsdt);
+	acpi_add_table(rsdp, fadt);
+
 	/*
 	 * We explicitly add these tables later on:
 	 */
@@ -268,28 +290,6 @@ 
 	}
 #endif
 
-	/* FACS */
-	printk(BIOS_DEBUG, "ACPI:    * FACS\n");
-	facs = (acpi_facs_t *) current;
-	current += sizeof(acpi_facs_t);
-	acpi_create_facs(facs);
-
-	/* DSDT */
-	printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
-	dsdt = (acpi_header_t *)current;
-	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-	current += dsdt->length;
-	memcpy(dsdt, &AmlCode, dsdt->length);
-	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n", dsdt, dsdt->length);
-
-	/* FADT */
-	printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
-	fadt = (acpi_fadt_t *) current;
-	current += sizeof(acpi_fadt_t);
-
-	acpi_create_fadt(fadt, facs, dsdt);
-	acpi_add_table(rsdp, fadt);
-
 #if DUMP_ACPI_TABLES == 1
 	printk(BIOS_DEBUG, "rsdp\n");
 	dump_mem(rsdp, ((void *)rsdp) + sizeof(acpi_rsdp_t));
Index: src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c
===================================================================
--- src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c	(revision 6599)
+++ src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c	(working copy)
@@ -197,6 +197,31 @@ 
 	acpi_write_rsdp(rsdp, rsdt, NULL);
 	acpi_write_rsdt(rsdt);
 
+	/* DSDT */
+	current	  = ( current + 0x07) & -0x08;
+	printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
+	dsdt = (acpi_header_t *)current;
+	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
+	current += dsdt->length;
+	memcpy(dsdt, &AmlCode, dsdt->length);
+	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n", dsdt, dsdt->length);
+
+	/* FACS */ // it needs 64 bit alignment
+	current	  = ( current + 0x07) & -0x08;
+	printk(BIOS_DEBUG, "ACPI:	* FACS at %lx\n", current);
+	facs = (acpi_facs_t *) current;
+	current += sizeof(acpi_facs_t);
+	acpi_create_facs(facs);
+
+	/* FADT */
+	current	  = ( current + 0x07) & -0x08;
+	printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
+	fadt = (acpi_fadt_t *) current;
+	current += sizeof(acpi_fadt_t);
+
+	acpi_create_fadt(fadt, facs, dsdt);
+	acpi_add_table(rsdp, fadt);
+
 	/*
 	 * We explicitly add these tables later on:
 	 */
@@ -289,31 +314,6 @@ 
 	}
 #endif
 
-	/* DSDT */
-	current	  = ( current + 0x07) & -0x08;
-	printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
-	dsdt = (acpi_header_t *)current;
-	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-	current += dsdt->length;
-	memcpy(dsdt, &AmlCode, dsdt->length);
-	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n", dsdt, dsdt->length);
-
-	/* FACS */ // it needs 64 bit alignment
-	current	  = ( current + 0x07) & -0x08;
-	printk(BIOS_DEBUG, "ACPI:	* FACS at %lx\n", current);
-	facs = (acpi_facs_t *) current;
-	current += sizeof(acpi_facs_t);
-	acpi_create_facs(facs);
-
-	/* FADT */
-	current	  = ( current + 0x07) & -0x08;
-	printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
-	fadt = (acpi_fadt_t *) current;
-	current += sizeof(acpi_fadt_t);
-
-	acpi_create_fadt(fadt, facs, dsdt);
-	acpi_add_table(rsdp, fadt);
-
 #if DUMP_ACPI_TABLES == 1
 	printk(BIOS_DEBUG, "rsdp\n");
 	dump_mem(rsdp, ((void *)rsdp) + sizeof(acpi_rsdp_t));
Index: src/mainboard/amd/tilapia_fam10/acpi_tables.c
===================================================================
--- src/mainboard/amd/tilapia_fam10/acpi_tables.c	(revision 6599)
+++ src/mainboard/amd/tilapia_fam10/acpi_tables.c	(working copy)
@@ -127,6 +127,31 @@ 
 	acpi_write_rsdp(rsdp, rsdt, NULL);
 	acpi_write_rsdt(rsdt);
 
+	/* DSDT */
+	current	  = ( current + 0x07) & -0x08;
+	printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
+	dsdt = (acpi_header_t *)current; // it will used by fadt
+	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
+	current += dsdt->length;
+	memcpy(dsdt, &AmlCode, dsdt->length);
+	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n",dsdt,dsdt->length);
+
+	/* FACS */ // it needs 64 bit alignment
+	current	  = ( current + 0x07) & -0x08;
+	printk(BIOS_DEBUG, "ACPI:	* FACS at %lx\n", current);
+	facs = (acpi_facs_t *) current; // it will be used by fadt
+	current += sizeof(acpi_facs_t);
+	acpi_create_facs(facs);
+
+	/* FADT */
+	current	  = ( current + 0x07) & -0x08;
+	printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
+	fadt = (acpi_fadt_t *) current;
+	current += sizeof(acpi_fadt_t);
+
+	acpi_create_fadt(fadt, facs, dsdt);
+	acpi_add_table(rsdp, fadt);
+
 	/*
 	 * We explicitly add these tables later on:
 	 */
@@ -219,31 +244,6 @@ 
 	}
 #endif
 
-	/* DSDT */
-	current	  = ( current + 0x07) & -0x08;
-	printk(BIOS_DEBUG, "ACPI:    * DSDT at %lx\n", current);
-	dsdt = (acpi_header_t *)current; // it will used by fadt
-	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-	current += dsdt->length;
-	memcpy(dsdt, &AmlCode, dsdt->length);
-	printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n",dsdt,dsdt->length);
-
-	/* FACS */ // it needs 64 bit alignment
-	current	  = ( current + 0x07) & -0x08;
-	printk(BIOS_DEBUG, "ACPI:	* FACS at %lx\n", current);
-	facs = (acpi_facs_t *) current; // it will be used by fadt
-	current += sizeof(acpi_facs_t);
-	acpi_create_facs(facs);
-
-	/* FADT */
-	current	  = ( current + 0x07) & -0x08;
-	printk(BIOS_DEBUG, "ACPI:    * FADT at %lx\n", current);
-	fadt = (acpi_fadt_t *) current;
-	current += sizeof(acpi_fadt_t);
-
-	acpi_create_fadt(fadt, facs, dsdt);
-	acpi_add_table(rsdp, fadt);
-
 #if DUMP_ACPI_TABLES == 1
 	printk(BIOS_DEBUG, "rsdp\n");
 	dump_mem(rsdp, ((void *)rsdp) + sizeof(acpi_rsdp_t));