cpu_sh7757.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /*
  2. * Copyright (C) 2011 Renesas Solutions Corp.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of
  7. * the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  17. * MA 02111-1307 USA
  18. *
  19. */
  20. #ifndef _ASM_CPU_SH7757_H_
  21. #define _ASM_CPU_SH7757_H_
  22. #define CCR 0xFF00001C
  23. #define WTCNT 0xFFCC0000
  24. #define CCR_CACHE_INIT 0x0000090b
  25. #define CACHE_OC_NUM_WAYS 1
  26. #ifndef __ASSEMBLY__ /* put C only stuff in this section */
  27. /* MMU */
  28. struct mmu_regs {
  29. unsigned int reserved[4];
  30. unsigned int mmucr;
  31. };
  32. #define MMU_BASE ((struct mmu_regs *)0xff000000)
  33. /* Watchdog */
  34. #define WTCSR0 0xffcc0002
  35. #define WRSTCSR_R 0xffcc0003
  36. #define WRSTCSR_W 0xffcc0002
  37. #define WTCSR_PREFIX 0xa500
  38. #define WRSTCSR_PREFIX 0x6900
  39. #define WRSTCSR_WOVF_PREFIX 0x9600
  40. /* SCIF */
  41. #define SCIF0_BASE 0xfe4b0000 /* The real name is SCIF2 */
  42. #define SCIF1_BASE 0xfe4c0000 /* The real name is SCIF3 */
  43. #define SCIF2_BASE 0xfe4d0000 /* The real name is SCIF4 */
  44. /* SerMux */
  45. #define SMR0 0xfe470000
  46. /* TMU0 */
  47. #define TMU_BASE 0xFE430000
  48. /* ETHER, GETHER MAC address */
  49. struct ether_mac_regs {
  50. unsigned int reserved[114];
  51. unsigned int mahr;
  52. unsigned int reserved2;
  53. unsigned int malr;
  54. };
  55. #define GETHER0_MAC_BASE ((struct ether_mac_regs *)0xfee0400)
  56. #define GETHER1_MAC_BASE ((struct ether_mac_regs *)0xfee0c00)
  57. #define ETHER0_MAC_BASE ((struct ether_mac_regs *)0xfef0000)
  58. #define ETHER1_MAC_BASE ((struct ether_mac_regs *)0xfef0800)
  59. /* GETHER */
  60. struct gether_control_regs {
  61. unsigned int gbecont;
  62. };
  63. #define GETHER_CONTROL_BASE ((struct gether_control_regs *)0xffc10100)
  64. #define GBECONT_RMII1 0x00020000
  65. #define GBECONT_RMII0 0x00010000
  66. /* USB0/1 */
  67. struct usb_common_regs {
  68. unsigned short reserved[129];
  69. unsigned short suspmode;
  70. };
  71. #define USB0_COMMON_BASE ((struct usb_common_regs *)0xfe450000)
  72. #define USB1_COMMON_BASE ((struct usb_common_regs *)0xfe4f0000)
  73. struct usb0_phy_regs {
  74. unsigned short reset;
  75. unsigned short reserved[4];
  76. unsigned short portsel;
  77. };
  78. #define USB0_PHY_BASE ((struct usb0_phy_regs *)0xfe5f0000)
  79. struct usb1_port_regs {
  80. unsigned int port1sel;
  81. unsigned int reserved;
  82. unsigned int usb1intsts;
  83. };
  84. #define USB1_PORT_BASE ((struct usb1_port_regs *)0xfe4f2000)
  85. struct usb1_alignment_regs {
  86. unsigned int ehcidatac; /* 0xfe4fe018 */
  87. unsigned int reserved[63];
  88. unsigned int ohcidatac;
  89. };
  90. #define USB1_ALIGNMENT_BASE ((struct usb1_alignment_regs *)0xfe4fe018)
  91. /* GCTRL, GRA */
  92. struct gctrl_regs {
  93. unsigned int wprotect;
  94. unsigned int gplldiv;
  95. unsigned int gracr2; /* GRA */
  96. unsigned int gracr3; /* GRA */
  97. unsigned int reserved[4];
  98. unsigned int fcntcr1;
  99. unsigned int fcntcr2;
  100. unsigned int reserved2[2];
  101. unsigned int gpll1div;
  102. unsigned int vcompsel;
  103. unsigned int reserved3[62];
  104. unsigned int fdlmon;
  105. unsigned int reserved4[2];
  106. unsigned int flcrmon;
  107. unsigned int reserved5[944];
  108. unsigned int spibootcan;
  109. };
  110. #define GCTRL_BASE ((struct gctrl_regs *)0xffc10000)
  111. /* PCIe setup */
  112. struct pcie_setup_regs {
  113. unsigned int pbictl0;
  114. unsigned int gradevctl;
  115. unsigned int reserved[2];
  116. unsigned int bmcinf[6];
  117. unsigned int reserved2[118];
  118. unsigned int idset[2];
  119. unsigned int subidset;
  120. unsigned int reserved3[2];
  121. unsigned int linkconfset[4];
  122. unsigned int trsid;
  123. unsigned int reserved4[6];
  124. unsigned int toutset;
  125. unsigned int reserved5[7];
  126. unsigned int lad0;
  127. unsigned int ladmsk0;
  128. unsigned int lad1;
  129. unsigned int ladmsk1;
  130. unsigned int lad2;
  131. unsigned int ladmsk2;
  132. unsigned int lad3;
  133. unsigned int ladmsk3;
  134. unsigned int lad4;
  135. unsigned int ladmsk4;
  136. unsigned int lad5;
  137. unsigned int ladmsk5;
  138. unsigned int reserved6[94];
  139. unsigned int vdmrxvid[2];
  140. unsigned int reserved7;
  141. unsigned int pbiintfr;
  142. unsigned int pbiinten;
  143. unsigned int msimap;
  144. unsigned int barmap;
  145. unsigned int baracsize;
  146. unsigned int advserest;
  147. unsigned int pbictl3;
  148. unsigned int reserved8[8];
  149. unsigned int pbictl1;
  150. unsigned int scratch0;
  151. unsigned int reserved9[6];
  152. unsigned int pbictl2;
  153. unsigned int reserved10;
  154. unsigned int pbirev;
  155. };
  156. #define PCIE_SETUP_BASE ((struct pcie_setup_regs *)0xffca1000)
  157. struct pcie_system_bus_regs {
  158. unsigned int reserved[3];
  159. unsigned int endictl0;
  160. unsigned int endictl1;
  161. };
  162. #define PCIE_SYSTEM_BUS_BASE ((struct pcie_system_bus_regs *)0xffca1600)
  163. /* PCIe-Bridge */
  164. struct pciebrg_regs {
  165. unsigned short ctrl_h8s;
  166. unsigned short reserved[7];
  167. unsigned short cp_addr;
  168. unsigned short reserved2;
  169. unsigned short cp_data;
  170. unsigned short reserved3;
  171. unsigned short cp_ctrl;
  172. };
  173. #define PCIEBRG_BASE ((struct pciebrg_regs *)0xffd60000)
  174. /* CPU version */
  175. #define CCN_PRR 0xff000044
  176. #define prr_mask(_val) ((_val >> 4) & 0xff)
  177. #define PRR_SH7757_B0 0x10
  178. #define PRR_SH7757_C0 0x11
  179. #define is_sh7757_b0(_val) \
  180. ({ \
  181. int __ret = prr_mask(__raw_readl(CCN_PRR)) == PRR_SH7757_B0; \
  182. __ret; \
  183. })
  184. #endif /* ifndef __ASSEMBLY__ */
  185. #endif /* _ASM_CPU_SH7757_H_ */