* [PATCH] Always include PHYS_OFFSET in PAGE_OFFSET
@ 2007-03-19 15:59 Franck Bui-Huu
2007-03-20 16:21 ` Franck Bui-Huu
0 siblings, 1 reply; 2+ messages in thread
From: Franck Bui-Huu @ 2007-03-19 15:59 UTC (permalink / raw)
To: Ralf Baechle; +Cc: mbizon, post, linux-mips
From: Franck Bui-Huu <fbuihuu@gmail.com>
For platforms that use PHYS_OFFSET and do not use a mapped kernel,
this patch automatically adds PHYS_OFFSET into PAGE_OFFSET.
Therefore for these platforms there are no more needs to change
PAGE_OFFSET.
For mapped kernel, they need to redefine PAGE_OFFSET anyways.
Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
---
Maxime,
Could you give a try to this patch ? It removes the need to
change your PAGE_OFFSET. If I remember correctly it's now
0x90000000, and you should be able to restore back to
0x80000000.
Franck
include/asm-mips/mach-generic/spaces.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/asm-mips/mach-generic/spaces.h b/include/asm-mips/mach-generic/spaces.h
index 0ae9997..600561f 100644
--- a/include/asm-mips/mach-generic/spaces.h
+++ b/include/asm-mips/mach-generic/spaces.h
@@ -22,7 +22,7 @@
* This handles the memory map.
* We handle pages at KSEG0 for kernels with 32 bit address space.
*/
-#define PAGE_OFFSET 0x80000000UL
+#define PAGE_OFFSET (0x80000000UL + PHYS_OFFSET)
/*
* Memory above this physical address will be considered highmem.
@@ -39,9 +39,9 @@
* This handles the memory map.
*/
#ifdef CONFIG_DMA_NONCOHERENT
-#define PAGE_OFFSET 0x9800000000000000UL
+#define PAGE_OFFSET (0x9800000000000000UL + PHYS_OFFSET)
#else
-#define PAGE_OFFSET 0xa800000000000000UL
+#define PAGE_OFFSET (0xa800000000000000UL + PHYS_OFFSET)
#endif
/*
--
1.4.4.3.ge6d4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Always include PHYS_OFFSET in PAGE_OFFSET
2007-03-19 15:59 [PATCH] Always include PHYS_OFFSET in PAGE_OFFSET Franck Bui-Huu
@ 2007-03-20 16:21 ` Franck Bui-Huu
0 siblings, 0 replies; 2+ messages in thread
From: Franck Bui-Huu @ 2007-03-20 16:21 UTC (permalink / raw)
To: Ralf Baechle; +Cc: mbizon, post, linux-mips
Ralf,
On 3/19/07, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> From: Franck Bui-Huu <fbuihuu@gmail.com>
>
> For platforms that use PHYS_OFFSET and do not use a mapped kernel,
> this patch automatically adds PHYS_OFFSET into PAGE_OFFSET.
> Therefore for these platforms there are no more needs to change
> PAGE_OFFSET.
>
This patch is actually useless. I didn't notice that spaces.h must be
totaly rewritten by platforms when they need to customize one value.
Why, I dunno ?
Why not doing something like:
-- >8 --
diff --git a/include/asm-mips/mach-generic/spaces.h
b/include/asm-mips/mach-generic/spaces.h
index 0ae9997..beec80e 100644
--- a/include/asm-mips/mach-generic/spaces.h
+++ b/include/asm-mips/mach-generic/spaces.h
@@ -16,13 +16,18 @@
#define CAC_BASE 0x80000000
#define IO_BASE 0xa0000000
#define UNCAC_BASE 0xa0000000
+
+#ifndef MAP_BASE
#define MAP_BASE 0xc0000000
+#endif
/*
* This handles the memory map.
* We handle pages at KSEG0 for kernels with 32 bit address space.
*/
+#ifndef PAGE_OFFSET
#define PAGE_OFFSET 0x80000000UL
+#endif
/*
* Memory above this physical address will be considered highmem.
@@ -38,11 +43,13 @@
/*
* This handles the memory map.
*/
+#ifndef PAGE_OFFSET
#ifdef CONFIG_DMA_NONCOHERENT
#define PAGE_OFFSET 0x9800000000000000UL
#else
#define PAGE_OFFSET 0xa800000000000000UL
#endif
+#endif
/*
* Memory above this physical address will be considered highmem.
-- >8 --
and doing in platform's spaces.h:
[ redefine a couple of constants]
#include <asm/mach-generic/spaces.h>
AFAIK, {CAC,UNCAC,IO}_BASE are likely to be the same for all platforms, no ?
Does that need some cleanup ? if so I'm your man ;)
--
Franck
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-20 16:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-19 15:59 [PATCH] Always include PHYS_OFFSET in PAGE_OFFSET Franck Bui-Huu
2007-03-20 16:21 ` Franck Bui-Huu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox