normalDataOperation.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * linux/arch/alpha/kernel/core_t2.c
  3. *
  4. * Written by Jay A Estabrook (jestabro@amt.tay1.dec.com).
  5. * December 1996.
  6. *
  7. * based on CIA code by David A Rusling (david.rusling@reo.mts.dec.com)
  8. *
  9. * Code common to all T2 core logic chips.
  10. */
  11. #define __EXTERN_INLINE
  12. #include <asm/io.h>
  13. #include <asm/core_t2.h>
  14. #undef __EXTERN_INLINE
  15. #include <linux/types.h>
  16. #include <linux/pci.h>
  17. #include <linux/sched.h>
  18. #include <linux/init.h>
  19. #include <asm/ptrace.h>
  20. #include <asm/delay.h>
  21. #include <asm/mce.h>
  22. #include "proto.h"
  23. #include "pci_impl.h"
  24. /* For dumping initial DMA window settings. */
  25. #define DEBUG_PRINT_INITIAL_SETTINGS 0
  26. /* For dumping final DMA window settings. */
  27. #define DEBUG_PRINT_FINAL_SETTINGS 0
  28. /*
  29. * By default, we direct-map starting at 2GB, in order to allow the
  30. * maximum size direct-map window (2GB) to match the maximum amount of
  31. * memory (2GB) that can be present on SABLEs. But that limits the
  32. * floppy to DMA only via the scatter/gather window set up for 8MB
  33. * ISA DMA, since the maximum ISA DMA address is 2GB-1.
  34. *
  35. * For now, this seems a reasonable trade-off: even though most SABLEs
  36. * have less than 1GB of memory, floppy usage/performance will not
  37. * really be affected by forcing it to go via scatter/gather...
  38. */
  39. #define T2_DIRECTMAP_2G 1
  40. #if T2_DIRECTMAP_2G
  41. # define T2_DIRECTMAP_START 0x80000000UL
  42. # define T2_DIRECTMAP_LENGTH 0x80000000UL
  43. #else
  44. # define T2_DIRECTMAP_START 0x40000000UL
  45. # define T2_DIRECTMAP_LENGTH 0x40000000UL
  46. #endif
  47. /* The ISA scatter/gather window settings. */
  48. #define T2_ISA_SG_START 0x00800000UL
  49. #define T2_ISA_SG_LENGTH 0x00800000UL
  50. /*
  51. * NOTE: Herein lie back-to-back mb instructions. They are magic.
  52. * One plausible explanation is that the i/o controller does not properly
  53. * handle the system transaction. Another involves timing. Ho hum.
  54. */
  55. /*
  56. * BIOS32-style PCI interface:
  57. */
  58. #define DEBUG_CONFIG 0
  59. #if DEBUG_CONFIG
  60. # define DBG(args) printk args
  61. #else
  62. # define DBG(args)
  63. #endif
  64. static volatile unsigned int t2_mcheck_any_expected;
  65. static volatile unsigned int t2_mcheck_last_taken;
  66. /* Place to save the DMA Window registers as set up by SRM
  67. for restoration during shutdown. */
  68. static struct
  69. {
  70. struct {
  71. unsigned long wbase;
  72. unsigned long wmask;
  73. unsigned long tbase;
  74. } window[2];
  75. unsigned long hae_1;
  76. unsigned long hae_2;
  77. unsigned long hae_3;
  78. unsigned long hae_4;
  79. unsigned long hbase;
  80. } t2_saved_config __attribute((common));