head.S 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  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 bits 13-15 in SWRST if they werent cleared */
  404. p0.h = hi(SWRST);
  405. p0.l = lo(SWRST);
  406. csync;
  407. r0.l = w[p0];
  408. /* Clear the IMASK register */
  409. p0.h = hi(IMASK);
  410. p0.l = lo(IMASK);
  411. r0 = 0x0;
  412. [p0] = r0;
  413. /* Clear the ILAT register */
  414. p0.h = hi(ILAT);
  415. p0.l = lo(ILAT);
  416. r0 = [p0];
  417. [p0] = r0;
  418. SSYNC;
  419. /* Disable the WDOG TIMER */
  420. p0.h = hi(WDOG_CTL);
  421. p0.l = lo(WDOG_CTL);
  422. r0.l = 0xAD6;
  423. w[p0] = r0.l;
  424. SSYNC;
  425. /* Clear the sticky bit incase it is already set */
  426. p0.h = hi(WDOG_CTL);
  427. p0.l = lo(WDOG_CTL);
  428. r0.l = 0x8AD6;
  429. w[p0] = r0.l;
  430. SSYNC;
  431. /* Program the count value */
  432. R0.l = 0x100;
  433. R0.h = 0x0;
  434. P0.h = hi(WDOG_CNT);
  435. P0.l = lo(WDOG_CNT);
  436. [P0] = R0;
  437. SSYNC;
  438. /* Program WDOG_STAT if necessary */
  439. P0.h = hi(WDOG_CTL);
  440. P0.l = lo(WDOG_CTL);
  441. R0 = W[P0](Z);
  442. CC = BITTST(R0,1);
  443. if !CC JUMP .LWRITESTAT;
  444. CC = BITTST(R0,2);
  445. if !CC JUMP .LWRITESTAT;
  446. JUMP .LSKIP_WRITE;
  447. .LWRITESTAT:
  448. /* When watch dog timer is enabled, a write to STAT will load the contents of CNT to STAT */
  449. R0 = 0x0000(z);
  450. P0.h = hi(WDOG_STAT);
  451. P0.l = lo(WDOG_STAT)
  452. [P0] = R0;
  453. SSYNC;
  454. .LSKIP_WRITE:
  455. /* Enable the reset event */
  456. P0.h = hi(WDOG_CTL);
  457. P0.l = lo(WDOG_CTL);
  458. R0 = W[P0](Z);
  459. BITCLR(R0,1);
  460. BITCLR(R0,2);
  461. W[P0] = R0.L;
  462. SSYNC;
  463. NOP;
  464. /* Enable the wdog counter */
  465. R0 = W[P0](Z);
  466. BITCLR(R0,4);
  467. W[P0] = R0.L;
  468. SSYNC;
  469. IDLE;
  470. RTS;
  471. #if CONFIG_DEBUG_KERNEL_START
  472. debug_kernel_start_trap:
  473. /* Set up a temp stack in L1 - SDRAM might not be working */
  474. P0.L = lo(L1_DATA_A_START + 0x100);
  475. P0.H = hi(L1_DATA_A_START + 0x100);
  476. SP = P0;
  477. /* Make sure the Clocks are the way I think they should be */
  478. r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */
  479. r0 = r0 << 9; /* Shift it over, */
  480. r1 = CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/
  481. r0 = r1 | r0;
  482. r1 = PLL_BYPASS; /* Bypass the PLL? */
  483. r1 = r1 << 8; /* Shift it over */
  484. r0 = r1 | r0; /* add them all together */
  485. p0.h = hi(PLL_CTL);
  486. p0.l = lo(PLL_CTL); /* Load the address */
  487. cli r2; /* Disable interrupts */
  488. ssync;
  489. w[p0] = r0.l; /* Set the value */
  490. idle; /* Wait for the PLL to stablize */
  491. sti r2; /* Enable interrupts */
  492. .Lcheck_again1:
  493. p0.h = hi(PLL_STAT);
  494. p0.l = lo(PLL_STAT);
  495. R0 = W[P0](Z);
  496. CC = BITTST(R0,5);
  497. if ! CC jump .Lcheck_again1;
  498. /* Configure SCLK & CCLK Dividers */
  499. r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
  500. p0.h = hi(PLL_DIV);
  501. p0.l = lo(PLL_DIV);
  502. w[p0] = r0.l;
  503. ssync;
  504. /* Make sure UART is enabled - you can never be sure */
  505. /*
  506. * Setup for console. Argument comes from the menuconfig
  507. */
  508. #ifdef CONFIG_BAUD_9600
  509. #define CONSOLE_BAUD_RATE 9600
  510. #elif CONFIG_BAUD_19200
  511. #define CONSOLE_BAUD_RATE 19200
  512. #elif CONFIG_BAUD_38400
  513. #define CONSOLE_BAUD_RATE 38400
  514. #elif CONFIG_BAUD_57600
  515. #define CONSOLE_BAUD_RATE 57600
  516. #elif CONFIG_BAUD_115200
  517. #define CONSOLE_BAUD_RATE 115200
  518. #endif
  519. p0.h = hi(UART_GCTL);
  520. p0.l = lo(UART_GCTL);
  521. r0 = 0x00(Z);
  522. w[p0] = r0.L; /* To Turn off UART clocks */
  523. ssync;
  524. p0.h = hi(UART_LCR);
  525. p0.l = lo(UART_LCR);
  526. r0 = 0x83(Z);
  527. w[p0] = r0.L; /* To enable DLL writes */
  528. ssync;
  529. R1 = (((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT) / CONFIG_SCLK_DIV) / (CONSOLE_BAUD_RATE * 16));
  530. p0.h = hi(UART_DLL);
  531. p0.l = lo(UART_DLL);
  532. r0 = 0xFF(Z);
  533. r0 = R1 & R0;
  534. w[p0] = r0.L;
  535. ssync;
  536. p0.h = hi(UART_DLH);
  537. p0.l = lo(UART_DLH);
  538. r1 >>= 8 ;
  539. w[p0] = r1.L;
  540. ssync;
  541. p0.h = hi(UART_GCTL);
  542. p0.l = lo(UART_GCTL);
  543. r0 = 0x0(Z);
  544. w[p0] = r0.L; /* To enable UART clock */
  545. ssync;
  546. p0.h = hi(UART_LCR);
  547. p0.l = lo(UART_LCR);
  548. r0 = 0x03(Z);
  549. w[p0] = r0.L; /* To Turn on UART */
  550. ssync;
  551. p0.h = hi(UART_GCTL);
  552. p0.l = lo(UART_GCTL);
  553. r0 = 0x01(Z);
  554. w[p0] = r0.L; /* To Turn on UART Clocks */
  555. ssync;
  556. P0.h = hi(UART_THR);
  557. P0.l = lo(UART_THR);
  558. P1.h = hi(UART_LSR);
  559. P1.l = lo(UART_LSR);
  560. R0.L = 'K';
  561. call .Lwait_char;
  562. R0.L='e';
  563. call .Lwait_char;
  564. R0.L='r';
  565. call .Lwait_char;
  566. R0.L='n'
  567. call .Lwait_char;
  568. R0.L='e'
  569. call .Lwait_char;
  570. R0.L='l';
  571. call .Lwait_char;
  572. R0.L=' ';
  573. call .Lwait_char;
  574. R0.L='c';
  575. call .Lwait_char;
  576. R0.L='r';
  577. call .Lwait_char;
  578. R0.L='a';
  579. call .Lwait_char;
  580. R0.L='s';
  581. call .Lwait_char;
  582. R0.L='h';
  583. call .Lwait_char;
  584. R0.L='\r';
  585. call .Lwait_char;
  586. R0.L='\n';
  587. call .Lwait_char;
  588. R0.L='S';
  589. call .Lwait_char;
  590. R0.L='E';
  591. call .Lwait_char;
  592. R0.L='Q'
  593. call .Lwait_char;
  594. R0.L='S'
  595. call .Lwait_char;
  596. R0.L='T';
  597. call .Lwait_char;
  598. R0.L='A';
  599. call .Lwait_char;
  600. R0.L='T';
  601. call .Lwait_char;
  602. R0.L='=';
  603. call .Lwait_char;
  604. R2 = SEQSTAT;
  605. call .Ldump_reg;
  606. R0.L=' ';
  607. call .Lwait_char;
  608. R0.L='R';
  609. call .Lwait_char;
  610. R0.L='E'
  611. call .Lwait_char;
  612. R0.L='T'
  613. call .Lwait_char;
  614. R0.L='X';
  615. call .Lwait_char;
  616. R0.L='=';
  617. call .Lwait_char;
  618. R2 = RETX;
  619. call .Ldump_reg;
  620. R0.L='\r';
  621. call .Lwait_char;
  622. R0.L='\n';
  623. call .Lwait_char;
  624. .Ldebug_kernel_start_trap_done:
  625. JUMP .Ldebug_kernel_start_trap_done;
  626. .Ldump_reg:
  627. R3 = 32;
  628. R4 = 0x0F;
  629. R5 = ':'; /* one past 9 */
  630. .Ldump_reg2:
  631. R0 = R2;
  632. R3 += -4;
  633. R0 >>>= R3;
  634. R0 = R0 & R4;
  635. R0 += 0x30;
  636. CC = R0 <= R5;
  637. if CC JUMP .Ldump_reg1;
  638. R0 += 7;
  639. .Ldump_reg1:
  640. R1.l = W[P1];
  641. CC = BITTST(R1, 5);
  642. if !CC JUMP .Ldump_reg1;
  643. W[P0] = r0;
  644. CC = R3 == 0;
  645. if !CC JUMP .Ldump_reg2
  646. RTS;
  647. .Lwait_char:
  648. R1.l = W[P1];
  649. CC = BITTST(R1, 5);
  650. if !CC JUMP .Lwait_char;
  651. W[P0] = r0;
  652. RTS;
  653. #endif /* CONFIG_DEBUG_KERNEL_START */
  654. .data
  655. /*
  656. * Set up the usable of RAM stuff. Size of RAM is determined then
  657. * an initial stack set up at the end.
  658. */
  659. .align 4
  660. __rambase:
  661. .long 0
  662. __ramstart:
  663. .long 0
  664. __ramend:
  665. .long 0