start.S 14 KB

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