dataSynchronizationMemory.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * linux/arch/alpha/kernel/core_tsunami.c
  3. *
  4. * Based on code written by David A. Rusling (david.rusling@reo.mts.dec.com).
  5. *
  6. * Code common to all TSUNAMI core logic chips.
  7. */
  8. #define __EXTERN_INLINE inline
  9. #include <asm/io.h>
  10. #include <asm/core_tsunami.h>
  11. #undef __EXTERN_INLINE
  12. #include <linux/module.h>
  13. #include <linux/types.h>
  14. #include <linux/pci.h>
  15. #include <linux/sched.h>
  16. #include <linux/init.h>
  17. #include <linux/bootmem.h>
  18. #include <asm/ptrace.h>
  19. #include <asm/smp.h>
  20. #include <asm/vga.h>
  21. #include "proto.h"
  22. #include "pci_impl.h"
  23. /* Save Tsunami configuration data as the console had it set up. */
  24. struct
  25. {
  26. unsigned long wsba[4];
  27. unsigned long wsm[4];
  28. unsigned long tba[4];
  29. } saved_config[2] __attribute__((common));
  30. /*
  31. * NOTE: Herein lie back-to-back mb instructions. They are magic.
  32. * One plausible explanation is that the I/O controller does not properly
  33. * handle the system transaction. Another involves timing. Ho hum.
  34. */
  35. /*
  36. * BIOS32-style PCI interface:
  37. */
  38. #define DEBUG_CONFIG 0
  39. #if DEBUG_CONFIG
  40. # define DBG_CFG(args) printk args
  41. #else
  42. # define DBG_CFG(args)
  43. #endif
  44. /*
  45. * Given a bus, device, and function number, compute resulting
  46. * configuration space address
  47. * accordingly. It is therefore not safe to have concurrent
  48. * invocations to configuration space access routines, but there
  49. * really shouldn't be any need for this.
  50. *
  51. * Note that all config space accesses use Type 1 address format.
  52. *
  53. * Note also that type 1 is determined by non-zero bus number.
  54. *
  55. * Type 1:
  56. *
  57. * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1
  58. * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0
  59. * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  60. * | | | | | | | | | | |B|B|B|B|B|B|B|B|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|1|
  61. * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  62. *
  63. * 31:24 reserved
  64. * 23:16 bus number (8 bits = 128 possible buses)
  65. * 15:11 Device number (5 bits)
  66. * 10:8 function number
  67. * 7:2 register number
  68. *
  69. * Notes:
  70. * The function number selects which function of a multi-function device
  71. * (e.g., SCSI and Ethernet).
  72. *
  73. * The register selects a DWORD (32 bit) register offset. Hence it
  74. * doesn't get shifted by 2 bits as we want to "drop" the bottom two