memory.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * linux/include/asm-arm/arch-iop3xx/memory.h
  3. */
  4. #ifndef __ASM_ARCH_MEMORY_H
  5. #define __ASM_ARCH_MEMORY_H
  6. #include <asm/hardware.h>
  7. /*
  8. * Physical DRAM offset.
  9. */
  10. #ifndef CONFIG_ARCH_IOP331
  11. #define PHYS_OFFSET UL(0xa0000000)
  12. #else
  13. #define PHYS_OFFSET UL(0x00000000)
  14. #endif
  15. /*
  16. * Virtual view <-> PCI DMA view memory address translations
  17. * virt_to_bus: Used to translate the virtual address to an
  18. * address suitable to be passed to set_dma_addr
  19. * bus_to_virt: Used to convert an address for DMA operations
  20. * to an address that the kernel can use.
  21. */
  22. #if defined(CONFIG_ARCH_IOP321)
  23. #define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP321_IATVR2)) | ((*IOP321_IABAR2) & 0xfffffff0))
  24. #define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP321_IALR2)) | ( *IOP321_IATVR2)))
  25. #elif defined(CONFIG_ARCH_IOP331)
  26. #define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP331_IATVR2)) | ((*IOP331_IABAR2) & 0xfffffff0))
  27. #define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP331_IALR2)) | ( *IOP331_IATVR2)))
  28. #endif
  29. #endif