anna.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * include/asm-v850/anna.h -- Anna V850E2 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_ANNA_H__
  14. #define __V850_ANNA_H__
  15. #include <asm/v850e2.h> /* Based on V850E2 core. */
  16. #define CPU_MODEL "v850e2/anna"
  17. #define CPU_MODEL_LONG "NEC V850E2/Anna"
  18. #define PLATFORM "anna"
  19. #define PLATFORM_LONG "NEC/Midas lab V850E2/Anna evaluation board"
  20. #define CPU_CLOCK_FREQ 200000000 /* 200MHz */
  21. #define SYS_CLOCK_FREQ 33300000 /* 33.3MHz */
  22. /* 1MB of static RAM. This memory is mirrored 64 times. */
  23. #define SRAM_ADDR 0x04000000
  24. #define SRAM_SIZE 0x00100000 /* 1MB */
  25. /* 64MB of DRAM. */
  26. #define SDRAM_ADDR 0x08000000
  27. #define SDRAM_SIZE 0x04000000 /* 64MB */
  28. /* For <asm/page.h> */
  29. #define PAGE_OFFSET SRAM_ADDR
  30. /* We use on-chip RAM, for a few miscellaneous variables that must be
  31. accessible using a load instruction relative to R0. The Anna chip has
  32. 128K of `dLB' ram nominally located at 0xFFF00000, but it's mirrored
  33. every 128K, so we can use the `last mirror' (except for the portion at
  34. the top which is overridden by I/O space). In addition, the early
  35. sample chip we're using has lots of memory errors in the dLB ram, so we
  36. use a specially chosen location that has at least 20 bytes of contiguous
  37. valid memory (xxxF0020 - xxxF003F). */
  38. #define R0_RAM_ADDR 0xFFFF8020
  39. /* Anna specific control registers. */
  40. #define ANNA_ILBEN_ADDR 0xFFFFF7F2
  41. #define ANNA_ILBEN (*(volatile u16 *)ANNA_ILBEN_ADDR)
  42. /* I/O port P0-P3. */
  43. /* Direct I/O. Bits 0-7 are pins Pn0-Pn7. */
  44. #define ANNA_PORT_IO_ADDR(n) (0xFFFFF400 + (n) * 2)
  45. #define ANNA_PORT_IO(n) (*(volatile u8 *)ANNA_PORT_IO_ADDR(n))
  46. /* Port mode (for direct I/O, 0 = output, 1 = input). */
  47. #define ANNA_PORT_PM_ADDR(n) (0xFFFFF410 + (n) * 2)
  48. #define ANNA_PORT_PM(n) (*(volatile u8 *)ANNA_PORT_PM_ADDR(n))
  49. /* Hardware-specific interrupt numbers (in the kernel IRQ namespace). */
  50. #define IRQ_INTP(n) (n) /* Pnnn (pin) interrupts 0-15 */
  51. #define IRQ_INTP_NUM 16
  52. #define IRQ_INTOV(n) (0x10 + (n)) /* 0-2 */
  53. #define IRQ_INTOV_NUM 2
  54. #define IRQ_INTCCC(n) (0x12 + (n))
  55. #define IRQ_INTCCC_NUM 4
  56. #define IRQ_INTCMD(n) (0x16 + (n)) /* interval timer interrupts 0-5 */
  57. #define IRQ_INTCMD_NUM 6
  58. #define IRQ_INTDMA(n) (0x1C + (n)) /* DMA interrupts 0-3 */
  59. #define IRQ_INTDMA_NUM 4
  60. #define IRQ_INTDMXER 0x20
  61. #define IRQ_INTSRE(n) (0x21 + (n)*3) /* UART 0-1 reception error */
  62. #define IRQ_INTSRE_NUM 2
  63. #define IRQ_INTSR(n) (0x22 + (n)*3) /* UART 0-1 reception completion */
  64. #define IRQ_INTSR_NUM 2
  65. #define IRQ_INTST(n) (0x23 + (n)*3) /* UART 0-1 transmission completion */
  66. #define IRQ_INTST_NUM 2
  67. #define NUM_CPU_IRQS 64
  68. #ifndef __ASSEMBLY__
  69. /* Initialize chip interrupts. */
  70. extern void anna_init_irqs (void);
  71. #endif
  72. /* Anna UART details (basically the same as the V850E/MA1, but 2 channels). */
  73. #define V850E_UART_NUM_CHANNELS 2
  74. #define V850E_UART_BASE_FREQ (SYS_CLOCK_FREQ / 2)
  75. #define V850E_UART_CHIP_NAME "V850E2/NA85E2A"
  76. /* This is the UART channel that's actually connected on the board. */
  77. #define V850E_UART_CONSOLE_CHANNEL 1
  78. /* This is a function that gets called before configuring the UART. */
  79. #define V850E_UART_PRE_CONFIGURE anna_uart_pre_configure
  80. #ifndef __ASSEMBLY__
  81. extern void anna_uart_pre_configure (unsigned chan,
  82. unsigned cflags, unsigned baud);
  83. #endif
  84. /* This board supports RTS/CTS for the on-chip UART, but only for channel 1. */
  85. /* CTS for UART channel 1 is pin P37 (bit 7 of port 3). */
  86. #define V850E_UART_CTS(chan) ((chan) == 1 ? !(ANNA_PORT_IO(3) & 0x80) : 1)
  87. /* RTS for UART channel 1 is pin P07 (bit 7 of port 0). */
  88. #define V850E_UART_SET_RTS(chan, val) \
  89. do { \
  90. if (chan == 1) { \
  91. unsigned old = ANNA_PORT_IO(0); \
  92. if (val) \
  93. ANNA_PORT_IO(0) = old & ~0x80; \
  94. else \
  95. ANNA_PORT_IO(0) = old | 0x80; \
  96. } \
  97. } while (0)
  98. /* Timer C details. */
  99. #define V850E_TIMER_C_BASE_ADDR 0xFFFFF600
  100. /* Timer D details (the Anna actually has 5 of these; should change later). */
  101. #define V850E_TIMER_D_BASE_ADDR 0xFFFFF540
  102. #define V850E_TIMER_D_TMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x0)
  103. #define V850E_TIMER_D_CMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x2)
  104. #define V850E_TIMER_D_TMCD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x4)
  105. #define V850E_TIMER_D_BASE_FREQ SYS_CLOCK_FREQ
  106. #define V850E_TIMER_D_TMCD_CS_MIN 1 /* min 2^1 divider */
  107. /* For <asm/param.h> */
  108. #ifndef HZ
  109. #define HZ 100
  110. #endif
  111. #endif /* __V850_ANNA_H__ */