cpu.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * cpu.h
  4. *
  5. * AM33xx specific header file
  6. *
  7. * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
  8. */
  9. #ifndef _AM33XX_CPU_H
  10. #define _AM33XX_CPU_H
  11. #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
  12. #include <asm/types.h>
  13. #endif /* !(__KERNEL_STRICT_NAMES || __ASSEMBLY__) */
  14. #include <asm/arch/hardware.h>
  15. #define CL_BIT(x) (0 << x)
  16. /* Timer register bits */
  17. #define TCLR_ST BIT(0) /* Start=1 Stop=0 */
  18. #define TCLR_AR BIT(1) /* Auto reload */
  19. #define TCLR_PRE BIT(5) /* Pre-scaler enable */
  20. #define TCLR_PTV_SHIFT (2) /* Pre-scaler shift value */
  21. #define TCLR_PRE_DISABLE CL_BIT(5) /* Pre-scalar disable */
  22. #define TCLR_CE BIT(6) /* compare mode enable */
  23. #define TCLR_SCPWM BIT(7) /* pwm outpin behaviour */
  24. #define TCLR_TCM BIT(8) /* edge detection of input pin*/
  25. #define TCLR_TRG_SHIFT (10) /* trigmode on pwm outpin */
  26. #define TCLR_PT BIT(12) /* pulse/toggle mode of outpin*/
  27. #define TCLR_CAPTMODE BIT(13) /* capture mode */
  28. #define TCLR_GPOCFG BIT(14) /* 0=output,1=input */
  29. #define TCFG_RESET BIT(0) /* software reset */
  30. #define TCFG_EMUFREE BIT(1) /* behaviour of tmr on debug */
  31. #define TCFG_IDLEMOD_SHIFT (2) /* power management */
  32. /* cpu-id for AM43XX AM33XX and TI81XX family */
  33. #define AM437X 0xB98C
  34. #define AM335X 0xB944
  35. #define TI81XX 0xB81E
  36. #define DEVICE_ID (CTRL_BASE + 0x0600)
  37. #define DEVICE_ID_MASK 0x1FFF
  38. #define PACKAGE_TYPE_SHIFT 16
  39. #define PACKAGE_TYPE_MASK (3 << 16)
  40. /* Package Type */
  41. #define PACKAGE_TYPE_UNDEFINED 0x0
  42. #define PACKAGE_TYPE_ZCZ 0x1
  43. #define PACKAGE_TYPE_ZCE 0x2
  44. #define PACKAGE_TYPE_RESERVED 0x3
  45. /* MPU max frequencies */
  46. #define AM335X_ZCZ_300 0x1FEF
  47. #define AM335X_ZCZ_600 0x1FAF
  48. #define AM335X_ZCZ_720 0x1F2F
  49. #define AM335X_ZCZ_800 0x1E2F
  50. #define AM335X_ZCZ_1000 0x1C2F
  51. #define AM335X_ZCE_300 0x1FDF
  52. #define AM335X_ZCE_600 0x1F9F
  53. /* This gives the status of the boot mode pins on the evm */
  54. #define SYSBOOT_MASK (BIT(0) | BIT(1) | BIT(2)\
  55. | BIT(3) | BIT(4))
  56. #define PRM_RSTCTRL_RESET 0x01
  57. #define PRM_RSTST_WARM_RESET_MASK 0x232
  58. /* EMIF Control register bits */
  59. #define EMIF_CTRL_DEVOFF BIT(0)
  60. #ifndef __KERNEL_STRICT_NAMES
  61. #ifndef __ASSEMBLY__
  62. #include <asm/ti-common/omap_wdt.h>
  63. #ifndef CONFIG_AM43XX
  64. /* Encapsulating core pll registers */
  65. struct cm_wkuppll {
  66. unsigned int wkclkstctrl; /* offset 0x00 */
  67. unsigned int wkctrlclkctrl; /* offset 0x04 */
  68. unsigned int wkgpio0clkctrl; /* offset 0x08 */
  69. unsigned int wkl4wkclkctrl; /* offset 0x0c */
  70. unsigned int timer0clkctrl; /* offset 0x10 */
  71. unsigned int resv2[3];
  72. unsigned int idlestdpllmpu; /* offset 0x20 */
  73. unsigned int sscdeltamstepdllmpu; /* off 0x24 */
  74. unsigned int sscmodfreqdivdpllmpu; /* off 0x28 */
  75. unsigned int clkseldpllmpu; /* offset 0x2c */
  76. unsigned int resv4[1];
  77. unsigned int idlestdpllddr; /* offset 0x34 */
  78. unsigned int resv5[2];
  79. unsigned int clkseldpllddr; /* offset 0x40 */
  80. unsigned int resv6[4];
  81. unsigned int clkseldplldisp; /* offset 0x54 */
  82. unsigned int resv7[1];
  83. unsigned int idlestdpllcore; /* offset 0x5c */
  84. unsigned int resv8[2];
  85. unsigned int clkseldpllcore; /* offset 0x68 */
  86. unsigned int resv9[1];
  87. unsigned int idlestdpllper; /* offset 0x70 */
  88. unsigned int resv10[2];
  89. unsigned int clkdcoldodpllper; /* offset 0x7c */
  90. unsigned int divm4dpllcore; /* offset 0x80 */
  91. unsigned int divm5dpllcore; /* offset 0x84 */
  92. unsigned int clkmoddpllmpu; /* offset 0x88 */
  93. unsigned int clkmoddpllper; /* offset 0x8c */
  94. unsigned int clkmoddpllcore; /* offset 0x90 */
  95. unsigned int clkmoddpllddr; /* offset 0x94 */
  96. unsigned int clkmoddplldisp; /* offset 0x98 */
  97. unsigned int clkseldpllper; /* offset 0x9c */
  98. unsigned int divm2dpllddr; /* offset 0xA0 */
  99. unsigned int divm2dplldisp; /* offset 0xA4 */
  100. unsigned int divm2dpllmpu; /* offset 0xA8 */
  101. unsigned int divm2dpllper; /* offset 0xAC */
  102. unsigned int resv11[1];
  103. unsigned int wkup_uart0ctrl; /* offset 0xB4 */
  104. unsigned int wkup_i2c0ctrl; /* offset 0xB8 */
  105. unsigned int wkup_adctscctrl; /* offset 0xBC */
  106. unsigned int resv12;
  107. unsigned int timer1clkctrl; /* offset 0xC4 */
  108. unsigned int resv13[4];
  109. unsigned int divm6dpllcore; /* offset 0xD8 */
  110. };
  111. /**
  112. * Encapsulating peripheral functional clocks
  113. * pll registers
  114. */
  115. struct cm_perpll {
  116. unsigned int l4lsclkstctrl; /* offset 0x00 */
  117. unsigned int l3sclkstctrl; /* offset 0x04 */
  118. unsigned int l4fwclkstctrl; /* offset 0x08 */
  119. unsigned int l3clkstctrl; /* offset 0x0c */
  120. unsigned int resv1;
  121. unsigned int cpgmac0clkctrl; /* offset 0x14 */
  122. unsigned int lcdclkctrl; /* offset 0x18 */
  123. unsigned int usb0clkctrl; /* offset 0x1C */
  124. unsigned int resv2;
  125. unsigned int tptc0clkctrl; /* offset 0x24 */
  126. unsigned int emifclkctrl; /* offset 0x28 */
  127. unsigned int ocmcramclkctrl; /* offset 0x2c */
  128. unsigned int gpmcclkctrl; /* offset 0x30 */
  129. unsigned int mcasp0clkctrl; /* offset 0x34 */
  130. unsigned int uart5clkctrl; /* offset 0x38 */
  131. unsigned int mmc0clkctrl; /* offset 0x3C */
  132. unsigned int elmclkctrl; /* offset 0x40 */
  133. unsigned int i2c2clkctrl; /* offset 0x44 */
  134. unsigned int i2c1clkctrl; /* offset 0x48 */
  135. unsigned int spi0clkctrl; /* offset 0x4C */
  136. unsigned int spi1clkctrl; /* offset 0x50 */
  137. unsigned int resv3[3];
  138. unsigned int l4lsclkctrl; /* offset 0x60 */
  139. unsigned int l4fwclkctrl; /* offset 0x64 */
  140. unsigned int mcasp1clkctrl; /* offset 0x68 */
  141. unsigned int uart1clkctrl; /* offset 0x6C */
  142. unsigned int uart2clkctrl; /* offset 0x70 */
  143. unsigned int uart3clkctrl; /* offset 0x74 */
  144. unsigned int uart4clkctrl; /* offset 0x78 */
  145. unsigned int timer7clkctrl; /* offset 0x7C */
  146. unsigned int timer2clkctrl; /* offset 0x80 */
  147. unsigned int timer3clkctrl; /* offset 0x84 */
  148. unsigned int timer4clkctrl; /* offset 0x88 */
  149. unsigned int resv4[8];
  150. unsigned int gpio1clkctrl; /* offset 0xAC */
  151. unsigned int gpio2clkctrl; /* offset 0xB0 */
  152. unsigned int gpio3clkctrl; /* offset 0xB4 */
  153. unsigned int resv5;
  154. unsigned int tpccclkctrl; /* offset 0xBC */
  155. unsigned int dcan0clkctrl; /* offset 0xC0 */
  156. unsigned int dcan1clkctrl; /* offset 0xC4 */
  157. unsigned int resv6;
  158. unsigned int epwmss1clkctrl; /* offset 0xCC */
  159. unsigned int emiffwclkctrl; /* offset 0xD0 */
  160. unsigned int epwmss0clkctrl; /* offset 0xD4 */
  161. unsigned int epwmss2clkctrl; /* offset 0xD8 */
  162. unsigned int l3instrclkctrl; /* offset 0xDC */
  163. unsigned int l3clkctrl; /* Offset 0xE0 */
  164. unsigned int resv8[2];
  165. unsigned int timer5clkctrl; /* offset 0xEC */
  166. unsigned int timer6clkctrl; /* offset 0xF0 */
  167. unsigned int mmc1clkctrl; /* offset 0xF4 */
  168. unsigned int mmc2clkctrl; /* offset 0xF8 */
  169. unsigned int resv9[8];
  170. unsigned int l4hsclkstctrl; /* offset 0x11C */
  171. unsigned int l4hsclkctrl; /* offset 0x120 */
  172. unsigned int resv10[8];
  173. unsigned int cpswclkstctrl; /* offset 0x144 */
  174. unsigned int lcdcclkstctrl; /* offset 0x148 */
  175. };
  176. /* Encapsulating Display pll registers */
  177. struct cm_dpll {
  178. unsigned int resv1;
  179. unsigned int clktimer7clk; /* offset 0x04 */
  180. unsigned int clktimer2clk; /* offset 0x08 */
  181. unsigned int clktimer3clk; /* offset 0x0C */
  182. unsigned int clktimer4clk; /* offset 0x10 */
  183. unsigned int resv2;
  184. unsigned int clktimer5clk; /* offset 0x18 */
  185. unsigned int clktimer6clk; /* offset 0x1C */
  186. unsigned int resv3[2];
  187. unsigned int clktimer1clk; /* offset 0x28 */
  188. unsigned int resv4[2];
  189. unsigned int clklcdcpixelclk; /* offset 0x34 */
  190. };
  191. struct prm_device_inst {
  192. unsigned int prm_rstctrl;
  193. unsigned int prm_rsttime;
  194. unsigned int prm_rstst;
  195. };
  196. #else
  197. /* Encapsulating core pll registers */
  198. struct cm_wkuppll {
  199. unsigned int resv0[136];
  200. unsigned int wkl4wkclkctrl; /* offset 0x220 */
  201. unsigned int resv1[7];
  202. unsigned int usbphy0clkctrl; /* offset 0x240 */
  203. unsigned int resv112;
  204. unsigned int usbphy1clkctrl; /* offset 0x248 */
  205. unsigned int resv113[45];
  206. unsigned int wkclkstctrl; /* offset 0x300 */
  207. unsigned int resv2[15];
  208. unsigned int wkup_i2c0ctrl; /* offset 0x340 */
  209. unsigned int resv3;
  210. unsigned int wkup_uart0ctrl; /* offset 0x348 */
  211. unsigned int resv4[5];
  212. unsigned int wkctrlclkctrl; /* offset 0x360 */
  213. unsigned int resv5;
  214. unsigned int wkgpio0clkctrl; /* offset 0x368 */
  215. unsigned int resv6[109];
  216. unsigned int clkmoddpllcore; /* offset 0x520 */
  217. unsigned int idlestdpllcore; /* offset 0x524 */
  218. unsigned int resv61;
  219. unsigned int clkseldpllcore; /* offset 0x52C */
  220. unsigned int resv7[2];
  221. unsigned int divm4dpllcore; /* offset 0x538 */
  222. unsigned int divm5dpllcore; /* offset 0x53C */
  223. unsigned int divm6dpllcore; /* offset 0x540 */
  224. unsigned int resv8[7];
  225. unsigned int clkmoddpllmpu; /* offset 0x560 */
  226. unsigned int idlestdpllmpu; /* offset 0x564 */
  227. unsigned int resv9;
  228. unsigned int clkseldpllmpu; /* offset 0x56c */
  229. unsigned int divm2dpllmpu; /* offset 0x570 */
  230. unsigned int resv10[11];
  231. unsigned int clkmoddpllddr; /* offset 0x5A0 */
  232. unsigned int idlestdpllddr; /* offset 0x5A4 */
  233. unsigned int resv11;
  234. unsigned int clkseldpllddr; /* offset 0x5AC */
  235. unsigned int divm2dpllddr; /* offset 0x5B0 */
  236. unsigned int resv12[11];
  237. unsigned int clkmoddpllper; /* offset 0x5E0 */
  238. unsigned int idlestdpllper; /* offset 0x5E4 */
  239. unsigned int resv13;
  240. unsigned int clkseldpllper; /* offset 0x5EC */
  241. unsigned int divm2dpllper; /* offset 0x5F0 */
  242. unsigned int resv14[8];
  243. unsigned int clkdcoldodpllper; /* offset 0x614 */
  244. unsigned int resv15[2];
  245. unsigned int clkmoddplldisp; /* offset 0x620 */
  246. unsigned int resv16[2];
  247. unsigned int clkseldplldisp; /* offset 0x62C */
  248. unsigned int divm2dplldisp; /* offset 0x630 */
  249. };
  250. /*
  251. * Encapsulating peripheral functional clocks
  252. * pll registers
  253. */
  254. struct cm_perpll {
  255. unsigned int l3clkstctrl; /* offset 0x00 */
  256. unsigned int resv0[7];
  257. unsigned int l3clkctrl; /* Offset 0x20 */
  258. unsigned int resv112[7];
  259. unsigned int l3instrclkctrl; /* offset 0x40 */
  260. unsigned int resv2[3];
  261. unsigned int ocmcramclkctrl; /* offset 0x50 */
  262. unsigned int resv3[9];
  263. unsigned int tpccclkctrl; /* offset 0x78 */
  264. unsigned int resv4;
  265. unsigned int tptc0clkctrl; /* offset 0x80 */
  266. unsigned int resv5[7];
  267. unsigned int l4hsclkctrl; /* offset 0x0A0 */
  268. unsigned int resv6;
  269. unsigned int l4fwclkctrl; /* offset 0x0A8 */
  270. unsigned int resv7[85];
  271. unsigned int l3sclkstctrl; /* offset 0x200 */
  272. unsigned int resv8[7];
  273. unsigned int gpmcclkctrl; /* offset 0x220 */
  274. unsigned int resv9[5];
  275. unsigned int mcasp0clkctrl; /* offset 0x238 */
  276. unsigned int resv10;
  277. unsigned int mcasp1clkctrl; /* offset 0x240 */
  278. unsigned int resv11;
  279. unsigned int mmc2clkctrl; /* offset 0x248 */
  280. unsigned int resv12[3];
  281. unsigned int qspiclkctrl; /* offset 0x258 */
  282. unsigned int resv121;
  283. unsigned int usb0clkctrl; /* offset 0x260 */
  284. unsigned int resv122;
  285. unsigned int usb1clkctrl; /* offset 0x268 */
  286. unsigned int resv13[101];
  287. unsigned int l4lsclkstctrl; /* offset 0x400 */
  288. unsigned int resv14[7];
  289. unsigned int l4lsclkctrl; /* offset 0x420 */
  290. unsigned int resv15;
  291. unsigned int dcan0clkctrl; /* offset 0x428 */
  292. unsigned int resv16;
  293. unsigned int dcan1clkctrl; /* offset 0x430 */
  294. unsigned int resv17[13];
  295. unsigned int elmclkctrl; /* offset 0x468 */
  296. unsigned int resv18[3];
  297. unsigned int gpio1clkctrl; /* offset 0x478 */
  298. unsigned int resv19;
  299. unsigned int gpio2clkctrl; /* offset 0x480 */
  300. unsigned int resv20;
  301. unsigned int gpio3clkctrl; /* offset 0x488 */
  302. unsigned int resv41;
  303. unsigned int gpio4clkctrl; /* offset 0x490 */
  304. unsigned int resv42;
  305. unsigned int gpio5clkctrl; /* offset 0x498 */
  306. unsigned int resv21[3];
  307. unsigned int i2c1clkctrl; /* offset 0x4A8 */
  308. unsigned int resv22;
  309. unsigned int i2c2clkctrl; /* offset 0x4B0 */
  310. unsigned int resv23[3];
  311. unsigned int mmc0clkctrl; /* offset 0x4C0 */
  312. unsigned int resv24;
  313. unsigned int mmc1clkctrl; /* offset 0x4C8 */
  314. unsigned int resv25[13];
  315. unsigned int spi0clkctrl; /* offset 0x500 */
  316. unsigned int resv26;
  317. unsigned int spi1clkctrl; /* offset 0x508 */
  318. unsigned int resv27[9];
  319. unsigned int timer2clkctrl; /* offset 0x530 */
  320. unsigned int resv28;
  321. unsigned int timer3clkctrl; /* offset 0x538 */
  322. unsigned int resv29;
  323. unsigned int timer4clkctrl; /* offset 0x540 */
  324. unsigned int resv30[5];
  325. unsigned int timer7clkctrl; /* offset 0x558 */
  326. unsigned int resv31[9];
  327. unsigned int uart1clkctrl; /* offset 0x580 */
  328. unsigned int resv32;
  329. unsigned int uart2clkctrl; /* offset 0x588 */
  330. unsigned int resv33;
  331. unsigned int uart3clkctrl; /* offset 0x590 */
  332. unsigned int resv34;
  333. unsigned int uart4clkctrl; /* offset 0x598 */
  334. unsigned int resv35;
  335. unsigned int uart5clkctrl; /* offset 0x5A0 */
  336. unsigned int resv36[5];
  337. unsigned int usbphyocp2scp0clkctrl; /* offset 0x5B8 */
  338. unsigned int resv361;
  339. unsigned int usbphyocp2scp1clkctrl; /* offset 0x5C0 */
  340. unsigned int resv3611[79];
  341. unsigned int emifclkstctrl; /* offset 0x700 */
  342. unsigned int resv362[7];
  343. unsigned int emifclkctrl; /* offset 0x720 */
  344. unsigned int resv37[3];
  345. unsigned int emiffwclkctrl; /* offset 0x730 */
  346. unsigned int resv371;
  347. unsigned int otfaemifclkctrl; /* offset 0x738 */
  348. unsigned int resv38[57];
  349. unsigned int lcdclkctrl; /* offset 0x820 */
  350. unsigned int resv39[183];
  351. unsigned int cpswclkstctrl; /* offset 0xB00 */
  352. unsigned int resv40[7];
  353. unsigned int cpgmac0clkctrl; /* offset 0xB20 */
  354. };
  355. struct cm_device_inst {
  356. unsigned int cm_clkout1_ctrl;
  357. unsigned int cm_dll_ctrl;
  358. };
  359. struct prm_device_inst {
  360. unsigned int rstctrl;
  361. unsigned int rstst;
  362. unsigned int rsttime;
  363. unsigned int sram_count;
  364. unsigned int ldo_sram_core_set; /* offset 0x10 */
  365. unsigned int ldo_sram_core_ctr;
  366. unsigned int ldo_sram_mpu_setu;
  367. unsigned int ldo_sram_mpu_ctrl;
  368. unsigned int io_count; /* offset 0x20 */
  369. unsigned int io_pmctrl;
  370. unsigned int vc_val_bypass;
  371. unsigned int resv1;
  372. unsigned int emif_ctrl; /* offset 0x30 */
  373. };
  374. struct cm_dpll {
  375. unsigned int resv1;
  376. unsigned int clktimer2clk; /* offset 0x04 */
  377. unsigned int resv2[11];
  378. unsigned int clkselmacclk; /* offset 0x34 */
  379. };
  380. #endif /* CONFIG_AM43XX */
  381. /* Control Module RTC registers */
  382. struct cm_rtc {
  383. unsigned int rtcclkctrl; /* offset 0x0 */
  384. unsigned int clkstctrl; /* offset 0x4 */
  385. };
  386. /* Timer 32 bit registers */
  387. struct gptimer {
  388. unsigned int tidr; /* offset 0x00 */
  389. unsigned char res1[12];
  390. unsigned int tiocp_cfg; /* offset 0x10 */
  391. unsigned char res2[12];
  392. unsigned int tier; /* offset 0x20 */
  393. unsigned int tistatr; /* offset 0x24 */
  394. unsigned int tistat; /* offset 0x28 */
  395. unsigned int tisr; /* offset 0x2c */
  396. unsigned int tcicr; /* offset 0x30 */
  397. unsigned int twer; /* offset 0x34 */
  398. unsigned int tclr; /* offset 0x38 */
  399. unsigned int tcrr; /* offset 0x3c */
  400. unsigned int tldr; /* offset 0x40 */
  401. unsigned int ttgr; /* offset 0x44 */
  402. unsigned int twpc; /* offset 0x48 */
  403. unsigned int tmar; /* offset 0x4c */
  404. unsigned int tcar1; /* offset 0x50 */
  405. unsigned int tscir; /* offset 0x54 */
  406. unsigned int tcar2; /* offset 0x58 */
  407. };
  408. /* UART Registers */
  409. struct uart_sys {
  410. unsigned int resv1[21];
  411. unsigned int uartsyscfg; /* offset 0x54 */
  412. unsigned int uartsyssts; /* offset 0x58 */
  413. };
  414. /* VTP Registers */
  415. struct vtp_reg {
  416. unsigned int vtp0ctrlreg;
  417. };
  418. /* Control Status Register */
  419. struct ctrl_stat {
  420. unsigned int resv1[16];
  421. unsigned int statusreg; /* ofset 0x40 */
  422. unsigned int resv2[51];
  423. unsigned int secure_emif_sdram_config; /* offset 0x0110 */
  424. unsigned int resv3[319];
  425. unsigned int dev_attr;
  426. };
  427. /* AM33XX GPIO registers */
  428. #define OMAP_GPIO_REVISION 0x0000
  429. #define OMAP_GPIO_SYSCONFIG 0x0010
  430. #define OMAP_GPIO_SYSSTATUS 0x0114
  431. #define OMAP_GPIO_IRQSTATUS1 0x002c
  432. #define OMAP_GPIO_IRQSTATUS2 0x0030
  433. #define OMAP_GPIO_IRQSTATUS_SET_0 0x0034
  434. #define OMAP_GPIO_IRQSTATUS_SET_1 0x0038
  435. #define OMAP_GPIO_CTRL 0x0130
  436. #define OMAP_GPIO_OE 0x0134
  437. #define OMAP_GPIO_DATAIN 0x0138
  438. #define OMAP_GPIO_DATAOUT 0x013c
  439. #define OMAP_GPIO_LEVELDETECT0 0x0140
  440. #define OMAP_GPIO_LEVELDETECT1 0x0144
  441. #define OMAP_GPIO_RISINGDETECT 0x0148
  442. #define OMAP_GPIO_FALLINGDETECT 0x014c
  443. #define OMAP_GPIO_DEBOUNCE_EN 0x0150
  444. #define OMAP_GPIO_DEBOUNCE_VAL 0x0154
  445. #define OMAP_GPIO_CLEARDATAOUT 0x0190
  446. #define OMAP_GPIO_SETDATAOUT 0x0194
  447. /* Control Device Register */
  448. /* Control Device Register */
  449. #define MREQPRIO_0_SAB_INIT1_MASK 0xFFFFFF8F
  450. #define MREQPRIO_0_SAB_INIT0_MASK 0xFFFFFFF8
  451. #define MREQPRIO_1_DSS_MASK 0xFFFFFF8F
  452. struct ctrl_dev {
  453. unsigned int deviceid; /* offset 0x00 */
  454. unsigned int resv1[7];
  455. unsigned int usb_ctrl0; /* offset 0x20 */
  456. unsigned int resv2;
  457. unsigned int usb_ctrl1; /* offset 0x28 */
  458. unsigned int resv3;
  459. unsigned int macid0l; /* offset 0x30 */
  460. unsigned int macid0h; /* offset 0x34 */
  461. unsigned int macid1l; /* offset 0x38 */
  462. unsigned int macid1h; /* offset 0x3c */
  463. unsigned int resv4[4];
  464. unsigned int miisel; /* offset 0x50 */
  465. unsigned int resv5[7];
  466. unsigned int mreqprio_0; /* offset 0x70 */
  467. unsigned int mreqprio_1; /* offset 0x74 */
  468. unsigned int resv6[97];
  469. unsigned int efuse_sma; /* offset 0x1FC */
  470. };
  471. /* Bandwidth Limiter Portion of the L3Fast Configuration Register */
  472. #define BW_LIMITER_BW_FRAC_MASK 0xFFFFFFE0
  473. #define BW_LIMITER_BW_INT_MASK 0xFFFFFFF0
  474. #define BW_LIMITER_BW_WATERMARK_MASK 0xFFFFF800
  475. struct l3f_cfg_bwlimiter {
  476. u32 padding0[2];
  477. u32 modena_init0_bw_fractional;
  478. u32 modena_init0_bw_integer;
  479. u32 modena_init0_watermark_0;
  480. };
  481. /* gmii_sel register defines */
  482. #define GMII1_SEL_MII 0x0
  483. #define GMII1_SEL_RMII 0x1
  484. #define GMII1_SEL_RGMII 0x2
  485. #define GMII2_SEL_MII 0x0
  486. #define GMII2_SEL_RMII 0x4
  487. #define GMII2_SEL_RGMII 0x8
  488. #define RGMII1_IDMODE BIT(4)
  489. #define RGMII2_IDMODE BIT(5)
  490. #define RMII1_IO_CLK_EN BIT(6)
  491. #define RMII2_IO_CLK_EN BIT(7)
  492. #define MII_MODE_ENABLE (GMII1_SEL_MII | GMII2_SEL_MII)
  493. #define RMII_MODE_ENABLE (GMII1_SEL_RMII | GMII2_SEL_RMII)
  494. #define RGMII_MODE_ENABLE (GMII1_SEL_RGMII | GMII2_SEL_RGMII)
  495. #define RGMII_INT_DELAY (RGMII1_IDMODE | RGMII2_IDMODE)
  496. #define RMII_CHIPCKL_ENABLE (RMII1_IO_CLK_EN | RMII2_IO_CLK_EN)
  497. /* PWMSS */
  498. struct pwmss_regs {
  499. unsigned int idver;
  500. unsigned int sysconfig;
  501. unsigned int clkconfig;
  502. unsigned int clkstatus;
  503. };
  504. #define ECAP_CLK_EN BIT(0)
  505. #define ECAP_CLK_STOP_REQ BIT(1)
  506. #define EPWM_CLK_EN BIT(8)
  507. #define EPWM_CLK_STOP_REQ BIT(9)
  508. struct pwmss_ecap_regs {
  509. unsigned int tsctr;
  510. unsigned int ctrphs;
  511. unsigned int cap1;
  512. unsigned int cap2;
  513. unsigned int cap3;
  514. unsigned int cap4;
  515. unsigned int resv1[4];
  516. unsigned short ecctl1;
  517. unsigned short ecctl2;
  518. };
  519. struct pwmss_epwm_regs {
  520. unsigned short tbctl;
  521. unsigned short tbsts;
  522. unsigned short tbphshr;
  523. unsigned short tbphs;
  524. unsigned short tbcnt;
  525. unsigned short tbprd;
  526. unsigned short res1;
  527. unsigned short cmpctl;
  528. unsigned short cmpahr;
  529. unsigned short cmpa;
  530. unsigned short cmpb;
  531. unsigned short aqctla;
  532. unsigned short aqctlb;
  533. unsigned short aqsfrc;
  534. unsigned short aqcsfrc;
  535. unsigned short dbctl;
  536. unsigned short dbred;
  537. unsigned short dbfed;
  538. unsigned short tzsel;
  539. unsigned short tzctl;
  540. unsigned short tzflg;
  541. unsigned short tzclr;
  542. unsigned short tzfrc;
  543. unsigned short etsel;
  544. unsigned short etps;
  545. unsigned short etflg;
  546. unsigned short etclr;
  547. unsigned short etfrc;
  548. unsigned short pcctl;
  549. unsigned int res2[66];
  550. unsigned short hrcnfg;
  551. };
  552. /* Capture Control register 2 */
  553. #define ECTRL2_SYNCOSEL_MASK (0x03 << 6)
  554. #define ECTRL2_MDSL_ECAP BIT(9)
  555. #define ECTRL2_CTRSTP_FREERUN BIT(4)
  556. #define ECTRL2_PLSL_LOW BIT(10)
  557. #define ECTRL2_SYNC_EN BIT(5)
  558. #endif /* __ASSEMBLY__ */
  559. #endif /* __KERNEL_STRICT_NAMES */
  560. #endif /* _AM33XX_CPU_H */