head.S 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. /*
  2. * File: arch/blackfin/mach-bf533/head.S
  3. * Based on:
  4. * Author: Jeff Dionne <jeff@uclinux.org> COPYRIGHT 1998 D. Jeff Dionne
  5. *
  6. * Created: 1998
  7. * Description: bf533 startup file
  8. *
  9. * Modified:
  10. * Copyright 2004-2006 Analog Devices Inc.
  11. *
  12. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, see the file COPYING, or write
  26. * to the Free Software Foundation, Inc.,
  27. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  28. */
  29. #include <linux/linkage.h>
  30. #include <linux/init.h>
  31. #include <asm/blackfin.h>
  32. #include <asm/trace.h>
  33. #if CONFIG_BFIN_KERNEL_CLOCK
  34. #include <asm/mach-common/clocks.h>
  35. #include <asm/mach/mem_init.h>
  36. #endif
  37. #if CONFIG_DEBUG_KERNEL_START
  38. #include <asm/mach-common/def_LPBlackfin.h>
  39. #endif
  40. .global __rambase
  41. .global __ramstart
  42. .global __ramend
  43. .extern ___bss_stop
  44. .extern ___bss_start
  45. .extern _bf53x_relocate_l1_mem
  46. #define INITIAL_STACK 0xFFB01000
  47. __INIT
  48. ENTRY(__start)
  49. /* R0: argument of command line string, passed from uboot, save it */
  50. R7 = R0;
  51. /* Set the SYSCFG register:
  52. * Enable Cycle Counter and Nesting Of Interrupts (3rd Bit)
  53. */
  54. R0 = 0x36;
  55. SYSCFG = R0;
  56. R0 = 0;
  57. /* Clear Out All the data and pointer Registers */
  58. R1 = R0;
  59. R2 = R0;
  60. R3 = R0;
  61. R4 = R0;
  62. R5 = R0;
  63. R6 = R0;
  64. P0 = R0;
  65. P1 = R0;
  66. P2 = R0;
  67. P3 = R0;
  68. P4 = R0;
  69. P5 = R0;
  70. LC0 = r0;
  71. LC1 = r0;
  72. L0 = r0;
  73. L1 = r0;
  74. L2 = r0;
  75. L3 = r0;
  76. /* Clear Out All the DAG Registers */
  77. B0 = r0;
  78. B1 = r0;
  79. B2 = r0;
  80. B3 = r0;
  81. I0 = r0;
  82. I1 = r0;
  83. I2 = r0;
  84. I3 = r0;
  85. M0 = r0;
  86. M1 = r0;
  87. M2 = r0;
  88. M3 = r0;
  89. trace_buffer_init(p0,r0);
  90. P0 = R1;
  91. R0 = R1;
  92. #if CONFIG_DEBUG_KERNEL_START
  93. /*
  94. * Set up a temporary Event Vector Table, so if something bad happens before
  95. * the kernel is fully started, it doesn't vector off into the bootloaders
  96. * table
  97. */
  98. P0.l = lo(EVT2);
  99. P0.h = hi(EVT2);
  100. P1.l = lo(EVT15);
  101. P1.h = hi(EVT15);
  102. P2.l = debug_kernel_start_trap;
  103. P2.h = debug_kernel_start_trap;
  104. RTS = P2;
  105. RTI = P2;
  106. RTX = P2;
  107. RTN = P2;
  108. RTE = P2;
  109. .Lfill_temp_vector_table:
  110. [P0++] = P2; /* Core Event Vector Table */
  111. CC = P0 == P1;
  112. if !CC JUMP .Lfill_temp_vector_table
  113. P0 = r0;
  114. P1 = r0;
  115. P2 = r0;
  116. #endif
  117. p0.h = hi(FIO_MASKA_C);
  118. p0.l = lo(FIO_MASKA_C);
  119. r0 = 0xFFFF(Z);
  120. w[p0] = r0.L; /* Disable all interrupts */
  121. ssync;
  122. p0.h = hi(FIO_MASKB_C);
  123. p0.l = lo(FIO_MASKB_C);
  124. r0 = 0xFFFF(Z);
  125. w[p0] = r0.L; /* Disable all interrupts */
  126. ssync;
  127. /* Turn off the icache */
  128. p0.l = LO(IMEM_CONTROL);
  129. p0.h = HI(IMEM_CONTROL);
  130. R1 = [p0];
  131. R0 = ~ENICPLB;
  132. R0 = R0 & R1;
  133. /* Anomaly 05000125 */
  134. #if ANOMALY_05000125
  135. CLI R2;
  136. SSYNC;
  137. #endif
  138. [p0] = R0;
  139. SSYNC;
  140. #if ANOMALY_05000125
  141. STI R2;
  142. #endif
  143. /* Turn off the dcache */
  144. p0.l = LO(DMEM_CONTROL);
  145. p0.h = HI(DMEM_CONTROL);
  146. R1 = [p0];
  147. R0 = ~ENDCPLB;
  148. R0 = R0 & R1;
  149. /* Anomaly 05000125 */
  150. #if ANOMALY_05000125
  151. CLI R2;
  152. SSYNC;
  153. #endif
  154. [p0] = R0;
  155. SSYNC;
  156. #if ANOMALY_05000125
  157. STI R2;
  158. #endif
  159. /* Initialise UART - when booting from u-boot, the UART is not disabled
  160. * so if we dont initalize here, our serial console gets hosed */
  161. p0.h = hi(UART_LCR);
  162. p0.l = lo(UART_LCR);
  163. r0 = 0x0(Z);
  164. w[p0] = r0.L; /* To enable DLL writes */
  165. ssync;
  166. p0.h = hi(UART_DLL);
  167. p0.l = lo(UART_DLL);
  168. r0 = 0x0(Z);
  169. w[p0] = r0.L;
  170. ssync;
  171. p0.h = hi(UART_DLH);
  172. p0.l = lo(UART_DLH);
  173. r0 = 0x00(Z);
  174. w[p0] = r0.L;
  175. ssync;
  176. p0.h = hi(UART_GCTL);
  177. p0.l = lo(UART_GCTL);
  178. r0 = 0x0(Z);
  179. w[p0] = r0.L; /* To enable UART clock */
  180. ssync;
  181. /* Initialize stack pointer */
  182. sp.l = lo(INITIAL_STACK);
  183. sp.h = hi(INITIAL_STACK);
  184. fp = sp;
  185. usp = sp;
  186. /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
  187. call _bf53x_relocate_l1_mem;
  188. #if CONFIG_BFIN_KERNEL_CLOCK
  189. call _start_dma_code;
  190. #endif
  191. /* Code for initializing Async memory banks */
  192. p2.h = hi(EBIU_AMBCTL1);
  193. p2.l = lo(EBIU_AMBCTL1);
  194. r0.h = hi(AMBCTL1VAL);
  195. r0.l = lo(AMBCTL1VAL);
  196. [p2] = r0;
  197. ssync;
  198. p2.h = hi(EBIU_AMBCTL0);
  199. p2.l = lo(EBIU_AMBCTL0);
  200. r0.h = hi(AMBCTL0VAL);
  201. r0.l = lo(AMBCTL0VAL);
  202. [p2] = r0;
  203. ssync;
  204. p2.h = hi(EBIU_AMGCTL);
  205. p2.l = lo(EBIU_AMGCTL);
  206. r0 = AMGCTLVAL;
  207. w[p2] = r0;
  208. ssync;
  209. /* This section keeps the processor in supervisor mode
  210. * during kernel boot. Switches to user mode at end of boot.
  211. * See page 3-9 of Hardware Reference manual for documentation.
  212. */
  213. /* EVT15 = _real_start */
  214. p0.l = lo(EVT15);
  215. p0.h = hi(EVT15);
  216. p1.l = _real_start;
  217. p1.h = _real_start;
  218. [p0] = p1;
  219. csync;
  220. p0.l = lo(IMASK);
  221. p0.h = hi(IMASK);
  222. p1.l = IMASK_IVG15;
  223. p1.h = 0x0;
  224. [p0] = p1;
  225. csync;
  226. raise 15;
  227. p0.l = .LWAIT_HERE;
  228. p0.h = .LWAIT_HERE;
  229. reti = p0;
  230. #if ANOMALY_05000281
  231. nop; nop; nop;
  232. #endif
  233. rti;
  234. .LWAIT_HERE:
  235. jump .LWAIT_HERE;
  236. ENDPROC(__start)
  237. ENTRY(_real_start)
  238. [ -- sp ] = reti;
  239. p0.l = lo(WDOG_CTL);
  240. p0.h = hi(WDOG_CTL);
  241. r0 = 0xAD6(z);
  242. w[p0] = r0; /* watchdog off for now */
  243. ssync;
  244. /* Code update for BSS size == 0
  245. * Zero out the bss region.
  246. */
  247. p1.l = ___bss_start;
  248. p1.h = ___bss_start;
  249. p2.l = ___bss_stop;
  250. p2.h = ___bss_stop;
  251. r0 = 0;
  252. p2 -= p1;
  253. lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
  254. .L_clear_bss:
  255. B[p1++] = r0;
  256. /* In case there is a NULL pointer reference
  257. * Zero out region before stext
  258. */
  259. p1.l = 0x0;
  260. p1.h = 0x0;
  261. r0.l = __stext;
  262. r0.h = __stext;
  263. r0 = r0 >> 1;
  264. p2 = r0;
  265. r0 = 0;
  266. lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
  267. .L_clear_zero:
  268. W[p1++] = r0;
  269. /* pass the uboot arguments to the global value command line */
  270. R0 = R7;
  271. call _cmdline_init;
  272. p1.l = __rambase;
  273. p1.h = __rambase;
  274. r0.l = __sdata;
  275. r0.h = __sdata;
  276. [p1] = r0;
  277. p1.l = __ramstart;
  278. p1.h = __ramstart;
  279. p3.l = ___bss_stop;
  280. p3.h = ___bss_stop;
  281. r1 = p3;
  282. [p1] = r1;
  283. /*
  284. * load the current thread pointer and stack
  285. */
  286. r1.l = _init_thread_union;
  287. r1.h = _init_thread_union;
  288. r2.l = 0x2000;
  289. r2.h = 0x0000;
  290. r1 = r1 + r2;
  291. sp = r1;
  292. usp = sp;
  293. fp = sp;
  294. jump.l _start_kernel;
  295. ENDPROC(_real_start)
  296. __FINIT
  297. .section .l1.text
  298. #if CONFIG_BFIN_KERNEL_CLOCK
  299. ENTRY(_start_dma_code)
  300. p0.h = hi(SIC_IWR);
  301. p0.l = lo(SIC_IWR);
  302. r0.l = 0x1;
  303. r0.h = 0x0;
  304. [p0] = r0;
  305. SSYNC;
  306. /*
  307. * Set PLL_CTL
  308. * - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
  309. * - [8] = BYPASS : BYPASS the PLL, run CLKIN into CCLK/SCLK
  310. * - [7] = output delay (add 200ps of delay to mem signals)
  311. * - [6] = input delay (add 200ps of input delay to mem signals)
  312. * - [5] = PDWN : 1=All Clocks off
  313. * - [3] = STOPCK : 1=Core Clock off
  314. * - [1] = PLL_OFF : 1=Disable Power to PLL
  315. * - [0] = DF : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
  316. * all other bits set to zero
  317. */
  318. p0.h = hi(PLL_LOCKCNT);
  319. p0.l = lo(PLL_LOCKCNT);
  320. r0 = 0x300(Z);
  321. w[p0] = r0.l;
  322. ssync;
  323. P2.H = hi(EBIU_SDGCTL);
  324. P2.L = lo(EBIU_SDGCTL);
  325. R0 = [P2];
  326. BITSET (R0, 24);
  327. [P2] = R0;
  328. SSYNC;
  329. r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */
  330. r0 = r0 << 9; /* Shift it over, */
  331. r1 = CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/
  332. r0 = r1 | r0;
  333. r1 = PLL_BYPASS; /* Bypass the PLL? */
  334. r1 = r1 << 8; /* Shift it over */
  335. r0 = r1 | r0; /* add them all together */
  336. p0.h = hi(PLL_CTL);
  337. p0.l = lo(PLL_CTL); /* Load the address */
  338. cli r2; /* Disable interrupts */
  339. ssync;
  340. w[p0] = r0.l; /* Set the value */
  341. idle; /* Wait for the PLL to stablize */
  342. sti r2; /* Enable interrupts */
  343. .Lcheck_again:
  344. p0.h = hi(PLL_STAT);
  345. p0.l = lo(PLL_STAT);
  346. R0 = W[P0](Z);
  347. CC = BITTST(R0,5);
  348. if ! CC jump .Lcheck_again;
  349. /* Configure SCLK & CCLK Dividers */
  350. r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
  351. p0.h = hi(PLL_DIV);
  352. p0.l = lo(PLL_DIV);
  353. w[p0] = r0.l;
  354. ssync;
  355. p0.l = lo(EBIU_SDRRC);
  356. p0.h = hi(EBIU_SDRRC);
  357. r0 = mem_SDRRC;
  358. w[p0] = r0.l;
  359. ssync;
  360. p0.l = LO(EBIU_SDBCTL);
  361. p0.h = HI(EBIU_SDBCTL); /* SDRAM Memory Bank Control Register */
  362. r0 = mem_SDBCTL;
  363. w[p0] = r0.l;
  364. ssync;
  365. P2.H = hi(EBIU_SDGCTL);
  366. P2.L = lo(EBIU_SDGCTL);
  367. R0 = [P2];
  368. BITCLR (R0, 24);
  369. p0.h = hi(EBIU_SDSTAT);
  370. p0.l = lo(EBIU_SDSTAT);
  371. r2.l = w[p0];
  372. cc = bittst(r2,3);
  373. if !cc jump .Lskip;
  374. NOP;
  375. BITSET (R0, 23);
  376. .Lskip:
  377. [P2] = R0;
  378. SSYNC;
  379. R0.L = lo(mem_SDGCTL);
  380. R0.H = hi(mem_SDGCTL);
  381. R1 = [p2];
  382. R1 = R1 | R0;
  383. [P2] = R1;
  384. SSYNC;
  385. p0.h = hi(SIC_IWR);
  386. p0.l = lo(SIC_IWR);
  387. r0.l = lo(IWR_ENABLE_ALL);
  388. r0.h = hi(IWR_ENABLE_ALL);
  389. [p0] = r0;
  390. SSYNC;
  391. RTS;
  392. ENDPROC(_start_dma_code)
  393. #endif /* CONFIG_BFIN_KERNEL_CLOCK */
  394. ENTRY(_bfin_reset)
  395. /* No more interrupts to be handled*/
  396. CLI R6;
  397. SSYNC;
  398. #if defined(CONFIG_BFIN_SHARED_FLASH_ENET)
  399. p0.h = hi(FIO_INEN);
  400. p0.l = lo(FIO_INEN);
  401. r0.l = ~(1 << CONFIG_ENET_FLASH_PIN);
  402. w[p0] = r0.l;
  403. p0.h = hi(FIO_DIR);
  404. p0.l = lo(FIO_DIR);
  405. r0.l = (1 << CONFIG_ENET_FLASH_PIN);
  406. w[p0] = r0.l;
  407. p0.h = hi(FIO_FLAG_C);
  408. p0.l = lo(FIO_FLAG_C);
  409. r0.l = (1 << CONFIG_ENET_FLASH_PIN);
  410. w[p0] = r0.l;
  411. #endif
  412. /* Clear the IMASK register */
  413. p0.h = hi(IMASK);
  414. p0.l = lo(IMASK);
  415. r0 = 0x0;
  416. [p0] = r0;
  417. /* Clear the ILAT register */
  418. p0.h = hi(ILAT);
  419. p0.l = lo(ILAT);
  420. r0 = [p0];
  421. [p0] = r0;
  422. SSYNC;
  423. /* make sure SYSCR is set to use BMODE */
  424. P0.h = hi(SYSCR);
  425. P0.l = lo(SYSCR);
  426. R0.l = 0x0;
  427. W[P0] = R0.l;
  428. SSYNC;
  429. /* issue a system soft reset */
  430. P1.h = hi(SWRST);
  431. P1.l = lo(SWRST);
  432. R1.l = 0x0007;
  433. W[P1] = R1;
  434. SSYNC;
  435. /* clear system soft reset */
  436. R0.l = 0x0000;
  437. W[P0] = R0;
  438. SSYNC;
  439. /* issue core reset */
  440. raise 1;
  441. RTS;
  442. ENDPROC(_bfin_reset)
  443. #if CONFIG_DEBUG_KERNEL_START
  444. debug_kernel_start_trap:
  445. /* Set up a temp stack in L1 - SDRAM might not be working */
  446. P0.L = lo(L1_DATA_A_START + 0x100);
  447. P0.H = hi(L1_DATA_A_START + 0x100);
  448. SP = P0;
  449. /* Make sure the Clocks are the way I think they should be */
  450. r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */
  451. r0 = r0 << 9; /* Shift it over, */
  452. r1 = CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/
  453. r0 = r1 | r0;
  454. r1 = PLL_BYPASS; /* Bypass the PLL? */
  455. r1 = r1 << 8; /* Shift it over */
  456. r0 = r1 | r0; /* add them all together */
  457. p0.h = hi(PLL_CTL);
  458. p0.l = lo(PLL_CTL); /* Load the address */
  459. cli r2; /* Disable interrupts */
  460. ssync;
  461. w[p0] = r0.l; /* Set the value */
  462. idle; /* Wait for the PLL to stablize */
  463. sti r2; /* Enable interrupts */
  464. .Lcheck_again1:
  465. p0.h = hi(PLL_STAT);
  466. p0.l = lo(PLL_STAT);
  467. R0 = W[P0](Z);
  468. CC = BITTST(R0,5);
  469. if ! CC jump .Lcheck_again1;
  470. /* Configure SCLK & CCLK Dividers */
  471. r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
  472. p0.h = hi(PLL_DIV);
  473. p0.l = lo(PLL_DIV);
  474. w[p0] = r0.l;
  475. ssync;
  476. /* Make sure UART is enabled - you can never be sure */
  477. /*
  478. * Setup for console. Argument comes from the menuconfig
  479. */
  480. #ifdef CONFIG_BAUD_9600
  481. #define CONSOLE_BAUD_RATE 9600
  482. #elif CONFIG_BAUD_19200
  483. #define CONSOLE_BAUD_RATE 19200
  484. #elif CONFIG_BAUD_38400
  485. #define CONSOLE_BAUD_RATE 38400
  486. #elif CONFIG_BAUD_57600
  487. #define CONSOLE_BAUD_RATE 57600
  488. #elif CONFIG_BAUD_115200
  489. #define CONSOLE_BAUD_RATE 115200
  490. #endif
  491. p0.h = hi(UART_GCTL);
  492. p0.l = lo(UART_GCTL);
  493. r0 = 0x00(Z);
  494. w[p0] = r0.L; /* To Turn off UART clocks */
  495. ssync;
  496. p0.h = hi(UART_LCR);
  497. p0.l = lo(UART_LCR);
  498. r0 = 0x83(Z);
  499. w[p0] = r0.L; /* To enable DLL writes */
  500. ssync;
  501. R1 = (((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT) / CONFIG_SCLK_DIV) / (CONSOLE_BAUD_RATE * 16));
  502. p0.h = hi(UART_DLL);
  503. p0.l = lo(UART_DLL);
  504. r0 = 0xFF(Z);
  505. r0 = R1 & R0;
  506. w[p0] = r0.L;
  507. ssync;
  508. p0.h = hi(UART_DLH);
  509. p0.l = lo(UART_DLH);
  510. r1 >>= 8 ;
  511. w[p0] = r1.L;
  512. ssync;
  513. p0.h = hi(UART_GCTL);
  514. p0.l = lo(UART_GCTL);
  515. r0 = 0x0(Z);
  516. w[p0] = r0.L; /* To enable UART clock */
  517. ssync;
  518. p0.h = hi(UART_LCR);
  519. p0.l = lo(UART_LCR);
  520. r0 = 0x03(Z);
  521. w[p0] = r0.L; /* To Turn on UART */
  522. ssync;
  523. p0.h = hi(UART_GCTL);
  524. p0.l = lo(UART_GCTL);
  525. r0 = 0x01(Z);
  526. w[p0] = r0.L; /* To Turn on UART Clocks */
  527. ssync;
  528. P0.h = hi(UART_THR);
  529. P0.l = lo(UART_THR);
  530. P1.h = hi(UART_LSR);
  531. P1.l = lo(UART_LSR);
  532. R0.L = 'K';
  533. call .Lwait_char;
  534. R0.L='e';
  535. call .Lwait_char;
  536. R0.L='r';
  537. call .Lwait_char;
  538. R0.L='n'
  539. call .Lwait_char;
  540. R0.L='e'
  541. call .Lwait_char;
  542. R0.L='l';
  543. call .Lwait_char;
  544. R0.L=' ';
  545. call .Lwait_char;
  546. R0.L='c';
  547. call .Lwait_char;
  548. R0.L='r';
  549. call .Lwait_char;
  550. R0.L='a';
  551. call .Lwait_char;
  552. R0.L='s';
  553. call .Lwait_char;
  554. R0.L='h';
  555. call .Lwait_char;
  556. R0.L='\r';
  557. call .Lwait_char;
  558. R0.L='\n';
  559. call .Lwait_char;
  560. R0.L='S';
  561. call .Lwait_char;
  562. R0.L='E';
  563. call .Lwait_char;
  564. R0.L='Q'
  565. call .Lwait_char;
  566. R0.L='S'
  567. call .Lwait_char;
  568. R0.L='T';
  569. call .Lwait_char;
  570. R0.L='A';
  571. call .Lwait_char;
  572. R0.L='T';
  573. call .Lwait_char;
  574. R0.L='=';
  575. call .Lwait_char;
  576. R2 = SEQSTAT;
  577. call .Ldump_reg;
  578. R0.L=' ';
  579. call .Lwait_char;
  580. R0.L='R';
  581. call .Lwait_char;
  582. R0.L='E'
  583. call .Lwait_char;
  584. R0.L='T'
  585. call .Lwait_char;
  586. R0.L='X';
  587. call .Lwait_char;
  588. R0.L='=';
  589. call .Lwait_char;
  590. R2 = RETX;
  591. call .Ldump_reg;
  592. R0.L='\r';
  593. call .Lwait_char;
  594. R0.L='\n';
  595. call .Lwait_char;
  596. .Ldebug_kernel_start_trap_done:
  597. JUMP .Ldebug_kernel_start_trap_done;
  598. .Ldump_reg:
  599. R3 = 32;
  600. R4 = 0x0F;
  601. R5 = ':'; /* one past 9 */
  602. .Ldump_reg2:
  603. R0 = R2;
  604. R3 += -4;
  605. R0 >>>= R3;
  606. R0 = R0 & R4;
  607. R0 += 0x30;
  608. CC = R0 <= R5;
  609. if CC JUMP .Ldump_reg1;
  610. R0 += 7;
  611. .Ldump_reg1:
  612. R1.l = W[P1];
  613. CC = BITTST(R1, 5);
  614. if !CC JUMP .Ldump_reg1;
  615. W[P0] = r0;
  616. CC = R3 == 0;
  617. if !CC JUMP .Ldump_reg2
  618. RTS;
  619. .Lwait_char:
  620. R1.l = W[P1];
  621. CC = BITTST(R1, 5);
  622. if !CC JUMP .Lwait_char;
  623. W[P0] = r0;
  624. RTS;
  625. #endif /* CONFIG_DEBUG_KERNEL_START */
  626. .data
  627. /*
  628. * Set up the usable of RAM stuff. Size of RAM is determined then
  629. * an initial stack set up at the end.
  630. */
  631. .align 4
  632. __rambase:
  633. .long 0
  634. __ramstart:
  635. .long 0
  636. __ramend:
  637. .long 0