cpu_init.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. /*
  2. * Copyright (C) 2004-2009 Freescale Semiconductor, Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <mpc83xx.h>
  8. #include <ioports.h>
  9. #include <asm/io.h>
  10. #include <asm/processor.h>
  11. #ifdef CONFIG_USB_EHCI_FSL
  12. #include <usb/ehci-ci.h>
  13. #endif
  14. DECLARE_GLOBAL_DATA_PTR;
  15. #ifdef CONFIG_QE
  16. extern qe_iop_conf_t qe_iop_conf_tab[];
  17. extern void qe_config_iopin(u8 port, u8 pin, int dir,
  18. int open_drain, int assign);
  19. extern void qe_init(uint qe_base);
  20. extern void qe_reset(void);
  21. static void config_qe_ioports(void)
  22. {
  23. u8 port, pin;
  24. int dir, open_drain, assign;
  25. int i;
  26. for (i = 0; qe_iop_conf_tab[i].assign != QE_IOP_TAB_END; i++) {
  27. port = qe_iop_conf_tab[i].port;
  28. pin = qe_iop_conf_tab[i].pin;
  29. dir = qe_iop_conf_tab[i].dir;
  30. open_drain = qe_iop_conf_tab[i].open_drain;
  31. assign = qe_iop_conf_tab[i].assign;
  32. qe_config_iopin(port, pin, dir, open_drain, assign);
  33. }
  34. }
  35. #endif
  36. /*
  37. * Breathe some life into the CPU...
  38. *
  39. * Set up the memory map,
  40. * initialize a bunch of registers,
  41. * initialize the UPM's
  42. */
  43. void cpu_init_f (volatile immap_t * im)
  44. {
  45. __be32 acr_mask =
  46. #ifdef CONFIG_SYS_ACR_PIPE_DEP /* Arbiter pipeline depth */
  47. ACR_PIPE_DEP |
  48. #endif
  49. #ifdef CONFIG_SYS_ACR_RPTCNT /* Arbiter repeat count */
  50. ACR_RPTCNT |
  51. #endif
  52. #ifdef CONFIG_SYS_ACR_APARK /* Arbiter address parking mode */
  53. ACR_APARK |
  54. #endif
  55. #ifdef CONFIG_SYS_ACR_PARKM /* Arbiter parking master */
  56. ACR_PARKM |
  57. #endif
  58. 0;
  59. __be32 acr_val =
  60. #ifdef CONFIG_SYS_ACR_PIPE_DEP /* Arbiter pipeline depth */
  61. (CONFIG_SYS_ACR_PIPE_DEP << ACR_PIPE_DEP_SHIFT) |
  62. #endif
  63. #ifdef CONFIG_SYS_ACR_RPTCNT /* Arbiter repeat count */
  64. (CONFIG_SYS_ACR_RPTCNT << ACR_RPTCNT_SHIFT) |
  65. #endif
  66. #ifdef CONFIG_SYS_ACR_APARK /* Arbiter address parking mode */
  67. (CONFIG_SYS_ACR_APARK << ACR_APARK_SHIFT) |
  68. #endif
  69. #ifdef CONFIG_SYS_ACR_PARKM /* Arbiter parking master */
  70. (CONFIG_SYS_ACR_PARKM << ACR_PARKM_SHIFT) |
  71. #endif
  72. 0;
  73. __be32 spcr_mask =
  74. #ifdef CONFIG_SYS_SPCR_OPT /* Optimize transactions between CSB and other dev */
  75. SPCR_OPT |
  76. #endif
  77. #ifdef CONFIG_SYS_SPCR_TSECEP /* all eTSEC's Emergency priority */
  78. SPCR_TSECEP |
  79. #endif
  80. #ifdef CONFIG_SYS_SPCR_TSEC1EP /* TSEC1 Emergency priority */
  81. SPCR_TSEC1EP |
  82. #endif
  83. #ifdef CONFIG_SYS_SPCR_TSEC2EP /* TSEC2 Emergency priority */
  84. SPCR_TSEC2EP |
  85. #endif
  86. 0;
  87. __be32 spcr_val =
  88. #ifdef CONFIG_SYS_SPCR_OPT
  89. (CONFIG_SYS_SPCR_OPT << SPCR_OPT_SHIFT) |
  90. #endif
  91. #ifdef CONFIG_SYS_SPCR_TSECEP /* all eTSEC's Emergency priority */
  92. (CONFIG_SYS_SPCR_TSECEP << SPCR_TSECEP_SHIFT) |
  93. #endif
  94. #ifdef CONFIG_SYS_SPCR_TSEC1EP /* TSEC1 Emergency priority */
  95. (CONFIG_SYS_SPCR_TSEC1EP << SPCR_TSEC1EP_SHIFT) |
  96. #endif
  97. #ifdef CONFIG_SYS_SPCR_TSEC2EP /* TSEC2 Emergency priority */
  98. (CONFIG_SYS_SPCR_TSEC2EP << SPCR_TSEC2EP_SHIFT) |
  99. #endif
  100. 0;
  101. __be32 sccr_mask =
  102. #ifdef CONFIG_SYS_SCCR_ENCCM /* Encryption clock mode */
  103. SCCR_ENCCM |
  104. #endif
  105. #ifdef CONFIG_SYS_SCCR_PCICM /* PCI & DMA clock mode */
  106. SCCR_PCICM |
  107. #endif
  108. #ifdef CONFIG_SYS_SCCR_PCIEXP1CM /* PCIE1 clock mode */
  109. SCCR_PCIEXP1CM |
  110. #endif
  111. #ifdef CONFIG_SYS_SCCR_PCIEXP2CM /* PCIE2 clock mode */
  112. SCCR_PCIEXP2CM |
  113. #endif
  114. #ifdef CONFIG_SYS_SCCR_TSECCM /* all TSEC's clock mode */
  115. SCCR_TSECCM |
  116. #endif
  117. #ifdef CONFIG_SYS_SCCR_TSEC1CM /* TSEC1 clock mode */
  118. SCCR_TSEC1CM |
  119. #endif
  120. #ifdef CONFIG_SYS_SCCR_TSEC2CM /* TSEC2 clock mode */
  121. SCCR_TSEC2CM |
  122. #endif
  123. #ifdef CONFIG_SYS_SCCR_TSEC1ON /* TSEC1 clock switch */
  124. SCCR_TSEC1ON |
  125. #endif
  126. #ifdef CONFIG_SYS_SCCR_TSEC2ON /* TSEC2 clock switch */
  127. SCCR_TSEC2ON |
  128. #endif
  129. #ifdef CONFIG_SYS_SCCR_USBMPHCM /* USB MPH clock mode */
  130. SCCR_USBMPHCM |
  131. #endif
  132. #ifdef CONFIG_SYS_SCCR_USBDRCM /* USB DR clock mode */
  133. SCCR_USBDRCM |
  134. #endif
  135. #ifdef CONFIG_SYS_SCCR_SATACM /* SATA controller clock mode */
  136. SCCR_SATACM |
  137. #endif
  138. 0;
  139. __be32 sccr_val =
  140. #ifdef CONFIG_SYS_SCCR_ENCCM /* Encryption clock mode */
  141. (CONFIG_SYS_SCCR_ENCCM << SCCR_ENCCM_SHIFT) |
  142. #endif
  143. #ifdef CONFIG_SYS_SCCR_PCICM /* PCI & DMA clock mode */
  144. (CONFIG_SYS_SCCR_PCICM << SCCR_PCICM_SHIFT) |
  145. #endif
  146. #ifdef CONFIG_SYS_SCCR_PCIEXP1CM /* PCIE1 clock mode */
  147. (CONFIG_SYS_SCCR_PCIEXP1CM << SCCR_PCIEXP1CM_SHIFT) |
  148. #endif
  149. #ifdef CONFIG_SYS_SCCR_PCIEXP2CM /* PCIE2 clock mode */
  150. (CONFIG_SYS_SCCR_PCIEXP2CM << SCCR_PCIEXP2CM_SHIFT) |
  151. #endif
  152. #ifdef CONFIG_SYS_SCCR_TSECCM /* all TSEC's clock mode */
  153. (CONFIG_SYS_SCCR_TSECCM << SCCR_TSECCM_SHIFT) |
  154. #endif
  155. #ifdef CONFIG_SYS_SCCR_TSEC1CM /* TSEC1 clock mode */
  156. (CONFIG_SYS_SCCR_TSEC1CM << SCCR_TSEC1CM_SHIFT) |
  157. #endif
  158. #ifdef CONFIG_SYS_SCCR_TSEC2CM /* TSEC2 clock mode */
  159. (CONFIG_SYS_SCCR_TSEC2CM << SCCR_TSEC2CM_SHIFT) |
  160. #endif
  161. #ifdef CONFIG_SYS_SCCR_TSEC1ON /* TSEC1 clock switch */
  162. (CONFIG_SYS_SCCR_TSEC1ON << SCCR_TSEC1ON_SHIFT) |
  163. #endif
  164. #ifdef CONFIG_SYS_SCCR_TSEC2ON /* TSEC2 clock switch */
  165. (CONFIG_SYS_SCCR_TSEC2ON << SCCR_TSEC2ON_SHIFT) |
  166. #endif
  167. #ifdef CONFIG_SYS_SCCR_USBMPHCM /* USB MPH clock mode */
  168. (CONFIG_SYS_SCCR_USBMPHCM << SCCR_USBMPHCM_SHIFT) |
  169. #endif
  170. #ifdef CONFIG_SYS_SCCR_USBDRCM /* USB DR clock mode */
  171. (CONFIG_SYS_SCCR_USBDRCM << SCCR_USBDRCM_SHIFT) |
  172. #endif
  173. #ifdef CONFIG_SYS_SCCR_SATACM /* SATA controller clock mode */
  174. (CONFIG_SYS_SCCR_SATACM << SCCR_SATACM_SHIFT) |
  175. #endif
  176. 0;
  177. __be32 lcrr_mask =
  178. #ifdef CONFIG_SYS_LCRR_DBYP /* PLL bypass */
  179. LCRR_DBYP |
  180. #endif
  181. #ifdef CONFIG_SYS_LCRR_EADC /* external address delay */
  182. LCRR_EADC |
  183. #endif
  184. #ifdef CONFIG_SYS_LCRR_CLKDIV /* system clock divider */
  185. LCRR_CLKDIV |
  186. #endif
  187. 0;
  188. __be32 lcrr_val =
  189. #ifdef CONFIG_SYS_LCRR_DBYP /* PLL bypass */
  190. CONFIG_SYS_LCRR_DBYP |
  191. #endif
  192. #ifdef CONFIG_SYS_LCRR_EADC
  193. CONFIG_SYS_LCRR_EADC |
  194. #endif
  195. #ifdef CONFIG_SYS_LCRR_CLKDIV /* system clock divider */
  196. CONFIG_SYS_LCRR_CLKDIV |
  197. #endif
  198. 0;
  199. /* Pointer is writable since we allocated a register for it */
  200. gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
  201. /* global data region was cleared in start.S */
  202. /* system performance tweaking */
  203. clrsetbits_be32(&im->arbiter.acr, acr_mask, acr_val);
  204. clrsetbits_be32(&im->sysconf.spcr, spcr_mask, spcr_val);
  205. clrsetbits_be32(&im->clk.sccr, sccr_mask, sccr_val);
  206. /* RSR - Reset Status Register - clear all status (4.6.1.3) */
  207. gd->arch.reset_status = __raw_readl(&im->reset.rsr);
  208. __raw_writel(~(RSR_RES), &im->reset.rsr);
  209. /* AER - Arbiter Event Register - store status */
  210. gd->arch.arbiter_event_attributes = __raw_readl(&im->arbiter.aeatr);
  211. gd->arch.arbiter_event_address = __raw_readl(&im->arbiter.aeadr);
  212. /*
  213. * RMR - Reset Mode Register
  214. * contains checkstop reset enable (4.6.1.4)
  215. */
  216. __raw_writel(RMR_CSRE & (1<<RMR_CSRE_SHIFT), &im->reset.rmr);
  217. /* LCRR - Clock Ratio Register (10.3.1.16)
  218. * write, read, and isync per MPC8379ERM rev.1 CLKDEV field description
  219. */
  220. clrsetbits_be32(&im->im_lbc.lcrr, lcrr_mask, lcrr_val);
  221. __raw_readl(&im->im_lbc.lcrr);
  222. isync();
  223. /* Enable Time Base & Decrementer ( so we will have udelay() )*/
  224. setbits_be32(&im->sysconf.spcr, SPCR_TBEN);
  225. /* System General Purpose Register */
  226. #ifdef CONFIG_SYS_SICRH
  227. #if defined(CONFIG_MPC834x) || defined(CONFIG_MPC8313)
  228. /* regarding to MPC34x manual rev.1 bits 28..29 must be preserved */
  229. __raw_writel((im->sysconf.sicrh & 0x0000000C) | CONFIG_SYS_SICRH,
  230. &im->sysconf.sicrh);
  231. #else
  232. __raw_writel(CONFIG_SYS_SICRH, &im->sysconf.sicrh);
  233. #endif
  234. #endif
  235. #ifdef CONFIG_SYS_SICRL
  236. __raw_writel(CONFIG_SYS_SICRL, &im->sysconf.sicrl);
  237. #endif
  238. #ifdef CONFIG_SYS_GPR1
  239. __raw_writel(CONFIG_SYS_GPR1, &im->sysconf.gpr1);
  240. #endif
  241. #ifdef CONFIG_SYS_DDRCDR /* DDR control driver register */
  242. __raw_writel(CONFIG_SYS_DDRCDR, &im->sysconf.ddrcdr);
  243. #endif
  244. #ifdef CONFIG_SYS_OBIR /* Output buffer impedance register */
  245. __raw_writel(CONFIG_SYS_OBIR, &im->sysconf.obir);
  246. #endif
  247. #ifdef CONFIG_QE
  248. /* Config QE ioports */
  249. config_qe_ioports();
  250. #endif
  251. /* Set up preliminary BR/OR regs */
  252. init_early_memctl_regs();
  253. /* Local Access window setup */
  254. #if defined(CONFIG_SYS_LBLAWBAR0_PRELIM) && defined(CONFIG_SYS_LBLAWAR0_PRELIM)
  255. im->sysconf.lblaw[0].bar = CONFIG_SYS_LBLAWBAR0_PRELIM;
  256. im->sysconf.lblaw[0].ar = CONFIG_SYS_LBLAWAR0_PRELIM;
  257. #else
  258. #error CONFIG_SYS_LBLAWBAR0_PRELIM & CONFIG_SYS_LBLAWAR0_PRELIM must be defined
  259. #endif
  260. #if defined(CONFIG_SYS_LBLAWBAR1_PRELIM) && defined(CONFIG_SYS_LBLAWAR1_PRELIM)
  261. im->sysconf.lblaw[1].bar = CONFIG_SYS_LBLAWBAR1_PRELIM;
  262. im->sysconf.lblaw[1].ar = CONFIG_SYS_LBLAWAR1_PRELIM;
  263. #endif
  264. #if defined(CONFIG_SYS_LBLAWBAR2_PRELIM) && defined(CONFIG_SYS_LBLAWAR2_PRELIM)
  265. im->sysconf.lblaw[2].bar = CONFIG_SYS_LBLAWBAR2_PRELIM;
  266. im->sysconf.lblaw[2].ar = CONFIG_SYS_LBLAWAR2_PRELIM;
  267. #endif
  268. #if defined(CONFIG_SYS_LBLAWBAR3_PRELIM) && defined(CONFIG_SYS_LBLAWAR3_PRELIM)
  269. im->sysconf.lblaw[3].bar = CONFIG_SYS_LBLAWBAR3_PRELIM;
  270. im->sysconf.lblaw[3].ar = CONFIG_SYS_LBLAWAR3_PRELIM;
  271. #endif
  272. #if defined(CONFIG_SYS_LBLAWBAR4_PRELIM) && defined(CONFIG_SYS_LBLAWAR4_PRELIM)
  273. im->sysconf.lblaw[4].bar = CONFIG_SYS_LBLAWBAR4_PRELIM;
  274. im->sysconf.lblaw[4].ar = CONFIG_SYS_LBLAWAR4_PRELIM;
  275. #endif
  276. #if defined(CONFIG_SYS_LBLAWBAR5_PRELIM) && defined(CONFIG_SYS_LBLAWAR5_PRELIM)
  277. im->sysconf.lblaw[5].bar = CONFIG_SYS_LBLAWBAR5_PRELIM;
  278. im->sysconf.lblaw[5].ar = CONFIG_SYS_LBLAWAR5_PRELIM;
  279. #endif
  280. #if defined(CONFIG_SYS_LBLAWBAR6_PRELIM) && defined(CONFIG_SYS_LBLAWAR6_PRELIM)
  281. im->sysconf.lblaw[6].bar = CONFIG_SYS_LBLAWBAR6_PRELIM;
  282. im->sysconf.lblaw[6].ar = CONFIG_SYS_LBLAWAR6_PRELIM;
  283. #endif
  284. #if defined(CONFIG_SYS_LBLAWBAR7_PRELIM) && defined(CONFIG_SYS_LBLAWAR7_PRELIM)
  285. im->sysconf.lblaw[7].bar = CONFIG_SYS_LBLAWBAR7_PRELIM;
  286. im->sysconf.lblaw[7].ar = CONFIG_SYS_LBLAWAR7_PRELIM;
  287. #endif
  288. #ifdef CONFIG_SYS_GPIO1_PRELIM
  289. im->gpio[0].dat = CONFIG_SYS_GPIO1_DAT;
  290. im->gpio[0].dir = CONFIG_SYS_GPIO1_DIR;
  291. #endif
  292. #ifdef CONFIG_SYS_GPIO2_PRELIM
  293. im->gpio[1].dat = CONFIG_SYS_GPIO2_DAT;
  294. im->gpio[1].dir = CONFIG_SYS_GPIO2_DIR;
  295. #endif
  296. #if defined(CONFIG_USB_EHCI_FSL) && defined(CONFIG_MPC831x)
  297. uint32_t temp;
  298. struct usb_ehci *ehci = (struct usb_ehci *)CONFIG_SYS_FSL_USB1_ADDR;
  299. /* Configure interface. */
  300. setbits_be32(&ehci->control, REFSEL_16MHZ | UTMI_PHY_EN);
  301. /* Wait for clock to stabilize */
  302. do {
  303. temp = __raw_readl(&ehci->control);
  304. udelay(1000);
  305. } while (!(temp & PHY_CLK_VALID));
  306. #endif
  307. }
  308. int cpu_init_r (void)
  309. {
  310. #ifdef CONFIG_QE
  311. uint qe_base = CONFIG_SYS_IMMR + 0x00100000; /* QE immr base */
  312. qe_init(qe_base);
  313. qe_reset();
  314. #endif
  315. return 0;
  316. }
  317. /*
  318. * Print out the bus arbiter event
  319. */
  320. #if defined(CONFIG_DISPLAY_AER_FULL)
  321. static int print_83xx_arb_event(int force)
  322. {
  323. static char* event[] = {
  324. "Address Time Out",
  325. "Data Time Out",
  326. "Address Only Transfer Type",
  327. "External Control Word Transfer Type",
  328. "Reserved Transfer Type",
  329. "Transfer Error",
  330. "reserved",
  331. "reserved"
  332. };
  333. static char* master[] = {
  334. "e300 Core Data Transaction",
  335. "reserved",
  336. "e300 Core Instruction Fetch",
  337. "reserved",
  338. "TSEC1",
  339. "TSEC2",
  340. "USB MPH",
  341. "USB DR",
  342. "Encryption Core",
  343. "I2C Boot Sequencer",
  344. "JTAG",
  345. "reserved",
  346. "eSDHC",
  347. "PCI1",
  348. "PCI2",
  349. "DMA",
  350. "QUICC Engine 00",
  351. "QUICC Engine 01",
  352. "QUICC Engine 10",
  353. "QUICC Engine 11",
  354. "reserved",
  355. "reserved",
  356. "reserved",
  357. "reserved",
  358. "SATA1",
  359. "SATA2",
  360. "SATA3",
  361. "SATA4",
  362. "reserved",
  363. "PCI Express 1",
  364. "PCI Express 2",
  365. "TDM-DMAC"
  366. };
  367. static char *transfer[] = {
  368. "Address-only, Clean Block",
  369. "Address-only, lwarx reservation set",
  370. "Single-beat or Burst write",
  371. "reserved",
  372. "Address-only, Flush Block",
  373. "reserved",
  374. "Burst write",
  375. "reserved",
  376. "Address-only, sync",
  377. "Address-only, tlbsync",
  378. "Single-beat or Burst read",
  379. "Single-beat or Burst read",
  380. "Address-only, Kill Block",
  381. "Address-only, icbi",
  382. "Burst read",
  383. "reserved",
  384. "Address-only, eieio",
  385. "reserved",
  386. "Single-beat write",
  387. "reserved",
  388. "ecowx - Illegal single-beat write",
  389. "reserved",
  390. "reserved",
  391. "reserved",
  392. "Address-only, TLB Invalidate",
  393. "reserved",
  394. "Single-beat or Burst read",
  395. "reserved",
  396. "eciwx - Illegal single-beat read",
  397. "reserved",
  398. "Burst read",
  399. "reserved"
  400. };
  401. int etype = (gd->arch.arbiter_event_attributes & AEATR_EVENT)
  402. >> AEATR_EVENT_SHIFT;
  403. int mstr_id = (gd->arch.arbiter_event_attributes & AEATR_MSTR_ID)
  404. >> AEATR_MSTR_ID_SHIFT;
  405. int tbst = (gd->arch.arbiter_event_attributes & AEATR_TBST)
  406. >> AEATR_TBST_SHIFT;
  407. int tsize = (gd->arch.arbiter_event_attributes & AEATR_TSIZE)
  408. >> AEATR_TSIZE_SHIFT;
  409. int ttype = (gd->arch.arbiter_event_attributes & AEATR_TTYPE)
  410. >> AEATR_TTYPE_SHIFT;
  411. if (!force && !gd->arch.arbiter_event_address)
  412. return 0;
  413. puts("Arbiter Event Status:\n");
  414. printf(" Event Address: 0x%08lX\n",
  415. gd->arch.arbiter_event_address);
  416. printf(" Event Type: 0x%1x = %s\n", etype, event[etype]);
  417. printf(" Master ID: 0x%02x = %s\n", mstr_id, master[mstr_id]);
  418. printf(" Transfer Size: 0x%1x = %d bytes\n", (tbst<<3) | tsize,
  419. tbst ? (tsize ? tsize : 8) : 16 + 8 * tsize);
  420. printf(" Transfer Type: 0x%02x = %s\n", ttype, transfer[ttype]);
  421. return gd->arch.arbiter_event_address;
  422. }
  423. #elif defined(CONFIG_DISPLAY_AER_BRIEF)
  424. static int print_83xx_arb_event(int force)
  425. {
  426. if (!force && !gd->arch.arbiter_event_address)
  427. return 0;
  428. printf("Arbiter Event Status: AEATR=0x%08lX, AEADR=0x%08lX\n",
  429. gd->arch.arbiter_event_attributes,
  430. gd->arch.arbiter_event_address);
  431. return gd->arch.arbiter_event_address;
  432. }
  433. #endif /* CONFIG_DISPLAY_AER_xxxx */
  434. /*
  435. * Figure out the cause of the reset
  436. */
  437. int prt_83xx_rsr(void)
  438. {
  439. static struct {
  440. ulong mask;
  441. char *desc;
  442. } bits[] = {
  443. {
  444. RSR_SWSR, "Software Soft"}, {
  445. RSR_SWHR, "Software Hard"}, {
  446. RSR_JSRS, "JTAG Soft"}, {
  447. RSR_CSHR, "Check Stop"}, {
  448. RSR_SWRS, "Software Watchdog"}, {
  449. RSR_BMRS, "Bus Monitor"}, {
  450. RSR_SRS, "External/Internal Soft"}, {
  451. RSR_HRS, "External/Internal Hard"}
  452. };
  453. static int n = ARRAY_SIZE(bits);
  454. ulong rsr = gd->arch.reset_status;
  455. int i;
  456. char *sep;
  457. puts("Reset Status:");
  458. sep = " ";
  459. for (i = 0; i < n; i++)
  460. if (rsr & bits[i].mask) {
  461. printf("%s%s", sep, bits[i].desc);
  462. sep = ", ";
  463. }
  464. puts("\n");
  465. #if defined(CONFIG_DISPLAY_AER_FULL) || defined(CONFIG_DISPLAY_AER_BRIEF)
  466. print_83xx_arb_event(rsr & RSR_BMRS);
  467. #endif
  468. puts("\n");
  469. return 0;
  470. }