Skip to contentSkip to conversation

fix xmon input on 440

PATCH In review Hollis Blanchard 5 participants 7 messages Sep 14, 2007 – Sep 17, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix xmon input on 440

Implement udbg_getc() for 440, which fixes xmon input.

arch/powerpc/kernel/udbg_16550.c +11 -0
@@ -206,11 +206,22 @@ static void udbg_44x_as1_putc(char c)
        }
 }
 
+static int udbg_44x_as1_getc(void)
+{
+       if (udbg_comport) {
+               while ((as1_readb(&udbg_comport->lsr) & LSR_DR) == 0)
+                       /* wait for char */;
+               return as1_readb(&udbg_comport->rbr);
+       }
+       return -1;
+}
+
 void __init udbg_init_44x_as1(void)
 {
        udbg_comport =
                (volatile struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR;
 
        udbg_putc = udbg_44x_as1_putc;
+       udbg_getc = udbg_44x_as1_getc;
 }
 #endif /* CONFIG_PPC_EARLY_DEBUG_44x */
Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
#3 lore raw
Quoted 9 lines · Josh Boyer
Quoted 5 lines · David Gibson
Quoted 2 lines · Hollis Blanchard

Implement udbg_getc() for 440, which fixes xmon input.

I fixed up the whitespace issues and applied it to my tree. Oh, and comments don't need semi-colons ;)

Well, there's a big difference between:

	while (foo)
		/* moof */;
	return bar;

and:

	while (foo)
		/* moof */
	return bar;

:-)

#4 lore raw
Quoted 13 lines · Olof Johansson
Quoted 9 lines · Josh Boyer
Quoted 5 lines · David Gibson
Quoted 2 lines · Hollis Blanchard

Implement udbg_getc() for 440, which fixes xmon input.

I fixed up the whitespace issues and applied it to my tree. Oh, and comments don't need semi-colons ;)

Well, there's a big difference between:

Quoted 8 lines
	while (foo)
		/* moof */;
	return bar;

and:

	while (foo)
		/* moof */
	return bar;

Right, so this commit is broken:
http://git.infradead.org/?p=users/jwboyer/powerpc.git;a=commitdiff;h=81ec428065c01e37fb143ad31dc04fea27fddcac

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
#5 lore raw
Quoted 18 lines · Hollis Blanchard
Quoted 17 lines · Olof Johansson
Quoted 9 lines · Josh Boyer
Quoted 5 lines · David Gibson
Quoted 2 lines · Hollis Blanchard

Implement udbg_getc() for 440, which fixes xmon input.

I fixed up the whitespace issues and applied it to my tree. Oh, and comments don't need semi-colons ;)

Well, there's a big difference between:

	while (foo)
		/* moof */;
	return bar;
Quoted 7 lines
Quoted 4 lines

and:

	while (foo)
		/* moof */
	return bar;

Right, so this commit is broken:
http://git.infradead.org/?p=users/jwboyer/powerpc.git;a=commitdiff;h=81ec428065c01e37fb143ad31dc04fea27fddcac

Yes, it is. I realized that right as I was going to bed. I've pushed a new commit instead.

http://git.infradead.org/?p=users/jwboyer/powerpc.git;a=commitdiff;h=88305119ccab262897ddbbceeb5a1f725f2b60fa

josh

#6 lore raw
In reply to Hollis Blanchard
Quoted 5 lines · Hollis Blanchard

Implement udbg_getc() for 440, which fixes xmon input.
Signed-off-by: Hollis Blanchard <hollisb at us.ibm.com>

        udbg_putc = udbg_44x_as1_putc;

+ udbg_getc = udbg_44x_as1_getc;

How about adding udbg_getc_poll as well?

While there are no in-tree users, we can use it for console input later.

milton