as85ep1.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /*
  2. * include/asm-v850/as85ep1.h -- AS85EP1 evaluation CPU chip/board
  3. *
  4. * Copyright (C) 2001,02,03 NEC Electronics Corporation
  5. * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
  6. *
  7. * This file is subject to the terms and conditions of the GNU General
  8. * Public License. See the file COPYING in the main directory of this
  9. * archive for more details.
  10. *
  11. * Written by Miles Bader <miles@gnu.org>
  12. */
  13. #ifndef __V850_AS85EP1_H__
  14. #define __V850_AS85EP1_H__
  15. #include <asm/v850e.h>
  16. #define CPU_MODEL "as85ep1"
  17. #define CPU_MODEL_LONG "NEC V850E/AS85EP1"
  18. #define PLATFORM "AS85EP1"
  19. #define PLATFORM_LONG "NEC V850E/AS85EP1 evaluation board"
  20. #define CPU_CLOCK_FREQ 96000000 /* 96MHz */
  21. #define SYS_CLOCK_FREQ CPU_CLOCK_FREQ
  22. /* 1MB of static RAM. */
  23. #define SRAM_ADDR 0x00400000
  24. #define SRAM_SIZE 0x00100000 /* 1MB */
  25. /* About 58MB of DRAM. This can actually be at one of two positions,
  26. determined by jump JP3; we have to use the first position because the
  27. second is partially out of processor instruction addressing range
  28. (though in the second position there's actually 64MB available). */
  29. #define SDRAM_ADDR 0x00600000
  30. #define SDRAM_SIZE 0x039F8000 /* approx 58MB */
  31. /* For <asm/page.h> */
  32. #define PAGE_OFFSET SRAM_ADDR
  33. /* We use on-chip RAM, for a few miscellaneous variables that must be
  34. accessible using a load instruction relative to R0. The AS85EP1 chip
  35. 16K of internal RAM located slightly before I/O space. */
  36. #define R0_RAM_ADDR 0xFFFF8000
  37. /* AS85EP1 specific control registers. */
  38. #define AS85EP1_CSC_ADDR(n) (0xFFFFF060 + (n) * 2)
  39. #define AS85EP1_CSC(n) (*(volatile u16 *)AS85EP1_CSC_ADDR(n))
  40. #define AS85EP1_BSC_ADDR 0xFFFFF066
  41. #define AS85EP1_BSC (*(volatile u16 *)AS85EP1_BSC_ADDR)
  42. #define AS85EP1_BCT_ADDR(n) (0xFFFFF480 + (n) * 2)
  43. #define AS85EP1_BCT(n) (*(volatile u16 *)AS85EP1_BCT_ADDR(n))
  44. #define AS85EP1_DWC_ADDR(n) (0xFFFFF484 + (n) * 2)
  45. #define AS85EP1_DWC(n) (*(volatile u16 *)AS85EP1_DWC_ADDR(n))
  46. #define AS85EP1_BCC_ADDR 0xFFFFF488
  47. #define AS85EP1_BCC (*(volatile u16 *)AS85EP1_BCC_ADDR)
  48. #define AS85EP1_ASC_ADDR 0xFFFFF48A
  49. #define AS85EP1_ASC (*(volatile u16 *)AS85EP1_ASC_ADDR)
  50. #define AS85EP1_BCP_ADDR 0xFFFFF48C
  51. #define AS85EP1_BCP (*(volatile u16 *)AS85EP1_BCP_ADDR)
  52. #define AS85EP1_LBS_ADDR 0xFFFFF48E
  53. #define AS85EP1_LBS (*(volatile u16 *)AS85EP1_LBS_ADDR)
  54. #define AS85EP1_BMC_ADDR 0xFFFFF498
  55. #define AS85EP1_BMC (*(volatile u16 *)AS85EP1_BMC_ADDR)
  56. #define AS85EP1_PRC_ADDR 0xFFFFF49A
  57. #define AS85EP1_PRC (*(volatile u16 *)AS85EP1_PRC_ADDR)
  58. #define AS85EP1_SCR_ADDR(n) (0xFFFFF4A0 + (n) * 4)
  59. #define AS85EP1_SCR(n) (*(volatile u16 *)AS85EP1_SCR_ADDR(n))
  60. #define AS85EP1_RFS_ADDR(n) (0xFFFFF4A2 + (n) * 4)
  61. #define AS85EP1_RFS(n) (*(volatile u16 *)AS85EP1_RFS_ADDR(n))
  62. #define AS85EP1_IRAMM_ADDR 0xFFFFF80A
  63. #define AS85EP1_IRAMM (*(volatile u8 *)AS85EP1_IRAMM_ADDR)
  64. /* I/O port P0-P13. */
  65. /* Direct I/O. Bits 0-7 are pins Pn0-Pn7. */
  66. #define AS85EP1_PORT_IO_ADDR(n) (0xFFFFF400 + (n) * 2)
  67. #define AS85EP1_PORT_IO(n) (*(volatile u8 *)AS85EP1_PORT_IO_ADDR(n))
  68. /* Port mode (for direct I/O, 0 = output, 1 = input). */
  69. #define AS85EP1_PORT_PM_ADDR(n) (0xFFFFF420 + (n) * 2)
  70. #define AS85EP1_PORT_PM(n) (*(volatile u8 *)AS85EP1_PORT_PM_ADDR(n))
  71. /* Port mode control (0 = direct I/O mode, 1 = alternative I/O mode). */
  72. #define AS85EP1_PORT_PMC_ADDR(n) (0xFFFFF440 + (n) * 2)
  73. #define AS85EP1_PORT_PMC(n) (*(volatile u8 *)AS85EP1_PORT_PMC_ADDR(n))
  74. /* Hardware-specific interrupt numbers (in the kernel IRQ namespace). */
  75. #define IRQ_INTCCC(n) (0x0C + (n))
  76. #define IRQ_INTCCC_NUM 8
  77. #define IRQ_INTCMD(n) (0x14 + (n)) /* interval timer interrupts 0-5 */
  78. #define IRQ_INTCMD_NUM 6
  79. #define IRQ_INTSRE(n) (0x1E + (n)*3) /* UART 0-1 reception error */
  80. #define IRQ_INTSRE_NUM 2
  81. #define IRQ_INTSR(n) (0x1F + (n)*3) /* UART 0-1 reception completion */
  82. #define IRQ_INTSR_NUM 2
  83. #define IRQ_INTST(n) (0x20 + (n)*3) /* UART 0-1 transmission completion */
  84. #define IRQ_INTST_NUM 2
  85. #define NUM_CPU_IRQS 64
  86. #ifndef __ASSEMBLY__
  87. /* Initialize chip interrupts. */
  88. extern void as85ep1_init_irqs (void);
  89. #endif
  90. /* AS85EP1 UART details (basically the same as the V850E/MA1, but 2 channels). */
  91. #define V850E_UART_NUM_CHANNELS 2
  92. #define V850E_UART_BASE_FREQ (SYS_CLOCK_FREQ / 4)
  93. #define V850E_UART_CHIP_NAME "V850E/NA85E"
  94. /* This is a function that gets called before configuring the UART. */
  95. #define V850E_UART_PRE_CONFIGURE as85ep1_uart_pre_configure
  96. #ifndef __ASSEMBLY__
  97. extern void as85ep1_uart_pre_configure (unsigned chan,
  98. unsigned cflags, unsigned baud);
  99. #endif
  100. /* This board supports RTS/CTS for the on-chip UART, but only for channel 1. */
  101. /* CTS for UART channel 1 is pin P54 (bit 4 of port 5). */
  102. #define V850E_UART_CTS(chan) ((chan) == 1 ? !(AS85EP1_PORT_IO(5) & 0x10) : 1)
  103. /* RTS for UART channel 1 is pin P53 (bit 3 of port 5). */
  104. #define V850E_UART_SET_RTS(chan, val) \
  105. do { \
  106. if (chan == 1) { \
  107. unsigned old = AS85EP1_PORT_IO(5); \
  108. if (val) \
  109. AS85EP1_PORT_IO(5) = old & ~0x8; \
  110. else \
  111. AS85EP1_PORT_IO(5) = old | 0x8; \
  112. } \
  113. } while (0)
  114. /* Timer C details. */
  115. #define V850E_TIMER_C_BASE_ADDR 0xFFFFF600
  116. /* Timer D details (the AS85EP1 actually has 5 of these; should change later). */
  117. #define V850E_TIMER_D_BASE_ADDR 0xFFFFF540
  118. #define V850E_TIMER_D_TMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x0)
  119. #define V850E_TIMER_D_CMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x2)
  120. #define V850E_TIMER_D_TMCD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x4)
  121. #define V850E_TIMER_D_BASE_FREQ SYS_CLOCK_FREQ
  122. #define V850E_TIMER_D_TMCD_CS_MIN 2 /* min 2^2 divider */
  123. /* For <asm/param.h> */
  124. #ifndef HZ
  125. #define HZ 100
  126. #endif
  127. #endif /* __V850_AS85EP1_H__ */