]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/kernel/head.S
Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[linux-2.6-omap-h63xx.git] / arch / arm / kernel / head.S
index bda0748ffb004b31bb66e5a234091c6fe01fd9fd..cf495a3084b31f8a7ead7089508ff16096864ae9 100644 (file)
 #include <asm/thread_info.h>
 #include <asm/system.h>
 
-#define KERNEL_RAM_ADDR        (PAGE_OFFSET + TEXT_OFFSET)
+#if (PHYS_OFFSET & 0x001fffff)
+#error "PHYS_OFFSET must be at an even 2MiB boundary!"
+#endif
+
+#define KERNEL_RAM_VADDR       (PAGE_OFFSET + TEXT_OFFSET)
+#define KERNEL_RAM_PADDR       (PHYS_OFFSET + TEXT_OFFSET)
 
 /*
  * swapper_pg_dir is the virtual address of the initial page table.
- * We place the page tables 16K below KERNEL_RAM_ADDR.  Therefore, we must
- * make sure that KERNEL_RAM_ADDR is correctly set.  Currently, we expect
+ * We place the page tables 16K below KERNEL_RAM_VADDR.  Therefore, we must
+ * make sure that KERNEL_RAM_VADDR is correctly set.  Currently, we expect
  * the least significant 16 bits to be 0x8000, but we could probably
- * relax this restriction to KERNEL_RAM_ADDR >= PAGE_OFFSET + 0x4000.
+ * relax this restriction to KERNEL_RAM_VADDR >= PAGE_OFFSET + 0x4000.
  */
-#if (KERNEL_RAM_ADDR & 0xffff) != 0x8000
-#error KERNEL_RAM_ADDR must start at 0xXXXX8000
+#if (KERNEL_RAM_VADDR & 0xffff) != 0x8000
+#error KERNEL_RAM_VADDR must start at 0xXXXX8000
 #endif
 
        .globl  swapper_pg_dir
-       .equ    swapper_pg_dir, KERNEL_RAM_ADDR - 0x4000
+       .equ    swapper_pg_dir, KERNEL_RAM_VADDR - 0x4000
 
        .macro  pgtbl, rd
-       ldr     \rd, =(__virt_to_phys(KERNEL_RAM_ADDR - 0x4000))
+       ldr     \rd, =(KERNEL_RAM_PADDR - 0x4000)
        .endm
 
 #ifdef CONFIG_XIP_KERNEL
 #define TEXTADDR  XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR)
 #else
-#define TEXTADDR  KERNEL_RAM_ADDR
+#define TEXTADDR  KERNEL_RAM_VADDR
 #endif
 
 /*
@@ -250,7 +255,8 @@ __create_page_tables:
         * Then map first 1MB of ram in case it contains our boot params.
         */
        add     r0, r4, #PAGE_OFFSET >> 18
-       orr     r6, r7, #PHYS_OFFSET
+       orr     r6, r7, #(PHYS_OFFSET & 0xff000000)
+       orr     r6, r6, #(PHYS_OFFSET & 0x00e00000)
        str     r6, [r0]
 
 #ifdef CONFIG_XIP_KERNEL