memory.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * arch/arm/mach-footbridge/include/mach/memory.h
  3. *
  4. * Copyright (C) 1996-1999 Russell King.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * Changelog:
  11. * 20-Oct-1996 RMK Created
  12. * 31-Dec-1997 RMK Fixed definitions to reduce warnings.
  13. * 17-May-1998 DAG Added __virt_to_bus and __bus_to_virt functions.
  14. * 21-Nov-1998 RMK Changed __virt_to_bus and __bus_to_virt to macros.
  15. * 21-Mar-1999 RMK Added PAGE_OFFSET for co285 architecture.
  16. * Renamed to memory.h
  17. * Moved PAGE_OFFSET and TASK_SIZE here
  18. */
  19. #ifndef __ASM_ARCH_MEMORY_H
  20. #define __ASM_ARCH_MEMORY_H
  21. #if defined(CONFIG_FOOTBRIDGE_ADDIN)
  22. /*
  23. * If we may be using add-in footbridge mode, then we must
  24. * use the out-of-line translation that makes use of the
  25. * PCI BAR
  26. */
  27. #ifndef __ASSEMBLY__
  28. extern unsigned long __virt_to_bus(unsigned long);
  29. extern unsigned long __bus_to_virt(unsigned long);
  30. extern unsigned long __pfn_to_bus(unsigned long);
  31. extern unsigned long __bus_to_pfn(unsigned long);
  32. #endif
  33. #define __virt_to_bus __virt_to_bus
  34. #define __bus_to_virt __bus_to_virt
  35. #elif defined(CONFIG_FOOTBRIDGE_HOST)
  36. /*
  37. * The footbridge is programmed to expose the system RAM at 0xe0000000.
  38. * The requirement is that the RAM isn't placed at bus address 0, which
  39. * would clash with VGA cards.
  40. */
  41. #define BUS_OFFSET 0xe0000000
  42. #define __virt_to_bus(x) ((x) + (BUS_OFFSET - PAGE_OFFSET))
  43. #define __bus_to_virt(x) ((x) - (BUS_OFFSET - PAGE_OFFSET))
  44. #define __pfn_to_bus(x) (__pfn_to_phys(x) + (BUS_OFFSET - PHYS_OFFSET))
  45. #define __bus_to_pfn(x) __phys_to_pfn((x) - (BUS_OFFSET - PHYS_OFFSET))
  46. #else
  47. #error "Undefined footbridge mode"
  48. #endif
  49. /*
  50. * Cache flushing area.
  51. */
  52. #define FLUSH_BASE 0xf9000000
  53. /*
  54. * Physical DRAM offset.
  55. */
  56. #define PLAT_PHYS_OFFSET UL(0x00000000)
  57. #define FLUSH_BASE_PHYS 0x50000000
  58. #endif