vr41xx.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * include/asm-mips/vr41xx/vr41xx.h
  3. *
  4. * Include file for NEC VR4100 series.
  5. *
  6. * Copyright (C) 1999 Michael Klar
  7. * Copyright (C) 2001, 2002 Paul Mundt
  8. * Copyright (C) 2002 MontaVista Software, Inc.
  9. * Copyright (C) 2002 TimeSys Corp.
  10. * Copyright (C) 2003-2008 Yoichi Yuasa <yuasa@linux-mips.org>
  11. *
  12. * This program is free software; you can redistribute it and/or modify it
  13. * under the terms of the GNU General Public License as published by the
  14. * Free Software Foundation; either version 2 of the License, or (at your
  15. * option) any later version.
  16. */
  17. #ifndef __NEC_VR41XX_H
  18. #define __NEC_VR41XX_H
  19. #include <linux/interrupt.h>
  20. /*
  21. * CPU Revision
  22. */
  23. /* VR4122 0x00000c70-0x00000c72 */
  24. #define PRID_VR4122_REV1_0 0x00000c70
  25. #define PRID_VR4122_REV2_0 0x00000c70
  26. #define PRID_VR4122_REV2_1 0x00000c70
  27. #define PRID_VR4122_REV3_0 0x00000c71
  28. #define PRID_VR4122_REV3_1 0x00000c72
  29. /* VR4181A 0x00000c73-0x00000c7f */
  30. #define PRID_VR4181A_REV1_0 0x00000c73
  31. #define PRID_VR4181A_REV1_1 0x00000c74
  32. /* VR4131 0x00000c80-0x00000c83 */
  33. #define PRID_VR4131_REV1_2 0x00000c80
  34. #define PRID_VR4131_REV2_0 0x00000c81
  35. #define PRID_VR4131_REV2_1 0x00000c82
  36. #define PRID_VR4131_REV2_2 0x00000c83
  37. /* VR4133 0x00000c84- */
  38. #define PRID_VR4133 0x00000c84
  39. /*
  40. * Bus Control Uint
  41. */
  42. extern unsigned long vr41xx_calculate_clock_frequency(void);
  43. extern unsigned long vr41xx_get_vtclock_frequency(void);
  44. extern unsigned long vr41xx_get_tclock_frequency(void);
  45. /*
  46. * Clock Mask Unit
  47. */
  48. typedef enum {
  49. PIU_CLOCK,
  50. SIU_CLOCK,
  51. AIU_CLOCK,
  52. KIU_CLOCK,
  53. FIR_CLOCK,
  54. DSIU_CLOCK,
  55. CSI_CLOCK,
  56. PCIU_CLOCK,
  57. HSP_CLOCK,
  58. PCI_CLOCK,
  59. CEU_CLOCK,
  60. ETHER0_CLOCK,
  61. ETHER1_CLOCK
  62. } vr41xx_clock_t;
  63. extern void vr41xx_supply_clock(vr41xx_clock_t clock);
  64. extern void vr41xx_mask_clock(vr41xx_clock_t clock);
  65. /*
  66. * Interrupt Control Unit
  67. */
  68. extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign);
  69. extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int));
  70. #define PIUINT_COMMAND 0x0040
  71. #define PIUINT_DATA 0x0020
  72. #define PIUINT_PAGE1 0x0010
  73. #define PIUINT_PAGE0 0x0008
  74. #define PIUINT_DATALOST 0x0004
  75. #define PIUINT_STATUSCHANGE 0x0001
  76. extern void vr41xx_enable_piuint(uint16_t mask);
  77. extern void vr41xx_disable_piuint(uint16_t mask);
  78. #define AIUINT_INPUT_DMAEND 0x0800
  79. #define AIUINT_INPUT_DMAHALT 0x0400
  80. #define AIUINT_INPUT_DATALOST 0x0200
  81. #define AIUINT_INPUT_DATA 0x0100
  82. #define AIUINT_OUTPUT_DMAEND 0x0008
  83. #define AIUINT_OUTPUT_DMAHALT 0x0004
  84. #define AIUINT_OUTPUT_NODATA 0x0002
  85. extern void vr41xx_enable_aiuint(uint16_t mask);
  86. extern void vr41xx_disable_aiuint(uint16_t mask);
  87. #define KIUINT_DATALOST 0x0004
  88. #define KIUINT_DATAREADY 0x0002
  89. #define KIUINT_SCAN 0x0001
  90. extern void vr41xx_enable_kiuint(uint16_t mask);
  91. extern void vr41xx_disable_kiuint(uint16_t mask);
  92. #define DSIUINT_CTS 0x0800
  93. #define DSIUINT_RXERR 0x0400
  94. #define DSIUINT_RX 0x0200
  95. #define DSIUINT_TX 0x0100
  96. #define DSIUINT_ALL 0x0f00
  97. extern void vr41xx_enable_dsiuint(uint16_t mask);
  98. extern void vr41xx_disable_dsiuint(uint16_t mask);
  99. #define FIRINT_UNIT 0x0010
  100. #define FIRINT_RX_DMAEND 0x0008
  101. #define FIRINT_RX_DMAHALT 0x0004
  102. #define FIRINT_TX_DMAEND 0x0002
  103. #define FIRINT_TX_DMAHALT 0x0001
  104. extern void vr41xx_enable_firint(uint16_t mask);
  105. extern void vr41xx_disable_firint(uint16_t mask);
  106. extern void vr41xx_enable_pciint(void);
  107. extern void vr41xx_disable_pciint(void);
  108. extern void vr41xx_enable_scuint(void);
  109. extern void vr41xx_disable_scuint(void);
  110. #define CSIINT_TX_DMAEND 0x0040
  111. #define CSIINT_TX_DMAHALT 0x0020
  112. #define CSIINT_TX_DATA 0x0010
  113. #define CSIINT_TX_FIFOEMPTY 0x0008
  114. #define CSIINT_RX_DMAEND 0x0004
  115. #define CSIINT_RX_DMAHALT 0x0002
  116. #define CSIINT_RX_FIFOEMPTY 0x0001
  117. extern void vr41xx_enable_csiint(uint16_t mask);
  118. extern void vr41xx_disable_csiint(uint16_t mask);
  119. extern void vr41xx_enable_bcuint(void);
  120. extern void vr41xx_disable_bcuint(void);
  121. #ifdef CONFIG_SERIAL_VR41XX_CONSOLE
  122. extern void vr41xx_siu_setup(void);
  123. #else
  124. static inline void vr41xx_siu_setup(void) {}
  125. #endif
  126. #endif /* __NEC_VR41XX_H */