diff options
Diffstat (limited to 'arch/powerpc/boot/serial.c')
-rw-r--r-- | arch/powerpc/boot/serial.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c index eaa0d3ae3518..cafeece20ac7 100644 --- a/arch/powerpc/boot/serial.c +++ b/arch/powerpc/boot/serial.c | |||
@@ -19,8 +19,6 @@ | |||
19 | #include "io.h" | 19 | #include "io.h" |
20 | #include "ops.h" | 20 | #include "ops.h" |
21 | 21 | ||
22 | extern void udelay(long delay); | ||
23 | |||
24 | static int serial_open(void) | 22 | static int serial_open(void) |
25 | { | 23 | { |
26 | struct serial_console_data *scdp = console_ops.data; | 24 | struct serial_console_data *scdp = console_ops.data; |
@@ -114,29 +112,36 @@ int serial_console_init(void) | |||
114 | { | 112 | { |
115 | void *devp; | 113 | void *devp; |
116 | int rc = -1; | 114 | int rc = -1; |
117 | char compat[MAX_PROP_LEN]; | ||
118 | 115 | ||
119 | devp = serial_get_stdout_devp(); | 116 | devp = serial_get_stdout_devp(); |
120 | if (devp == NULL) | 117 | if (devp == NULL) |
121 | goto err_out; | 118 | goto err_out; |
122 | 119 | ||
123 | if (getprop(devp, "compatible", compat, sizeof(compat)) < 0) | 120 | if (dt_is_compatible(devp, "ns16550")) |
124 | goto err_out; | ||
125 | |||
126 | if (!strcmp(compat, "ns16550")) | ||
127 | rc = ns16550_console_init(devp, &serial_cd); | 121 | rc = ns16550_console_init(devp, &serial_cd); |
128 | else if (!strcmp(compat, "marvell,mpsc")) | 122 | else if (dt_is_compatible(devp, "marvell,mpsc")) |
129 | rc = mpsc_console_init(devp, &serial_cd); | 123 | rc = mpsc_console_init(devp, &serial_cd); |
124 | else if (dt_is_compatible(devp, "fsl,cpm1-scc-uart") || | ||
125 | dt_is_compatible(devp, "fsl,cpm1-smc-uart") || | ||
126 | dt_is_compatible(devp, "fsl,cpm2-scc-uart") || | ||
127 | dt_is_compatible(devp, "fsl,cpm2-smc-uart")) | ||
128 | rc = cpm_console_init(devp, &serial_cd); | ||
129 | else if (dt_is_compatible(devp, "mpc5200-psc-uart")) | ||
130 | rc = mpc5200_psc_console_init(devp, &serial_cd); | ||
131 | else if (dt_is_compatible(devp, "xilinx,uartlite")) | ||
132 | rc = uartlite_console_init(devp, &serial_cd); | ||
130 | 133 | ||
131 | /* Add other serial console driver calls here */ | 134 | /* Add other serial console driver calls here */ |
132 | 135 | ||
133 | if (!rc) { | 136 | if (!rc) { |
134 | console_ops.open = serial_open; | 137 | console_ops.open = serial_open; |
135 | console_ops.write = serial_write; | 138 | console_ops.write = serial_write; |
136 | console_ops.edit_cmdline = serial_edit_cmdline; | ||
137 | console_ops.close = serial_close; | 139 | console_ops.close = serial_close; |
138 | console_ops.data = &serial_cd; | 140 | console_ops.data = &serial_cd; |
139 | 141 | ||
142 | if (serial_cd.getc) | ||
143 | console_ops.edit_cmdline = serial_edit_cmdline; | ||
144 | |||
140 | return 0; | 145 | return 0; |
141 | } | 146 | } |
142 | err_out: | 147 | err_out: |