m68k/mac: Make SCC reset work more reliably
authorFinn Thain <fthain@telegraphics.com.au>
Sun, 12 Jan 2014 13:56:38 +0000 (00:56 +1100)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Sun, 19 Jan 2014 10:53:22 +0000 (11:53 +0100)
For SCC initialization we cannot assume that the control register is in
the correct state to accept a register pointer. So first read from the
control register in order to "sync" up.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/kernel/head.S

index 7d7913f5dce3beabd14ecac0afdc66109ee30e55..4c99bab7e6647c0709ebacbff38b42f01ab24449 100644 (file)
@@ -2915,7 +2915,9 @@ func_start        serial_init,%d0/%d1/%a0/%a1
 
 #if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B)
        movel   %pc@(L(mac_sccbase)),%a0
-       /* Reset SCC device */
+       /* Reset SCC register pointer */
+       moveb   %a0@(mac_scc_cha_a_ctrl_offset),%d0
+       /* Reset SCC device: write register pointer then register value */
        moveb   #9,%a0@(mac_scc_cha_a_ctrl_offset)
        moveb   #0xc0,%a0@(mac_scc_cha_a_ctrl_offset)
        /* Wait for 5 PCLK cycles, which is about 68 CPU cycles */