patch-2.3.49 linux/include/asm-arm/arch-nexuspci/memory.h

Next file: linux/include/asm-arm/arch-nexuspci/system.h
Previous file: linux/include/asm-arm/arch-nexuspci/keyboard.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.48/linux/include/asm-arm/arch-nexuspci/memory.h linux/include/asm-arm/arch-nexuspci/memory.h
@@ -1,7 +1,7 @@
 /*
  * linux/include/asm-arm/arch-nexuspci/memory.h
  *
- * Copyright (c) 1997, 1998 Philip Blundell.
+ * Copyright (c) 1997, 1998, 2000 FutureTV Labs Ltd.
  * Copyright (c) 1999 Russell King
  *
  */
@@ -19,21 +19,22 @@
  */
 #define PAGE_OFFSET	(0xc0000000UL)
 #define PHYS_OFFSET	(0x40000000UL)
+#define BUS_OFFSET	(0xe0000000UL)
 
 /*
- * On NexusPCI, the DRAM is contiguous
+ * DRAM is contiguous
  */
-#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET)
+#define __virt_to_phys(vpage) ((unsigned long)(vpage) - PAGE_OFFSET + PHYS_OFFSET)
+#define __phys_to_virt(ppage) ((unsigned long)(ppage) + PAGE_OFFSET - PHYS_OFFSET)
 #define __virt_to_phys__is_a_macro
 #define __phys_to_virt__is_a_macro
 
 /*
- * On the PCI bus the DRAM appears at address 0
+ * On the PCI bus the DRAM appears at address 0xe0000000
  */
 #define __virt_to_bus__is_a_macro
-#define __virt_to_bus(x) ((x) - PAGE_OFFSET)
+#define __virt_to_bus(x) ((unsigned long)(x) - PAGE_OFFSET + BUS_OFFSET)
 #define __bus_to_virt__is_a_macro
-#define __bus_to_virt(x) ((x) + PAGE_OFFSET)
+#define __bus_to_virt(x) ((unsigned long)(x) + PAGE_OFFSET - BUS_OFFSET)
 
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)