On Tue, 2007-03-06 at 22:39 +0100, Franck Bui-Huu wrote:
> - set PAGE_OFFSET to 0x90000000.
>
> You said that you already tried the second solution but it fails. I
> don't see why though...
Ok that makes sense for me now.
Though on the opposite of other arch, on 32bits mips you will always
have PAGE_OFFSET == PHYS_OFFSET + 0x80000000 because of fixed KSEG.
Making it possible to change both confused me.
I found the problem, I think these two liners are missing from your
patch. My board now works correctly, with 2MB more free memory, thanks
for this ! (and for the free tour in mm/ ;)
Commit 6f284a2ce7b8bc49cb8455b1763357897a899abb introduced PHYS_OFFSET,
but missed some virtual to physical address conversion. The following
patch fixes it.
Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
--- linux-2.6.20/include/asm-mips/pgtable.h 2007-02-04 21:22:45.000000000
+0100
+++ linux/include/asm-mips/pgtable.h 2007-03-07 17:28:20.000000000 +0100
@@ -75,7 +75,7 @@
* Conversion functions: convert a page and protection to a page entry,
* and a page entry and page directory to the page they refer to.
*/
-#define pmd_phys(pmd) (pmd_val(pmd) - PAGE_OFFSET)
+#define pmd_phys(pmd) (pmd_val(pmd) - PAGE_OFFSET + PHYS_OFFSET)
#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
#define pmd_page_vaddr(pmd) pmd_val(pmd)
--- linux-2.6.20/include/asm-mips/pgtable-64.h 2007-02-04 21:22:45.000000000
+0100
+++ linux/include/asm-mips/pgtable-64.h 2007-03-07 17:28:47.000000000 +0100
@@ -199,7 +199,7 @@
{
return pud_val(pud);
}
-#define pud_phys(pud) (pud_val(pud) - PAGE_OFFSET)
+#define pud_phys(pud) (pud_val(pud) - PAGE_OFFSET + PHYS_OFFSET)
#define pud_page(pud) (pfn_to_page(pud_phys(pud) >> PAGE_SHIFT))
/* Find an entry in the second-level page table.. */
--
Maxime
|