Commit 19127e73 authored by Sylvain Munaut's avatar Sylvain Munaut Committed by Linus Torvalds

ppc: Fix output of low-level serial debug on Freescale MPC52xx

Thanks to Roger Blofeld for pointing that out.
Signed-off-by: default avatarSylvain Munaut <tnt@246tNt.com>
parent 0f43d237
...@@ -100,6 +100,14 @@ mpc52xx_map_io(void) ...@@ -100,6 +100,14 @@ mpc52xx_map_io(void)
#error "mpc52xx PSC for console not selected" #error "mpc52xx PSC for console not selected"
#endif #endif
static void
mpc52xx_psc_putc(struct mpc52xx_psc * psc, unsigned char c)
{
while (!(in_be16(&psc->mpc52xx_psc_status) &
MPC52xx_PSC_SR_TXRDY));
out_8(&psc->mpc52xx_psc_buffer_8, c);
}
void void
mpc52xx_progress(char *s, unsigned short hex) mpc52xx_progress(char *s, unsigned short hex)
{ {
...@@ -107,15 +115,13 @@ mpc52xx_progress(char *s, unsigned short hex) ...@@ -107,15 +115,13 @@ mpc52xx_progress(char *s, unsigned short hex)
char c; char c;
while ((c = *s++) != 0) { while ((c = *s++) != 0) {
if (c == '\n') { if (c == '\n')
while (!(in_be16(&psc->mpc52xx_psc_status) & mpc52xx_psc_putc(psc, '\r');
MPC52xx_PSC_SR_TXRDY)) ; mpc52xx_psc_putc(psc, c);
out_8(&psc->mpc52xx_psc_buffer_8, '\r');
}
while (!(in_be16(&psc->mpc52xx_psc_status) &
MPC52xx_PSC_SR_TXRDY)) ;
out_8(&psc->mpc52xx_psc_buffer_8, c);
} }
mpc52xx_psc_putc(psc, '\r');
mpc52xx_psc_putc(psc, '\n');
} }
#endif /* CONFIG_SERIAL_TEXT_DEBUG */ #endif /* CONFIG_SERIAL_TEXT_DEBUG */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment