serial.c (3ee9b7abafc36a9377af6f036f50c3450954884c) serial.c (d0f53fafc016b3f4f20f63ecf52f6df8774bcb3c)
1/*
2 * Generic serial console support
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 *
6 * Code in serial_edit_cmdline() copied from <file:arch/ppc/boot/simple/misc.c>
7 * and was written by Matt Porter <mporter@kernel.crashing.org>.
8 *

--- 107 unchanged lines hidden (view full) ---

116 devp = serial_get_stdout_devp();
117 if (devp == NULL)
118 goto err_out;
119
120 if (dt_is_compatible(devp, "ns16550"))
121 rc = ns16550_console_init(devp, &serial_cd);
122 else if (dt_is_compatible(devp, "marvell,mpsc"))
123 rc = mpsc_console_init(devp, &serial_cd);
1/*
2 * Generic serial console support
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 *
6 * Code in serial_edit_cmdline() copied from <file:arch/ppc/boot/simple/misc.c>
7 * and was written by Matt Porter <mporter@kernel.crashing.org>.
8 *

--- 107 unchanged lines hidden (view full) ---

116 devp = serial_get_stdout_devp();
117 if (devp == NULL)
118 goto err_out;
119
120 if (dt_is_compatible(devp, "ns16550"))
121 rc = ns16550_console_init(devp, &serial_cd);
122 else if (dt_is_compatible(devp, "marvell,mpsc"))
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);
124
125 /* Add other serial console driver calls here */
126
127 if (!rc) {
128 console_ops.open = serial_open;
129 console_ops.write = serial_write;
130 console_ops.close = serial_close;
131 console_ops.data = &serial_cd;
132
133 if (serial_cd.getc)
134 console_ops.edit_cmdline = serial_edit_cmdline;
135
136 return 0;
137 }
138err_out:
139 return -1;
140}
129
130 /* Add other serial console driver calls here */
131
132 if (!rc) {
133 console_ops.open = serial_open;
134 console_ops.write = serial_write;
135 console_ops.close = serial_close;
136 console_ops.data = &serial_cd;
137
138 if (serial_cd.getc)
139 console_ops.edit_cmdline = serial_edit_cmdline;
140
141 return 0;
142 }
143err_out:
144 return -1;
145}