diff options
author | Eddie C. Dost <ecd@brainaid.de> | 2006-01-18 17:54:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-01-18 17:54:31 -0500 |
commit | c126cf80d450a4d0aac3de7162d4c14b5c971b24 (patch) | |
tree | dfac36b98cd1ff6d05d2a15482c39c2ecedc5cb3 /drivers | |
parent | c07a8475ddcadb55b11379c35c9586971a9cedbf (diff) |
[SPARC64]: Serial Console for E250 Patch
From: Eddie C. Dost <ecd@brainaid.de>
I have the following patch for serial console over the RSC
(remote system controller) on my E250 machine. It basically adds
support for input-device=rsc and output-device=rsc from OBP, and
allows 115200,8,n,1,- serial mode setting.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/suncore.c | 34 | ||||
-rw-r--r-- | drivers/serial/sunsab.c | 7 |
2 files changed, 36 insertions, 5 deletions
diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c index 5fc4a62173d9..fa4ae94243c2 100644 --- a/drivers/serial/suncore.c +++ b/drivers/serial/suncore.c | |||
@@ -34,6 +34,7 @@ sunserial_console_termios(struct console *con) | |||
34 | char *mode_prop = "ttyX-mode"; | 34 | char *mode_prop = "ttyX-mode"; |
35 | char *cd_prop = "ttyX-ignore-cd"; | 35 | char *cd_prop = "ttyX-ignore-cd"; |
36 | char *dtr_prop = "ttyX-rts-dtr-off"; | 36 | char *dtr_prop = "ttyX-rts-dtr-off"; |
37 | char *ssp_console_modes_prop = "ssp-console-modes"; | ||
37 | int baud, bits, stop, cflag; | 38 | int baud, bits, stop, cflag; |
38 | char parity; | 39 | char parity; |
39 | int carrier = 0; | 40 | int carrier = 0; |
@@ -43,14 +44,39 @@ sunserial_console_termios(struct console *con) | |||
43 | if (!serial_console) | 44 | if (!serial_console) |
44 | return; | 45 | return; |
45 | 46 | ||
46 | if (serial_console == 1) { | 47 | switch (serial_console) { |
48 | case PROMDEV_OTTYA: | ||
47 | mode_prop[3] = 'a'; | 49 | mode_prop[3] = 'a'; |
48 | cd_prop[3] = 'a'; | 50 | cd_prop[3] = 'a'; |
49 | dtr_prop[3] = 'a'; | 51 | dtr_prop[3] = 'a'; |
50 | } else { | 52 | break; |
53 | |||
54 | case PROMDEV_OTTYB: | ||
51 | mode_prop[3] = 'b'; | 55 | mode_prop[3] = 'b'; |
52 | cd_prop[3] = 'b'; | 56 | cd_prop[3] = 'b'; |
53 | dtr_prop[3] = 'b'; | 57 | dtr_prop[3] = 'b'; |
58 | break; | ||
59 | |||
60 | case PROMDEV_ORSC: | ||
61 | |||
62 | nd = prom_pathtoinode("rsc"); | ||
63 | if (!nd) { | ||
64 | strcpy(mode, "115200,8,n,1,-"); | ||
65 | goto no_options; | ||
66 | } | ||
67 | |||
68 | if (!prom_node_has_property(nd, ssp_console_modes_prop)) { | ||
69 | strcpy(mode, "115200,8,n,1,-"); | ||
70 | goto no_options; | ||
71 | } | ||
72 | |||
73 | memset(mode, 0, sizeof(mode)); | ||
74 | prom_getstring(nd, ssp_console_modes_prop, mode, sizeof(mode)); | ||
75 | goto no_options; | ||
76 | |||
77 | default: | ||
78 | strcpy(mode, "9600,8,n,1,-"); | ||
79 | goto no_options; | ||
54 | } | 80 | } |
55 | 81 | ||
56 | topnd = prom_getchild(prom_root_node); | 82 | topnd = prom_getchild(prom_root_node); |
@@ -110,6 +136,10 @@ no_options: | |||
110 | case 9600: cflag |= B9600; break; | 136 | case 9600: cflag |= B9600; break; |
111 | case 19200: cflag |= B19200; break; | 137 | case 19200: cflag |= B19200; break; |
112 | case 38400: cflag |= B38400; break; | 138 | case 38400: cflag |= B38400; break; |
139 | case 57600: cflag |= B57600; break; | ||
140 | case 115200: cflag |= B115200; break; | ||
141 | case 230400: cflag |= B230400; break; | ||
142 | case 460800: cflag |= B460800; break; | ||
113 | default: baud = 9600; cflag |= B9600; break; | 143 | default: baud = 9600; cflag |= B9600; break; |
114 | } | 144 | } |
115 | 145 | ||
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index 7e773ff76c61..8bcaebcc0ad7 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c | |||
@@ -897,9 +897,6 @@ static int sunsab_console_setup(struct console *con, char *options) | |||
897 | 897 | ||
898 | sunserial_console_termios(con); | 898 | sunserial_console_termios(con); |
899 | 899 | ||
900 | /* Firmware console speed is limited to 150-->38400 baud so | ||
901 | * this hackish cflag thing is OK. | ||
902 | */ | ||
903 | switch (con->cflag & CBAUD) { | 900 | switch (con->cflag & CBAUD) { |
904 | case B150: baud = 150; break; | 901 | case B150: baud = 150; break; |
905 | case B300: baud = 300; break; | 902 | case B300: baud = 300; break; |
@@ -910,6 +907,10 @@ static int sunsab_console_setup(struct console *con, char *options) | |||
910 | default: case B9600: baud = 9600; break; | 907 | default: case B9600: baud = 9600; break; |
911 | case B19200: baud = 19200; break; | 908 | case B19200: baud = 19200; break; |
912 | case B38400: baud = 38400; break; | 909 | case B38400: baud = 38400; break; |
910 | case B57600: baud = 57600; break; | ||
911 | case B115200: baud = 115200; break; | ||
912 | case B230400: baud = 230400; break; | ||
913 | case B460800: baud = 460800; break; | ||
913 | }; | 914 | }; |
914 | 915 | ||
915 | /* | 916 | /* |