m32700ut_lan.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #ifndef _M32700UT_M32700UT_LAN_H
  2. #define _M32700UT_M32700UT_LAN_H
  3. /*
  4. * include/asm-m32r/m32700ut/m32700ut_lan.h
  5. *
  6. * M32700UT-LAN board
  7. *
  8. * Copyright (c) 2002 Takeo Takahashi
  9. *
  10. * This file is subject to the terms and conditions of the GNU General
  11. * Public License. See the file "COPYING" in the main directory of
  12. * this archive for more details.
  13. */
  14. #ifndef __ASSEMBLY__
  15. /*
  16. * C functions use non-cache address.
  17. */
  18. #define M32700UT_LAN_BASE (0x10000000 /* + NONCACHE_OFFSET */)
  19. #else
  20. #define M32700UT_LAN_BASE (0x10000000 + NONCACHE_OFFSET)
  21. #endif /* __ASSEMBLY__ */
  22. /* ICU
  23. * ICUISTS: status register
  24. * ICUIREQ0: request register
  25. * ICUIREQ1: request register
  26. * ICUCR3: control register for CFIREQ# interrupt
  27. * ICUCR4: control register for CFC Card insert interrupt
  28. * ICUCR5: control register for CFC Card eject interrupt
  29. * ICUCR6: control register for external interrupt
  30. * ICUCR11: control register for MMC Card insert/eject interrupt
  31. * ICUCR13: control register for SC error interrupt
  32. * ICUCR14: control register for SC receive interrupt
  33. * ICUCR15: control register for SC send interrupt
  34. * ICUCR16: control register for SIO0 receive interrupt
  35. * ICUCR17: control register for SIO0 send interrupt
  36. */
  37. #define M32700UT_LAN_IRQ_LAN (M32700UT_LAN_PLD_IRQ_BASE + 1) /* LAN */
  38. #define M32700UT_LAN_IRQ_I2C (M32700UT_LAN_PLD_IRQ_BASE + 3) /* I2C */
  39. #define M32700UT_LAN_ICUISTS __reg16(M32700UT_LAN_BASE + 0xc0002)
  40. #define M32700UT_LAN_ICUISTS_VECB_MASK (0xf000)
  41. #define M32700UT_LAN_VECB(x) ((x) & M32700UT_LAN_ICUISTS_VECB_MASK)
  42. #define M32700UT_LAN_ICUISTS_ISN_MASK (0x07c0)
  43. #define M32700UT_LAN_ICUISTS_ISN(x) ((x) & M32700UT_LAN_ICUISTS_ISN_MASK)
  44. #define M32700UT_LAN_ICUIREQ0 __reg16(M32700UT_LAN_BASE + 0xc0004)
  45. #define M32700UT_LAN_ICUCR1 __reg16(M32700UT_LAN_BASE + 0xc0010)
  46. #define M32700UT_LAN_ICUCR3 __reg16(M32700UT_LAN_BASE + 0xc0014)
  47. /*
  48. * AR register on PLD
  49. */
  50. #define ARVCR0 __reg32(M32700UT_LAN_BASE + 0x40000)
  51. #define ARVCR0_VDS 0x00080000
  52. #define ARVCR0_RST 0x00010000
  53. #define ARVCR1 __reg32(M32700UT_LAN_BASE + 0x40004)
  54. #define ARVCR1_QVGA 0x02000000
  55. #define ARVCR1_NORMAL 0x01000000
  56. #define ARVCR1_HIEN 0x00010000
  57. #define ARVHCOUNT __reg32(M32700UT_LAN_BASE + 0x40008)
  58. #define ARDATA __reg32(M32700UT_LAN_BASE + 0x40010)
  59. #define ARINTSEL __reg32(M32700UT_LAN_BASE + 0x40014)
  60. #define ARINTSEL_INT3 0x10000000 /* CPU INT3 */
  61. #define ARDATA32 __reg32(M32700UT_LAN_BASE + 0x04040010) // Block 5
  62. /*
  63. #define ARINTSEL_SEL2 0x00002000
  64. #define ARINTSEL_SEL3 0x00001000
  65. #define ARINTSEL_SEL6 0x00000200
  66. #define ARINTSEL_SEL7 0x00000100
  67. #define ARINTSEL_SEL9 0x00000040
  68. #define ARINTSEL_SEL10 0x00000020
  69. #define ARINTSEL_SEL11 0x00000010
  70. #define ARINTSEL_SEL12 0x00000008
  71. */
  72. /*
  73. * I2C register on PLD
  74. */
  75. #define PLDI2CCR __reg32(M32700UT_LAN_BASE + 0x40040)
  76. #define PLDI2CCR_ES0 0x00000001 /* enable I2C interface */
  77. #define PLDI2CMOD __reg32(M32700UT_LAN_BASE + 0x40044)
  78. #define PLDI2CMOD_ACKCLK 0x00000200
  79. #define PLDI2CMOD_DTWD 0x00000100
  80. #define PLDI2CMOD_10BT 0x00000004
  81. #define PLDI2CMOD_ATM_NORMAL 0x00000000
  82. #define PLDI2CMOD_ATM_AUTO 0x00000003
  83. #define PLDI2CACK __reg32(M32700UT_LAN_BASE + 0x40048)
  84. #define PLDI2CACK_ACK 0x00000001
  85. #define PLDI2CFREQ __reg32(M32700UT_LAN_BASE + 0x4004c)
  86. #define PLDI2CCND __reg32(M32700UT_LAN_BASE + 0x40050)
  87. #define PLDI2CCND_START 0x00000001
  88. #define PLDI2CCND_STOP 0x00000002
  89. #define PLDI2CSTEN __reg32(M32700UT_LAN_BASE + 0x40054)
  90. #define PLDI2CSTEN_STEN 0x00000001
  91. #define PLDI2CDATA __reg32(M32700UT_LAN_BASE + 0x40060)
  92. #define PLDI2CSTS __reg32(M32700UT_LAN_BASE + 0x40064)
  93. #define PLDI2CSTS_TRX 0x00000020
  94. #define PLDI2CSTS_BB 0x00000010
  95. #define PLDI2CSTS_NOACK 0x00000001 /* 0:ack, 1:noack */
  96. #endif /* _M32700UT_M32700UT_LAN_H */