Path: blob/master/arch/arm/mach-ks8695/include/mach/memory.h
15159 views
/*1* arch/arm/mach-ks8695/include/mach/memory.h2*3* Copyright (C) 2006 Andrew Victor4*5* KS8695 Memory definitions6*7* This file is licensed under the terms of the GNU General Public8* License version 2. This program is licensed "as is" without any9* warranty of any kind, whether express or implied.10*/1112#ifndef __ASM_ARCH_MEMORY_H13#define __ASM_ARCH_MEMORY_H1415#include <mach/hardware.h>1617/*18* Physical SRAM offset.19*/20#define PLAT_PHYS_OFFSET KS8695_SDRAM_PA2122#ifndef __ASSEMBLY__2324#ifdef CONFIG_PCI2526/* PCI mappings */27#define __virt_to_bus(x) ((x) - PAGE_OFFSET + KS8695_PCIMEM_PA)28#define __bus_to_virt(x) ((x) - KS8695_PCIMEM_PA + PAGE_OFFSET)2930/* Platform-bus mapping */31extern struct bus_type platform_bus_type;32#define is_lbus_device(dev) (dev && dev->bus == &platform_bus_type)33#define __arch_dma_to_virt(dev, x) ({ (void *) (is_lbus_device(dev) ? \34__phys_to_virt(x) : __bus_to_virt(x)); })35#define __arch_virt_to_dma(dev, x) ({ is_lbus_device(dev) ? \36(dma_addr_t)__virt_to_phys(x) : (dma_addr_t)__virt_to_bus(x); })37#define __arch_pfn_to_dma(dev, pfn) \38({ dma_addr_t __dma = __pfn_to_phys(pfn); \39if (!is_lbus_device(dev)) \40__dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \41__dma; })4243#define __arch_dma_to_pfn(dev, x) \44({ dma_addr_t __dma = x; \45if (!is_lbus_device(dev)) \46__dma += PHYS_OFFSET - KS8695_PCIMEM_PA; \47__phys_to_pfn(__dma); \48})4950#endif5152#endif5354#endif555657