* [PATCH] mpc52xx: fix early text output
@ 2004-09-15 14:35 roger blofeld
2004-09-15 19:41 ` Sylvain Munaut
0 siblings, 1 reply; 2+ messages in thread
From: roger blofeld @ 2004-09-15 14:35 UTC (permalink / raw)
To: tnt; +Cc: linuxppc-dev
This patch fixes early serial text output
-rb
===== arch/ppc/syslib/mpc52xx_setup.c 1.4 vs edited =====
--- 1.4/arch/ppc/syslib/mpc52xx_setup.c 2004-09-14 09:29:40 -05:00
+++ edited/arch/ppc/syslib/mpc52xx_setup.c 2004-09-15 09:13:10
-05:00
@@ -100,6 +100,14 @@
#error "mpc52xx PSC for console not selected"
#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
mpc52xx_progress(char *s, unsigned short hex)
{
@@ -109,15 +117,10 @@
/* Don't we need to disable serial interrupts ? */
while ((c = *s++) != 0) {
- if (c == '\n') {
- while (!(in_be16(&psc->mpc52xx_psc_status) &
- MPC52xx_PSC_SR_TXRDY)) ;
- 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, c);
}
+ mpc52xx_psc_putc(psc, '\r');
+ mpc52xx_psc_putc(psc, '\n');
}
#endif /* CONFIG_SERIAL_TEXT_DEBUG */
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mpc52xx: fix early text output
2004-09-15 14:35 [PATCH] mpc52xx: fix early text output roger blofeld
@ 2004-09-15 19:41 ` Sylvain Munaut
0 siblings, 0 replies; 2+ messages in thread
From: Sylvain Munaut @ 2004-09-15 19:41 UTC (permalink / raw)
To: roger blofeld; +Cc: linuxppc-dev
Hi Roger,
roger blofeld wrote:
>This patch fixes early serial text output
>-rb
>
>
Thanks for pointing that out. The output is nicer ;)
However, I would leave the test to add a \r in front of a \n.
Even if it doesn't happen in current code, someone may use it (I know I
did at somepoint in the debug ... )
Applied to my public tree. I'll post it as [PATCH 10/9] in the group of
updates I'm trying to push upstream.
Sylvain
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/09/15 21:23:46+02:00 tnt@246tNt.com
# ppc: Fix output of low-level serial debug on Freescale MPC52xx
#
# Thanks to Roger Blofeld for pointing that out.
#
# Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
#
# arch/ppc/syslib/mpc52xx_setup.c
# 2004/09/15 21:23:06+02:00 tnt@246tNt.com +14 -10
# ppc: Fix output of low-level serial debug on Freescale MPC52xx
#
diff -Nru a/arch/ppc/syslib/mpc52xx_setup.c
b/arch/ppc/syslib/mpc52xx_setup.c
--- a/arch/ppc/syslib/mpc52xx_setup.c 2004-09-15 21:24:24 +02:00
+++ b/arch/ppc/syslib/mpc52xx_setup.c 2004-09-15 21:24:24 +02:00
@@ -100,24 +100,28 @@
#error "mpc52xx PSC for console not selected"
#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
mpc52xx_progress(char *s, unsigned short hex)
{
struct mpc52xx_psc *psc = (struct mpc52xx_psc *)MPC52xx_CONSOLE;
char c;
- /* Don't we need to disable serial interrupts ? */
-
while ((c = *s++) != 0) {
- if (c == '\n') {
- while (!(in_be16(&psc->mpc52xx_psc_status) &
- MPC52xx_PSC_SR_TXRDY)) ;
- 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);
+ if (c == '\n')
+ mpc52xx_psc_putc(psc, '\r');
+ mpc52xx_psc_putc(psc, c);
}
+
+ mpc52xx_psc_putc(psc, '\r');
+ mpc52xx_psc_putc(psc, '\n');
}
#endif /* CONFIG_SERIAL_TEXT_DEBUG */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-09-15 19:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-15 14:35 [PATCH] mpc52xx: fix early text output roger blofeld
2004-09-15 19:41 ` Sylvain Munaut
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.