m32r.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. #ifndef _ASM_M32R_M32R_H_
  2. #define _ASM_M32R_M32R_H_
  3. /*
  4. * Renesas M32R processor
  5. *
  6. * Copyright (C) 2003, 2004 Renesas Technology Corp.
  7. */
  8. /* Chip type */
  9. #if defined(CONFIG_CHIP_XNUX_MP) || defined(CONFIG_CHIP_XNUX2_MP)
  10. #include <asm/m32r_mp_fpga.h>
  11. #elif defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_XNUX2) \
  12. || defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_M32102) \
  13. || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104)
  14. #include <asm/m32102.h>
  15. #endif
  16. /* Platform type */
  17. #if defined(CONFIG_PLAT_M32700UT)
  18. #include <asm/m32700ut/m32700ut_pld.h>
  19. #include <asm/m32700ut/m32700ut_lan.h>
  20. #include <asm/m32700ut/m32700ut_lcd.h>
  21. /* for ei_handler:linux/arch/m32r/kernel/entry.S */
  22. #define M32R_INT1ICU_ISTS PLD_ICUISTS
  23. #define M32R_INT1ICU_IRQ_BASE M32700UT_PLD_IRQ_BASE
  24. #define M32R_INT0ICU_ISTS M32700UT_LAN_ICUISTS
  25. #define M32R_INT0ICU_IRQ_BASE M32700UT_LAN_PLD_IRQ_BASE
  26. #define M32R_INT2ICU_ISTS M32700UT_LCD_ICUISTS
  27. #define M32R_INT2ICU_IRQ_BASE M32700UT_LCD_PLD_IRQ_BASE
  28. #endif /* CONFIG_PLAT_M32700UT */
  29. #if defined(CONFIG_PLAT_OPSPUT)
  30. #include <asm/opsput/opsput_pld.h>
  31. #include <asm/opsput/opsput_lan.h>
  32. #include <asm/opsput/opsput_lcd.h>
  33. /* for ei_handler:linux/arch/m32r/kernel/entry.S */
  34. #define M32R_INT1ICU_ISTS PLD_ICUISTS
  35. #define M32R_INT1ICU_IRQ_BASE OPSPUT_PLD_IRQ_BASE
  36. #define M32R_INT0ICU_ISTS OPSPUT_LAN_ICUISTS
  37. #define M32R_INT0ICU_IRQ_BASE OPSPUT_LAN_PLD_IRQ_BASE
  38. #define M32R_INT2ICU_ISTS OPSPUT_LCD_ICUISTS
  39. #define M32R_INT2ICU_IRQ_BASE OPSPUT_LCD_PLD_IRQ_BASE
  40. #endif /* CONFIG_PLAT_OPSPUT */
  41. #if defined(CONFIG_PLAT_MAPPI2)
  42. #include <asm/mappi2/mappi2_pld.h>
  43. #endif /* CONFIG_PLAT_MAPPI2 */
  44. #if defined(CONFIG_PLAT_MAPPI3)
  45. #include <asm/mappi3/mappi3_pld.h>
  46. #endif /* CONFIG_PLAT_MAPPI3 */
  47. #if defined(CONFIG_PLAT_USRV)
  48. #include <asm/m32700ut/m32700ut_pld.h>
  49. /* for ei_handler:linux/arch/m32r/kernel/entry.S */
  50. #define M32R_INT1ICU_ISTS PLD_ICUISTS
  51. #define M32R_INT1ICU_IRQ_BASE M32700UT_PLD_IRQ_BASE
  52. #endif
  53. #if defined(CONFIG_PLAT_M32104UT)
  54. #include <asm/m32104ut/m32104ut_pld.h>
  55. /* for ei_handler:linux/arch/m32r/kernel/entry.S */
  56. #define M32R_INT1ICU_ISTS PLD_ICUISTS
  57. #define M32R_INT1ICU_IRQ_BASE M32104UT_PLD_IRQ_BASE
  58. #endif /* CONFIG_PLAT_M32104 */
  59. /*
  60. * M32R Register
  61. */
  62. /*
  63. * MMU Register
  64. */
  65. #define MMU_REG_BASE (0xffff0000)
  66. #define ITLB_BASE (0xfe000000)
  67. #define DTLB_BASE (0xfe000800)
  68. #define NR_TLB_ENTRIES CONFIG_TLB_ENTRIES
  69. #define MATM MMU_REG_BASE /* MMU Address Translation Mode
  70. Register */
  71. #define MPSZ (0x04 + MMU_REG_BASE) /* MMU Page Size Designation Register */
  72. #define MASID (0x08 + MMU_REG_BASE) /* MMU Address Space ID Register */
  73. #define MESTS (0x0c + MMU_REG_BASE) /* MMU Exception Status Register */
  74. #define MDEVA (0x10 + MMU_REG_BASE) /* MMU Operand Exception Virtual
  75. Address Register */
  76. #define MDEVP (0x14 + MMU_REG_BASE) /* MMU Operand Exception Virtual Page
  77. Number Register */
  78. #define MPTB (0x18 + MMU_REG_BASE) /* MMU Page Table Base Register */
  79. #define MSVA (0x20 + MMU_REG_BASE) /* MMU Search Virtual Address
  80. Register */
  81. #define MTOP (0x24 + MMU_REG_BASE) /* MMU TLB Operation Register */
  82. #define MIDXI (0x28 + MMU_REG_BASE) /* MMU Index Register for
  83. Instruciton */
  84. #define MIDXD (0x2c + MMU_REG_BASE) /* MMU Index Register for Operand */
  85. #define MATM_offset (MATM - MMU_REG_BASE)
  86. #define MPSZ_offset (MPSZ - MMU_REG_BASE)
  87. #define MASID_offset (MASID - MMU_REG_BASE)
  88. #define MESTS_offset (MESTS - MMU_REG_BASE)
  89. #define MDEVA_offset (MDEVA - MMU_REG_BASE)
  90. #define MDEVP_offset (MDEVP - MMU_REG_BASE)
  91. #define MPTB_offset (MPTB - MMU_REG_BASE)
  92. #define MSVA_offset (MSVA - MMU_REG_BASE)
  93. #define MTOP_offset (MTOP - MMU_REG_BASE)
  94. #define MIDXI_offset (MIDXI - MMU_REG_BASE)
  95. #define MIDXD_offset (MIDXD - MMU_REG_BASE)
  96. #define MESTS_IT (1 << 0) /* Instruction TLB miss */
  97. #define MESTS_IA (1 << 1) /* Instruction Access Exception */
  98. #define MESTS_DT (1 << 4) /* Operand TLB miss */
  99. #define MESTS_DA (1 << 5) /* Operand Access Exception */
  100. #define MESTS_DRW (1 << 6) /* Operand Write Exception Flag */
  101. /*
  102. * PSW (Processor Status Word)
  103. */
  104. /* PSW bit */
  105. #define M32R_PSW_BIT_SM (7) /* Stack Mode */
  106. #define M32R_PSW_BIT_IE (6) /* Interrupt Enable */
  107. #define M32R_PSW_BIT_PM (3) /* Processor Mode [0:Supervisor,1:User] */
  108. #define M32R_PSW_BIT_C (0) /* Condition */
  109. #define M32R_PSW_BIT_BSM (7+8) /* Backup Stack Mode */
  110. #define M32R_PSW_BIT_BIE (6+8) /* Backup Interrupt Enable */
  111. #define M32R_PSW_BIT_BPM (3+8) /* Backup Processor Mode */
  112. #define M32R_PSW_BIT_BC (0+8) /* Backup Condition */
  113. /* PSW bit map */
  114. #define M32R_PSW_SM (1UL<< M32R_PSW_BIT_SM) /* Stack Mode */
  115. #define M32R_PSW_IE (1UL<< M32R_PSW_BIT_IE) /* Interrupt Enable */
  116. #define M32R_PSW_PM (1UL<< M32R_PSW_BIT_PM) /* Processor Mode */
  117. #define M32R_PSW_C (1UL<< M32R_PSW_BIT_C) /* Condition */
  118. #define M32R_PSW_BSM (1UL<< M32R_PSW_BIT_BSM) /* Backup Stack Mode */
  119. #define M32R_PSW_BIE (1UL<< M32R_PSW_BIT_BIE) /* Backup Interrupt Enable */
  120. #define M32R_PSW_BPM (1UL<< M32R_PSW_BIT_BPM) /* Backup Processor Mode */
  121. #define M32R_PSW_BC (1UL<< M32R_PSW_BIT_BC) /* Backup Condition */
  122. /*
  123. * Direct address to SFR
  124. */
  125. #include <asm/page.h>
  126. #ifdef CONFIG_MMU
  127. #define NONCACHE_OFFSET (__PAGE_OFFSET + 0x20000000)
  128. #else
  129. #define NONCACHE_OFFSET __PAGE_OFFSET
  130. #endif /* CONFIG_MMU */
  131. #define M32R_ICU_ISTS_ADDR M32R_ICU_ISTS_PORTL+NONCACHE_OFFSET
  132. #define M32R_ICU_IPICR_ADDR M32R_ICU_IPICR0_PORTL+NONCACHE_OFFSET
  133. #define M32R_ICU_IMASK_ADDR M32R_ICU_IMASK_PORTL+NONCACHE_OFFSET
  134. #define M32R_FPGA_CPU_NAME_ADDR M32R_FPGA_CPU_NAME0_PORTL+NONCACHE_OFFSET
  135. #define M32R_FPGA_MODEL_ID_ADDR M32R_FPGA_MODEL_ID0_PORTL+NONCACHE_OFFSET
  136. #define M32R_FPGA_VERSION_ADDR M32R_FPGA_VERSION0_PORTL+NONCACHE_OFFSET
  137. #endif /* _ASM_M32R_M32R_H_ */