rte_ma1_cb.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * include/asm-v850/rte_ma1_cb.h -- Midas labs RTE-V850/MA1-CB 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_RTE_MA1_CB_H__
  14. #define __V850_RTE_MA1_CB_H__
  15. #include <asm/rte_cb.h> /* Common defs for Midas RTE-CB boards. */
  16. #define PLATFORM "rte-v850e/ma1-cb"
  17. #define PLATFORM_LONG "Midas lab RTE-V850E/MA1-CB"
  18. #define CPU_CLOCK_FREQ 50000000 /* 50MHz */
  19. /* 1MB of onboard SRAM. Note that the monitor ROM uses parts of this
  20. for its own purposes, so care must be taken. Some address lines are
  21. not decoded, so the SRAM area is mirrored every 1MB from 0x400000 to
  22. 0x800000 (exclusive). */
  23. #define SRAM_ADDR 0x00400000
  24. #define SRAM_SIZE 0x00100000 /* 1MB */
  25. /* 32MB of onbard SDRAM. */
  26. #define SDRAM_ADDR 0x00800000
  27. #define SDRAM_SIZE 0x02000000 /* 32MB */
  28. /* CPU addresses of GBUS memory spaces. */
  29. #define GCS0_ADDR 0x05000000 /* GCS0 - Common SRAM (2MB) */
  30. #define GCS0_SIZE 0x00200000 /* 2MB */
  31. #define GCS1_ADDR 0x06000000 /* GCS1 - Flash ROM (8MB) */
  32. #define GCS1_SIZE 0x00800000 /* 8MB */
  33. #define GCS2_ADDR 0x07900000 /* GCS2 - I/O registers */
  34. #define GCS2_SIZE 0x00400000 /* 4MB */
  35. #define GCS5_ADDR 0x04000000 /* GCS5 - PCI bus space */
  36. #define GCS5_SIZE 0x01000000 /* 16MB */
  37. #define GCS6_ADDR 0x07980000 /* GCS6 - PCI control registers */
  38. #define GCS6_SIZE 0x00000200 /* 512B */
  39. /* For <asm/page.h> */
  40. #define PAGE_OFFSET SRAM_ADDR
  41. /* The GBUS GINT0 - GINT3 interrupts are connected to the INTP000 - INTP011
  42. pins on the CPU. These are shared among the GBUS interrupts. */
  43. #define IRQ_GINT(n) IRQ_INTP(n)
  44. #define IRQ_GINT_NUM 4
  45. /* Used by <asm/rte_cb.h> to derive NUM_MACH_IRQS. */
  46. #define NUM_RTE_CB_IRQS NUM_CPU_IRQS
  47. #ifdef CONFIG_ROM_KERNEL
  48. /* Kernel is in ROM, starting at address 0. */
  49. #define INTV_BASE 0
  50. #else /* !CONFIG_ROM_KERNEL */
  51. #ifdef CONFIG_RTE_CB_MULTI
  52. /* Using RAM kernel with ROM monitor for Multi debugger. */
  53. /* The chip's real interrupt vectors are in ROM, but they jump to a
  54. secondary interrupt vector table in RAM. */
  55. #define INTV_BASE 0x004F8000
  56. /* Scratch memory used by the ROM monitor, which shouldn't be used by
  57. linux (except for the alternate interrupt vector area, defined
  58. above). */
  59. #define MON_SCRATCH_ADDR 0x004F8000
  60. #define MON_SCRATCH_SIZE 0x00008000 /* 32KB */
  61. #else /* !CONFIG_RTE_CB_MULTI */
  62. /* Using RAM-kernel. Assume some sort of boot-loader got us loaded at
  63. address 0. */
  64. #define INTV_BASE 0
  65. #endif /* CONFIG_RTE_CB_MULTI */
  66. #endif /* CONFIG_ROM_KERNEL */
  67. /* Some misc. on-board devices. */
  68. /* Seven-segment LED display (two digits). Write-only. */
  69. #define LED_ADDR(n) (0x07802000 + (n))
  70. #define LED(n) (*(volatile unsigned char *)LED_ADDR(n))
  71. #define LED_NUM_DIGITS 2
  72. /* Override the basic MA uart pre-initialization so that we can
  73. initialize extra stuff. */
  74. #undef V850E_UART_PRE_CONFIGURE /* should be defined by <asm/ma.h> */
  75. #define V850E_UART_PRE_CONFIGURE rte_ma1_cb_uart_pre_configure
  76. #ifndef __ASSEMBLY__
  77. extern void rte_ma1_cb_uart_pre_configure (unsigned chan,
  78. unsigned cflags, unsigned baud);
  79. #endif
  80. /* This board supports RTS/CTS for the on-chip UART, but only for channel 0. */
  81. /* CTS for UART channel 0 is pin P43 (bit 3 of port 4). */
  82. #define V850E_UART_CTS(chan) ((chan) == 0 ? !(MA_PORT4_IO & 0x8) : 1)
  83. /* RTS for UART channel 0 is pin P42 (bit 2 of port 4). */
  84. #define V850E_UART_SET_RTS(chan, val) \
  85. do { \
  86. if (chan == 0) { \
  87. unsigned old = MA_PORT4_IO; \
  88. if (val) \
  89. MA_PORT4_IO = old & ~0x4; \
  90. else \
  91. MA_PORT4_IO = old | 0x4; \
  92. } \
  93. } while (0)
  94. #endif /* __V850_RTE_MA1_CB_H__ */