aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2014-05-26 09:29:19 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2014-05-28 04:11:53 -0400
commit83adc18110d632eebefb5c2a1dd27b58ae843d64 (patch)
tree4cfb54cc271d193b50135eb4d6c67cb8f0871898 /arch/m68k
parentc46f46d02c90959b82b99badfadc575081666aae (diff)
m68k/atari: fix SCC initialization for debug console
Fix SCC initialization for Atari as was previously fixed for Mac. It's probably not practical to share more code but some attempt is made to align the Mac and Atari variants. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/kernel/head.S31
1 files changed, 21 insertions, 10 deletions
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S
index b671f07aeb81..15c8f55e4835 100644
--- a/arch/m68k/kernel/head.S
+++ b/arch/m68k/kernel/head.S
@@ -2722,6 +2722,7 @@ func_return get_new_page
2722#define MAC_USE_SCC_B /* Printer port */ 2722#define MAC_USE_SCC_B /* Printer port */
2723 2723
2724#if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B) 2724#if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B)
2725/* Initialisation table for SCC with 3.6864 MHz PCLK */
2725L(scc_initable_mac): 2726L(scc_initable_mac):
2726 .byte 4,0x44 /* x16, 1 stopbit, no parity */ 2727 .byte 4,0x44 /* x16, 1 stopbit, no parity */
2727 .byte 3,0xc0 /* receiver: 8 bpc */ 2728 .byte 3,0xc0 /* receiver: 8 bpc */
@@ -2744,14 +2745,12 @@ L(scc_initable_mac):
2744#define USE_MFP 2745#define USE_MFP
2745 2746
2746#if defined(USE_SCC_A) || defined(USE_SCC_B) 2747#if defined(USE_SCC_A) || defined(USE_SCC_B)
2747#define USE_SCC 2748/* Initialisation table for SCC with 7.9872 MHz PCLK */
2748/* Initialisation table for SCC */ 2749/* PCLK == 8.0539 gives baud == 9680.1 */
2749L(scc_initable): 2750L(scc_initable_atari):
2750 .byte 9,12 /* Reset */
2751 .byte 4,0x44 /* x16, 1 stopbit, no parity */ 2751 .byte 4,0x44 /* x16, 1 stopbit, no parity */
2752 .byte 3,0xc0 /* receiver: 8 bpc */ 2752 .byte 3,0xc0 /* receiver: 8 bpc */
2753 .byte 5,0xe2 /* transmitter: 8 bpc, assert dtr/rts */ 2753 .byte 5,0xe2 /* transmitter: 8 bpc, assert dtr/rts */
2754 .byte 9,0 /* no interrupts */
2755 .byte 10,0 /* NRZ */ 2754 .byte 10,0 /* NRZ */
2756 .byte 11,0x50 /* use baud rate generator */ 2755 .byte 11,0x50 /* use baud rate generator */
2757 .byte 12,24,13,0 /* 9600 baud */ 2756 .byte 12,24,13,0 /* 9600 baud */
@@ -2800,7 +2799,7 @@ LMFP_UDR = 0xfffa2f
2800 */ 2799 */
2801 2800
2802/* 2801/*
2803 * Initialize serial port hardware for 9600/8/1 2802 * Initialize serial port hardware
2804 */ 2803 */
2805func_start serial_init,%d0/%d1/%a0/%a1 2804func_start serial_init,%d0/%d1/%a0/%a1
2806 /* 2805 /*
@@ -2810,7 +2809,7 @@ func_start serial_init,%d0/%d1/%a0/%a1
2810 * d0 = boot info offset 2809 * d0 = boot info offset
2811 * CONFIG_ATARI 2810 * CONFIG_ATARI
2812 * a0 = address of SCC 2811 * a0 = address of SCC
2813 * a1 = Liobase address/address of scc_initable 2812 * a1 = Liobase address/address of scc_initable_atari
2814 * d0 = init data for serial port 2813 * d0 = init data for serial port
2815 * CONFIG_MAC 2814 * CONFIG_MAC
2816 * a0 = address of SCC 2815 * a0 = address of SCC
@@ -2846,9 +2845,21 @@ func_start serial_init,%d0/%d1/%a0/%a1
2846 moveb %a1@(LPSG_READ),%d0 2845 moveb %a1@(LPSG_READ),%d0
2847 bset #5,%d0 2846 bset #5,%d0
2848 moveb %d0,%a1@(LPSG_WRITE) 2847 moveb %d0,%a1@(LPSG_WRITE)
2849#elif defined(USE_SCC) 2848#elif defined(USE_SCC_A) || defined(USE_SCC_B)
2850 lea %a1@(LSCC_CTRL),%a0 2849 lea %a1@(LSCC_CTRL),%a0
2851 lea %pc@(L(scc_initable)),%a1 2850 /* Reset SCC register pointer */
2851 moveb %a0@,%d0
2852 /* Reset SCC device: write register pointer then register value */
2853 moveb #9,%a0@
2854 moveb #0xc0,%a0@
2855 /* Wait for 5 PCLK cycles, which is about 63 CPU cycles */
2856 /* 5 / 7.9872 MHz = approx. 0.63 us = 63 / 100 MHz */
2857 movel #32,%d0
28582:
2859 subq #1,%d0
2860 jne 2b
2861 /* Initialize channel */
2862 lea %pc@(L(scc_initable_atari)),%a1
28522: moveb %a1@+,%d0 28632: moveb %a1@+,%d0
2853 jmi 3f 2864 jmi 3f
2854 moveb %d0,%a0@ 2865 moveb %d0,%a0@
@@ -3017,7 +3028,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1
3017 nop 3028 nop
3018 bset #5,%d0 3029 bset #5,%d0
3019 moveb %d0,%a1@(LPSG_WRITE) 3030 moveb %d0,%a1@(LPSG_WRITE)
3020#elif defined(USE_SCC) 3031#elif defined(USE_SCC_A) || defined(USE_SCC_B)
30213: btst #2,%a1@(LSCC_CTRL) 30323: btst #2,%a1@(LSCC_CTRL)
3022 jeq 3b 3033 jeq 3b
3023 moveb %d0,%a1@(LSCC_DATA) 3034 moveb %d0,%a1@(LSCC_DATA)