fpga85e2c.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * include/asm-v850/fpga85e2c.h -- Machine-dependent defs for
  3. * FPGA implementation of V850E2/NA85E2C
  4. *
  5. * Copyright (C) 2002,03 NEC Electronics Corporation
  6. * Copyright (C) 2002,03 Miles Bader <miles@gnu.org>
  7. *
  8. * This file is subject to the terms and conditions of the GNU General
  9. * Public License. See the file COPYING in the main directory of this
  10. * archive for more details.
  11. *
  12. * Written by Miles Bader <miles@gnu.org>
  13. */
  14. #ifndef __V850_FPGA85E2C_H__
  15. #define __V850_FPGA85E2C_H__
  16. #include <asm/v850e2.h>
  17. #include <asm/clinkage.h>
  18. #define CPU_MODEL "v850e2/fpga85e2c"
  19. #define CPU_MODEL_LONG "NEC V850E2/NA85E2C"
  20. #define PLATFORM "fpga85e2c"
  21. #define PLATFORM_LONG "NA85E2C FPGA implementation"
  22. /* `external ram'. */
  23. #define ERAM_ADDR 0
  24. #define ERAM_SIZE 0x00100000 /* 1MB */
  25. /* FPGA specific control registers. */
  26. /* Writing a non-zero value to FLGREG(0) will signal the controlling CPU
  27. to stop execution. */
  28. #define FLGREG_ADDR(n) (0xFFE80100 + 2*(n))
  29. #define FLGREG(n) (*(volatile unsigned char *)FLGREG_ADDR (n))
  30. #define FLGREG_NUM 2
  31. #define CSDEV_ADDR(n) (0xFFE80110 + 2*(n))
  32. #define CSDEV(n) (*(volatile unsigned char *)CSDEV_ADDR (n))
  33. /* Timer interrupts 0-3, interrupt at intervals from CLK/4096 to CLK/16384. */
  34. #define IRQ_RPU(n) (60 + (n))
  35. #define IRQ_RPU_NUM 4
  36. /* For <asm/irq.h> */
  37. #define NUM_CPU_IRQS 64
  38. /* General-purpose timer. */
  39. /* control/status register (can only be read/written via bit insns) */
  40. #define RPU_GTMC_ADDR 0xFFFFFB00
  41. #define RPU_GTMC (*(volatile unsigned char *)RPU_GTMC_ADDR)
  42. #define RPU_GTMC_CE_BIT 7 /* clock enable (control) */
  43. #define RPU_GTMC_OV_BIT 6 /* overflow (status) */
  44. #define RPU_GTMC_CLK_BIT 1 /* 0 = .5 MHz CLK, 1 = 1 Mhz (control) */
  45. /* 32-bit count (8 least-significant bits are always zero). */
  46. #define RPU_GTM_ADDR 0xFFFFFB28
  47. #define RPU_GTM (*(volatile unsigned long *)RPU_GTMC_ADDR)
  48. /* For <asm/page.h> */
  49. #define PAGE_OFFSET ERAM_ADDR /* minimum allocatable address */
  50. /* For <asm/entry.h> */
  51. /* `R0 RAM', used for a few miscellaneous variables that must be accessible
  52. using a load instruction relative to R0. The FPGA implementation
  53. actually has no on-chip RAM, so we use part of main ram just after the
  54. interrupt vectors. */
  55. #ifdef __ASSEMBLY__
  56. #define R0_RAM_ADDR lo(C_SYMBOL_NAME(_r0_ram))
  57. #else
  58. extern char _r0_ram;
  59. #define R0_RAM_ADDR ((unsigned long)&_r0_ram);
  60. #endif
  61. /* For <asm/param.h> */
  62. #ifndef HZ
  63. #define HZ 122 /* actually, 8.192ms ticks =~ 122.07 */
  64. #endif
  65. #endif /* __V850_FPGA85E2C_H__ */