currentMemoryDefinition.h 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #ifndef __ALPHA_APECS__H__
  2. #define __ALPHA_APECS__H__
  3. #include <linux/types.h>
  4. #include <asm/compiler.h>
  5. /*
  6. * APECS is the internal name for the 2107x chipset which provides
  7. * memory controller and PCI access for the 21064 chip based systems.
  8. *
  9. * This file is based on:
  10. *
  11. * DECchip 21071-AA and DECchip 21072-AA Core Logic Chipsets
  12. * Data Sheet
  13. *
  14. * EC-N0648-72
  15. *
  16. *
  17. * david.rusling@reo.mts.dec.com Initial Version.
  18. *
  19. */
  20. /*
  21. An AVANTI *might* be an XL, and an XL has only 27 bits of ISA address
  22. that get passed through the PCI<->ISA bridge chip. So we've gotta use
  23. both windows to max out the physical memory we can DMA to. Sigh...
  24. If we try a window at 0 for 1GB as a work-around, we run into conflicts
  25. with ISA/PCI bus memory which can't be relocated, like VGA aperture and
  26. BIOS ROMs. So we must put the windows high enough to avoid these areas.
  27. We put window 1 at BUS 64Mb for 64Mb, mapping physical 0 to 64Mb-1,
  28. and window 2 at BUS 1Gb for 1Gb, mapping physical 0 to 1Gb-1.
  29. Yes, this does map 0 to 64Mb-1 twice, but only window 1 will actually
  30. be used for that range (via virt_to_bus()).
  31. Note that we actually fudge the window 1 maximum as 48Mb instead of 64Mb,
  32. to keep virt_to_bus() from returning an address in the first window, for
  33. a data area that goes beyond the 64Mb first DMA window. Sigh...
  34. The fudge factor MUST match with <asm/dma.h> MAX_DMA_ADDRESS, but
  35. we can't just use that here, because of header file looping... :-(
  36. Window 1 will be used for all DMA from the ISA bus; yes, that does
  37. limit what memory an ISA floppy or sound card or Ethernet can touch, but
  38. it's also a known limitation on other platforms as well. We use the
  39. same technique that is used on INTEL platforms with similar limitation:
  40. set MAX_DMA_ADDRESS and clear some pages' DMAable flags during mem_init().
  41. We trust that any ISA bus device drivers will *always* ask for DMAable
  42. memory explicitly via kmalloc()/get_free_pages() flags arguments.
  43. Note that most PCI bus devices' drivers do *not* explicitly ask for
  44. DMAable memory; they count on being able to DMA to any memory they
  45. get from kmalloc()/get_free_pages(). They will also use window 1 for
  46. any physical memory accesses below 64Mb; the rest will be handled by
  47. window 2, maxing out at 1Gb of memory. I trust this is enough... :-)
  48. We hope that the area before the first window is large enough so that
  49. there will be no overlap at the top end (64Mb). We *must* locate the
  50. PCI cards' memory just below window 1, so that there's still the
  51. possibility of being able to access it via SPARSE space. This is
  52. important for cards such as the Matrox Millennium, whose Xserver
  53. wants to access memory-mapped registers in byte and short lengths.
  54. Note that the XL is treated differently from the AVANTI, even though
  55. for most other things they are identical. It didn't seem reasonable to
  56. make the AVANTI support pay for the limitations of the XL. It is true,
  57. however, that an XL kernel will run on an AVANTI without problems.
  58. %%% All of this should be obviated by the ability to route
  59. everything through the iommu.
  60. */
  61. /*
  62. * 21071-DA Control and Status registers.
  63. * These are used for PCI memory access.
  64. */
  65. #define APECS_IOC_DCSR (IDENT_ADDR + 0x1A0000000UL)
  66. #define APECS_IOC_PEAR (IDENT_ADDR + 0x1A0000020UL)
  67. #define APECS_IOC_SEAR (IDENT_ADDR + 0x1A0000040UL)
  68. #define APECS_IOC_DR1 (IDENT_ADDR + 0x1A0000060UL)
  69. #define APECS_IOC_DR2 (IDENT_ADDR + 0x1A0000080UL)
  70. #define APECS_IOC_DR3 (IDENT_ADDR + 0x1A00000A0UL)
  71. #define APECS_IOC_TB1R (IDENT_ADDR + 0x1A00000C0UL)
  72. #define APECS_IOC_TB2R (IDENT_ADDR + 0x1A00000E0UL)
  73. #define APECS_IOC_PB1R (IDENT_ADDR + 0x1A0000100UL)
  74. #define APECS_IOC_PB2R (IDENT_ADDR + 0x1A0000120UL)
  75. #define APECS_IOC_PM1R (IDENT_ADDR + 0x1A0000140UL)
  76. #define APECS_IOC_PM2R (IDENT_ADDR + 0x1A0000160UL)
  77. #define APECS_IOC_HAXR0 (IDENT_ADDR + 0x1A0000180UL)
  78. #define APECS_IOC_HAXR1 (IDENT_ADDR + 0x1A00001A0UL)
  79. #define APECS_IOC_HAXR2 (IDENT_ADDR + 0x1A00001C0UL)
  80. #define APECS_IOC_PMLT (IDENT_ADDR + 0x1A00001E0UL)