cpu.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. /*
  2. * cpu.h
  3. *
  4. * AM33xx specific header file
  5. *
  6. * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #ifndef _AM33XX_CPU_H
  11. #define _AM33XX_CPU_H
  12. #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
  13. #include <asm/types.h>
  14. #endif /* !(__KERNEL_STRICT_NAMES || __ASSEMBLY__) */
  15. #include <asm/arch/hardware.h>
  16. #define BIT(x) (1 << x)
  17. #define CL_BIT(x) (0 << x)
  18. /* Timer register bits */
  19. #define TCLR_ST BIT(0) /* Start=1 Stop=0 */
  20. #define TCLR_AR BIT(1) /* Auto reload */
  21. #define TCLR_PRE BIT(5) /* Pre-scaler enable */
  22. #define TCLR_PTV_SHIFT (2) /* Pre-scaler shift value */
  23. #define TCLR_PRE_DISABLE CL_BIT(5) /* Pre-scalar disable */
  24. /* device type */
  25. #define DEVICE_MASK (BIT(8) | BIT(9) | BIT(10))
  26. #define TST_DEVICE 0x0
  27. #define EMU_DEVICE 0x1
  28. #define HS_DEVICE 0x2
  29. #define GP_DEVICE 0x3
  30. /* cpu-id for AM33XX and TI81XX family */
  31. #define AM335X 0xB944
  32. #define TI81XX 0xB81E
  33. #define DEVICE_ID (CTRL_BASE + 0x0600)
  34. #define DEVICE_ID_MASK 0x1FFF
  35. /* MPU max frequencies */
  36. #define AM335X_ZCZ_300 0x1FEF
  37. #define AM335X_ZCZ_600 0x1FAF
  38. #define AM335X_ZCZ_720 0x1F2F
  39. #define AM335X_ZCZ_800 0x1E2F
  40. #define AM335X_ZCZ_1000 0x1C2F
  41. #define AM335X_ZCE_300 0x1FDF
  42. #define AM335X_ZCE_600 0x1F9F
  43. /* This gives the status of the boot mode pins on the evm */
  44. #define SYSBOOT_MASK (BIT(0) | BIT(1) | BIT(2)\
  45. | BIT(3) | BIT(4))
  46. #define PRM_RSTCTRL_RESET 0x01
  47. #define PRM_RSTST_WARM_RESET_MASK 0x232
  48. /*
  49. * Watchdog:
  50. * Using the prescaler, the OMAP watchdog could go for many
  51. * months before firing. These limits work without scaling,
  52. * with the 60 second default assumed by most tools and docs.
  53. */
  54. #define TIMER_MARGIN_MAX (24 * 60 * 60) /* 1 day */
  55. #define TIMER_MARGIN_DEFAULT 60 /* 60 secs */
  56. #define TIMER_MARGIN_MIN 1
  57. #define PTV 0 /* prescale */
  58. #define GET_WLDR_VAL(secs) (0xffffffff - ((secs) * (32768/(1<<PTV))) + 1)
  59. #define WDT_WWPS_PEND_WCLR BIT(0)
  60. #define WDT_WWPS_PEND_WLDR BIT(2)
  61. #define WDT_WWPS_PEND_WTGR BIT(3)
  62. #define WDT_WWPS_PEND_WSPR BIT(4)
  63. #define WDT_WCLR_PRE BIT(5)
  64. #define WDT_WCLR_PTV_OFF 2
  65. #ifndef __KERNEL_STRICT_NAMES
  66. #ifndef __ASSEMBLY__
  67. struct gpmc_cs {
  68. u32 config1; /* 0x00 */
  69. u32 config2; /* 0x04 */
  70. u32 config3; /* 0x08 */
  71. u32 config4; /* 0x0C */
  72. u32 config5; /* 0x10 */
  73. u32 config6; /* 0x14 */
  74. u32 config7; /* 0x18 */
  75. u32 nand_cmd; /* 0x1C */
  76. u32 nand_adr; /* 0x20 */
  77. u32 nand_dat; /* 0x24 */
  78. u8 res[8]; /* blow up to 0x30 byte */
  79. };
  80. struct bch_res_0_3 {
  81. u32 bch_result_x[4];
  82. };
  83. struct gpmc {
  84. u8 res1[0x10];
  85. u32 sysconfig; /* 0x10 */
  86. u8 res2[0x4];
  87. u32 irqstatus; /* 0x18 */
  88. u32 irqenable; /* 0x1C */
  89. u8 res3[0x20];
  90. u32 timeout_control; /* 0x40 */
  91. u8 res4[0xC];
  92. u32 config; /* 0x50 */
  93. u32 status; /* 0x54 */
  94. u8 res5[0x8]; /* 0x58 */
  95. struct gpmc_cs cs[8]; /* 0x60, 0x90, .. */
  96. u8 res6[0x14]; /* 0x1E0 */
  97. u32 ecc_config; /* 0x1F4 */
  98. u32 ecc_control; /* 0x1F8 */
  99. u32 ecc_size_config; /* 0x1FC */
  100. u32 ecc1_result; /* 0x200 */
  101. u32 ecc2_result; /* 0x204 */
  102. u32 ecc3_result; /* 0x208 */
  103. u32 ecc4_result; /* 0x20C */
  104. u32 ecc5_result; /* 0x210 */
  105. u32 ecc6_result; /* 0x214 */
  106. u32 ecc7_result; /* 0x218 */
  107. u32 ecc8_result; /* 0x21C */
  108. u32 ecc9_result; /* 0x220 */
  109. u8 res7[12]; /* 0x224 */
  110. u32 testmomde_ctrl; /* 0x230 */
  111. u8 res8[12]; /* 0x234 */
  112. struct bch_res_0_3 bch_result_0_3[2]; /* 0x240 */
  113. };
  114. /* Used for board specific gpmc initialization */
  115. extern struct gpmc *gpmc_cfg;
  116. #ifndef CONFIG_AM43XX
  117. /* Encapsulating core pll registers */
  118. struct cm_wkuppll {
  119. unsigned int wkclkstctrl; /* offset 0x00 */
  120. unsigned int wkctrlclkctrl; /* offset 0x04 */
  121. unsigned int wkgpio0clkctrl; /* offset 0x08 */
  122. unsigned int wkl4wkclkctrl; /* offset 0x0c */
  123. unsigned int resv2[4];
  124. unsigned int idlestdpllmpu; /* offset 0x20 */
  125. unsigned int resv3[2];
  126. unsigned int clkseldpllmpu; /* offset 0x2c */
  127. unsigned int resv4[1];
  128. unsigned int idlestdpllddr; /* offset 0x34 */
  129. unsigned int resv5[2];
  130. unsigned int clkseldpllddr; /* offset 0x40 */
  131. unsigned int resv6[4];
  132. unsigned int clkseldplldisp; /* offset 0x54 */
  133. unsigned int resv7[1];
  134. unsigned int idlestdpllcore; /* offset 0x5c */
  135. unsigned int resv8[2];
  136. unsigned int clkseldpllcore; /* offset 0x68 */
  137. unsigned int resv9[1];
  138. unsigned int idlestdpllper; /* offset 0x70 */
  139. unsigned int resv10[2];
  140. unsigned int clkdcoldodpllper; /* offset 0x7c */
  141. unsigned int divm4dpllcore; /* offset 0x80 */
  142. unsigned int divm5dpllcore; /* offset 0x84 */
  143. unsigned int clkmoddpllmpu; /* offset 0x88 */
  144. unsigned int clkmoddpllper; /* offset 0x8c */
  145. unsigned int clkmoddpllcore; /* offset 0x90 */
  146. unsigned int clkmoddpllddr; /* offset 0x94 */
  147. unsigned int clkmoddplldisp; /* offset 0x98 */
  148. unsigned int clkseldpllper; /* offset 0x9c */
  149. unsigned int divm2dpllddr; /* offset 0xA0 */
  150. unsigned int divm2dplldisp; /* offset 0xA4 */
  151. unsigned int divm2dpllmpu; /* offset 0xA8 */
  152. unsigned int divm2dpllper; /* offset 0xAC */
  153. unsigned int resv11[1];
  154. unsigned int wkup_uart0ctrl; /* offset 0xB4 */
  155. unsigned int wkup_i2c0ctrl; /* offset 0xB8 */
  156. unsigned int resv12[7];
  157. unsigned int divm6dpllcore; /* offset 0xD8 */
  158. };
  159. /**
  160. * Encapsulating peripheral functional clocks
  161. * pll registers
  162. */
  163. struct cm_perpll {
  164. unsigned int l4lsclkstctrl; /* offset 0x00 */
  165. unsigned int l3sclkstctrl; /* offset 0x04 */
  166. unsigned int l4fwclkstctrl; /* offset 0x08 */
  167. unsigned int l3clkstctrl; /* offset 0x0c */
  168. unsigned int resv1;
  169. unsigned int cpgmac0clkctrl; /* offset 0x14 */
  170. unsigned int lcdclkctrl; /* offset 0x18 */
  171. unsigned int usb0clkctrl; /* offset 0x1C */
  172. unsigned int resv2;
  173. unsigned int tptc0clkctrl; /* offset 0x24 */
  174. unsigned int emifclkctrl; /* offset 0x28 */
  175. unsigned int ocmcramclkctrl; /* offset 0x2c */
  176. unsigned int gpmcclkctrl; /* offset 0x30 */
  177. unsigned int mcasp0clkctrl; /* offset 0x34 */
  178. unsigned int uart5clkctrl; /* offset 0x38 */
  179. unsigned int mmc0clkctrl; /* offset 0x3C */
  180. unsigned int elmclkctrl; /* offset 0x40 */
  181. unsigned int i2c2clkctrl; /* offset 0x44 */
  182. unsigned int i2c1clkctrl; /* offset 0x48 */
  183. unsigned int spi0clkctrl; /* offset 0x4C */
  184. unsigned int spi1clkctrl; /* offset 0x50 */
  185. unsigned int resv3[3];
  186. unsigned int l4lsclkctrl; /* offset 0x60 */
  187. unsigned int l4fwclkctrl; /* offset 0x64 */
  188. unsigned int mcasp1clkctrl; /* offset 0x68 */
  189. unsigned int uart1clkctrl; /* offset 0x6C */
  190. unsigned int uart2clkctrl; /* offset 0x70 */
  191. unsigned int uart3clkctrl; /* offset 0x74 */
  192. unsigned int uart4clkctrl; /* offset 0x78 */
  193. unsigned int timer7clkctrl; /* offset 0x7C */
  194. unsigned int timer2clkctrl; /* offset 0x80 */
  195. unsigned int timer3clkctrl; /* offset 0x84 */
  196. unsigned int timer4clkctrl; /* offset 0x88 */
  197. unsigned int resv4[8];
  198. unsigned int gpio1clkctrl; /* offset 0xAC */
  199. unsigned int gpio2clkctrl; /* offset 0xB0 */
  200. unsigned int gpio3clkctrl; /* offset 0xB4 */
  201. unsigned int resv5;
  202. unsigned int tpccclkctrl; /* offset 0xBC */
  203. unsigned int dcan0clkctrl; /* offset 0xC0 */
  204. unsigned int dcan1clkctrl; /* offset 0xC4 */
  205. unsigned int resv6[2];
  206. unsigned int emiffwclkctrl; /* offset 0xD0 */
  207. unsigned int epwmss0clkctrl; /* offset 0xD4 */
  208. unsigned int epwmss2clkctrl; /* offset 0xD8 */
  209. unsigned int l3instrclkctrl; /* offset 0xDC */
  210. unsigned int l3clkctrl; /* Offset 0xE0 */
  211. unsigned int resv8[4];
  212. unsigned int mmc1clkctrl; /* offset 0xF4 */
  213. unsigned int mmc2clkctrl; /* offset 0xF8 */
  214. unsigned int resv9[8];
  215. unsigned int l4hsclkstctrl; /* offset 0x11C */
  216. unsigned int l4hsclkctrl; /* offset 0x120 */
  217. unsigned int resv10[8];
  218. unsigned int cpswclkstctrl; /* offset 0x144 */
  219. unsigned int lcdcclkstctrl; /* offset 0x148 */
  220. };
  221. /* Encapsulating Display pll registers */
  222. struct cm_dpll {
  223. unsigned int resv1[2];
  224. unsigned int clktimer2clk; /* offset 0x08 */
  225. unsigned int resv2[10];
  226. unsigned int clklcdcpixelclk; /* offset 0x34 */
  227. };
  228. #else
  229. /* Encapsulating core pll registers */
  230. struct cm_wkuppll {
  231. unsigned int resv0[136];
  232. unsigned int wkl4wkclkctrl; /* offset 0x220 */
  233. unsigned int resv1[55];
  234. unsigned int wkclkstctrl; /* offset 0x300 */
  235. unsigned int resv2[15];
  236. unsigned int wkup_i2c0ctrl; /* offset 0x340 */
  237. unsigned int resv3;
  238. unsigned int wkup_uart0ctrl; /* offset 0x348 */
  239. unsigned int resv4[5];
  240. unsigned int wkctrlclkctrl; /* offset 0x360 */
  241. unsigned int resv5;
  242. unsigned int wkgpio0clkctrl; /* offset 0x368 */
  243. unsigned int resv6[109];
  244. unsigned int clkmoddpllcore; /* offset 0x520 */
  245. unsigned int idlestdpllcore; /* offset 0x524 */
  246. unsigned int resv61;
  247. unsigned int clkseldpllcore; /* offset 0x52C */
  248. unsigned int resv7[2];
  249. unsigned int divm4dpllcore; /* offset 0x538 */
  250. unsigned int divm5dpllcore; /* offset 0x53C */
  251. unsigned int divm6dpllcore; /* offset 0x540 */
  252. unsigned int resv8[7];
  253. unsigned int clkmoddpllmpu; /* offset 0x560 */
  254. unsigned int idlestdpllmpu; /* offset 0x564 */
  255. unsigned int resv9;
  256. unsigned int clkseldpllmpu; /* offset 0x56c */
  257. unsigned int divm2dpllmpu; /* offset 0x570 */
  258. unsigned int resv10[11];
  259. unsigned int clkmoddpllddr; /* offset 0x5A0 */
  260. unsigned int idlestdpllddr; /* offset 0x5A4 */
  261. unsigned int resv11;
  262. unsigned int clkseldpllddr; /* offset 0x5AC */
  263. unsigned int divm2dpllddr; /* offset 0x5B0 */
  264. unsigned int resv12[11];
  265. unsigned int clkmoddpllper; /* offset 0x5E0 */
  266. unsigned int idlestdpllper; /* offset 0x5E4 */
  267. unsigned int resv13;
  268. unsigned int clkseldpllper; /* offset 0x5EC */
  269. unsigned int divm2dpllper; /* offset 0x5F0 */
  270. unsigned int resv14[8];
  271. unsigned int clkdcoldodpllper; /* offset 0x614 */
  272. unsigned int resv15[2];
  273. unsigned int clkmoddplldisp; /* offset 0x620 */
  274. unsigned int resv16[2];
  275. unsigned int clkseldplldisp; /* offset 0x62C */
  276. unsigned int divm2dplldisp; /* offset 0x630 */
  277. };
  278. /*
  279. * Encapsulating peripheral functional clocks
  280. * pll registers
  281. */
  282. struct cm_perpll {
  283. unsigned int l3clkstctrl; /* offset 0x00 */
  284. unsigned int resv0[7];
  285. unsigned int l3clkctrl; /* Offset 0x20 */
  286. unsigned int resv1[7];
  287. unsigned int l3instrclkctrl; /* offset 0x40 */
  288. unsigned int resv2[3];
  289. unsigned int ocmcramclkctrl; /* offset 0x50 */
  290. unsigned int resv3[9];
  291. unsigned int tpccclkctrl; /* offset 0x78 */
  292. unsigned int resv4;
  293. unsigned int tptc0clkctrl; /* offset 0x80 */
  294. unsigned int resv5[7];
  295. unsigned int l4hsclkctrl; /* offset 0x0A0 */
  296. unsigned int resv6;
  297. unsigned int l4fwclkctrl; /* offset 0x0A8 */
  298. unsigned int resv7[85];
  299. unsigned int l3sclkstctrl; /* offset 0x200 */
  300. unsigned int resv8[7];
  301. unsigned int gpmcclkctrl; /* offset 0x220 */
  302. unsigned int resv9[5];
  303. unsigned int mcasp0clkctrl; /* offset 0x238 */
  304. unsigned int resv10;
  305. unsigned int mcasp1clkctrl; /* offset 0x240 */
  306. unsigned int resv11;
  307. unsigned int mmc2clkctrl; /* offset 0x248 */
  308. unsigned int resv12[5];
  309. unsigned int usb0clkctrl; /* offset 0x260 */
  310. unsigned int resv13[103];
  311. unsigned int l4lsclkstctrl; /* offset 0x400 */
  312. unsigned int resv14[7];
  313. unsigned int l4lsclkctrl; /* offset 0x420 */
  314. unsigned int resv15;
  315. unsigned int dcan0clkctrl; /* offset 0x428 */
  316. unsigned int resv16;
  317. unsigned int dcan1clkctrl; /* offset 0x430 */
  318. unsigned int resv17[13];
  319. unsigned int elmclkctrl; /* offset 0x468 */
  320. unsigned int resv18[3];
  321. unsigned int gpio1clkctrl; /* offset 0x478 */
  322. unsigned int resv19;
  323. unsigned int gpio2clkctrl; /* offset 0x480 */
  324. unsigned int resv20;
  325. unsigned int gpio3clkctrl; /* offset 0x488 */
  326. unsigned int resv21[7];
  327. unsigned int i2c1clkctrl; /* offset 0x4A8 */
  328. unsigned int resv22;
  329. unsigned int i2c2clkctrl; /* offset 0x4B0 */
  330. unsigned int resv23[3];
  331. unsigned int mmc0clkctrl; /* offset 0x4C0 */
  332. unsigned int resv24;
  333. unsigned int mmc1clkctrl; /* offset 0x4C8 */
  334. unsigned int resv25[13];
  335. unsigned int spi0clkctrl; /* offset 0x500 */
  336. unsigned int resv26;
  337. unsigned int spi1clkctrl; /* offset 0x508 */
  338. unsigned int resv27[9];
  339. unsigned int timer2clkctrl; /* offset 0x530 */
  340. unsigned int resv28;
  341. unsigned int timer3clkctrl; /* offset 0x538 */
  342. unsigned int resv29;
  343. unsigned int timer4clkctrl; /* offset 0x540 */
  344. unsigned int resv30[5];
  345. unsigned int timer7clkctrl; /* offset 0x558 */
  346. unsigned int resv31[9];
  347. unsigned int uart1clkctrl; /* offset 0x580 */
  348. unsigned int resv32;
  349. unsigned int uart2clkctrl; /* offset 0x588 */
  350. unsigned int resv33;
  351. unsigned int uart3clkctrl; /* offset 0x590 */
  352. unsigned int resv34;
  353. unsigned int uart4clkctrl; /* offset 0x598 */
  354. unsigned int resv35;
  355. unsigned int uart5clkctrl; /* offset 0x5A0 */
  356. unsigned int resv36[87];
  357. unsigned int emifclkstctrl; /* offset 0x700 */
  358. unsigned int resv361[7];
  359. unsigned int emifclkctrl; /* offset 0x720 */
  360. unsigned int resv37[3];
  361. unsigned int emiffwclkctrl; /* offset 0x730 */
  362. unsigned int resv371;
  363. unsigned int otfaemifclkctrl; /* offset 0x738 */
  364. unsigned int resv38[57];
  365. unsigned int lcdclkctrl; /* offset 0x820 */
  366. unsigned int resv39[183];
  367. unsigned int cpswclkstctrl; /* offset 0xB00 */
  368. unsigned int resv40[7];
  369. unsigned int cpgmac0clkctrl; /* offset 0xB20 */
  370. };
  371. struct cm_device_inst {
  372. unsigned int cm_clkout1_ctrl;
  373. unsigned int cm_dll_ctrl;
  374. };
  375. struct cm_dpll {
  376. unsigned int resv1;
  377. unsigned int clktimer2clk; /* offset 0x04 */
  378. };
  379. #endif /* CONFIG_AM43XX */
  380. /* Control Module RTC registers */
  381. struct cm_rtc {
  382. unsigned int rtcclkctrl; /* offset 0x0 */
  383. unsigned int clkstctrl; /* offset 0x4 */
  384. };
  385. /* Watchdog timer registers */
  386. struct wd_timer {
  387. unsigned int resv1[4];
  388. unsigned int wdtwdsc; /* offset 0x010 */
  389. unsigned int wdtwdst; /* offset 0x014 */
  390. unsigned int wdtwisr; /* offset 0x018 */
  391. unsigned int wdtwier; /* offset 0x01C */
  392. unsigned int wdtwwer; /* offset 0x020 */
  393. unsigned int wdtwclr; /* offset 0x024 */
  394. unsigned int wdtwcrr; /* offset 0x028 */
  395. unsigned int wdtwldr; /* offset 0x02C */
  396. unsigned int wdtwtgr; /* offset 0x030 */
  397. unsigned int wdtwwps; /* offset 0x034 */
  398. unsigned int resv2[3];
  399. unsigned int wdtwdly; /* offset 0x044 */
  400. unsigned int wdtwspr; /* offset 0x048 */
  401. unsigned int resv3[1];
  402. unsigned int wdtwqeoi; /* offset 0x050 */
  403. unsigned int wdtwqstar; /* offset 0x054 */
  404. unsigned int wdtwqsta; /* offset 0x058 */
  405. unsigned int wdtwqens; /* offset 0x05C */
  406. unsigned int wdtwqenc; /* offset 0x060 */
  407. unsigned int resv4[39];
  408. unsigned int wdt_unfr; /* offset 0x100 */
  409. };
  410. /* Timer 32 bit registers */
  411. struct gptimer {
  412. unsigned int tidr; /* offset 0x00 */
  413. unsigned char res1[12];
  414. unsigned int tiocp_cfg; /* offset 0x10 */
  415. unsigned char res2[12];
  416. unsigned int tier; /* offset 0x20 */
  417. unsigned int tistatr; /* offset 0x24 */
  418. unsigned int tistat; /* offset 0x28 */
  419. unsigned int tisr; /* offset 0x2c */
  420. unsigned int tcicr; /* offset 0x30 */
  421. unsigned int twer; /* offset 0x34 */
  422. unsigned int tclr; /* offset 0x38 */
  423. unsigned int tcrr; /* offset 0x3c */
  424. unsigned int tldr; /* offset 0x40 */
  425. unsigned int ttgr; /* offset 0x44 */
  426. unsigned int twpc; /* offset 0x48 */
  427. unsigned int tmar; /* offset 0x4c */
  428. unsigned int tcar1; /* offset 0x50 */
  429. unsigned int tscir; /* offset 0x54 */
  430. unsigned int tcar2; /* offset 0x58 */
  431. };
  432. /* UART Registers */
  433. struct uart_sys {
  434. unsigned int resv1[21];
  435. unsigned int uartsyscfg; /* offset 0x54 */
  436. unsigned int uartsyssts; /* offset 0x58 */
  437. };
  438. /* VTP Registers */
  439. struct vtp_reg {
  440. unsigned int vtp0ctrlreg;
  441. };
  442. /* Control Status Register */
  443. struct ctrl_stat {
  444. unsigned int resv1[16];
  445. unsigned int statusreg; /* ofset 0x40 */
  446. unsigned int resv2[51];
  447. unsigned int secure_emif_sdram_config; /* offset 0x0110 */
  448. unsigned int resv3[319];
  449. unsigned int dev_attr;
  450. };
  451. /* AM33XX GPIO registers */
  452. #define OMAP_GPIO_REVISION 0x0000
  453. #define OMAP_GPIO_SYSCONFIG 0x0010
  454. #define OMAP_GPIO_SYSSTATUS 0x0114
  455. #define OMAP_GPIO_IRQSTATUS1 0x002c
  456. #define OMAP_GPIO_IRQSTATUS2 0x0030
  457. #define OMAP_GPIO_CTRL 0x0130
  458. #define OMAP_GPIO_OE 0x0134
  459. #define OMAP_GPIO_DATAIN 0x0138
  460. #define OMAP_GPIO_DATAOUT 0x013c
  461. #define OMAP_GPIO_LEVELDETECT0 0x0140
  462. #define OMAP_GPIO_LEVELDETECT1 0x0144
  463. #define OMAP_GPIO_RISINGDETECT 0x0148
  464. #define OMAP_GPIO_FALLINGDETECT 0x014c
  465. #define OMAP_GPIO_DEBOUNCE_EN 0x0150
  466. #define OMAP_GPIO_DEBOUNCE_VAL 0x0154
  467. #define OMAP_GPIO_CLEARDATAOUT 0x0190
  468. #define OMAP_GPIO_SETDATAOUT 0x0194
  469. /* Control Device Register */
  470. struct ctrl_dev {
  471. unsigned int deviceid; /* offset 0x00 */
  472. unsigned int resv1[7];
  473. unsigned int usb_ctrl0; /* offset 0x20 */
  474. unsigned int resv2;
  475. unsigned int usb_ctrl1; /* offset 0x28 */
  476. unsigned int resv3;
  477. unsigned int macid0l; /* offset 0x30 */
  478. unsigned int macid0h; /* offset 0x34 */
  479. unsigned int macid1l; /* offset 0x38 */
  480. unsigned int macid1h; /* offset 0x3c */
  481. unsigned int resv4[4];
  482. unsigned int miisel; /* offset 0x50 */
  483. unsigned int resv5[106];
  484. unsigned int efuse_sma; /* offset 0x1FC */
  485. };
  486. /* gmii_sel register defines */
  487. #define GMII1_SEL_MII 0x0
  488. #define GMII1_SEL_RMII 0x1
  489. #define GMII1_SEL_RGMII 0x2
  490. #define GMII2_SEL_MII 0x0
  491. #define GMII2_SEL_RMII 0x4
  492. #define GMII2_SEL_RGMII 0x8
  493. #define RGMII1_IDMODE BIT(4)
  494. #define RGMII2_IDMODE BIT(5)
  495. #define RMII1_IO_CLK_EN BIT(6)
  496. #define RMII2_IO_CLK_EN BIT(7)
  497. #define MII_MODE_ENABLE (GMII1_SEL_MII | GMII2_SEL_MII)
  498. #define RMII_MODE_ENABLE (GMII1_SEL_RMII | GMII2_SEL_RMII)
  499. #define RGMII_MODE_ENABLE (GMII1_SEL_RGMII | GMII2_SEL_RGMII)
  500. #define RGMII_INT_DELAY (RGMII1_IDMODE | RGMII2_IDMODE)
  501. #define RMII_CHIPCKL_ENABLE (RMII1_IO_CLK_EN | RMII2_IO_CLK_EN)
  502. /* PWMSS */
  503. struct pwmss_regs {
  504. unsigned int idver;
  505. unsigned int sysconfig;
  506. unsigned int clkconfig;
  507. unsigned int clkstatus;
  508. };
  509. #define ECAP_CLK_EN BIT(0)
  510. #define ECAP_CLK_STOP_REQ BIT(1)
  511. struct pwmss_ecap_regs {
  512. unsigned int tsctr;
  513. unsigned int ctrphs;
  514. unsigned int cap1;
  515. unsigned int cap2;
  516. unsigned int cap3;
  517. unsigned int cap4;
  518. unsigned int resv1[4];
  519. unsigned short ecctl1;
  520. unsigned short ecctl2;
  521. };
  522. /* Capture Control register 2 */
  523. #define ECTRL2_SYNCOSEL_MASK (0x03 << 6)
  524. #define ECTRL2_MDSL_ECAP BIT(9)
  525. #define ECTRL2_CTRSTP_FREERUN BIT(4)
  526. #define ECTRL2_PLSL_LOW BIT(10)
  527. #define ECTRL2_SYNC_EN BIT(5)
  528. #endif /* __ASSEMBLY__ */
  529. #endif /* __KERNEL_STRICT_NAMES */
  530. #endif /* _AM33XX_CPU_H */