aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-08-20 13:39:54 -0400
committerPaul Mackerras <paulus@samba.org>2007-08-22 01:21:48 -0400
commitdc4f397d6e385c4ea0fe9732df911a86f1a78c9a (patch)
treeb447785d5fb9a03f658dbaee362861218dc1e408 /arch/powerpc/boot
parent61d3b949b70802c4f32d540b11a93128c31c67ea (diff)
[POWERPC] bootwrapper: serial_console_init() fixes
1. Search the entire compatible list for serial devices. The serial code previously did a simple strcmp on the compatible node; this fails when the match string is not the first compatible listed. Use dt_is_compatible() instead. 2. Don't call serial_edit_cmdline if getc isn't defined. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r--arch/powerpc/boot/serial.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c
index eaa0d3ae3518..3ce7f651ab34 100644
--- a/arch/powerpc/boot/serial.c
+++ b/arch/powerpc/boot/serial.c
@@ -114,18 +114,14 @@ int serial_console_init(void)
114{ 114{
115 void *devp; 115 void *devp;
116 int rc = -1; 116 int rc = -1;
117 char compat[MAX_PROP_LEN];
118 117
119 devp = serial_get_stdout_devp(); 118 devp = serial_get_stdout_devp();
120 if (devp == NULL) 119 if (devp == NULL)
121 goto err_out; 120 goto err_out;
122 121
123 if (getprop(devp, "compatible", compat, sizeof(compat)) < 0) 122 if (dt_is_compatible(devp, "ns16550"))
124 goto err_out;
125
126 if (!strcmp(compat, "ns16550"))
127 rc = ns16550_console_init(devp, &serial_cd); 123 rc = ns16550_console_init(devp, &serial_cd);
128 else if (!strcmp(compat, "marvell,mpsc")) 124 else if (dt_is_compatible(devp, "marvell,mpsc"))
129 rc = mpsc_console_init(devp, &serial_cd); 125 rc = mpsc_console_init(devp, &serial_cd);
130 126
131 /* Add other serial console driver calls here */ 127 /* Add other serial console driver calls here */
@@ -133,10 +129,12 @@ int serial_console_init(void)
133 if (!rc) { 129 if (!rc) {
134 console_ops.open = serial_open; 130 console_ops.open = serial_open;
135 console_ops.write = serial_write; 131 console_ops.write = serial_write;
136 console_ops.edit_cmdline = serial_edit_cmdline;
137 console_ops.close = serial_close; 132 console_ops.close = serial_close;
138 console_ops.data = &serial_cd; 133 console_ops.data = &serial_cd;
139 134
135 if (serial_cd.getc)
136 console_ops.edit_cmdline = serial_edit_cmdline;
137
140 return 0; 138 return 0;
141 } 139 }
142err_out: 140err_out: