assabet.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:7k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  * linux/include/asm-arm/arch-sa1100/assabet.h
  3.  *
  4.  * Created 2000/06/05 by Nicolas Pitre <nico@cam.org>
  5.  *
  6.  * This file contains the hardware specific definitions for Assabet
  7.  * Only include this file from SA1100-specific files.
  8.  *
  9.  * 2000/05/23 John Dorsey <john+@cs.cmu.edu>
  10.  *      Definitions for Neponset added.
  11.  */
  12. #ifndef __ASM_ARCH_ASSABET_H
  13. #define __ASM_ARCH_ASSABET_H
  14. /* System Configuration Register flags */
  15. #define ASSABET_SCR_SDRAM_LOW (1<<2) /* SDRAM size (low bit) */
  16. #define ASSABET_SCR_SDRAM_HIGH (1<<3) /* SDRAM size (high bit) */
  17. #define ASSABET_SCR_FLASH_LOW (1<<4) /* Flash size (low bit) */
  18. #define ASSABET_SCR_FLASH_HIGH (1<<5) /* Flash size (high bit) */
  19. #define ASSABET_SCR_GFX (1<<8) /* Graphics Accelerator (0 = present) */
  20. #define ASSABET_SCR_SA1111 (1<<9) /* Neponset (0 = present) */
  21. #define ASSABET_SCR_INIT -1
  22. /* Board Control Register */
  23. #define ASSABET_BCR_BASE  0xf1000000
  24. #define ASSABET_BCR (*(volatile unsigned int *)(ASSABET_BCR_BASE))
  25. #define ASSABET_BCR_CF_PWR (1<<0) /* Compact Flash Power (1 = 3.3v, 0 = off) */
  26. #define ASSABET_BCR_CF_RST (1<<1) /* Compact Flash Reset (1 = power up reset) */
  27. #define ASSABET_BCR_GFX_RST (1<<1) /* Graphics Accelerator Reset (0 = hold reset) */
  28. #define ASSABET_BCR_CODEC_RST (1<<2) /* 0 = Holds UCB1300, ADI7171, and UDA1341 in reset */
  29. #define ASSABET_BCR_IRDA_FSEL (1<<3) /* IRDA Frequency select (0 = SIR, 1 = MIR/ FIR) */
  30. #define ASSABET_BCR_IRDA_MD0 (1<<4) /* Range/Power select */
  31. #define ASSABET_BCR_IRDA_MD1 (1<<5) /* Range/Power select */
  32. #define ASSABET_BCR_STEREO_LB (1<<6) /* Stereo Loopback */
  33. #define ASSABET_BCR_CF_BUS_OFF (1<<7) /* Compact Flash bus (0 = on, 1 = off (float)) */
  34. #define ASSABET_BCR_AUDIO_ON (1<<8) /* Audio power on */
  35. #define ASSABET_BCR_LIGHT_ON (1<<9) /* Backlight */
  36. #define ASSABET_BCR_LCD_12RGB (1<<10) /* 0 = 16RGB, 1 = 12RGB */
  37. #define ASSABET_BCR_LCD_ON (1<<11) /* LCD power on */
  38. #define ASSABET_BCR_RS232EN (1<<12) /* RS232 transceiver enable */
  39. #define ASSABET_BCR_LED_RED (1<<13) /* D9 (0 = on, 1 = off) */
  40. #define ASSABET_BCR_LED_GREEN (1<<14) /* D8 (0 = on, 1 = off) */
  41. #define ASSABET_BCR_VIB_ON (1<<15) /* Vibration motor (quiet alert) */
  42. #define ASSABET_BCR_COM_DTR (1<<16) /* COMport Data Terminal Ready */
  43. #define ASSABET_BCR_COM_RTS (1<<17) /* COMport Request To Send */
  44. #define ASSABET_BCR_RAD_WU (1<<18) /* Radio wake up interrupt */
  45. #define ASSABET_BCR_SMB_EN (1<<19) /* System management bus enable */
  46. #define ASSABET_BCR_TV_IR_DEC (1<<20) /* TV IR Decode Enable (not implemented) */
  47. #define ASSABET_BCR_QMUTE (1<<21) /* Quick Mute */
  48. #define ASSABET_BCR_RAD_ON (1<<22) /* Radio Power On */
  49. #define ASSABET_BCR_SPK_OFF (1<<23) /* 1 = Speaker amplifier power off */
  50. extern unsigned long SCR_value;
  51. extern unsigned long BCR_value;
  52. #ifdef CONFIG_SA1100_ASSABET
  53. extern void ASSABET_BCR_frob(unsigned int mask, unsigned int set);
  54. #else
  55. #define ASSABET_BCR_frob(m,s) do { } while (0)
  56. #endif
  57. #define ASSABET_BCR_set(x) ASSABET_BCR_frob((x), (x))
  58. #define ASSABET_BCR_clear(x) ASSABET_BCR_frob((x), 0)
  59. #define ASSABET_BSR_BASE 0xf1000000
  60. #define ASSABET_BSR (*(volatile unsigned int*)(ASSABET_BSR_BASE))
  61. #define ASSABET_BSR_RS232_VALID (1 << 24)
  62. #define ASSABET_BSR_COM_DCD (1 << 25)
  63. #define ASSABET_BSR_COM_CTS (1 << 26)
  64. #define ASSABET_BSR_COM_DSR (1 << 27)
  65. #define ASSABET_BSR_RAD_CTS (1 << 28)
  66. #define ASSABET_BSR_RAD_DSR (1 << 29)
  67. #define ASSABET_BSR_RAD_DCD (1 << 30)
  68. #define ASSABET_BSR_RAD_RI (1 << 31)
  69. /* GPIOs for which the generic definition doesn't say much */
  70. #define ASSABET_GPIO_RADIO_IRQ GPIO_GPIO (14) /* Radio interrupt request  */
  71. #define ASSABET_GPIO_PS_MODE_SYNC GPIO_GPIO (16) /* Power supply mode/sync   */
  72. #define ASSABET_GPIO_STEREO_64FS_CLK GPIO_GPIO (19) /* SSP UDA1341 clock input  */
  73. #define ASSABET_GPIO_CF_IRQ GPIO_GPIO (21) /* CF IRQ   */
  74. #define ASSABET_GPIO_CF_CD GPIO_GPIO (22) /* CF CD */
  75. #define ASSABET_GPIO_CF_BVD2 GPIO_GPIO (24) /* CF BVD */
  76. #define ASSABET_GPIO_GFX_IRQ GPIO_GPIO (24) /* Graphics IRQ */
  77. #define ASSABET_GPIO_CF_BVD1 GPIO_GPIO (25) /* CF BVD */
  78. #define ASSABET_GPIO_BATT_LOW GPIO_GPIO (26) /* Low battery */
  79. #define ASSABET_GPIO_RCLK GPIO_GPIO (26) /* CCLK/2  */
  80. #define ASSABET_IRQ_GPIO_CF_IRQ IRQ_GPIO21
  81. #define ASSABET_IRQ_GPIO_CF_CD IRQ_GPIO22
  82. #define ASSABET_IRQ_GPIO_CF_BVD2 IRQ_GPIO24
  83. #define ASSABET_IRQ_GPIO_CF_BVD1 IRQ_GPIO25
  84. /*
  85.  * Neponset definitions: 
  86.  */
  87. #define NEPONSET_SA1111_BASE (0x40000000)
  88. #define NEPONSET_CPLD_BASE      (0x10000000)
  89. #define Nep_p2v( x )            ((x) - NEPONSET_CPLD_BASE + 0xf3000000)
  90. #define Nep_v2p( x )            ((x) - 0xf3000000 + NEPONSET_CPLD_BASE)
  91. #define _IRR                    0x10000024      /* Interrupt Reason Register */
  92. #define _AUD_CTL                0x100000c0      /* Audio controls (RW)       */
  93. #define _MDM_CTL_0              0x100000b0      /* Modem control 0 (RW)      */
  94. #define _MDM_CTL_1              0x100000b4      /* Modem control 1 (RW)      */
  95. #define _NCR_0                 0x100000a0      /* Control Register (RW)     */
  96. #define _KP_X_OUT               0x10000090      /* Keypad row write (RW)     */
  97. #define _KP_Y_IN                0x10000080      /* Keypad column read (RO)   */
  98. #define _SWPK                   0x10000020      /* Switch pack (RO)          */
  99. #define _WHOAMI                 0x10000000      /* System ID Register (RO)   */
  100. #define _LEDS                   0x10000010      /* LEDs [31:0] (WO)          */
  101. #define IRR                     (*((volatile u_char *) Nep_p2v(_IRR)))
  102. #define AUD_CTL                 (*((volatile u_char *) Nep_p2v(_AUD_CTL)))
  103. #define MDM_CTL_0               (*((volatile u_char *) Nep_p2v(_MDM_CTL_0)))
  104. #define MDM_CTL_1               (*((volatile u_char *) Nep_p2v(_MDM_CTL_1)))
  105. #define NCR_0 (*((volatile u_char *) Nep_p2v(_NCR_0)))
  106. #define KP_X_OUT                (*((volatile u_char *) Nep_p2v(_KP_X_OUT)))
  107. #define KP_Y_IN                 (*((volatile u_char *) Nep_p2v(_KP_Y_IN)))
  108. #define SWPK                    (*((volatile u_char *) Nep_p2v(_SWPK)))
  109. #define WHOAMI                  (*((volatile u_char *) Nep_p2v(_WHOAMI)))
  110. #define LEDS                    (*((volatile Word   *) Nep_p2v(_LEDS)))
  111. #define IRR_ETHERNET (1<<0)
  112. #define IRR_USAR (1<<1)
  113. #define IRR_SA1111 (1<<2)
  114. #define AUD_SEL_1341            (1<<0)
  115. #define AUD_MUTE_1341           (1<<1)
  116. #define MDM_CTL0_RTS1 (1 << 0)
  117. #define MDM_CTL0_DTR1 (1 << 1)
  118. #define MDM_CTL0_RTS2 (1 << 2)
  119. #define MDM_CTL0_DTR2 (1 << 3)
  120. #define MDM_CTL1_CTS1 (1 << 0)
  121. #define MDM_CTL1_DSR1 (1 << 1)
  122. #define MDM_CTL1_DCD1 (1 << 2)
  123. #define MDM_CTL1_CTS2 (1 << 3)
  124. #define MDM_CTL1_DSR2 (1 << 4)
  125. #define MDM_CTL1_DCD2 (1 << 5)
  126. #define NCR_GP01_OFF (1<<0)
  127. #define NCR_TP_PWR_EN (1<<1)
  128. #define NCR_MS_PWR_EN (1<<2)
  129. #define NCR_ENET_OSC_EN (1<<3)
  130. #define NCR_SPI_KB_WK_UP (1<<4)
  131. #define NCR_A0VPP (1<<5)
  132. #define NCR_A1VPP (1<<6)
  133. #ifdef CONFIG_ASSABET_NEPONSET
  134. #define machine_has_neponset()  ((SCR_value & ASSABET_SCR_SA1111) == 0)
  135. #else
  136. #define machine_has_neponset() (0)
  137. #endif
  138. #endif