start.S 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. /*
  2. * U-boot - start.S Startup file of u-boot for BF537
  3. *
  4. * Copyright (c) 2005-2007 Analog Devices Inc.
  5. *
  6. * This file is based on head.S
  7. * Copyright (c) 2003 Metrowerks/Motorola
  8. * Copyright (C) 1998 D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
  9. * Kenneth Albanowski <kjahds@kjahds.com>,
  10. * The Silver Hammer Group, Ltd.
  11. * (c) 1995, Dionne & Associates
  12. * (c) 1995, DKG Display Tech.
  13. *
  14. * See file CREDITS for list of people who contributed to this
  15. * project.
  16. *
  17. * This program is free software; you can redistribute it and/or
  18. * modify it under the terms of the GNU General Public License as
  19. * published by the Free Software Foundation; either version 2 of
  20. * the License, or (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program; if not, write to the Free Software
  29. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
  30. * MA 02110-1301 USA
  31. */
  32. /*
  33. * Note: A change in this file subsequently requires a change in
  34. * board/$(board_name)/config.mk for a valid u-boot.bin
  35. */
  36. #define ASSEMBLY
  37. #include <linux/config.h>
  38. #include <config.h>
  39. #include <asm/blackfin.h>
  40. #include <asm/mach-common/bits/core.h>
  41. #include <asm/mach-common/bits/dma.h>
  42. #include <asm/mach-common/bits/pll.h>
  43. .global _stext;
  44. .global __bss_start;
  45. .global start;
  46. .global _start;
  47. .global edata;
  48. .global _exit;
  49. .global init_sdram;
  50. .global _icache_enable;
  51. .global _dcache_enable;
  52. #if defined(CONFIG_BF537)&&defined(CONFIG_POST)
  53. .global _memory_post_test;
  54. .global _post_flag;
  55. #endif
  56. #if (BFIN_BOOT_MODE == BF537_UART_BOOT)
  57. #if (CONFIG_CCLK_DIV == 1)
  58. #define CONFIG_CCLK_ACT_DIV CCLK_DIV1
  59. #endif
  60. #if (CONFIG_CCLK_DIV == 2)
  61. #define CONFIG_CCLK_ACT_DIV CCLK_DIV2
  62. #endif
  63. #if (CONFIG_CCLK_DIV == 4)
  64. #define CONFIG_CCLK_ACT_DIV CCLK_DIV4
  65. #endif
  66. #if (CONFIG_CCLK_DIV == 8)
  67. #define CONFIG_CCLK_ACT_DIV CCLK_DIV8
  68. #endif
  69. #ifndef CONFIG_CCLK_ACT_DIV
  70. #define CONFIG_CCLK_ACT_DIV CONFIG_CCLK_DIV_not_defined_properly
  71. #endif
  72. #endif
  73. .text
  74. _start:
  75. start:
  76. _stext:
  77. R0 = 0x32;
  78. SYSCFG = R0;
  79. SSYNC;
  80. /* As per HW reference manual DAG registers,
  81. * DATA and Address resgister shall be zero'd
  82. * in initialization, after a reset state
  83. */
  84. r1 = 0; /* Data registers zero'd */
  85. r2 = 0;
  86. r3 = 0;
  87. r4 = 0;
  88. r5 = 0;
  89. r6 = 0;
  90. r7 = 0;
  91. p0 = 0; /* Address registers zero'd */
  92. p1 = 0;
  93. p2 = 0;
  94. p3 = 0;
  95. p4 = 0;
  96. p5 = 0;
  97. i0 = 0; /* DAG Registers zero'd */
  98. i1 = 0;
  99. i2 = 0;
  100. i3 = 0;
  101. m0 = 0;
  102. m1 = 0;
  103. m3 = 0;
  104. m3 = 0;
  105. l0 = 0;
  106. l1 = 0;
  107. l2 = 0;
  108. l3 = 0;
  109. b0 = 0;
  110. b1 = 0;
  111. b2 = 0;
  112. b3 = 0;
  113. /* Set loop counters to zero, to make sure that
  114. * hw loops are disabled.
  115. */
  116. r0 = 0;
  117. lc0 = r0;
  118. lc1 = r0;
  119. SSYNC;
  120. /* Check soft reset status */
  121. p0.h = SWRST >> 16;
  122. p0.l = SWRST & 0xFFFF;
  123. r0.l = w[p0];
  124. cc = bittst(r0, 15);
  125. if !cc jump no_soft_reset;
  126. /* Clear Soft reset */
  127. r0 = 0x0000;
  128. w[p0] = r0;
  129. ssync;
  130. no_soft_reset:
  131. nop;
  132. /* Clear EVT registers */
  133. p0.h = (EVT0 >> 16);
  134. p0.l = (EVT0 & 0xFFFF);
  135. p0 += 8;
  136. p1 = 14;
  137. r1 = 0;
  138. LSETUP(4,4) lc0 = p1;
  139. [ p0 ++ ] = r1;
  140. #if (BFIN_BOOT_MODE != BF537_SPI_MASTER_BOOT)
  141. p0.h = hi(SIC_IWR);
  142. p0.l = lo(SIC_IWR);
  143. r0.l = 0x1;
  144. w[p0] = r0.l;
  145. SSYNC;
  146. #endif
  147. #if (BFIN_BOOT_MODE == BF537_UART_BOOT)
  148. p0.h = hi(SIC_IWR);
  149. p0.l = lo(SIC_IWR);
  150. r0.l = 0x1;
  151. w[p0] = r0.l;
  152. SSYNC;
  153. /*
  154. * PLL_LOCKCNT - how many SCLK Cycles to delay while PLL becomes stable
  155. */
  156. p0.h = hi(PLL_LOCKCNT);
  157. p0.l = lo(PLL_LOCKCNT);
  158. r0 = 0x300(Z);
  159. w[p0] = r0.l;
  160. ssync;
  161. /*
  162. * Put SDRAM in self-refresh, incase anything is running
  163. */
  164. P2.H = hi(EBIU_SDGCTL);
  165. P2.L = lo(EBIU_SDGCTL);
  166. R0 = [P2];
  167. BITSET (R0, 24);
  168. [P2] = R0;
  169. SSYNC;
  170. /*
  171. * Set PLL_CTL with the value that we calculate in R0
  172. * - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
  173. * - [8] = BYPASS : BYPASS the PLL, run CLKIN into CCLK/SCLK
  174. * - [7] = output delay (add 200ps of delay to mem signals)
  175. * - [6] = input delay (add 200ps of input delay to mem signals)
  176. * - [5] = PDWN : 1=All Clocks off
  177. * - [3] = STOPCK : 1=Core Clock off
  178. * - [1] = PLL_OFF : 1=Disable Power to PLL
  179. * - [0] = DF : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
  180. * all other bits set to zero
  181. */
  182. r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */
  183. r0 = r0 << 9; /* Shift it over, */
  184. r1 = CONFIG_CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/
  185. r0 = r1 | r0;
  186. r1 = CONFIG_PLL_BYPASS; /* Bypass the PLL? */
  187. r1 = r1 << 8; /* Shift it over */
  188. r0 = r1 | r0; /* add them all together */
  189. p0.h = hi(PLL_CTL);
  190. p0.l = lo(PLL_CTL); /* Load the address */
  191. cli r2; /* Disable interrupts */
  192. ssync;
  193. w[p0] = r0.l; /* Set the value */
  194. idle; /* Wait for the PLL to stablize */
  195. sti r2; /* Enable interrupts */
  196. check_again:
  197. p0.h = hi(PLL_STAT);
  198. p0.l = lo(PLL_STAT);
  199. R0 = W[P0](Z);
  200. CC = BITTST(R0,5);
  201. if ! CC jump check_again;
  202. /* Configure SCLK & CCLK Dividers */
  203. r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
  204. p0.h = hi(PLL_DIV);
  205. p0.l = lo(PLL_DIV);
  206. w[p0] = r0.l;
  207. ssync;
  208. #endif
  209. /*
  210. * We now are running at speed, time to set the Async mem bank wait states
  211. * This will speed up execution, since we are normally running from FLASH.
  212. * we need to read MAC address from FLASH
  213. */
  214. p2.h = (EBIU_AMBCTL1 >> 16);
  215. p2.l = (EBIU_AMBCTL1 & 0xFFFF);
  216. r0.h = (AMBCTL1VAL >> 16);
  217. r0.l = (AMBCTL1VAL & 0xFFFF);
  218. [p2] = r0;
  219. ssync;
  220. p2.h = (EBIU_AMBCTL0 >> 16);
  221. p2.l = (EBIU_AMBCTL0 & 0xFFFF);
  222. r0.h = (AMBCTL0VAL >> 16);
  223. r0.l = (AMBCTL0VAL & 0xFFFF);
  224. [p2] = r0;
  225. ssync;
  226. p2.h = (EBIU_AMGCTL >> 16);
  227. p2.l = (EBIU_AMGCTL & 0xffff);
  228. r0 = AMGCTLVAL;
  229. w[p2] = r0;
  230. ssync;
  231. #if ((BFIN_BOOT_MODE != BF537_SPI_MASTER_BOOT) && (BFIN_BOOT_MODE != BF537_UART_BOOT))
  232. sp.l = (0xffb01000 & 0xFFFF);
  233. sp.h = (0xffb01000 >> 16);
  234. call init_sdram;
  235. #endif
  236. #if defined(CONFIG_BF537)&&defined(CONFIG_POST)
  237. /* DMA POST code to Hi of L1 SRAM */
  238. postcopy:
  239. /* P1 Points to the beginning of SYSTEM MMR Space */
  240. P1.H = hi(SYSMMR_BASE);
  241. P1.L = lo(SYSMMR_BASE);
  242. R0.H = _text_l1;
  243. R0.L = _text_l1;
  244. R1.H = _etext_l1;
  245. R1.L = _etext_l1;
  246. R2 = R1 - R0; /* Count */
  247. R0.H = _etext;
  248. R0.L = _etext;
  249. R1.H = (CFG_MONITOR_BASE >> 16);
  250. R1.L = (CFG_MONITOR_BASE & 0xFFFF);
  251. R0 = R0 - R1;
  252. R1.H = (CFG_FLASH_BASE >> 16);
  253. R1.L = (CFG_FLASH_BASE & 0xFFFF);
  254. R0 = R0 + R1; /* Source Address */
  255. R1.H = hi(L1_INST_SRAM); /* Destination Address (high) */
  256. R1.L = lo(L1_INST_SRAM); /* Destination Address (low) */
  257. R3.L = DMAEN; /* Source DMAConfig Value (8-bit words) */
  258. /* Destination DMAConfig Value (8-bit words) */
  259. R4.L = (DI_EN | WNR | DMAEN);
  260. R6 = 0x1 (Z);
  261. W[P1+OFFSET_(MDMA_S0_X_MODIFY)] = R6; /* Source Modify = 1 */
  262. W[P1+OFFSET_(MDMA_D0_X_MODIFY)] = R6; /* Destination Modify = 1 */
  263. [P1+OFFSET_(MDMA_S0_START_ADDR)] = R0; /* Set Source Base Address */
  264. W[P1+OFFSET_(MDMA_S0_X_COUNT)] = R2; /* Set Source Count */
  265. /* Set Source DMAConfig = DMA Enable,
  266. Memory Read, 8-Bit Transfers, 1-D DMA, Flow - Stop */
  267. W[P1+OFFSET_(MDMA_S0_CONFIG)] = R3;
  268. [P1+OFFSET_(MDMA_D0_START_ADDR)] = R1; /* Set Destination Base Address */
  269. W[P1+OFFSET_(MDMA_D0_X_COUNT)] = R2; /* Set Destination Count */
  270. /* Set Destination DMAConfig = DMA Enable,
  271. Memory Write, 8-Bit Transfers, 1-D DMA, Flow - Stop, IOC */
  272. W[P1+OFFSET_(MDMA_D0_CONFIG)] = R4;
  273. POST_DMA_DONE:
  274. p0.h = hi(MDMA_D0_IRQ_STATUS);
  275. p0.l = lo(MDMA_D0_IRQ_STATUS);
  276. R0 = W[P0](Z);
  277. CC = BITTST(R0, 0);
  278. if ! CC jump POST_DMA_DONE
  279. R0 = 0x1;
  280. W[P1+OFFSET_(MDMA_D0_IRQ_STATUS)] = R0; /* Write 1 to clear DMA interrupt */
  281. /* DMA POST data to Hi of L1 SRAM */
  282. R0.H = _rodata_l1;
  283. R0.L = _rodata_l1;
  284. R1.H = _erodata_l1;
  285. R1.L = _erodata_l1;
  286. R2 = R1 - R0; /* Count */
  287. R0.H = _erodata;
  288. R0.L = _erodata;
  289. R1.H = (CFG_MONITOR_BASE >> 16);
  290. R1.L = (CFG_MONITOR_BASE & 0xFFFF);
  291. R0 = R0 - R1;
  292. R1.H = (CFG_FLASH_BASE >> 16);
  293. R1.L = (CFG_FLASH_BASE & 0xFFFF);
  294. R0 = R0 + R1; /* Source Address */
  295. R1.H = hi(DATA_BANKB_SRAM); /* Destination Address (high) */
  296. R1.L = lo(DATA_BANKB_SRAM); /* Destination Address (low) */
  297. R3.L = DMAEN; /* Source DMAConfig Value (8-bit words) */
  298. R4.L = (DI_EN | WNR | DMAEN); /* Destination DMAConfig Value (8-bit words) */
  299. R6 = 0x1 (Z);
  300. W[P1+OFFSET_(MDMA_S0_X_MODIFY)] = R6; /* Source Modify = 1 */
  301. W[P1+OFFSET_(MDMA_D0_X_MODIFY)] = R6; /* Destination Modify = 1 */
  302. [P1+OFFSET_(MDMA_S0_START_ADDR)] = R0; /* Set Source Base Address */
  303. W[P1+OFFSET_(MDMA_S0_X_COUNT)] = R2; /* Set Source Count */
  304. /* Set Source DMAConfig = DMA Enable,
  305. Memory Read, 8-Bit Transfers, 1-D DMA, Flow - Stop */
  306. W[P1+OFFSET_(MDMA_S0_CONFIG)] = R3;
  307. [P1+OFFSET_(MDMA_D0_START_ADDR)] = R1; /* Set Destination Base Address */
  308. W[P1+OFFSET_(MDMA_D0_X_COUNT)] = R2; /* Set Destination Count */
  309. /* Set Destination DMAConfig = DMA Enable,
  310. Memory Write, 8-Bit Transfers, 1-D DMA, Flow - Stop, IOC */
  311. W[P1+OFFSET_(MDMA_D0_CONFIG)] = R4;
  312. POST_DATA_DMA_DONE:
  313. p0.h = hi(MDMA_D0_IRQ_STATUS);
  314. p0.l = lo(MDMA_D0_IRQ_STATUS);
  315. R0 = W[P0](Z);
  316. CC = BITTST(R0, 0);
  317. if ! CC jump POST_DATA_DMA_DONE
  318. R0 = 0x1;
  319. W[P1+OFFSET_(MDMA_D0_IRQ_STATUS)] = R0; /* Write 1 to clear DMA interrupt */
  320. p0.l = _memory_post_test;
  321. p0.h = _memory_post_test;
  322. r0 = 0x0;
  323. call (p0);
  324. r7 = r0; /* save return value */
  325. call init_sdram;
  326. #endif
  327. /* relocate into to RAM */
  328. call get_pc;
  329. offset:
  330. r2.l = offset;
  331. r2.h = offset;
  332. r3.l = start;
  333. r3.h = start;
  334. r1 = r2 - r3;
  335. r0 = r0 - r1;
  336. p1 = r0;
  337. p2.l = (CFG_MONITOR_BASE & 0xffff);
  338. p2.h = (CFG_MONITOR_BASE >> 16);
  339. p3 = 0x04;
  340. p4.l = ((CFG_MONITOR_BASE + CFG_MONITOR_LEN) & 0xffff);
  341. p4.h = ((CFG_MONITOR_BASE + CFG_MONITOR_LEN) >> 16);
  342. loop1:
  343. r1 = [p1 ++ p3];
  344. [p2 ++ p3] = r1;
  345. cc=p2==p4;
  346. if !cc jump loop1;
  347. /*
  348. * configure STACK
  349. */
  350. r0.h = (CONFIG_STACKBASE >> 16);
  351. r0.l = (CONFIG_STACKBASE & 0xFFFF);
  352. sp = r0;
  353. fp = sp;
  354. /*
  355. * This next section keeps the processor in supervisor mode
  356. * during kernel boot. Switches to user mode at end of boot.
  357. * See page 3-9 of Hardware Reference manual for documentation.
  358. */
  359. /* To keep ourselves in the supervisor mode */
  360. p0.l = (EVT15 & 0xFFFF);
  361. p0.h = (EVT15 >> 16);
  362. p1.l = _real_start;
  363. p1.h = _real_start;
  364. [p0] = p1;
  365. p0.l = (IMASK & 0xFFFF);
  366. p0.h = (IMASK >> 16);
  367. r0.l = LO(EVT_IVG15);
  368. r0.h = HI(EVT_IVG15);
  369. [p0] = r0;
  370. raise 15;
  371. p0.l = WAIT_HERE;
  372. p0.h = WAIT_HERE;
  373. reti = p0;
  374. rti;
  375. WAIT_HERE:
  376. jump WAIT_HERE;
  377. .global _real_start;
  378. _real_start:
  379. [ -- sp ] = reti;
  380. #ifdef CONFIG_BF537
  381. /* Initialise General-Purpose I/O Modules on BF537
  382. * Rev 0.0 Anomaly 05000212 - PORTx_FER,
  383. * PORT_MUX Registers Do Not accept "writes" correctly
  384. */
  385. p0.h = hi(PORTF_FER);
  386. p0.l = lo(PORTF_FER);
  387. R0.L = W[P0]; /* Read */
  388. nop;
  389. nop;
  390. nop;
  391. ssync;
  392. R0 = 0x000F(Z);
  393. W[P0] = R0.L; /* Write */
  394. nop;
  395. nop;
  396. nop;
  397. ssync;
  398. W[P0] = R0.L; /* Enable peripheral function of PORTF for UART0 and UART1 */
  399. nop;
  400. nop;
  401. nop;
  402. ssync;
  403. p0.h = hi(PORTH_FER);
  404. p0.l = lo(PORTH_FER);
  405. R0.L = W[P0]; /* Read */
  406. nop;
  407. nop;
  408. nop;
  409. ssync;
  410. R0 = 0xFFFF(Z);
  411. W[P0] = R0.L; /* Write */
  412. nop;
  413. nop;
  414. nop;
  415. ssync;
  416. W[P0] = R0.L; /* Enable peripheral function of PORTH for MAC */
  417. nop;
  418. nop;
  419. nop;
  420. ssync;
  421. #endif
  422. /* DMA reset code to Hi of L1 SRAM */
  423. copy:
  424. P1.H = hi(SYSMMR_BASE); /* P1 Points to the beginning of SYSTEM MMR Space */
  425. P1.L = lo(SYSMMR_BASE);
  426. R0.H = reset_start; /* Source Address (high) */
  427. R0.L = reset_start; /* Source Address (low) */
  428. R1.H = reset_end;
  429. R1.L = reset_end;
  430. R2 = R1 - R0; /* Count */
  431. R1.H = hi(L1_INST_SRAM); /* Destination Address (high) */
  432. R1.L = lo(L1_INST_SRAM); /* Destination Address (low) */
  433. R3.L = DMAEN; /* Source DMAConfig Value (8-bit words) */
  434. R4.L = (DI_EN | WNR | DMAEN); /* Destination DMAConfig Value (8-bit words) */
  435. DMA:
  436. R6 = 0x1 (Z);
  437. W[P1+OFFSET_(MDMA_S0_X_MODIFY)] = R6; /* Source Modify = 1 */
  438. W[P1+OFFSET_(MDMA_D0_X_MODIFY)] = R6; /* Destination Modify = 1 */
  439. [P1+OFFSET_(MDMA_S0_START_ADDR)] = R0; /* Set Source Base Address */
  440. W[P1+OFFSET_(MDMA_S0_X_COUNT)] = R2; /* Set Source Count */
  441. /* Set Source DMAConfig = DMA Enable,
  442. Memory Read, 8-Bit Transfers, 1-D DMA, Flow - Stop */
  443. W[P1+OFFSET_(MDMA_S0_CONFIG)] = R3;
  444. [P1+OFFSET_(MDMA_D0_START_ADDR)] = R1; /* Set Destination Base Address */
  445. W[P1+OFFSET_(MDMA_D0_X_COUNT)] = R2; /* Set Destination Count */
  446. /* Set Destination DMAConfig = DMA Enable,
  447. Memory Write, 8-Bit Transfers, 1-D DMA, Flow - Stop, IOC */
  448. W[P1+OFFSET_(MDMA_D0_CONFIG)] = R4;
  449. WAIT_DMA_DONE:
  450. p0.h = hi(MDMA_D0_IRQ_STATUS);
  451. p0.l = lo(MDMA_D0_IRQ_STATUS);
  452. R0 = W[P0](Z);
  453. CC = BITTST(R0, 0);
  454. if ! CC jump WAIT_DMA_DONE
  455. R0 = 0x1;
  456. W[P1+OFFSET_(MDMA_D0_IRQ_STATUS)] = R0; /* Write 1 to clear DMA interrupt */
  457. /* Initialize BSS Section with 0 s */
  458. p1.l = __bss_start;
  459. p1.h = __bss_start;
  460. p2.l = _end;
  461. p2.h = _end;
  462. r1 = p1;
  463. r2 = p2;
  464. r3 = r2 - r1;
  465. r3 = r3 >> 2;
  466. p3 = r3;
  467. lsetup (_clear_bss, _clear_bss_end ) lc1 = p3;
  468. CC = p2<=p1;
  469. if CC jump _clear_bss_skip;
  470. r0 = 0;
  471. _clear_bss:
  472. _clear_bss_end:
  473. [p1++] = r0;
  474. _clear_bss_skip:
  475. #if defined(CONFIG_BF537)&&defined(CONFIG_POST)
  476. p0.l = _post_flag;
  477. p0.h = _post_flag;
  478. r0 = r7;
  479. [p0] = r0;
  480. #endif
  481. p0.l = _start1;
  482. p0.h = _start1;
  483. jump (p0);
  484. reset_start:
  485. p0.h = WDOG_CNT >> 16;
  486. p0.l = WDOG_CNT & 0xffff;
  487. r0 = 0x0010;
  488. w[p0] = r0;
  489. p0.h = WDOG_CTL >> 16;
  490. p0.l = WDOG_CTL & 0xffff;
  491. r0 = 0x0000;
  492. w[p0] = r0;
  493. reset_wait:
  494. jump reset_wait;
  495. reset_end:
  496. nop;
  497. _exit:
  498. jump.s _exit;
  499. get_pc:
  500. r0 = rets;
  501. rts;