250250 * USE_MFP: Use the ST - MFP port (Modem1) for serial debug.
251251 *
252252 * Macintosh constants:
253- * MAC_SERIAL_DEBUG: Turns on serial debug output for the Macintosh.
254- * MAC_USE_SCC_A: Use the SCC port A (modem) for serial debug.
255- * MAC_USE_SCC_B: Use the SCC port B (printer) for serial debug (default).
253+ * MAC_USE_SCC_A: Use SCC port A (modem) for serial debug and early console.
254+ * MAC_USE_SCC_B: Use SCC port B (printer) for serial debug and early console.
256255 * /
257256
258257#include <linux/linkage.h>
268267
269268#include <asm/machw.h>
270269
271- / *
272- * Macintosh console support
273- * /
274-
275270#ifdef CONFIG_FRAMEBUFFER_CONSOLE
276271#define CONSOLE
277272#define CONSOLE_PENGUIN
278273#endif
279274
280- / *
281- * Macintosh serial debug support ; outputs boot info to the printer
282- * and / or modem serial ports
283- * /
284- #undef MAC_SERIAL_DEBUG
275+ #ifdef CONFIG_EARLY_PRINTK
276+ #define SERIAL_DEBUG
277+ #else
278+ #undef SERIAL_DEBUG
279+ #endif
285280
286- / *
287- * Macintosh serial debug port selection ; define one or both;
288- * requires MAC_SERIAL_DEBUG to be defined
289- * /
290- #define MAC_USE_SCC_A / * Macintosh modem serial port * /
291- #define MAC_USE_SCC_B / * Macintosh printer serial port * /
281+ #else / * !CONFIG_MAC * /
292282
293- #endif / * CONFIG_MAC * /
283+ #define SERIAL_DEBUG
284+
285+ #endif / * !CONFIG_MAC * /
294286
295287#undef MMU_PRINT
296288#undef MMU_NOCACHE_KERNEL
297- #define SERIAL_DEBUG
298289#undef DEBUG
299290
300291/ *
@@ -655,11 +646,11 @@ ENTRY(__start)
655646 lea %pc@(L(mac_rowbytes)) , %a1
656647 movel %a0@ , %a1@
657648
658- #ifdef MAC_SERIAL_DEBUG
649+ #ifdef SERIAL_DEBUG
659650 get_bi_record BI_MAC_SCCBASE
660651 lea %pc@(L(mac_sccbase)) , %a1
661652 movel %a0@ , %a1@
662- #endif / * MAC_SERIAL_DEBUG * /
653+ #endif
663654
664655#if 0
665656 / *
@@ -1427,7 +1418,7 @@ L(mmu_fixup_done):
14271418 subl %d0 , L(console_font)
14281419 subl %d0 , L(console_font_data)
14291420#endif
1430- #ifdef MAC_SERIAL_DEBUG
1421+ #ifdef SERIAL_DEBUG
14311422 orl # 0x50000000 , L(mac_sccbase)
14321423#endif
143314241 :
@@ -1917,7 +1908,7 @@ mmu_030_print:
19171908 jbne 30b
19181909
19191910mmu_print_done:
1920- puts "\n\n "
1911+ puts "\n"
19211912
19221913func_return mmu_print
19231914
@@ -2768,7 +2759,7 @@ L(scc_initable_mac):
27682759 . byte 9 , 0 / * no interrupts * /
27692760 . byte 10 , 0 / * NRZ * /
27702761 . byte 11 , 0x50 / * use baud rate generator * /
2771- . byte 12 , 10 , 13 , 0 / * 9600 baud * /
2762+ . byte 12 , 1 , 13 , 0 / * 38400 baud * /
27722763 . byte 14 , 1 / * Baud rate generator enable * /
27732764 . byte 3 , 0xc1 / * enable receiver * /
27742765 . byte 5 , 0xea / * enable transmitter * /
@@ -2906,10 +2897,12 @@ func_start serial_init,%d0/%d1/%a0/%a1
29062897#endif
29072898#ifdef CONFIG_MAC
29082899 is_not_mac(L(serial_init_not_mac))
2909- #ifdef MAC_SERIAL_DEBUG
2910- #if !defined(MAC_USE_SCC_A) && !defined(MAC_USE_SCC_B)
2911- #define MAC_USE_SCC_B
2912- #endif
2900+
2901+ #ifdef SERIAL_DEBUG
2902+ / * You may define either or both of these. * /
2903+ #define MAC_USE_SCC_A / * Modem port * /
2904+ #define MAC_USE_SCC_B / * Printer port * /
2905+
29132906#define mac_scc_cha_b_ctrl_offset 0x0
29142907#define mac_scc_cha_a_ctrl_offset 0x2
29152908#define mac_scc_cha_b_data_offset 0x4
@@ -2940,7 +2933,7 @@ func_start serial_init,%d0/%d1/%a0/%a1
29402933 jra 7b
294129348 :
29422935#endif / * MAC_USE_SCC_B * /
2943- #endif / * MAC_SERIAL_DEBUG * /
2936+ #endif / * SERIAL_DEBUG * /
29442937
29452938 jra L(serial_init_done)
29462939L(serial_init_not_mac):
@@ -3011,7 +3004,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1
30113004#ifdef CONFIG_MAC
30123005 is_not_mac(5f)
30133006
3014- #ifdef MAC_SERIAL_DEBUG
3007+ #ifdef SERIAL_DEBUG
30153008
30163009#ifdef MAC_USE_SCC_A
30173010 movel %pc@(L(mac_sccbase)) , %a1
@@ -3029,7 +3022,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1
30293022 moveb %d0 , %a1@(mac_scc_cha_b_data_offset)
30303023#endif / * MAC_USE_SCC_B * /
30313024
3032- #endif / * MAC_SERIAL_DEBUG * /
3025+ #endif / * SERIAL_DEBUG * /
30333026
30343027 jra L(serial_putc_done)
303530285 :
@@ -3248,33 +3241,39 @@ func_return putn
32483241
32493242#ifdef CONFIG_MAC
32503243/ *
3251- * mac_serial_print
3244+ * mac_early_print
32523245 *
32533246 * This routine takes its parameters on the stack. It then
3254- * turns around and calls the internal routine . This routine
3255- * is used until the Linux console driver initializes itself .
3247+ * turns around and calls the internal routines . This routine
3248+ * is used by the boot console.
32563249 *
32573250 * The calling parameters are:
3258- * void mac_serial_print (const char * str ) ;
3251+ * void mac_early_print (const char * str , unsigned length );
32593252 *
32603253 * This routine does NOT understand variable arguments only
32613254 * simple strings!
32623255 * /
3263- ENTRY(mac_serial_print)
3264- moveml %d0/%a0 , % sp @ -
3265- #if 1
3266- move %sr , % sp @ -
3256+ ENTRY(mac_early_print)
3257+ moveml %d0/%d1/%a0 , % sp @ -
3258+ movew %sr , % sp @ -
32673259 ori # 0x0700 , %sr
3268- #endif
3269- movel % sp @( 10 ) , %a0 / * fetch parameter * /
3260+ movel % sp @( 18 ) , %a0 / * fetch parameter * /
3261+ movel % sp @( 22 ) , %d1 / * fetch parameter * /
32703262 jra 2f
3271- 1 : serial_putc %d0
3272- 2 : moveb %a0@ +, %d0
3273- jne 1b
3274- #if 1
3275- move % sp @ +, %sr
3263+ 1 :
3264+ #ifdef CONSOLE
3265+ console_putc %d0
32763266#endif
3277- moveml % sp @ +, %d0/%a0
3267+ #ifdef SERIAL_DEBUG
3268+ serial_putc %d0
3269+ #endif
3270+ subq # 1 , %d1
3271+ 2 : jeq 3f
3272+ moveb %a0@ +, %d0
3273+ jne 1b
3274+ 3 :
3275+ movew % sp @ +, %sr
3276+ moveml % sp @ +, %d0/%d1/%a0
32783277 rts
32793278#endif / * CONFIG_MAC * /
32803279
@@ -3409,10 +3408,10 @@ func_start console_put_stats,%a0/%d7
34093408 * a0 = pointer to boot_info
34103409 * d7 = value of boot_info fields
34113410 * /
3412- puts "\nMacLinux\n\n "
3411+ puts "\nMacLinux\n"
34133412
34143413#ifdef SERIAL_DEBUG
3415- puts " vidaddr:"
3414+ puts "\n vidaddr:"
34163415 putn %pc@(L(mac_videobase)) / * video addr. * /
34173416
34183417 puts "\n _stext:"
@@ -3423,19 +3422,21 @@ func_start console_put_stats,%a0/%d7
34233422 lea %pc@(_end) , %a0
34243423 putn %a0
34253424
3426- puts "\ncpuid :"
3425+ puts "\n cpuid :"
34273426 putn %pc@(L(cputype))
3428- putc '\n'
34293427
3430- #ifdef MAC_SERIAL_DEBUG
3428+ # ifdef CONFIG_MAC
3429+ puts "\n sccbase:"
34313430 putn %pc@(L(mac_sccbase))
3431+ # endif
3432+ # ifdef MMU_PRINT
34323433 putc '\n'
3433- #endif
3434- # if defined(MMU_PRINT)
34353434 jbsr mmu_print_machine_cpu_types
3436- # endif / * MMU_PRINT * /
3435+ # endif
34373436#endif / * SERIAL_DEBUG * /
34383437
3438+ putc '\n'
3439+
34393440func_return console_put_stats
34403441
34413442#ifdef CONSOLE_PENGUIN
@@ -3896,11 +3897,11 @@ L(mac_dimensions):
38963897 .long 0
38973898L(mac_rowbytes):
38983899 .long 0
3899- #ifdef MAC_SERIAL_DEBUG
3900+ #ifdef SERIAL_DEBUG
39003901L(mac_sccbase):
39013902 .long 0
3902- #endif / * MAC_SERIAL_DEBUG * /
39033903#endif
3904+ #endif / * CONFIG_MAC * /
39043905
39053906#if defined (CONFIG_APOLLO)
39063907LSRB0 = 0x10412
0 commit comments