diff options
Diffstat (limited to 'arch/m68k/kernel')
-rw-r--r-- | arch/m68k/kernel/head.S | 112 |
1 files changed, 26 insertions, 86 deletions
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index 3ab329b88521..81e610bfa237 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S | |||
@@ -153,7 +153,7 @@ | |||
153 | * ------------ | 153 | * ------------ |
154 | * The console is also able to be turned off. The console in head.S | 154 | * The console is also able to be turned off. The console in head.S |
155 | * is specifically for debugging and can be very useful. It is surrounded by | 155 | * is specifically for debugging and can be very useful. It is surrounded by |
156 | * #ifdef CONSOLE/#endif clauses so it doesn't have to ship in known-good | 156 | * #ifdef / #endif clauses so it doesn't have to ship in known-good |
157 | * kernels. It's basic algorithm is to determine the size of the screen | 157 | * kernels. It's basic algorithm is to determine the size of the screen |
158 | * (in height/width and bit depth) and then use that information for | 158 | * (in height/width and bit depth) and then use that information for |
159 | * displaying an 8x8 font or an 8x16 (widthxheight). I prefer the 8x8 for | 159 | * displaying an 8x8 font or an 8x16 (widthxheight). I prefer the 8x8 for |
@@ -198,9 +198,8 @@ | |||
198 | * CONFIG_xxx: These are the obvious machine configuration defines created | 198 | * CONFIG_xxx: These are the obvious machine configuration defines created |
199 | * during configuration. These are defined in autoconf.h. | 199 | * during configuration. These are defined in autoconf.h. |
200 | * | 200 | * |
201 | * CONSOLE: There is support for head.S console in this file. This | 201 | * CONSOLE_DEBUG: Only supports a Mac frame buffer but could easily be |
202 | * console can talk to a Mac frame buffer, but could easily be extrapolated | 202 | * extended to support other platforms. |
203 | * to extend it to support other platforms. | ||
204 | * | 203 | * |
205 | * TEST_MMU: This is a test harness for running on any given machine but | 204 | * TEST_MMU: This is a test harness for running on any given machine but |
206 | * getting an MMU dump for another class of machine. The classes of machines | 205 | * getting an MMU dump for another class of machine. The classes of machines |
@@ -274,7 +273,7 @@ | |||
274 | #include <asm/machw.h> | 273 | #include <asm/machw.h> |
275 | 274 | ||
276 | #ifdef CONFIG_FRAMEBUFFER_CONSOLE | 275 | #ifdef CONFIG_FRAMEBUFFER_CONSOLE |
277 | #define CONSOLE | 276 | #define CONSOLE_DEBUG |
278 | #endif | 277 | #endif |
279 | 278 | ||
280 | #ifdef CONFIG_EARLY_PRINTK | 279 | #ifdef CONFIG_EARLY_PRINTK |
@@ -480,22 +479,21 @@ func_define serial_putc,1 | |||
480 | func_define console_putc,1 | 479 | func_define console_putc,1 |
481 | 480 | ||
482 | func_define console_init | 481 | func_define console_init |
483 | func_define console_put_stats | ||
484 | func_define console_put_penguin | 482 | func_define console_put_penguin |
485 | func_define console_plot_pixel,3 | 483 | func_define console_plot_pixel,3 |
486 | func_define console_scroll | 484 | func_define console_scroll |
487 | 485 | ||
488 | .macro putc ch | 486 | .macro putc ch |
489 | #if defined(CONSOLE) || defined(SERIAL_DEBUG) | 487 | #if defined(CONSOLE_DEBUG) || defined(SERIAL_DEBUG) |
490 | pea \ch | 488 | pea \ch |
491 | #endif | 489 | #endif |
492 | #ifdef CONSOLE | 490 | #ifdef CONSOLE_DEBUG |
493 | func_call console_putc | 491 | func_call console_putc |
494 | #endif | 492 | #endif |
495 | #ifdef SERIAL_DEBUG | 493 | #ifdef SERIAL_DEBUG |
496 | func_call serial_putc | 494 | func_call serial_putc |
497 | #endif | 495 | #endif |
498 | #if defined(CONSOLE) || defined(SERIAL_DEBUG) | 496 | #if defined(CONSOLE_DEBUG) || defined(SERIAL_DEBUG) |
499 | addql #4,%sp | 497 | addql #4,%sp |
500 | #endif | 498 | #endif |
501 | .endm | 499 | .endm |
@@ -515,7 +513,7 @@ func_define putn,1 | |||
515 | .endm | 513 | .endm |
516 | 514 | ||
517 | .macro puts string | 515 | .macro puts string |
518 | #if defined(CONSOLE) || defined(SERIAL_DEBUG) | 516 | #if defined(CONSOLE_DEBUG) || defined(SERIAL_DEBUG) |
519 | __INITDATA | 517 | __INITDATA |
520 | .Lstr\@: | 518 | .Lstr\@: |
521 | .string "\string" | 519 | .string "\string" |
@@ -651,11 +649,9 @@ ENTRY(__start) | |||
651 | lea %pc@(L(mac_rowbytes)),%a1 | 649 | lea %pc@(L(mac_rowbytes)),%a1 |
652 | movel %a0@,%a1@ | 650 | movel %a0@,%a1@ |
653 | 651 | ||
654 | #ifdef SERIAL_DEBUG | ||
655 | get_bi_record BI_MAC_SCCBASE | 652 | get_bi_record BI_MAC_SCCBASE |
656 | lea %pc@(L(mac_sccbase)),%a1 | 653 | lea %pc@(L(mac_sccbase)),%a1 |
657 | movel %a0@,%a1@ | 654 | movel %a0@,%a1@ |
658 | #endif | ||
659 | 655 | ||
660 | L(test_notmac): | 656 | L(test_notmac): |
661 | #endif /* CONFIG_MAC */ | 657 | #endif /* CONFIG_MAC */ |
@@ -885,13 +881,12 @@ L(nothp): | |||
885 | */ | 881 | */ |
886 | #ifdef CONFIG_MAC | 882 | #ifdef CONFIG_MAC |
887 | is_not_mac(L(nocon)) | 883 | is_not_mac(L(nocon)) |
888 | # ifdef CONSOLE | 884 | # ifdef CONSOLE_DEBUG |
889 | console_init | 885 | console_init |
890 | # ifdef CONFIG_LOGO | 886 | # ifdef CONFIG_LOGO |
891 | console_put_penguin | 887 | console_put_penguin |
892 | # endif /* CONFIG_LOGO */ | 888 | # endif /* CONFIG_LOGO */ |
893 | console_put_stats | 889 | # endif /* CONSOLE_DEBUG */ |
894 | # endif /* CONSOLE */ | ||
895 | L(nocon): | 890 | L(nocon): |
896 | #endif /* CONFIG_MAC */ | 891 | #endif /* CONFIG_MAC */ |
897 | 892 | ||
@@ -1396,15 +1391,13 @@ L(mmu_fixup_done): | |||
1396 | andl L(mac_videobase),%d0 | 1391 | andl L(mac_videobase),%d0 |
1397 | addl #VIDEOMEMBASE,%d0 | 1392 | addl #VIDEOMEMBASE,%d0 |
1398 | movel %d0,L(mac_videobase) | 1393 | movel %d0,L(mac_videobase) |
1399 | #if defined(CONSOLE) | 1394 | #ifdef CONSOLE_DEBUG |
1400 | movel %pc@(L(phys_kernel_start)),%d0 | 1395 | movel %pc@(L(phys_kernel_start)),%d0 |
1401 | subl #PAGE_OFFSET,%d0 | 1396 | subl #PAGE_OFFSET,%d0 |
1402 | subl %d0,L(console_font) | 1397 | subl %d0,L(console_font) |
1403 | subl %d0,L(console_font_data) | 1398 | subl %d0,L(console_font_data) |
1404 | #endif | 1399 | #endif |
1405 | #ifdef SERIAL_DEBUG | ||
1406 | orl #0x50000000,L(mac_sccbase) | 1400 | orl #0x50000000,L(mac_sccbase) |
1407 | #endif | ||
1408 | 1: | 1401 | 1: |
1409 | #endif | 1402 | #endif |
1410 | 1403 | ||
@@ -2734,7 +2727,11 @@ func_return get_new_page | |||
2734 | */ | 2727 | */ |
2735 | 2728 | ||
2736 | #ifdef CONFIG_MAC | 2729 | #ifdef CONFIG_MAC |
2730 | /* You may define either or both of these. */ | ||
2731 | #define MAC_USE_SCC_A /* Modem port */ | ||
2732 | #define MAC_USE_SCC_B /* Printer port */ | ||
2737 | 2733 | ||
2734 | #if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B) | ||
2738 | L(scc_initable_mac): | 2735 | L(scc_initable_mac): |
2739 | .byte 4,0x44 /* x16, 1 stopbit, no parity */ | 2736 | .byte 4,0x44 /* x16, 1 stopbit, no parity */ |
2740 | .byte 3,0xc0 /* receiver: 8 bpc */ | 2737 | .byte 3,0xc0 /* receiver: 8 bpc */ |
@@ -2748,6 +2745,7 @@ L(scc_initable_mac): | |||
2748 | .byte -1 | 2745 | .byte -1 |
2749 | .even | 2746 | .even |
2750 | #endif | 2747 | #endif |
2748 | #endif /* CONFIG_MAC */ | ||
2751 | 2749 | ||
2752 | #ifdef CONFIG_ATARI | 2750 | #ifdef CONFIG_ATARI |
2753 | /* #define USE_PRINTER */ | 2751 | /* #define USE_PRINTER */ |
@@ -2843,6 +2841,7 @@ func_start serial_init,%d0/%d1/%a0/%a1 | |||
2843 | | movew #61,CUSTOMBASE+C_SERPER-ZTWOBASE | 2841 | | movew #61,CUSTOMBASE+C_SERPER-ZTWOBASE |
2844 | 1: | 2842 | 1: |
2845 | #endif | 2843 | #endif |
2844 | |||
2846 | #ifdef CONFIG_ATARI | 2845 | #ifdef CONFIG_ATARI |
2847 | is_not_atari(4f) | 2846 | is_not_atari(4f) |
2848 | movel %pc@(L(iobase)),%a1 | 2847 | movel %pc@(L(iobase)),%a1 |
@@ -2877,21 +2876,14 @@ func_start serial_init,%d0/%d1/%a0/%a1 | |||
2877 | jra L(serial_init_done) | 2876 | jra L(serial_init_done) |
2878 | 4: | 2877 | 4: |
2879 | #endif | 2878 | #endif |
2879 | |||
2880 | #ifdef CONFIG_MAC | 2880 | #ifdef CONFIG_MAC |
2881 | is_not_mac(L(serial_init_not_mac)) | 2881 | is_not_mac(L(serial_init_not_mac)) |
2882 | 2882 | #if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B) | |
2883 | #ifdef SERIAL_DEBUG | ||
2884 | |||
2885 | /* You may define either or both of these. */ | ||
2886 | #define MAC_USE_SCC_A /* Modem port */ | ||
2887 | #define MAC_USE_SCC_B /* Printer port */ | ||
2888 | |||
2889 | #define mac_scc_cha_b_ctrl_offset 0x0 | 2883 | #define mac_scc_cha_b_ctrl_offset 0x0 |
2890 | #define mac_scc_cha_a_ctrl_offset 0x2 | 2884 | #define mac_scc_cha_a_ctrl_offset 0x2 |
2891 | #define mac_scc_cha_b_data_offset 0x4 | 2885 | #define mac_scc_cha_b_data_offset 0x4 |
2892 | #define mac_scc_cha_a_data_offset 0x6 | 2886 | #define mac_scc_cha_a_data_offset 0x6 |
2893 | |||
2894 | #if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B) | ||
2895 | movel %pc@(L(mac_sccbase)),%a0 | 2887 | movel %pc@(L(mac_sccbase)),%a0 |
2896 | /* Reset SCC register pointer */ | 2888 | /* Reset SCC register pointer */ |
2897 | moveb %a0@(mac_scc_cha_a_ctrl_offset),%d0 | 2889 | moveb %a0@(mac_scc_cha_a_ctrl_offset),%d0 |
@@ -2905,7 +2897,6 @@ func_start serial_init,%d0/%d1/%a0/%a1 | |||
2905 | subq #1,%d0 | 2897 | subq #1,%d0 |
2906 | jne 5b | 2898 | jne 5b |
2907 | #endif | 2899 | #endif |
2908 | |||
2909 | #ifdef MAC_USE_SCC_A | 2900 | #ifdef MAC_USE_SCC_A |
2910 | /* Initialize channel A */ | 2901 | /* Initialize channel A */ |
2911 | lea %pc@(L(scc_initable_mac)),%a1 | 2902 | lea %pc@(L(scc_initable_mac)),%a1 |
@@ -2916,7 +2907,6 @@ func_start serial_init,%d0/%d1/%a0/%a1 | |||
2916 | jra 5b | 2907 | jra 5b |
2917 | 6: | 2908 | 6: |
2918 | #endif /* MAC_USE_SCC_A */ | 2909 | #endif /* MAC_USE_SCC_A */ |
2919 | |||
2920 | #ifdef MAC_USE_SCC_B | 2910 | #ifdef MAC_USE_SCC_B |
2921 | /* Initialize channel B */ | 2911 | /* Initialize channel B */ |
2922 | lea %pc@(L(scc_initable_mac)),%a1 | 2912 | lea %pc@(L(scc_initable_mac)),%a1 |
@@ -2927,9 +2917,6 @@ func_start serial_init,%d0/%d1/%a0/%a1 | |||
2927 | jra 7b | 2917 | jra 7b |
2928 | 8: | 2918 | 8: |
2929 | #endif /* MAC_USE_SCC_B */ | 2919 | #endif /* MAC_USE_SCC_B */ |
2930 | |||
2931 | #endif /* SERIAL_DEBUG */ | ||
2932 | |||
2933 | jra L(serial_init_done) | 2920 | jra L(serial_init_done) |
2934 | L(serial_init_not_mac): | 2921 | L(serial_init_not_mac): |
2935 | #endif /* CONFIG_MAC */ | 2922 | #endif /* CONFIG_MAC */ |
@@ -2998,27 +2985,19 @@ func_start serial_putc,%d0/%d1/%a0/%a1 | |||
2998 | 2985 | ||
2999 | #ifdef CONFIG_MAC | 2986 | #ifdef CONFIG_MAC |
3000 | is_not_mac(5f) | 2987 | is_not_mac(5f) |
3001 | |||
3002 | #ifdef SERIAL_DEBUG | ||
3003 | |||
3004 | #if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B) | 2988 | #if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B) |
3005 | movel %pc@(L(mac_sccbase)),%a1 | 2989 | movel %pc@(L(mac_sccbase)),%a1 |
3006 | #endif | 2990 | #endif |
3007 | |||
3008 | #ifdef MAC_USE_SCC_A | 2991 | #ifdef MAC_USE_SCC_A |
3009 | 3: btst #2,%a1@(mac_scc_cha_a_ctrl_offset) | 2992 | 3: btst #2,%a1@(mac_scc_cha_a_ctrl_offset) |
3010 | jeq 3b | 2993 | jeq 3b |
3011 | moveb %d0,%a1@(mac_scc_cha_a_data_offset) | 2994 | moveb %d0,%a1@(mac_scc_cha_a_data_offset) |
3012 | #endif /* MAC_USE_SCC_A */ | 2995 | #endif /* MAC_USE_SCC_A */ |
3013 | |||
3014 | #ifdef MAC_USE_SCC_B | 2996 | #ifdef MAC_USE_SCC_B |
3015 | 4: btst #2,%a1@(mac_scc_cha_b_ctrl_offset) | 2997 | 4: btst #2,%a1@(mac_scc_cha_b_ctrl_offset) |
3016 | jeq 4b | 2998 | jeq 4b |
3017 | moveb %d0,%a1@(mac_scc_cha_b_data_offset) | 2999 | moveb %d0,%a1@(mac_scc_cha_b_data_offset) |
3018 | #endif /* MAC_USE_SCC_B */ | 3000 | #endif /* MAC_USE_SCC_B */ |
3019 | |||
3020 | #endif /* SERIAL_DEBUG */ | ||
3021 | |||
3022 | jra L(serial_putc_done) | 3001 | jra L(serial_putc_done) |
3023 | 5: | 3002 | 5: |
3024 | #endif /* CONFIG_MAC */ | 3003 | #endif /* CONFIG_MAC */ |
@@ -3195,7 +3174,7 @@ func_start puts,%d0/%a0 | |||
3195 | movel ARG1,%a0 | 3174 | movel ARG1,%a0 |
3196 | jra 2f | 3175 | jra 2f |
3197 | 1: | 3176 | 1: |
3198 | #ifdef CONSOLE | 3177 | #ifdef CONSOLE_DEBUG |
3199 | console_putc %d0 | 3178 | console_putc %d0 |
3200 | #endif | 3179 | #endif |
3201 | #ifdef SERIAL_DEBUG | 3180 | #ifdef SERIAL_DEBUG |
@@ -3224,7 +3203,7 @@ func_start putn,%d0-%d2 | |||
3224 | jls 2f | 3203 | jls 2f |
3225 | addb #'A'-('9'+1),%d2 | 3204 | addb #'A'-('9'+1),%d2 |
3226 | 2: | 3205 | 2: |
3227 | #ifdef CONSOLE | 3206 | #ifdef CONSOLE_DEBUG |
3228 | console_putc %d2 | 3207 | console_putc %d2 |
3229 | #endif | 3208 | #endif |
3230 | #ifdef SERIAL_DEBUG | 3209 | #ifdef SERIAL_DEBUG |
@@ -3256,7 +3235,7 @@ ENTRY(mac_early_print) | |||
3256 | movel %sp@(22),%d1 /* fetch parameter */ | 3235 | movel %sp@(22),%d1 /* fetch parameter */ |
3257 | jra 2f | 3236 | jra 2f |
3258 | 1: | 3237 | 1: |
3259 | #ifdef CONSOLE | 3238 | #ifdef CONSOLE_DEBUG |
3260 | console_putc %d0 | 3239 | console_putc %d0 |
3261 | #endif | 3240 | #endif |
3262 | #ifdef SERIAL_DEBUG | 3241 | #ifdef SERIAL_DEBUG |
@@ -3292,7 +3271,7 @@ func_start set_leds,%d0/%a0 | |||
3292 | func_return set_leds | 3271 | func_return set_leds |
3293 | #endif | 3272 | #endif |
3294 | 3273 | ||
3295 | #ifdef CONSOLE | 3274 | #ifdef CONSOLE_DEBUG |
3296 | /* | 3275 | /* |
3297 | * For continuity, see the data alignment | 3276 | * For continuity, see the data alignment |
3298 | * to which this structure is tied. | 3277 | * to which this structure is tied. |
@@ -3396,43 +3375,6 @@ L(console_clear_loop): | |||
3396 | 1: | 3375 | 1: |
3397 | func_return console_init | 3376 | func_return console_init |
3398 | 3377 | ||
3399 | func_start console_put_stats,%a0/%d7 | ||
3400 | /* | ||
3401 | * Some of the register usage that follows | ||
3402 | * a0 = pointer to boot_info | ||
3403 | * d7 = value of boot_info fields | ||
3404 | */ | ||
3405 | puts "\nMacLinux\n" | ||
3406 | |||
3407 | #ifdef SERIAL_DEBUG | ||
3408 | puts "\n vidaddr:" | ||
3409 | putn %pc@(L(mac_videobase)) /* video addr. */ | ||
3410 | |||
3411 | puts "\n _stext:" | ||
3412 | lea %pc@(_stext),%a0 | ||
3413 | putn %a0 | ||
3414 | |||
3415 | puts "\nbootinfo:" | ||
3416 | lea %pc@(_end),%a0 | ||
3417 | putn %a0 | ||
3418 | |||
3419 | puts "\n cpuid:" | ||
3420 | putn %pc@(L(cputype)) | ||
3421 | |||
3422 | # ifdef CONFIG_MAC | ||
3423 | puts "\n sccbase:" | ||
3424 | putn %pc@(L(mac_sccbase)) | ||
3425 | # endif | ||
3426 | # ifdef MMU_PRINT | ||
3427 | putc '\n' | ||
3428 | jbsr mmu_print_machine_cpu_types | ||
3429 | # endif | ||
3430 | #endif /* SERIAL_DEBUG */ | ||
3431 | |||
3432 | putc '\n' | ||
3433 | |||
3434 | func_return console_put_stats | ||
3435 | |||
3436 | #ifdef CONFIG_LOGO | 3378 | #ifdef CONFIG_LOGO |
3437 | func_start console_put_penguin,%a0-%a1/%d0-%d7 | 3379 | func_start console_put_penguin,%a0-%a1/%d0-%d7 |
3438 | /* | 3380 | /* |
@@ -3774,7 +3716,7 @@ L(white_16): | |||
3774 | 3716 | ||
3775 | L(console_plot_pixel_exit): | 3717 | L(console_plot_pixel_exit): |
3776 | func_return console_plot_pixel | 3718 | func_return console_plot_pixel |
3777 | #endif /* CONSOLE */ | 3719 | #endif /* CONSOLE_DEBUG */ |
3778 | 3720 | ||
3779 | 3721 | ||
3780 | __INITDATA | 3722 | __INITDATA |
@@ -3787,7 +3729,7 @@ L(iobase): | |||
3787 | .long 0 | 3729 | .long 0 |
3788 | #endif | 3730 | #endif |
3789 | 3731 | ||
3790 | #if defined(CONSOLE) | 3732 | #ifdef CONSOLE_DEBUG |
3791 | L(console_globals): | 3733 | L(console_globals): |
3792 | .long 0 /* cursor column */ | 3734 | .long 0 /* cursor column */ |
3793 | .long 0 /* cursor row */ | 3735 | .long 0 /* cursor row */ |
@@ -3798,7 +3740,7 @@ L(console_font): | |||
3798 | .long 0 /* pointer to console font (struct font_desc) */ | 3740 | .long 0 /* pointer to console font (struct font_desc) */ |
3799 | L(console_font_data): | 3741 | L(console_font_data): |
3800 | .long 0 /* pointer to console font data */ | 3742 | .long 0 /* pointer to console font data */ |
3801 | #endif /* CONSOLE */ | 3743 | #endif /* CONSOLE_DEBUG */ |
3802 | 3744 | ||
3803 | #if defined(MMU_PRINT) | 3745 | #if defined(MMU_PRINT) |
3804 | L(mmu_print_data): | 3746 | L(mmu_print_data): |
@@ -3856,10 +3798,8 @@ L(mac_dimensions): | |||
3856 | .long 0 | 3798 | .long 0 |
3857 | L(mac_rowbytes): | 3799 | L(mac_rowbytes): |
3858 | .long 0 | 3800 | .long 0 |
3859 | #ifdef SERIAL_DEBUG | ||
3860 | L(mac_sccbase): | 3801 | L(mac_sccbase): |
3861 | .long 0 | 3802 | .long 0 |
3862 | #endif | ||
3863 | #endif /* CONFIG_MAC */ | 3803 | #endif /* CONFIG_MAC */ |
3864 | 3804 | ||
3865 | #if defined (CONFIG_APOLLO) | 3805 | #if defined (CONFIG_APOLLO) |