memory.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * linux/include/asm-arm/arch-ixp4xx/memory.h
  3. *
  4. * Copyright (c) 2001-2004 MontaVista Software, Inc.
  5. */
  6. #ifndef __ASM_ARCH_MEMORY_H
  7. #define __ASM_ARCH_MEMORY_H
  8. #include <asm/sizes.h>
  9. /*
  10. * Physical DRAM offset.
  11. */
  12. #define PHYS_OFFSET (0x00000000UL)
  13. #ifndef __ASSEMBLY__
  14. /*
  15. * Only first 64MB of memory can be accessed via PCI.
  16. * We use GFP_DMA to allocate safe buffers to do map/unmap.
  17. * This is really ugly and we need a better way of specifying
  18. * DMA-capable regions of memory.
  19. */
  20. static inline void __arch_adjust_zones(int node, unsigned long *zone_size,
  21. unsigned long *zhole_size)
  22. {
  23. unsigned int sz = SZ_64M >> PAGE_SHIFT;
  24. /*
  25. * Only adjust if > 64M on current system
  26. */
  27. if (node || (zone_size[0] <= sz))
  28. return;
  29. zone_size[1] = zone_size[0] - sz;
  30. zone_size[0] = sz;
  31. zhole_size[1] = zhole_size[0];
  32. zhole_size[0] = 0;
  33. }
  34. #define arch_adjust_zones(node, size, holes) \
  35. __arch_adjust_zones(node, size, holes)
  36. #define ISA_DMA_THRESHOLD (SZ_64M - 1)
  37. #endif
  38. /*
  39. * Virtual view <-> DMA view memory address translations
  40. * virt_to_bus: Used to translate the virtual address to an
  41. * address suitable to be passed to set_dma_addr
  42. * bus_to_virt: Used to convert an address for DMA operations
  43. * to an address that the kernel can use.
  44. *
  45. * These are dummies for now.
  46. */
  47. #define __virt_to_bus(x) __virt_to_phys(x)
  48. #define __bus_to_virt(x) __phys_to_virt(x)
  49. #endif