head.S 14 KB

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