Subject: Re: AMD Geode GX reboot workaround
To: Juan RP <juan@xtrarom.org>
From: Allen Briggs <briggs@netbsd.org>
List: tech-kern
Date: 06/26/2007 13:57:58
On Tue, Jun 26, 2007 at 07:33:58PM +0200, Juan RP wrote:
> Can anyone explain why this patch works? and how to fix it properly?

For starters, I don't think this patch does what you think it does.

Index: machdep.c 
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/machdep.c,v
retrieving revision 1.603
diff -b -u -r1.603 machdep.c
--- machdep.c   17 May 2007 14:51:21 -0000      1.603
+++ machdep.c   26 Jun 2007 17:00:27 -0000
@@ -1632,6 +1632,11 @@
                                    bim->entry[x].type);
                                add_mem_cluster(0x100000, seg_end,
                                    bim->entry[x].type);
+                       } else if (seg_start < 0x6ffffff && seg_end > 0x6fffff) {

This covers a pretty large range of memory.  Is that the intent, or did
you mean to have another 'f' on the end of the last constant there?

+                               add_mem_cluster(seg_start, 0x6ffb00,
+                                   bim->entry[x].type);
+                               add_mem_cluster(0x710000, seg_end,
+                                   bim->entry[x].type);

And are these meant to match the ranges in the memory maps that you took
pictures of?  If so, you're missing a nibble.

                        } else
                                add_mem_cluster(seg_start, seg_end,
                                    bim->entry[x].type);

I wonder if you've tried skipping the ACPI NVS region (by adjusting the
switch above this section to continue for BIM_NVS).

-allen

-- 
Allen Briggs  |  http://www.ninthwonder.com/~briggs/  |  briggs@ninthwonder.com