diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-12-13 19:39:35 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-12-13 19:39:35 +0000 |
commit | fc7736688b046f91170591625b38f12a839ba994 (patch) | |
tree | e7198a9fabfcea785cbb16375455dbdb6aa9871b /arch/arm/mach-ixp23xx/include/mach/memory.h | |
parent | bc7ecbcbc2c0ff235382077b55de7896775afc16 (diff) | |
parent | 9074e144c10cba5d6bb6b326a8be5347d38e4473 (diff) | |
download | talos-op-linux-fc7736688b046f91170591625b38f12a839ba994.tar.gz talos-op-linux-fc7736688b046f91170591625b38f12a839ba994.zip |
Merge branch 'master' into devel
Diffstat (limited to 'arch/arm/mach-ixp23xx/include/mach/memory.h')
-rw-r--r-- | arch/arm/mach-ixp23xx/include/mach/memory.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/arm/mach-ixp23xx/include/mach/memory.h b/arch/arm/mach-ixp23xx/include/mach/memory.h index fdd138706c70..94a3a86cfeb8 100644 --- a/arch/arm/mach-ixp23xx/include/mach/memory.h +++ b/arch/arm/mach-ixp23xx/include/mach/memory.h @@ -19,16 +19,15 @@ */ #define PHYS_OFFSET (0x00000000) -#define __virt_to_bus(v) \ - ({ unsigned int ret; \ - ret = ((__virt_to_phys(v) - 0x00000000) + \ - (*((volatile int *)IXP23XX_PCI_SDRAM_BAR) & 0xfffffff0)); \ - ret; }) - -#define __bus_to_virt(b) \ - ({ unsigned int data; \ - data = *((volatile int *)IXP23XX_PCI_SDRAM_BAR); \ - __phys_to_virt((((b - (data & 0xfffffff0)) + 0x00000000))); }) +#define IXP23XX_PCI_SDRAM_OFFSET (*((volatile int *)IXP23XX_PCI_SDRAM_BAR) & 0xfffffff0)) + +#define __phys_to_bus(x) ((x) + (IXP23XX_PCI_SDRAM_OFFSET - PHYS_OFFSET)) +#define __bus_to_phys(x) ((x) - (IXP23XX_PCI_SDRAM_OFFSET - PHYS_OFFSET)) + +#define __virt_to_bus(v) __phys_to_bus(__virt_to_phys(v)) +#define __bus_to_virt(b) __phys_to_virt(__bus_to_phys(b)) +#define __pfn_to_bus(p) __phys_to_bus(__pfn_to_phys(p)) +#define __bus_to_pfn(b) __phys_to_pfn(__bus_to_phys(b)) #define arch_is_coherent() 1 |