aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-27 22:06:19 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-28 02:30:52 -0400
commitf023bf0f91f1f1b926ec8f5cf0ee24be134bf024 (patch)
tree32f8fdc281d6a76153aab7ae6f8f28c6cbf1f485
parent83ac6a1ed40bfbe185cf2bac5505d8d97aad8b1d (diff)
powerpc/powermac: Use sane default baudrate for SCC debugging
When using the "sccdbg" option to route early kernel messages and xmon to the SCC serial port on PowerMacs, when this wasn't the configured output port of Open Firmware, we initialize the baudrate to 57600bps. This isn't a very good default on some powermacs where both the FW and pmac_zilog will default to 38400. This fixes it to use the same logic as pmac_zilog to pick a default speed. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/platforms/powermac/udbg_scc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/powermac/udbg_scc.c b/arch/powerpc/platforms/powermac/udbg_scc.c
index 47de4d3fc167..572771fd8463 100644
--- a/arch/powerpc/platforms/powermac/udbg_scc.c
+++ b/arch/powerpc/platforms/powermac/udbg_scc.c
@@ -125,13 +125,23 @@ void udbg_scc_init(int force_scc)
125 out_8(sccc, 0xc0); 125 out_8(sccc, 0xc0);
126 126
127 /* If SCC was the OF output port, read the BRG value, else 127 /* If SCC was the OF output port, read the BRG value, else
128 * Setup for 57600 8N1 128 * Setup for 38400 or 57600 8N1 depending on the machine
129 */ 129 */
130 if (ch_def != NULL) { 130 if (ch_def != NULL) {
131 out_8(sccc, 13); 131 out_8(sccc, 13);
132 scc_inittab[1] = in_8(sccc); 132 scc_inittab[1] = in_8(sccc);
133 out_8(sccc, 12); 133 out_8(sccc, 12);
134 scc_inittab[3] = in_8(sccc); 134 scc_inittab[3] = in_8(sccc);
135 } else if (machine_is_compatible("RackMac1,1")
136 || machine_is_compatible("RackMac1,2")
137 || machine_is_compatible("MacRISC4")) {
138 /* Xserves and G5s default to 57600 */
139 scc_inittab[1] = 0;
140 scc_inittab[3] = 0;
141 } else {
142 /* Others default to 38400 */
143 scc_inittab[1] = 0;
144 scc_inittab[3] = 1;
135 } 145 }
136 146
137 for (i = 0; i < sizeof(scc_inittab); ++i) 147 for (i = 0; i < sizeof(scc_inittab); ++i)