serial.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. /*
  2. * (C) Copyright 2000
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <common.h>
  24. #include <commproc.h>
  25. #include <command.h>
  26. #if !defined(CONFIG_8xx_CONS_NONE) /* No Console at all */
  27. #if defined(CONFIG_8xx_CONS_SMC1) /* Console on SMC1 */
  28. #define SMC_INDEX 0
  29. #undef SCC_INDEX
  30. #define PROFF_SMC PROFF_SMC1
  31. #define CPM_CR_CH_SMC CPM_CR_CH_SMC1
  32. #elif defined(CONFIG_8xx_CONS_SMC2) /* Console on SMC2 */
  33. #define SMC_INDEX 1
  34. #undef SCC_INDEX
  35. #define PROFF_SMC PROFF_SMC2
  36. #define CPM_CR_CH_SMC CPM_CR_CH_SMC2
  37. #elif defined(CONFIG_8xx_CONS_SCC1) /* Console on SCC1 */
  38. #undef SMC_INDEX
  39. #define SCC_INDEX 0
  40. #define PROFF_SCC PROFF_SCC1
  41. #define CPM_CR_CH_SCC CPM_CR_CH_SCC1
  42. #elif defined(CONFIG_8xx_CONS_SCC2) /* Console on SCC2 */
  43. #undef SMC_INDEX
  44. #define SCC_INDEX 1
  45. #define PROFF_SCC PROFF_SCC2
  46. #define CPM_CR_CH_SCC CPM_CR_CH_SCC2
  47. #elif defined(CONFIG_8xx_CONS_SCC3) /* Console on SCC3 */
  48. #undef SMC_INDEX
  49. #define SCC_INDEX 2
  50. #define PROFF_SCC PROFF_SCC3
  51. #define CPM_CR_CH_SCC CPM_CR_CH_SCC3
  52. #elif defined(CONFIG_8xx_CONS_SCC4) /* Console on SCC4 */
  53. #undef SMC_INDEX
  54. #define SCC_INDEX 3
  55. #define PROFF_SCC PROFF_SCC4
  56. #define CPM_CR_CH_SCC CPM_CR_CH_SCC4
  57. #else /* CONFIG_8xx_CONS_? */
  58. #error "console not correctly defined"
  59. #endif
  60. #if (defined (CONFIG_8xx_CONS_SMC1) || defined (CONFIG_8xx_CONS_SMC2))
  61. /*
  62. * Minimal serial functions needed to use one of the SMC ports
  63. * as serial console interface.
  64. */
  65. int serial_init (void)
  66. {
  67. volatile immap_t *im = (immap_t *)CFG_IMMR;
  68. volatile smc_t *sp;
  69. volatile smc_uart_t *up;
  70. volatile cbd_t *tbdf, *rbdf;
  71. volatile cpm8xx_t *cp = &(im->im_cpm);
  72. #if (!defined(CONFIG_8xx_CONS_SMC1)) && (defined(CONFIG_MPC823) || defined(CONFIG_MPC850))
  73. volatile iop8xx_t *ip = (iop8xx_t *)&(im->im_ioport);
  74. #endif
  75. uint dpaddr;
  76. /* initialize pointers to SMC */
  77. sp = (smc_t *) &(cp->cp_smc[SMC_INDEX]);
  78. up = (smc_uart_t *) &cp->cp_dparam[PROFF_SMC];
  79. /* Disable transmitter/receiver.
  80. */
  81. sp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
  82. /* Enable SDMA.
  83. */
  84. im->im_siu_conf.sc_sdcr = 1;
  85. /* clear error conditions */
  86. #ifdef CFG_SDSR
  87. im->im_sdma.sdma_sdsr = CFG_SDSR;
  88. #else
  89. im->im_sdma.sdma_sdsr = 0x83;
  90. #endif
  91. /* clear SDMA interrupt mask */
  92. #ifdef CFG_SDMR
  93. im->im_sdma.sdma_sdmr = CFG_SDMR;
  94. #else
  95. im->im_sdma.sdma_sdmr = 0x00;
  96. #endif
  97. #if defined(CONFIG_8xx_CONS_SMC1)
  98. /* Use Port B for SMC1 instead of other functions.
  99. */
  100. cp->cp_pbpar |= 0x000000c0;
  101. cp->cp_pbdir &= ~0x000000c0;
  102. cp->cp_pbodr &= ~0x000000c0;
  103. #else /* CONFIG_8xx_CONS_SMC2 */
  104. # if defined(CONFIG_MPC823) || defined(CONFIG_MPC850)
  105. /* Use Port A for SMC2 instead of other functions.
  106. */
  107. ip->iop_papar |= 0x00c0;
  108. ip->iop_padir &= ~0x00c0;
  109. ip->iop_paodr &= ~0x00c0;
  110. # else /* must be a 860 then */
  111. /* Use Port B for SMC2 instead of other functions.
  112. */
  113. cp->cp_pbpar |= 0x00000c00;
  114. cp->cp_pbdir &= ~0x00000c00;
  115. cp->cp_pbodr &= ~0x00000c00;
  116. # endif
  117. #endif
  118. #if defined(CONFIG_FADS)
  119. /* Enable RS232 */
  120. #if defined(CONFIG_8xx_CONS_SMC1)
  121. *((uint *) BCSR1) &= ~BCSR1_RS232EN_1;
  122. #else
  123. *((uint *) BCSR1) &= ~BCSR1_RS232EN_2;
  124. #endif
  125. #endif /* CONFIG_FADS */
  126. #if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC)
  127. /* Enable Monitor Port Transceiver */
  128. *((uchar *) BCSR0) |= BCSR0_ENMONXCVR ;
  129. #endif /* CONFIG_RPXLITE */
  130. /* Set the physical address of the host memory buffers in
  131. * the buffer descriptors.
  132. */
  133. #ifdef CFG_ALLOC_DPRAM
  134. dpaddr = dpram_alloc_align (sizeof(cbd_t)*2 + 2, 8) ;
  135. #else
  136. dpaddr = CPM_SERIAL_BASE ;
  137. #endif
  138. /* Allocate space for two buffer descriptors in the DP ram.
  139. * For now, this address seems OK, but it may have to
  140. * change with newer versions of the firmware.
  141. * damm: allocating space after the two buffers for rx/tx data
  142. */
  143. rbdf = (cbd_t *)&cp->cp_dpmem[dpaddr];
  144. rbdf->cbd_bufaddr = (uint) (rbdf+2);
  145. rbdf->cbd_sc = 0;
  146. tbdf = rbdf + 1;
  147. tbdf->cbd_bufaddr = ((uint) (rbdf+2)) + 1;
  148. tbdf->cbd_sc = 0;
  149. /* Set up the uart parameters in the parameter ram.
  150. */
  151. up->smc_rbase = dpaddr;
  152. up->smc_tbase = dpaddr+sizeof(cbd_t);
  153. up->smc_rfcr = SMC_EB;
  154. up->smc_tfcr = SMC_EB;
  155. #if defined(CONFIG_MBX)
  156. board_serial_init();
  157. #endif /* CONFIG_MBX */
  158. /* Set UART mode, 8 bit, no parity, one stop.
  159. * Enable receive and transmit.
  160. */
  161. sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART;
  162. /* Mask all interrupts and remove anything pending.
  163. */
  164. sp->smc_smcm = 0;
  165. sp->smc_smce = 0xff;
  166. /* Set up the baud rate generator.
  167. */
  168. serial_setbrg ();
  169. /* Make the first buffer the only buffer.
  170. */
  171. tbdf->cbd_sc |= BD_SC_WRAP;
  172. rbdf->cbd_sc |= BD_SC_EMPTY | BD_SC_WRAP;
  173. /* Single character receive.
  174. */
  175. up->smc_mrblr = 1;
  176. up->smc_maxidl = 0;
  177. /* Initialize Tx/Rx parameters.
  178. */
  179. while (cp->cp_cpcr & CPM_CR_FLG) /* wait if cp is busy */
  180. ;
  181. cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_SMC, CPM_CR_INIT_TRX) | CPM_CR_FLG;
  182. while (cp->cp_cpcr & CPM_CR_FLG) /* wait if cp is busy */
  183. ;
  184. /* Enable transmitter/receiver.
  185. */
  186. sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN;
  187. return (0);
  188. }
  189. void
  190. serial_setbrg (void)
  191. {
  192. DECLARE_GLOBAL_DATA_PTR;
  193. volatile immap_t *im = (immap_t *)CFG_IMMR;
  194. volatile cpm8xx_t *cp = &(im->im_cpm);
  195. /* Set up the baud rate generator.
  196. * See 8xx_io/commproc.c for details.
  197. *
  198. * Wire BRG1 to SMCx
  199. */
  200. cp->cp_simode = 0x00000000;
  201. cp->cp_brgc1 =
  202. (((gd->cpu_clk / 16 / gd->baudrate)-1) << 1) | CPM_BRG_EN;
  203. }
  204. void
  205. serial_putc(const char c)
  206. {
  207. volatile cbd_t *tbdf;
  208. volatile char *buf;
  209. volatile smc_uart_t *up;
  210. volatile immap_t *im = (immap_t *)CFG_IMMR;
  211. volatile cpm8xx_t *cpmp = &(im->im_cpm);
  212. if (c == '\n')
  213. serial_putc ('\r');
  214. up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_SMC];
  215. tbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_tbase];
  216. /* Wait for last character to go.
  217. */
  218. buf = (char *)tbdf->cbd_bufaddr;
  219. #if 0
  220. __asm__("eieio");
  221. while (tbdf->cbd_sc & BD_SC_READY)
  222. __asm__("eieio");
  223. #endif
  224. *buf = c;
  225. tbdf->cbd_datlen = 1;
  226. tbdf->cbd_sc |= BD_SC_READY;
  227. __asm__("eieio");
  228. #if 1
  229. while (tbdf->cbd_sc & BD_SC_READY)
  230. __asm__("eieio");
  231. #endif
  232. }
  233. int
  234. serial_getc(void)
  235. {
  236. volatile cbd_t *rbdf;
  237. volatile unsigned char *buf;
  238. volatile smc_uart_t *up;
  239. volatile immap_t *im = (immap_t *)CFG_IMMR;
  240. volatile cpm8xx_t *cpmp = &(im->im_cpm);
  241. unsigned char c;
  242. up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_SMC];
  243. rbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase];
  244. /* Wait for character to show up.
  245. */
  246. buf = (unsigned char *)rbdf->cbd_bufaddr;
  247. while (rbdf->cbd_sc & BD_SC_EMPTY)
  248. ;
  249. c = *buf;
  250. rbdf->cbd_sc |= BD_SC_EMPTY;
  251. return(c);
  252. }
  253. int
  254. serial_tstc()
  255. {
  256. volatile cbd_t *rbdf;
  257. volatile smc_uart_t *up;
  258. volatile immap_t *im = (immap_t *)CFG_IMMR;
  259. volatile cpm8xx_t *cpmp = &(im->im_cpm);
  260. up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_SMC];
  261. rbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase];
  262. return(!(rbdf->cbd_sc & BD_SC_EMPTY));
  263. }
  264. #else /* ! CONFIG_8xx_CONS_SMC1, CONFIG_8xx_CONS_SMC2 */
  265. int serial_init (void)
  266. {
  267. volatile immap_t *im = (immap_t *)CFG_IMMR;
  268. volatile scc_t *sp;
  269. volatile scc_uart_t *up;
  270. volatile cbd_t *tbdf, *rbdf;
  271. volatile cpm8xx_t *cp = &(im->im_cpm);
  272. uint dpaddr;
  273. #if (SCC_INDEX != 2) || !defined(CONFIG_MPC850)
  274. volatile iop8xx_t *ip = (iop8xx_t *)&(im->im_ioport);
  275. #endif
  276. /* initialize pointers to SCC */
  277. sp = (scc_t *) &(cp->cp_scc[SCC_INDEX]);
  278. up = (scc_uart_t *) &cp->cp_dparam[PROFF_SCC];
  279. #if defined(CONFIG_LWMON) && defined(CONFIG_8xx_CONS_SCC2)
  280. { /* Disable Ethernet, enable Serial */
  281. uchar c;
  282. c = pic_read (0x61);
  283. c &= ~0x40; /* enable COM3 */
  284. c |= 0x80; /* disable Ethernet */
  285. pic_write (0x61, c);
  286. /* enable RTS2 */
  287. cp->cp_pbpar |= 0x2000;
  288. cp->cp_pbdat |= 0x2000;
  289. cp->cp_pbdir |= 0x2000;
  290. }
  291. #endif /* CONFIG_LWMON */
  292. /* Disable transmitter/receiver.
  293. */
  294. sp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
  295. #if (SCC_INDEX == 2) && defined(CONFIG_MPC850)
  296. /*
  297. * The MPC850 has SCC3 on Port B
  298. */
  299. cp->cp_pbpar |= 0x06;
  300. cp->cp_pbdir &= ~0x06;
  301. cp->cp_pbodr &= ~0x06;
  302. #elif (SCC_INDEX < 2) || !defined(CONFIG_IP860)
  303. /*
  304. * Standard configuration for SCC's is on Part A
  305. */
  306. ip->iop_papar |= ((3 << (2 * SCC_INDEX)));
  307. ip->iop_padir &= ~((3 << (2 * SCC_INDEX)));
  308. ip->iop_paodr &= ~((3 << (2 * SCC_INDEX)));
  309. #else
  310. /*
  311. * The IP860 has SCC3 and SCC4 on Port D
  312. */
  313. ip->iop_pdpar |= ((3 << (2 * SCC_INDEX)));
  314. #endif
  315. /* Allocate space for two buffer descriptors in the DP ram.
  316. */
  317. #ifdef CFG_ALLOC_DPRAM
  318. dpaddr = dpram_alloc_align (sizeof(cbd_t)*2 + 2, 8) ;
  319. #else
  320. dpaddr = CPM_SERIAL_BASE ;
  321. #endif
  322. /* Enable SDMA.
  323. */
  324. im->im_siu_conf.sc_sdcr = 0x0001;
  325. /* Set the physical address of the host memory buffers in
  326. * the buffer descriptors.
  327. */
  328. rbdf = (cbd_t *)&cp->cp_dpmem[dpaddr];
  329. rbdf->cbd_bufaddr = (uint) (rbdf+2);
  330. rbdf->cbd_sc = 0;
  331. tbdf = rbdf + 1;
  332. tbdf->cbd_bufaddr = ((uint) (rbdf+2)) + 1;
  333. tbdf->cbd_sc = 0;
  334. /* Set up the baud rate generator.
  335. */
  336. serial_setbrg ();
  337. /* Set up the uart parameters in the parameter ram.
  338. */
  339. up->scc_genscc.scc_rbase = dpaddr;
  340. up->scc_genscc.scc_tbase = dpaddr+sizeof(cbd_t);
  341. /* Initialize Tx/Rx parameters.
  342. */
  343. while (cp->cp_cpcr & CPM_CR_FLG) /* wait if cp is busy */
  344. ;
  345. cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_SCC, CPM_CR_INIT_TRX) | CPM_CR_FLG;
  346. while (cp->cp_cpcr & CPM_CR_FLG) /* wait if cp is busy */
  347. ;
  348. up->scc_genscc.scc_rfcr = SCC_EB | 0x05;
  349. up->scc_genscc.scc_tfcr = SCC_EB | 0x05;
  350. up->scc_genscc.scc_mrblr = 1; /* Single character receive */
  351. up->scc_maxidl = 0; /* disable max idle */
  352. up->scc_brkcr = 1; /* send one break character on stop TX */
  353. up->scc_parec = 0;
  354. up->scc_frmec = 0;
  355. up->scc_nosec = 0;
  356. up->scc_brkec = 0;
  357. up->scc_uaddr1 = 0;
  358. up->scc_uaddr2 = 0;
  359. up->scc_toseq = 0;
  360. up->scc_char1 = 0x8000;
  361. up->scc_char2 = 0x8000;
  362. up->scc_char3 = 0x8000;
  363. up->scc_char4 = 0x8000;
  364. up->scc_char5 = 0x8000;
  365. up->scc_char6 = 0x8000;
  366. up->scc_char7 = 0x8000;
  367. up->scc_char8 = 0x8000;
  368. up->scc_rccm = 0xc0ff;
  369. /* Set low latency / small fifo.
  370. */
  371. sp->scc_gsmrh = SCC_GSMRH_RFW;
  372. /* Set SCC(x) clock mode to 16x
  373. * See 8xx_io/commproc.c for details.
  374. *
  375. * Wire BRG1 to SCCn
  376. */
  377. /* Set UART mode, clock divider 16 on Tx and Rx
  378. */
  379. sp->scc_gsmrl |=
  380. (SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);
  381. sp->scc_psmr |= SCU_PSMR_CL;
  382. /* Mask all interrupts and remove anything pending.
  383. */
  384. sp->scc_sccm = 0;
  385. sp->scc_scce = 0xffff;
  386. sp->scc_dsr = 0x7e7e;
  387. sp->scc_psmr = 0x3000;
  388. /* Make the first buffer the only buffer.
  389. */
  390. tbdf->cbd_sc |= BD_SC_WRAP;
  391. rbdf->cbd_sc |= BD_SC_EMPTY | BD_SC_WRAP;
  392. /* Enable transmitter/receiver.
  393. */
  394. sp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT);
  395. return (0);
  396. }
  397. void
  398. serial_setbrg (void)
  399. {
  400. DECLARE_GLOBAL_DATA_PTR;
  401. volatile immap_t *im = (immap_t *)CFG_IMMR;
  402. volatile cpm8xx_t *cp = &(im->im_cpm);
  403. /* Set up the baud rate generator.
  404. * See 8xx_io/commproc.c for details.
  405. *
  406. * Wire BRG1 to SCCx
  407. */
  408. cp->cp_sicr &= ~(0x000000FF << (8 * SCC_INDEX));
  409. /* no |= needed, since BRG1 is 000 */
  410. cp->cp_brgc1 =
  411. (((gd->cpu_clk / 16 / gd->baudrate)-1) << 1) | CPM_BRG_EN;
  412. }
  413. void
  414. serial_putc(const char c)
  415. {
  416. volatile cbd_t *tbdf;
  417. volatile char *buf;
  418. volatile scc_uart_t *up;
  419. volatile immap_t *im = (immap_t *)CFG_IMMR;
  420. volatile cpm8xx_t *cpmp = &(im->im_cpm);
  421. if (c == '\n')
  422. serial_putc ('\r');
  423. up = (scc_uart_t *)&cpmp->cp_dparam[PROFF_SCC];
  424. tbdf = (cbd_t *)&cpmp->cp_dpmem[up->scc_genscc.scc_tbase];
  425. /* Wait for last character to go.
  426. */
  427. buf = (char *)tbdf->cbd_bufaddr;
  428. #if 0
  429. __asm__("eieio");
  430. while (tbdf->cbd_sc & BD_SC_READY)
  431. __asm__("eieio");
  432. #endif
  433. *buf = c;
  434. tbdf->cbd_datlen = 1;
  435. tbdf->cbd_sc |= BD_SC_READY;
  436. __asm__("eieio");
  437. #if 1
  438. while (tbdf->cbd_sc & BD_SC_READY)
  439. __asm__("eieio");
  440. #endif
  441. }
  442. int
  443. serial_getc(void)
  444. {
  445. volatile cbd_t *rbdf;
  446. volatile unsigned char *buf;
  447. volatile scc_uart_t *up;
  448. volatile immap_t *im = (immap_t *)CFG_IMMR;
  449. volatile cpm8xx_t *cpmp = &(im->im_cpm);
  450. unsigned char c;
  451. up = (scc_uart_t *)&cpmp->cp_dparam[PROFF_SCC];
  452. rbdf = (cbd_t *)&cpmp->cp_dpmem[up->scc_genscc.scc_rbase];
  453. /* Wait for character to show up.
  454. */
  455. buf = (unsigned char *)rbdf->cbd_bufaddr;
  456. while (rbdf->cbd_sc & BD_SC_EMPTY)
  457. ;
  458. c = *buf;
  459. rbdf->cbd_sc |= BD_SC_EMPTY;
  460. return(c);
  461. }
  462. int
  463. serial_tstc()
  464. {
  465. volatile cbd_t *rbdf;
  466. volatile scc_uart_t *up;
  467. volatile immap_t *im = (immap_t *)CFG_IMMR;
  468. volatile cpm8xx_t *cpmp = &(im->im_cpm);
  469. up = (scc_uart_t *)&cpmp->cp_dparam[PROFF_SCC];
  470. rbdf = (cbd_t *)&cpmp->cp_dpmem[up->scc_genscc.scc_rbase];
  471. return(!(rbdf->cbd_sc & BD_SC_EMPTY));
  472. }
  473. #endif /* CONFIG_8xx_CONS_SMC1, CONFIG_8xx_CONS_SMC2 */
  474. void
  475. serial_puts (const char *s)
  476. {
  477. while (*s) {
  478. serial_putc (*s++);
  479. }
  480. }
  481. #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
  482. void
  483. kgdb_serial_init(void)
  484. {
  485. #if defined(CONFIG_8xx_CONS_SMC1)
  486. serial_printf("[on SMC1] ");
  487. #elif defined(CONFIG_8xx_CONS_SMC2)
  488. serial_printf("[on SMC2] ");
  489. #elif defined(CONFIG_8xx_CONS_SCC1)
  490. serial_printf("[on SCC1] ");
  491. #elif defined(CONFIG_8xx_CONS_SCC2)
  492. serial_printf("[on SCC2] ");
  493. #elif defined(CONFIG_8xx_CONS_SCC3)
  494. serial_printf("[on SCC3] ");
  495. #elif defined(CONFIG_8xx_CONS_SCC4)
  496. serial_printf("[on SCC4] ");
  497. #endif
  498. }
  499. void
  500. putDebugChar (int c)
  501. {
  502. serial_putc (c);
  503. }
  504. void
  505. putDebugStr (const char *str)
  506. {
  507. serial_puts (str);
  508. }
  509. int
  510. getDebugChar (void)
  511. {
  512. return serial_getc();
  513. }
  514. void
  515. kgdb_interruptible (int yes)
  516. {
  517. return;
  518. }
  519. #endif /* CFG_CMD_KGDB */
  520. #endif /* CONFIG_8xx_CONS_NONE */