head.S 14 KB

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