preliminaryDataProcessing.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * SA-1101.h
  3. *
  4. * Copyright (c) Peter Danielsson 1999
  5. *
  6. * Definition of constants related to the sa1101
  7. * support chip for the sa1100
  8. *
  9. */
  10. /* Be sure that virtual mapping is defined right */
  11. #ifndef __ASM_ARCH_HARDWARE_H
  12. #error You must include hardware.h not SA-1101.h
  13. #endif
  14. #ifndef SA1101_BASE
  15. #error You must define SA-1101 physical base address
  16. #endif
  17. #ifndef LANGUAGE
  18. # ifdef __ASSEMBLY__
  19. # define LANGUAGE Assembly
  20. # else
  21. # define LANGUAGE C
  22. # endif
  23. #endif
  24. /*
  25. * We have mapped the sa1101 depending on the value of SA1101_BASE.
  26. * It then appears from 0xf4000000.
  27. */
  28. #define SA1101_p2v( x ) ((x) - SA1101_BASE + 0xf4000000)
  29. #define SA1101_v2p( x ) ((x) - 0xf4000000 + SA1101_BASE)
  30. #ifndef SA1101_p2v
  31. #define SA1101_p2v(PhAdd) (PhAdd)
  32. #endif
  33. #include <mach/bitfield.h>
  34. #define C 0
  35. #define Assembly 1
  36. /*
  37. * Memory map
  38. */
  39. #define __SHMEM_CONTROL0 0x00000000
  40. #define __SYSTEM_CONTROL1 0x00000400
  41. #define __ARBITER 0x00020000
  42. #define __SYSTEM_CONTROL2 0x00040000
  43. #define __SYSTEM_CONTROL3 0x00060000
  44. #define __PARALLEL_PORT 0x00080000
  45. #define __VIDMEM_CONTROL 0x00100000
  46. #define __UPDATE_FIFO 0x00120000
  47. #define __SHMEM_CONTROL1 0x00140000
  48. #define __INTERRUPT_CONTROL 0x00160000
  49. #define __USB_CONTROL 0x00180000
  50. #define __TRACK_INTERFACE 0x001a0000
  51. #define __MOUSE_INTERFACE 0x001b0000
  52. #define __KEYPAD_INTERFACE 0x001c0000
  53. #define __PCMCIA_INTERFACE 0x001e0000
  54. #define __VGA_CONTROL 0x00200000
  55. #define __GPIO_INTERFACE 0x00300000
  56. /*
  57. * Macro that calculates real address for registers in the SA-1101
  58. */
  59. #define _SA1101( x ) ((x) + SA1101_BASE)
  60. /*
  61. * Interface and shared memory controller registers
  62. *
  63. * Registers
  64. * SKCR SA-1101 control register (read/write)
  65. * SMCR Shared Memory Controller Register
  66. * SNPR Snoop Register
  67. */
  68. #define _SKCR _SA1101( 0x00000000 ) /* SA-1101 Control Reg. */
  69. #define _SMCR _SA1101( 0x00140000 ) /* Shared Mem. Control Reg. */
  70. #define _SNPR _SA1101( 0x00140400 ) /* Snoop Reg. */
  71. #if LANGUAGE == C
  72. #define SKCR (*((volatile Word *) SA1101_p2v (_SKCR)))
  73. #define SMCR (*((volatile Word *) SA1101_p2v (_SMCR)))
  74. #define SNPR (*((volatile Word *) SA1101_p2v (_SNPR)))
  75. #define SKCR_PLLEn 0x0001 /* Enable On-Chip PLL */
  76. #define SKCR_BCLKEn 0x0002 /* Enables BCLK */
  77. #define SKCR_Sleep 0x0004 /* Sleep Mode */
  78. #define SKCR_IRefEn 0x0008 /* DAC Iref input enable */
  79. #define SKCR_VCOON 0x0010 /* VCO bias */
  80. #define SKCR_ScanTestEn 0x0020 /* Enables scan test */
  81. #define SKCR_ClockTestEn 0x0040 /* Enables clock test */
  82. #define SMCR_DCAC Fld(2,0) /* Number of column address bits */
  83. #define SMCR_DRAC Fld(2,2) /* Number of row address bits */
  84. #define SMCR_ArbiterBias 0x0008 /* favor video or USB */
  85. #define SMCR_TopVidMem Fld(4,5) /* Top 4 bits of vidmem addr. */
  86. #define SMCR_ColAdrBits( x ) /* col. addr bits 8..11 */ \
  87. (( (x) - 8 ) << FShft (SMCR_DCAC))
  88. #define SMCR_RowAdrBits( x ) /* row addr bits 9..12 */\
  89. (( (x) - 9 ) << FShft (SMCR_DRAC))
  90. #define SNPR_VFBstart Fld(12,0) /* Video frame buffer addr */
  91. #define SNPR_VFBsize Fld(11,12) /* Video frame buffer size */
  92. #define SNPR_WholeBank (1 << 23) /* Whole bank bit */
  93. #define SNPR_BankSelect Fld(2,27) /* Bank select */
  94. #define SNPR_SnoopEn (1 << 31) /* Enable snoop operation */
  95. #define SNPR_Set_VFBsize( x ) /* set frame buffer size (in kb) */ \
  96. ( (x) << FShft (SNPR_VFBsize))
  97. #define SNPR_Select_Bank(x) /* select bank 0 or 1 */ \
  98. (( (x) + 1 ) << FShft (SNPR_BankSelect ))
  99. #endif /* LANGUAGE == C */
  100. /*
  101. * Video Memory Controller
  102. *
  103. * Registers
  104. * VMCCR Configuration register
  105. * VMCAR VMC address register
  106. * VMCDR VMC data register
  107. *
  108. */