serial.c 14 KB

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