start.S 14 KB

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