teg.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * include/asm-v850/teg.h -- NB85E-TEG cpu chip
  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_TEG_H__
  14. #define __V850_TEG_H__
  15. /* The TEG uses the V850E cpu core. */
  16. #include <asm/v850e.h>
  17. #include <asm/v850e_cache.h>
  18. #define CPU_MODEL "v850e/nb85e-teg"
  19. #define CPU_MODEL_LONG "NEC V850E/NB85E TEG"
  20. /* For <asm/entry.h> */
  21. /* We use on-chip RAM, for a few miscellaneous variables that must be
  22. accessible using a load instruction relative to R0. On the NB85E/TEG,
  23. There's 60KB of iRAM starting at 0xFFFF0000, however we need the base
  24. address to be addressable by a 16-bit signed offset, so we only use the
  25. second half of it starting from 0xFFFF8000. */
  26. #define R0_RAM_ADDR 0xFFFF8000
  27. /* Hardware-specific interrupt numbers (in the kernel IRQ namespace).
  28. Some of these are parameterized even though there's only a single
  29. interrupt, for compatibility with some generic code that works on other
  30. processor models. */
  31. #define IRQ_INTCMD(n) 6 /* interval timer interrupt */
  32. #define IRQ_INTCMD_NUM 1
  33. #define IRQ_INTSER(n) 16 /* UART reception error */
  34. #define IRQ_INTSER_NUM 1
  35. #define IRQ_INTSR(n) 17 /* UART reception completion */
  36. #define IRQ_INTSR_NUM 1
  37. #define IRQ_INTST(n) 18 /* UART transmission completion */
  38. #define IRQ_INTST_NUM 1
  39. /* For <asm/irq.h> */
  40. #define NUM_CPU_IRQS 64
  41. /* TEG UART details. */
  42. #define V850E_UART_BASE_ADDR(n) (0xFFFFF600 + 0x10 * (n))
  43. #define V850E_UART_ASIM_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x0)
  44. #define V850E_UART_ASIS_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x2)
  45. #define V850E_UART_ASIF_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x4)
  46. #define V850E_UART_CKSR_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x6)
  47. #define V850E_UART_BRGC_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x8)
  48. #define V850E_UART_TXB_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0xA)
  49. #define V850E_UART_RXB_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0xC)
  50. #define V850E_UART_NUM_CHANNELS 1
  51. #define V850E_UART_BASE_FREQ CPU_CLOCK_FREQ
  52. /* This is a function that gets called before configuring the UART. */
  53. #define V850E_UART_PRE_CONFIGURE teg_uart_pre_configure
  54. #ifndef __ASSEMBLY__
  55. extern void teg_uart_pre_configure (unsigned chan,
  56. unsigned cflags, unsigned baud);
  57. #endif
  58. /* The TEG RTPU. */
  59. #define V850E_RTPU_BASE_ADDR 0xFFFFF210
  60. /* TEG series timer D details. */
  61. #define V850E_TIMER_D_BASE_ADDR 0xFFFFF210
  62. #define V850E_TIMER_D_TMCD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x0)
  63. #define V850E_TIMER_D_TMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x4)
  64. #define V850E_TIMER_D_CMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x8)
  65. #define V850E_TIMER_D_BASE_FREQ CPU_CLOCK_FREQ
  66. /* `Interrupt Source Select' control register. */
  67. #define TEG_ISS_ADDR 0xFFFFF7FA
  68. #define TEG_ISS (*(volatile u8 *)TEG_ISS_ADDR)
  69. /* Port 0 I/O register (bits 0-3 used). */
  70. #define TEG_PORT0_IO_ADDR 0xFFFFF7F2
  71. #define TEG_PORT0_IO (*(volatile u8 *)TEG_PORT0_IO_ADDR)
  72. /* Port 0 control register (bits 0-3 control mode, 0 = output, 1 = input). */
  73. #define TEG_PORT0_PM_ADDR 0xFFFFF7F4
  74. #define TEG_PORT0_PM (*(volatile u8 *)TEG_PORT0_PM_ADDR)
  75. #ifndef __ASSEMBLY__
  76. extern void teg_init_irqs (void);
  77. #endif
  78. #endif /* __V850_TEG_H__ */