1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256 #include <linux/linkage.h>
257 #include <linux/init.h>
258 #include <asm/bootinfo.h>
259 #include <asm/bootinfo-amiga.h>
260 #include <asm/bootinfo-atari.h>
261 #include <asm/bootinfo-hp300.h>
262 #include <asm/bootinfo-mac.h>
263 #include <asm/bootinfo-q40.h>
264 #include <asm/bootinfo-vme.h>
265 #include <asm/setup.h>
266 #include <asm/entry.h>
267 #include <asm/pgtable.h>
268 #include <asm/page.h>
269 #include <asm/asm-offsets.h>
270 #ifdef CONFIG_MAC
271 # include <asm/machw.h>
272 #endif
273
274 #ifdef CONFIG_EARLY_PRINTK
275 # define SERIAL_DEBUG
276 # if defined(CONFIG_MAC) && defined(CONFIG_FONT_SUPPORT)
277 # define CONSOLE_DEBUG
278 # endif
279 #endif
280
281 #undef MMU_PRINT
282 #undef MMU_NOCACHE_KERNEL
283 #undef DEBUG
284
285
286
287
288
289 #define FONT_8x8
290
291
292
293 .globl kernel_pg_dir
294 .globl availmem
295 .globl m68k_init_mapped_size
296 .globl m68k_pgtable_cachemode
297 .globl m68k_supervisor_cachemode
298 #ifdef CONFIG_MVME16x
299 .globl mvme_bdid
300 #endif
301 #ifdef CONFIG_Q40
302 .globl q40_mem_cptr
303 #endif
304
305 CPUTYPE_040 = 1
306 CPUTYPE_060 = 2
307 CPUTYPE_0460 = 3
308 CPUTYPE_020 = 4
309
310
311 TC_ENABLE = 0x8000
312 TC_PAGE8K = 0x4000
313 TC_PAGE4K = 0x0000
314
315
316 TTR_ENABLE = 0x8000
317 TTR_ANYMODE = 0x4000
318 TTR_KERNELMODE = 0x2000
319 TTR_USERMODE = 0x0000
320 TTR_CI = 0x0400
321 TTR_RW = 0x0200
322 TTR_RWM = 0x0100
323 TTR_FCB2 = 0x0040
324 TTR_FCB1 = 0x0020
325 TTR_FCB0 = 0x0010
326 TTR_FCM2 = 0x0004
327 TTR_FCM1 = 0x0002
328 TTR_FCM0 = 0x0001
329
330
331 CC6_ENABLE_D = 0x80000000
332 CC6_FREEZE_D = 0x40000000
333 CC6_ENABLE_SB = 0x20000000
334 CC6_PUSH_DPI = 0x10000000
335 CC6_HALF_D = 0x08000000
336 CC6_ENABLE_B = 0x00800000
337 CC6_CLRA_B = 0x00400000
338 CC6_CLRU_B = 0x00200000
339 CC6_ENABLE_I = 0x00008000
340 CC6_FREEZE_I = 0x00004000
341 CC6_HALF_I = 0x00002000
342 CC3_ALLOC_WRITE = 0x00002000
343 CC3_ENABLE_DB = 0x00001000
344 CC3_CLR_D = 0x00000800
345 CC3_CLRE_D = 0x00000400
346 CC3_FREEZE_D = 0x00000200
347 CC3_ENABLE_D = 0x00000100
348 CC3_ENABLE_IB = 0x00000010
349 CC3_CLR_I = 0x00000008
350 CC3_CLRE_I = 0x00000004
351 CC3_FREEZE_I = 0x00000002
352 CC3_ENABLE_I = 0x00000001
353
354
355 PAGESIZE = 4096
356 PAGESHIFT = 12
357
358 ROOT_TABLE_SIZE = 128
359 PTR_TABLE_SIZE = 128
360 PAGE_TABLE_SIZE = 64
361 ROOT_INDEX_SHIFT = 25
362 PTR_INDEX_SHIFT = 18
363 PAGE_INDEX_SHIFT = 12
364
365 #ifdef DEBUG
366
367 #ifdef __STDC__
368 #define L(name) .head.S.##name
369 #else
370 #define L(name) .head.S.name
371 #endif
372 #else
373 #ifdef __STDC__
374 #define L(name) .L##name
375 #else
376 #define L(name) .Lname
377 #endif
378 #endif
379
380
381 #ifndef __INITDATA
382 #define __INITDATA .data
383 #define __FINIT .previous
384 #endif
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400 #define STACK %a6@(stackstart)
401 #define ARG0 %a6@(4)
402 #define ARG1 %a6@(8)
403 #define ARG2 %a6@(12)
404 #define ARG3 %a6@(16)
405 #define ARG4 %a6@(20)
406
407 .macro func_start name,saveregs,stack=0
408 L(\name):
409 linkw %a6,#-\stack
410 moveml \saveregs,%sp@-
411 .set stackstart,-\stack
412
413 .macro func_return_\name
414 moveml %sp@+,\saveregs
415 unlk %a6
416 rts
417 .endm
418 .endm
419
420 .macro func_return name
421 func_return_\name
422 .endm
423
424 .macro func_call name
425 jbsr L(\name)
426 .endm
427
428 .macro move_stack nr,arg1,arg2,arg3,arg4
429 .if \nr
430 move_stack "(\nr-1)",\arg2,\arg3,\arg4
431 movel \arg1,%sp@-
432 .endif
433 .endm
434
435 .macro func_define name,nr=0
436 .macro \name arg1,arg2,arg3,arg4
437 move_stack \nr,\arg1,\arg2,\arg3,\arg4
438 func_call \name
439 .if \nr
440 lea %sp@(\nr*4),%sp
441 .endif
442 .endm
443 .endm
444
445 func_define mmu_map,4
446 func_define mmu_map_tt,4
447 func_define mmu_fixup_page_mmu_cache,1
448 func_define mmu_temp_map,2
449 func_define mmu_engage
450 func_define mmu_get_root_table_entry,1
451 func_define mmu_get_ptr_table_entry,2
452 func_define mmu_get_page_table_entry,2
453 func_define mmu_print
454 func_define get_new_page
455 #if defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
456 func_define set_leds
457 #endif
458
459 .macro mmu_map_eq arg1,arg2,arg3
460 mmu_map \arg1,\arg1,\arg2,\arg3
461 .endm
462
463 .macro get_bi_record record
464 pea \record
465 func_call get_bi_record
466 addql #4,%sp
467 .endm
468
469 func_define serial_putc,1
470 func_define console_putc,1
471
472 func_define console_init
473 func_define console_put_penguin
474 func_define console_plot_pixel,3
475 func_define console_scroll
476
477 .macro putc ch
478 #if defined(CONSOLE_DEBUG) || defined(SERIAL_DEBUG)
479 pea \ch
480 #endif
481 #ifdef CONSOLE_DEBUG
482 func_call console_putc
483 #endif
484 #ifdef SERIAL_DEBUG
485 func_call serial_putc
486 #endif
487 #if defined(CONSOLE_DEBUG) || defined(SERIAL_DEBUG)
488 addql #4,%sp
489 #endif
490 .endm
491
492 .macro dputc ch
493 #ifdef DEBUG
494 putc \ch
495 #endif
496 .endm
497
498 func_define putn,1
499
500 .macro dputn nr
501 #ifdef DEBUG
502 putn \nr
503 #endif
504 .endm
505
506 .macro puts string
507 #if defined(CONSOLE_DEBUG) || defined(SERIAL_DEBUG)
508 __INITDATA
509 .Lstr\@:
510 .string "\string"
511 __FINIT
512 pea %pc@(.Lstr\@)
513 func_call puts
514 addql #4,%sp
515 #endif
516 .endm
517
518 .macro dputs string
519 #ifdef DEBUG
520 puts "\string"
521 #endif
522 .endm
523
524 #define is_not_amiga(lab) cmpl &MACH_AMIGA,%pc@(m68k_machtype); jne lab
525 #define is_not_atari(lab) cmpl &MACH_ATARI,%pc@(m68k_machtype); jne lab
526 #define is_not_mac(lab) cmpl &MACH_MAC,%pc@(m68k_machtype); jne lab
527 #define is_not_mvme147(lab) cmpl &MACH_MVME147,%pc@(m68k_machtype); jne lab
528 #define is_not_mvme16x(lab) cmpl &MACH_MVME16x,%pc@(m68k_machtype); jne lab
529 #define is_not_bvme6000(lab) cmpl &MACH_BVME6000,%pc@(m68k_machtype); jne lab
530 #define is_mvme147(lab) cmpl &MACH_MVME147,%pc@(m68k_machtype); jeq lab
531 #define is_mvme16x(lab) cmpl &MACH_MVME16x,%pc@(m68k_machtype); jeq lab
532 #define is_bvme6000(lab) cmpl &MACH_BVME6000,%pc@(m68k_machtype); jeq lab
533 #define is_not_hp300(lab) cmpl &MACH_HP300,%pc@(m68k_machtype); jne lab
534 #define is_not_apollo(lab) cmpl &MACH_APOLLO,%pc@(m68k_machtype); jne lab
535 #define is_not_q40(lab) cmpl &MACH_Q40,%pc@(m68k_machtype); jne lab
536 #define is_not_sun3x(lab) cmpl &MACH_SUN3X,%pc@(m68k_machtype); jne lab
537
538 #define hasnt_leds(lab) cmpl &MACH_HP300,%pc@(m68k_machtype); \
539 jeq 42f; \
540 cmpl &MACH_APOLLO,%pc@(m68k_machtype); \
541 jne lab ;\
542 42:\
543
544 #define is_040_or_060(lab) btst &CPUTYPE_0460,%pc@(L(cputype)+3); jne lab
545 #define is_not_040_or_060(lab) btst &CPUTYPE_0460,%pc@(L(cputype)+3); jeq lab
546 #define is_040(lab) btst &CPUTYPE_040,%pc@(L(cputype)+3); jne lab
547 #define is_060(lab) btst &CPUTYPE_060,%pc@(L(cputype)+3); jne lab
548 #define is_not_060(lab) btst &CPUTYPE_060,%pc@(L(cputype)+3); jeq lab
549 #define is_020(lab) btst &CPUTYPE_020,%pc@(L(cputype)+3); jne lab
550 #define is_not_020(lab) btst &CPUTYPE_020,%pc@(L(cputype)+3); jeq lab
551
552
553
554
555 .macro leds mask
556 #if defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
557 hasnt_leds(.Lled\@)
558 pea \mask
559 func_call set_leds
560 addql #4,%sp
561 .Lled\@:
562 #endif
563 .endm
564
565 __HEAD
566 ENTRY(_stext)
567
568
569
570
571 bras 1f
572
573 .long BOOTINFOV_MAGIC
574 .long MACH_AMIGA, AMIGA_BOOTI_VERSION
575 .long MACH_ATARI, ATARI_BOOTI_VERSION
576 .long MACH_MVME147, MVME147_BOOTI_VERSION
577 .long MACH_MVME16x, MVME16x_BOOTI_VERSION
578 .long MACH_BVME6000, BVME6000_BOOTI_VERSION
579 .long MACH_MAC, MAC_BOOTI_VERSION
580 .long MACH_Q40, Q40_BOOTI_VERSION
581 .long MACH_HP300, HP300_BOOTI_VERSION
582 .long 0
583 1: jra __start
584
585 .equ kernel_pg_dir,_stext
586
587 .equ .,_stext+PAGESIZE
588
589 ENTRY(_start)
590 jra __start
591 __INIT
592 ENTRY(__start)
593
594
595
596 lea %pc@(_stext),%sp
597
598
599
600
601 get_bi_record BI_MACHTYPE
602 lea %pc@(m68k_machtype),%a1
603 movel %a0@,%a1@
604
605 get_bi_record BI_FPUTYPE
606 lea %pc@(m68k_fputype),%a1
607 movel %a0@,%a1@
608
609 get_bi_record BI_MMUTYPE
610 lea %pc@(m68k_mmutype),%a1
611 movel %a0@,%a1@
612
613 get_bi_record BI_CPUTYPE
614 lea %pc@(m68k_cputype),%a1
615 movel %a0@,%a1@
616
617 leds 0x1
618
619 #ifdef CONFIG_MAC
620
621
622
623
624
625 is_not_mac(L(test_notmac))
626
627 get_bi_record BI_MAC_VADDR
628 lea %pc@(L(mac_videobase)),%a1
629 movel %a0@,%a1@
630
631 get_bi_record BI_MAC_VDEPTH
632 lea %pc@(L(mac_videodepth)),%a1
633 movel %a0@,%a1@
634
635 get_bi_record BI_MAC_VDIM
636 lea %pc@(L(mac_dimensions)),%a1
637 movel %a0@,%a1@
638
639 get_bi_record BI_MAC_VROW
640 lea %pc@(L(mac_rowbytes)),%a1
641 movel %a0@,%a1@
642
643 get_bi_record BI_MAC_SCCBASE
644 lea %pc@(L(mac_sccbase)),%a1
645 movel %a0@,%a1@
646
647 L(test_notmac):
648 #endif
649
650
651
652
653
654
655
656
657 movel %pc@(m68k_cputype),%d0
658
659
660
661 clrl %d1
662
663
664
665
666 btst #CPUB_68060,%d0
667 jeq 1f
668 bset #CPUTYPE_060,%d1
669 bset #CPUTYPE_0460,%d1
670 jra 3f
671 1:
672
673
674
675 btst #CPUB_68040,%d0
676 jeq 2f
677 bset #CPUTYPE_040,%d1
678 bset #CPUTYPE_0460,%d1
679 jra 3f
680 2:
681
682
683
684 btst #CPUB_68020,%d0
685 jeq 3f
686 bset #CPUTYPE_020,%d1
687 jra 3f
688 3:
689
690
691
692 lea %pc@(L(cputype)),%a0
693 movel %d1,%a0@
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710 clrl %d0
711 clrl %d1
712
713 is_not_040_or_060(L(save_cachetype))
714
715
716
717
718
719
720
721
722 #ifdef CONFIG_060_WRITETHROUGH
723
724
725
726
727
728
729 is_not_060(1f)
730 movel #_PAGE_CACHE040W,%d0
731 jra L(save_cachetype)
732 #endif
733 1:
734 movew #_PAGE_CACHE040,%d0
735
736 movel #_PAGE_CACHE040W,%d1
737
738 L(save_cachetype):
739
740
741 lea %pc@(m68k_supervisor_cachemode),%a0
742 movel %d0,%a0@
743 lea %pc@(m68k_pgtable_cachemode),%a0
744 movel %d1,%a0@
745
746
747
748
749 movew #0x2700,%sr
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770 #ifdef CONFIG_ATARI
771 is_not_atari(L(notypetest))
772
773
774 moveq #0,%d3
775 get_bi_record BI_ATARI_MCH_TYPE
776 tstl %d0
777 jbmi 1f
778 movel %a0@,%d3
779 lea %pc@(atari_mch_type),%a0
780 movel %d3,%a0@
781 1:
782
783
784 moveq #0,%d0
785 cmpl #ATARI_MACH_HADES,%d3
786 jbne 1f
787 movel #0xff000000,%d0
788 1: lea %pc@(L(iobase)),%a0
789 movel %d0,%a0@
790
791 L(notypetest):
792 #endif
793
794 #ifdef CONFIG_VME
795 is_mvme147(L(getvmetype))
796 is_bvme6000(L(getvmetype))
797 is_not_mvme16x(L(gvtdone))
798
799
800
801
802
803
804 L(getvmetype):
805 get_bi_record BI_VME_TYPE
806 tstl %d0
807 jbmi 1f
808 movel %a0@,%d3
809 lea %pc@(vme_brdtype),%a0
810 movel %d3,%a0@
811 1:
812 #ifdef CONFIG_MVME16x
813 is_not_mvme16x(L(gvtdone))
814
815
816
817
818
819 get_bi_record BI_VME_BRDINFO
820 tstl %d0
821 jpl 1f
822
823
824 movel %d2,%sp@-
825 trap #15
826 .word 0x70
827 movel %sp@+,%a0
828 1:
829 lea %pc@(mvme_bdid),%a1
830
831 movel %a0@+,%a1@+
832 movel %a0@+,%a1@+
833 movel %a0@+,%a1@+
834 movel %a0@+,%a1@+
835 movel %a0@+,%a1@+
836 movel %a0@+,%a1@+
837 movel %a0@+,%a1@+
838 movel %a0@+,%a1@+
839 #endif
840
841 L(gvtdone):
842
843 #endif
844
845 #ifdef CONFIG_HP300
846 is_not_hp300(L(nothp))
847
848
849 get_bi_record BI_HP300_UART_ADDR
850 tstl %d0
851 jbmi 1f
852 movel %a0@,%d3
853 lea %pc@(L(uartbase)),%a0
854 movel %d3,%a0@
855 get_bi_record BI_HP300_UART_SCODE
856 tstl %d0
857 jbmi 1f
858 movel %a0@,%d3
859 lea %pc@(L(uart_scode)),%a0
860 movel %d3,%a0@
861 1:
862 L(nothp):
863 #endif
864
865
866
867
868 jbsr L(serial_init)
869
870
871
872
873 #ifdef CONFIG_MAC
874 is_not_mac(L(nocon))
875 # ifdef CONSOLE_DEBUG
876 console_init
877 # ifdef CONFIG_LOGO
878 console_put_penguin
879 # endif
880 # endif
881 L(nocon):
882 #endif
883
884
885 putc '\n'
886 putc 'A'
887 leds 0x2
888 dputn %pc@(L(cputype))
889 dputn %pc@(m68k_supervisor_cachemode)
890 dputn %pc@(m68k_pgtable_cachemode)
891 dputc '\n'
892
893
894
895
896 lea %pc@(L(phys_kernel_start)),%a0
897 lea %pc@(_stext),%a1
898 subl #_stext,%a1
899 addl #PAGE_OFFSET,%a1
900 movel %a1,%a0@
901
902 putc 'B'
903
904 leds 0x4
905
906
907
908
909
910
911
912
913
914 get_bi_record BI_MEMCHUNK
915 movel %a0@(4),%d0
916 movel #16*1024*1024,%d1
917 cmpl %d0,%d1
918 jls 1f
919 lsrl #1,%d1
920 cmpl %d0,%d1
921 jls 1f
922 lsrl #1,%d1
923 1:
924 lea %pc@(m68k_init_mapped_size),%a0
925 movel %d1,%a0@
926 mmu_map #PAGE_OFFSET,%pc@(L(phys_kernel_start)),%d1,\
927 %pc@(m68k_supervisor_cachemode)
928
929 putc 'C'
930
931 #ifdef CONFIG_AMIGA
932
933 L(mmu_init_amiga):
934
935 is_not_amiga(L(mmu_init_not_amiga))
936
937
938
939
940 putc 'D'
941
942 is_not_040_or_060(1f)
943
944
945
946
947 mmu_map #0x80000000,#0,#0x01000000,#_PAGE_NOCACHE_S
948
949
950
951
952 mmu_map_tt #1,#0x40000000,#0x20000000,#_PAGE_NOCACHE_S
953
954 jbra L(mmu_init_done)
955
956 1:
957
958
959
960 mmu_map #0x80000000,#0,#0x02000000,#_PAGE_NOCACHE030
961 mmu_map_tt #1,#0x40000000,#0x20000000,#_PAGE_NOCACHE030
962
963 jbra L(mmu_init_done)
964
965 L(mmu_init_not_amiga):
966 #endif
967
968 #ifdef CONFIG_ATARI
969
970 L(mmu_init_atari):
971
972 is_not_atari(L(mmu_init_not_atari))
973
974 putc 'E'
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990 moveq #0,%d0
991 movel %pc@(atari_mch_type),%d3
992 cmpl #ATARI_MACH_MEDUSA,%d3
993 jbeq 2f
994 cmpl #ATARI_MACH_HADES,%d3
995 jbne 1f
996 2: movel #0xff000000,%d0
997 1: movel %d0,%d3
998
999 is_040_or_060(L(spata68040))
1000
1001
1002
1003
1004
1005
1006
1007 mmu_map #0xff000000,%d3,#0x01000000,#_PAGE_NOCACHE030
1008
1009 jbra L(mmu_init_done)
1010
1011 L(spata68040):
1012
1013 mmu_map #0xff000000,%d3,#0x01000000,#_PAGE_NOCACHE_S
1014
1015 jbra L(mmu_init_done)
1016
1017 L(mmu_init_not_atari):
1018 #endif
1019
1020 #ifdef CONFIG_Q40
1021 is_not_q40(L(notq40))
1022
1023
1024
1025
1026
1027
1028
1029 putc 'Q'
1030
1031 mmu_map_tt #0,#0xfe000000,#0x01000000,#_PAGE_CACHE040W
1032 mmu_map_tt #1,#0xff000000,#0x01000000,#_PAGE_NOCACHE_S
1033
1034 jbra L(mmu_init_done)
1035
1036 L(notq40):
1037 #endif
1038
1039 #ifdef CONFIG_HP300
1040 is_not_hp300(L(nothp300))
1041
1042
1043
1044
1045
1046
1047 is_040(1f)
1048
1049
1050
1051
1052 mmu_map #0xf0000000,#0,#0x02000000,#_PAGE_NOCACHE030
1053
1054 jbra L(mmu_init_done)
1055
1056 1:
1057
1058
1059
1060 mmu_map #0xf0000000,#0,#0x01000000,#_PAGE_NOCACHE_S
1061
1062 jbra L(mmu_init_done)
1063
1064 L(nothp300):
1065 #endif
1066
1067 #ifdef CONFIG_MVME147
1068
1069 is_not_mvme147(L(not147))
1070
1071
1072
1073
1074
1075
1076
1077
1078 mmu_map_tt #1,#0xe0000000,#0x20000000,#_PAGE_NOCACHE030
1079
1080 jbra L(mmu_init_done)
1081
1082 L(not147):
1083 #endif
1084
1085 #ifdef CONFIG_MVME16x
1086
1087 is_not_mvme16x(L(not16x))
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102 mmu_map_tt #1,#0xe0000000,#0x20000000,#_PAGE_NOCACHE_S
1103
1104 jbra L(mmu_init_done)
1105
1106 L(not16x):
1107 #endif
1108
1109 #ifdef CONFIG_BVME6000
1110
1111 is_not_bvme6000(L(not6000))
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122 mmu_map_tt #1,#0xe0000000,#0x20000000,#_PAGE_NOCACHE_S
1123
1124 jbra L(mmu_init_done)
1125
1126 L(not6000):
1127 #endif
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157 #ifdef CONFIG_MAC
1158
1159 L(mmu_init_mac):
1160
1161 is_not_mac(L(mmu_init_not_mac))
1162
1163 putc 'F'
1164
1165 is_not_040_or_060(1f)
1166
1167 moveq #_PAGE_NOCACHE_S,%d3
1168 jbra 2f
1169 1:
1170 moveq #_PAGE_NOCACHE030,%d3
1171 2:
1172
1173
1174
1175
1176
1177 movel #VIDEOMEMMASK,%d0
1178 andl %pc@(L(mac_videobase)),%d0
1179
1180 mmu_map #VIDEOMEMBASE,%d0,#VIDEOMEMSIZE,%d3
1181
1182 mmu_map_eq #0x40000000,#0x02000000,%d3
1183
1184 mmu_map_eq #0x50000000,#0x03000000,%d3
1185
1186 mmu_map_tt #1,#0xf8000000,#0x08000000,%d3
1187
1188 jbra L(mmu_init_done)
1189
1190 L(mmu_init_not_mac):
1191 #endif
1192
1193 #ifdef CONFIG_SUN3X
1194 is_not_sun3x(L(notsun3x))
1195
1196
1197
1198
1199
1200
1201
1202 movel #0xfee00000, %d0
1203 moveq #ROOT_INDEX_SHIFT, %d1
1204 lsrl %d1,%d0
1205 mmu_get_root_table_entry %d0
1206
1207 movel #0xfee00000, %d0
1208 moveq #PTR_INDEX_SHIFT, %d1
1209 lsrl %d1,%d0
1210 andl #PTR_TABLE_SIZE-1, %d0
1211 mmu_get_ptr_table_entry %a0,%d0
1212
1213 movel #0xfee00000, %d0
1214 moveq #PAGE_INDEX_SHIFT, %d1
1215 lsrl %d1,%d0
1216 andl #PAGE_TABLE_SIZE-1, %d0
1217 mmu_get_page_table_entry %a0,%d0
1218
1219
1220 movel 0xfefe00d4, %a1
1221 movel %a1@, %a1
1222
1223 movel #((0x200000 >> 13)-1), %d1
1224
1225 1:
1226 movel %a1@+, %d3
1227 movel %d3,%a0@+
1228 addl #0x1000,%d3
1229 movel %d3,%a0@+
1230
1231 dbra %d1,1b
1232
1233
1234 mmu_map_tt #1,#0x40000000,#0x40000000,#_PAGE_NOCACHE_S
1235 jbra L(mmu_init_done)
1236
1237 L(notsun3x):
1238 #endif
1239
1240 #ifdef CONFIG_APOLLO
1241 is_not_apollo(L(notapollo))
1242
1243 putc 'P'
1244 mmu_map #0x80000000,#0,#0x02000000,#_PAGE_NOCACHE030
1245
1246 L(notapollo):
1247 jbra L(mmu_init_done)
1248 #endif
1249
1250 L(mmu_init_done):
1251
1252 putc 'G'
1253 leds 0x8
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268 L(mmu_fixup):
1269
1270 is_not_040_or_060(L(mmu_fixup_done))
1271
1272 #ifdef MMU_NOCACHE_KERNEL
1273 jbra L(mmu_fixup_done)
1274 #endif
1275
1276
1277
1278
1279 movel %pc@(L(phys_kernel_start)),%d0
1280 subl #PAGE_OFFSET,%d0
1281 lea %pc@(_stext),%a0
1282 subl %d0,%a0
1283 mmu_fixup_page_mmu_cache %a0
1284
1285 movel %pc@(L(kernel_end)),%a0
1286 subl %d0,%a0
1287 movel %pc@(L(memory_start)),%a1
1288 subl %d0,%a1
1289 bra 2f
1290 1:
1291 mmu_fixup_page_mmu_cache %a0
1292 addw #PAGESIZE,%a0
1293 2:
1294 cmpl %a0,%a1
1295 jgt 1b
1296
1297 L(mmu_fixup_done):
1298
1299 #ifdef MMU_PRINT
1300 mmu_print
1301 #endif
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365 putc 'H'
1366
1367 mmu_engage
1368
1369
1370
1371
1372
1373
1374
1375 movel L(memory_start),availmem
1376
1377 #ifdef CONFIG_AMIGA
1378 is_not_amiga(1f)
1379
1380 clrl L(custom)
1381 1:
1382 #endif
1383
1384 #ifdef CONFIG_ATARI
1385 is_not_atari(1f)
1386
1387 movel #0xff000000,L(iobase)
1388 1:
1389 #endif
1390
1391 #ifdef CONFIG_MAC
1392 is_not_mac(1f)
1393 movel #~VIDEOMEMMASK,%d0
1394 andl L(mac_videobase),%d0
1395 addl #VIDEOMEMBASE,%d0
1396 movel %d0,L(mac_videobase)
1397 #ifdef CONSOLE_DEBUG
1398 movel %pc@(L(phys_kernel_start)),%d0
1399 subl #PAGE_OFFSET,%d0
1400 subl %d0,L(console_font)
1401 subl %d0,L(console_font_data)
1402 #endif
1403 orl #0x50000000,L(mac_sccbase)
1404 1:
1405 #endif
1406
1407 #ifdef CONFIG_HP300
1408 is_not_hp300(2f)
1409
1410
1411
1412 movel #0xf0000000,L(iobase)
1413
1414
1415
1416
1417 is_040(1f)
1418 movel #0x60,0xf05f400c
1419 jbra 2f
1420
1421
1422
1423
1424 1: movew #0,0xf05f400e
1425 movew #0x64,0xf05f400e
1426 2:
1427 #endif
1428
1429 #ifdef CONFIG_SUN3X
1430 is_not_sun3x(1f)
1431
1432
1433 oriw #0x4000,0x61000000
1434 1:
1435 #endif
1436
1437 #ifdef CONFIG_APOLLO
1438 is_not_apollo(1f)
1439
1440
1441
1442
1443 movel #0x80000000,L(iobase)
1444 1:
1445 #endif
1446
1447 putc 'I'
1448 leds 0x10
1449
1450
1451
1452
1453
1454 is_not_040_or_060(L(cache_not_680460))
1455
1456 L(cache680460):
1457 .chip 68040
1458 nop
1459 cpusha %bc
1460 nop
1461
1462 is_060(L(cache68060))
1463
1464 movel #CC6_ENABLE_D+CC6_ENABLE_I,%d0
1465
1466 movec %d0,%cacr
1467 jra L(cache_done)
1468
1469 L(cache68060):
1470 movel #CC6_ENABLE_D+CC6_ENABLE_I+CC6_ENABLE_SB+CC6_PUSH_DPI+CC6_ENABLE_B+CC6_CLRA_B,%d0
1471
1472 movec %d0,%cacr
1473
1474 moveq #1,%d0
1475 .chip 68060
1476 movec %d0,%pcr
1477
1478 jbra L(cache_done)
1479 L(cache_not_680460):
1480 L(cache68030):
1481 .chip 68030
1482 movel #CC3_ENABLE_DB+CC3_CLR_D+CC3_ENABLE_D+CC3_ENABLE_IB+CC3_CLR_I+CC3_ENABLE_I,%d0
1483 movec %d0,%cacr
1484
1485 jra L(cache_done)
1486 .chip 68k
1487 L(cache_done):
1488
1489 putc 'J'
1490
1491
1492
1493
1494 lea init_task,%curptr
1495 lea init_thread_union+THREAD_SIZE,%sp
1496
1497 putc 'K'
1498
1499 subl %a6,%a6
1500
1501
1502
1503
1504 jbsr base_trap_init
1505
1506
1507
1508 putc '\n'
1509 leds 0x55
1510
1511 jbsr start_kernel
1512
1513
1514
1515
1516
1517
1518
1519 func_start get_bi_record,%d1
1520
1521 movel ARG1,%d0
1522 lea %pc@(_end),%a0
1523 1: tstw %a0@(BIR_TAG)
1524 jeq 3f
1525 cmpw %a0@(BIR_TAG),%d0
1526 jeq 2f
1527 addw %a0@(BIR_SIZE),%a0
1528 jra 1b
1529 2: moveq #0,%d0
1530 movew %a0@(BIR_SIZE),%d0
1531 lea %a0@(BIR_DATA),%a0
1532 jra 4f
1533 3: moveq #-1,%d0
1534 lea %a0@(BIR_SIZE),%a0
1535 4:
1536 func_return get_bi_record
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601 #ifdef MMU_PRINT
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612 #define mmu_next_valid 0
1613 #define mmu_start_logical 4
1614 #define mmu_next_logical 8
1615 #define mmu_start_physical 12
1616 #define mmu_next_physical 16
1617
1618 #define MMU_PRINT_INVALID -1
1619 #define MMU_PRINT_VALID 1
1620 #define MMU_PRINT_UNINITED 0
1621
1622 #define putZc(z,n) jbne 1f; putc z; jbra 2f; 1: putc n; 2:
1623
1624 func_start mmu_print,%a0-%a6/%d0-%d7
1625
1626 movel %pc@(L(kernel_pgdir_ptr)),%a5
1627 lea %pc@(L(mmu_print_data)),%a0
1628 movel #MMU_PRINT_UNINITED,%a0@(mmu_next_valid)
1629
1630 is_not_040_or_060(mmu_030_print)
1631
1632 mmu_040_print:
1633 puts "\nMMU040\n"
1634 puts "rp:"
1635 putn %a5
1636 putc '\n'
1637 #if 0
1638
1639
1640
1641
1642
1643
1644 movel #ROOT_TABLE_SIZE,%d5
1645 #if 0
1646 movel %a5@+,%d7 | Burn an entry to skip the kernel mappings,
1647 subql #1,%d5 | they (might) work
1648 #endif
1649 1: tstl %d5
1650 jbeq mmu_print_done
1651 subq #1,%d5
1652 movel %a5@+,%d7
1653 btst #1,%d7
1654 jbeq 1b
1655
1656 2: putn %d7
1657 andil #0xFFFFFE00,%d7
1658 movel %d7,%a4
1659 movel #PTR_TABLE_SIZE,%d4
1660 putc ' '
1661 3: tstl %d4
1662 jbeq 11f
1663 subq #1,%d4
1664 movel %a4@+,%d7
1665 btst #1,%d7
1666 jbeq 3b
1667
1668 4: putn %d7
1669 andil #0xFFFFFF00,%d7
1670 movel %d7,%a3
1671 movel #PAGE_TABLE_SIZE,%d3
1672 5: movel #8,%d2
1673 6: tstl %d3
1674 jbeq 31f
1675 subq #1,%d3
1676 movel %a3@+,%d6
1677 btst #0,%d6
1678 jbeq 6b
1679 7: tstl %d2
1680 jbeq 8f
1681 subq #1,%d2
1682 putc ' '
1683 jbra 91f
1684 8: putc '\n'
1685 movel #8+1+8+1+1,%d2
1686 9: putc ' '
1687 dbra %d2,9b
1688 movel #7,%d2
1689 91: putn %d6
1690 jbra 6b
1691
1692 31: putc '\n'
1693 movel #8+1,%d2
1694 32: putc ' '
1695 dbra %d2,32b
1696 jbra 3b
1697
1698 11: putc '\n'
1699 jbra 1b
1700 #endif
1701
1702 lea %pc@(kernel_pg_dir),%a5
1703 movel %a5,%a0
1704 movel #0x00000000,%a4
1705 moveql #0,%d0
1706 40:
1707
1708 movel %a4,%d5
1709 addil #PAGESIZE<<13,%d5
1710 movel %a0@+,%d6
1711 btst #1,%d6
1712 jbne 41f
1713 jbsr mmu_print_tuple_invalidate
1714 jbra 48f
1715 41:
1716 movel #0,%d1
1717 andil #0xfffffe00,%d6
1718 movel %d6,%a1
1719 42:
1720 movel %a4,%d5
1721 addil #PAGESIZE<<6,%d5
1722 movel %a1@+,%d6
1723 btst #1,%d6
1724 jbne 43f
1725 jbsr mmu_print_tuple_invalidate
1726 jbra 47f
1727 43:
1728 movel #0,%d2
1729 andil #0xffffff00,%d6
1730 movel %d6,%a2
1731 44:
1732 movel %a4,%d5
1733 addil #PAGESIZE,%d5
1734 movel %a2@+,%d6
1735 btst #0,%d6
1736 jbne 45f
1737 jbsr mmu_print_tuple_invalidate
1738 jbra 46f
1739 45:
1740 moveml %d0-%d1,%sp@-
1741 movel %a4,%d0
1742 movel %d6,%d1
1743 andil #0xfffff4e0,%d1
1744 lea %pc@(mmu_040_print_flags),%a6
1745 jbsr mmu_print_tuple
1746 moveml %sp@+,%d0-%d1
1747 46:
1748 movel %d5,%a4
1749 addq #1,%d2
1750 cmpib #64,%d2
1751 jbne 44b
1752 47:
1753 movel %d5,%a4
1754 addq #1,%d1
1755 cmpib #128,%d1
1756 jbne 42b
1757 48:
1758 movel %d5,%a4
1759 addq #1,%d0
1760 cmpib #128,%d0
1761 jbne 40b
1762
1763 .chip 68040
1764 movec %dtt1,%d0
1765 movel %d0,%d1
1766 andiw #0x8000,%d1
1767 jbeq 1f
1768
1769 movel %d0,%d1
1770 andil #0xff000000,%d1
1771 putn %d1
1772 puts "=="
1773 putn %d1
1774
1775 movel %d0,%d6
1776 jbsr mmu_040_print_flags_tt
1777 1:
1778 movec %dtt0,%d0
1779 movel %d0,%d1
1780 andiw #0x8000,%d1
1781 jbeq 1f
1782
1783 movel %d0,%d1
1784 andil #0xff000000,%d1
1785 putn %d1
1786 puts "=="
1787 putn %d1
1788
1789 movel %d0,%d6
1790 jbsr mmu_040_print_flags_tt
1791 1:
1792 .chip 68k
1793
1794 jbra mmu_print_done
1795
1796 mmu_040_print_flags:
1797 btstl #10,%d6
1798 putZc(' ','G')
1799 btstl #7,%d6
1800 putZc(' ','S')
1801 mmu_040_print_flags_tt:
1802 btstl #6,%d6
1803 jbne 3f
1804 putc 'C'
1805 btstl #5,%d6
1806 putZc('w','c')
1807 jbra 4f
1808 3:
1809 putc 'N'
1810 btstl #5,%d6
1811 putZc('s',' ')
1812 4:
1813 rts
1814
1815 mmu_030_print_flags:
1816 btstl #6,%d6
1817 putZc('C','I')
1818 rts
1819
1820 mmu_030_print:
1821 puts "\nMMU030\n"
1822 puts "\nrp:"
1823 putn %a5
1824 putc '\n'
1825 movel %a5,%d0
1826 andil #0xfffffff0,%d0
1827 movel %d0,%a0
1828 movel #0x00000000,%a4
1829 movel #0,%d0
1830 30:
1831 movel %a4,%d5
1832 addil #PAGESIZE<<13,%d5
1833 movel %a0@+,%d6
1834 btst #1,%d6
1835 jbne 31f
1836 btst #0,%d6
1837 jbeq 1f
1838 jbsr mmu_030_print_helper
1839 jbra 38f
1840 1:
1841 jbsr mmu_print_tuple_invalidate
1842 jbra 38f
1843 31:
1844 movel #0,%d1
1845 andil #0xfffffff0,%d6
1846 movel %d6,%a1
1847 32:
1848 movel %a4,%d5
1849 addil #PAGESIZE<<6,%d5
1850 movel %a1@+,%d6
1851 btst #1,%d6
1852 jbne 33f
1853 btst #0,%d6
1854 jbeq 1f
1855 jbsr mmu_030_print_helper
1856 jbra 37f
1857 1:
1858 jbsr mmu_print_tuple_invalidate
1859 jbra 37f
1860 33:
1861 movel #0,%d2
1862 andil #0xfffffff0,%d6
1863 movel %d6,%a2
1864 34:
1865 movel %a4,%d5
1866 addil #PAGESIZE,%d5
1867 movel %a2@+,%d6
1868 btst #0,%d6
1869 jbne 35f
1870 jbsr mmu_print_tuple_invalidate
1871 jbra 36f
1872 35:
1873 jbsr mmu_030_print_helper
1874 36:
1875 movel %d5,%a4
1876 addq #1,%d2
1877 cmpib #64,%d2
1878 jbne 34b
1879 37:
1880 movel %d5,%a4
1881 addq #1,%d1
1882 cmpib #128,%d1
1883 jbne 32b
1884 38:
1885 movel %d5,%a4
1886 addq #1,%d0
1887 cmpib #128,%d0
1888 jbne 30b
1889
1890 mmu_print_done:
1891 puts "\n"
1892
1893 func_return mmu_print
1894
1895
1896 mmu_030_print_helper:
1897 moveml %d0-%d1,%sp@-
1898 movel %a4,%d0
1899 movel %d6,%d1
1900 lea %pc@(mmu_030_print_flags),%a6
1901 jbsr mmu_print_tuple
1902 moveml %sp@+,%d0-%d1
1903 rts
1904
1905 mmu_print_tuple_invalidate:
1906 moveml %a0/%d7,%sp@-
1907
1908 lea %pc@(L(mmu_print_data)),%a0
1909 tstl %a0@(mmu_next_valid)
1910 jbmi mmu_print_tuple_invalidate_exit
1911
1912 movel #MMU_PRINT_INVALID,%a0@(mmu_next_valid)
1913
1914 putn %a4
1915
1916 puts "##\n"
1917
1918 mmu_print_tuple_invalidate_exit:
1919 moveml %sp@+,%a0/%d7
1920 rts
1921
1922
1923 mmu_print_tuple:
1924 moveml %d0-%d7/%a0,%sp@-
1925
1926 lea %pc@(L(mmu_print_data)),%a0
1927
1928 tstl %a0@(mmu_next_valid)
1929 jble mmu_print_tuple_print
1930
1931 cmpl %a0@(mmu_next_physical),%d1
1932 jbeq mmu_print_tuple_increment
1933
1934 mmu_print_tuple_print:
1935 putn %d0
1936 puts "->"
1937 putn %d1
1938
1939 movel %d1,%d6
1940 jbsr %a6@
1941
1942 mmu_print_tuple_record:
1943 movel #MMU_PRINT_VALID,%a0@(mmu_next_valid)
1944
1945 movel %d1,%a0@(mmu_next_physical)
1946
1947 mmu_print_tuple_increment:
1948 movel %d5,%d7
1949 subl %a4,%d7
1950 addl %d7,%a0@(mmu_next_physical)
1951
1952 mmu_print_tuple_exit:
1953 moveml %sp@+,%d0-%d7/%a0
1954 rts
1955
1956 mmu_print_machine_cpu_types:
1957 puts "machine: "
1958
1959 is_not_amiga(1f)
1960 puts "amiga"
1961 jbra 9f
1962 1:
1963 is_not_atari(2f)
1964 puts "atari"
1965 jbra 9f
1966 2:
1967 is_not_mac(3f)
1968 puts "macintosh"
1969 jbra 9f
1970 3: puts "unknown"
1971 9: putc '\n'
1972
1973 puts "cputype: 0"
1974 is_not_060(1f)
1975 putc '6'
1976 jbra 9f
1977 1:
1978 is_not_040_or_060(2f)
1979 putc '4'
1980 jbra 9f
1981 2: putc '3'
1982 9: putc '0'
1983 putc '\n'
1984
1985 rts
1986 #endif
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997 func_start mmu_map_tt,%d0/%d1/%a0,4
1998
1999 dputs "mmu_map_tt:"
2000 dputn ARG1
2001 dputn ARG2
2002 dputn ARG3
2003 dputn ARG4
2004 dputc '\n'
2005
2006 is_020(L(do_map))
2007
2008
2009
2010 bfffo ARG3{#0,#32},%d1
2011 cmpw #8,%d1
2012 jcc L(do_map)
2013
2014
2015
2016 moveq #-1,%d0
2017 lsrl %d1,%d0
2018 lsrl #1,%d0
2019
2020
2021
2022 movel %d0,%d1
2023 notl %d1
2024 andl ARG2,%d1
2025
2026
2027
2028 lsrl #8,%d0
2029 orl %d0,%d1
2030 clrw %d1
2031
2032 is_040_or_060(L(mmu_map_tt_040))
2033
2034
2035
2036
2037 orw #TTR_ENABLE+TTR_RWM+TTR_FCB2+TTR_FCM1+TTR_FCM0,%d1
2038 movel ARG4,%d0
2039 btst #6,%d0
2040 jeq 1f
2041 orw #TTR_CI,%d1
2042
2043 1: lea STACK,%a0
2044 dputn %d1
2045 movel %d1,%a0@
2046 .chip 68030
2047 tstl ARG1
2048 jne 1f
2049 pmove %a0@,%tt0
2050 jra 2f
2051 1: pmove %a0@,%tt1
2052 2: .chip 68k
2053 jra L(mmu_map_tt_done)
2054
2055
2056
2057 L(mmu_map_tt_040):
2058 orw #TTR_ENABLE+TTR_KERNELMODE,%d1
2059 orl ARG4,%d1
2060 dputn %d1
2061
2062 .chip 68040
2063 tstl ARG1
2064 jne 1f
2065 movec %d1,%itt0
2066 movec %d1,%dtt0
2067 jra 2f
2068 1: movec %d1,%itt1
2069 movec %d1,%dtt1
2070 2: .chip 68k
2071
2072 jra L(mmu_map_tt_done)
2073
2074 L(do_map):
2075 mmu_map_eq ARG2,ARG3,ARG4
2076
2077 L(mmu_map_tt_done):
2078
2079 func_return mmu_map_tt
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099 func_start mmu_map,%d0-%d4/%a0-%a4
2100
2101 dputs "\nmmu_map:"
2102 dputn ARG1
2103 dputn ARG2
2104 dputn ARG3
2105 dputn ARG4
2106 dputc '\n'
2107
2108
2109
2110 movel ARG1,%d0
2111 andl #-(PAGESIZE*PAGE_TABLE_SIZE),%d0
2112 movel %d0,%a3
2113
2114
2115
2116 movel ARG1,%a4
2117 addl ARG3,%a4
2118 subql #1,%a4
2119
2120
2121
2122 movel ARG2,%d0
2123 andl #-(PAGESIZE*PAGE_TABLE_SIZE),%d0
2124 movel %d0,%a2
2125
2126
2127
2128 movel ARG4,%d0
2129 orw #_PAGE_PRESENT+_PAGE_ACCESSED+_PAGE_DIRTY,%d0
2130 addw %d0,%a2
2131
2132 dputn %a2
2133 dputn %a3
2134 dputn %a4
2135
2136 is_not_040_or_060(L(mmu_map_030))
2137
2138 addw #_PAGE_GLOBAL040,%a2
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155 L(mmu_map_040):
2156
2157
2158 movel %a3,%d0
2159 moveq #ROOT_INDEX_SHIFT,%d1
2160 lsrl %d1,%d0
2161 mmu_get_root_table_entry %d0
2162
2163
2164
2165 movel %a3,%d0
2166 moveq #PTR_INDEX_SHIFT,%d1
2167 lsrl %d1,%d0
2168 andl #PTR_TABLE_SIZE-1,%d0
2169 mmu_get_ptr_table_entry %a0,%d0
2170
2171
2172
2173 movel %a3,%d0
2174 moveq #PAGE_INDEX_SHIFT,%d1
2175 lsrl %d1,%d0
2176 andl #PAGE_TABLE_SIZE-1,%d0
2177 mmu_get_page_table_entry %a0,%d0
2178
2179
2180
2181 tstl %a0@
2182 jne L(mmu_map_error)
2183
2184
2185
2186 movel %a2,%a0@
2187 2:
2188 addw #PAGESIZE,%a2
2189 addw #PAGESIZE,%a3
2190
2191
2192
2193 lea %a3@(-1),%a0
2194 cmpl %a0,%a4
2195 jhi L(mmu_map_040)
2196 jra L(mmu_map_done)
2197
2198 L(mmu_map_030):
2199
2200
2201 movel %a3,%d0
2202 moveq #ROOT_INDEX_SHIFT,%d1
2203 lsrl %d1,%d0
2204 mmu_get_root_table_entry %d0
2205
2206
2207
2208
2209 movel %a3,%d0
2210 andl #(PTR_TABLE_SIZE*PAGE_TABLE_SIZE*PAGESIZE-1)&(-ROOT_TABLE_SIZE),%d0
2211 jne 1f
2212
2213
2214
2215 lea %a3@(PTR_TABLE_SIZE*PAGE_TABLE_SIZE*PAGESIZE-1),%a1
2216 cmpl %a1,%a4
2217 jcs 1f
2218
2219 addql #1,%a1
2220
2221
2222
2223 tstl %a0@
2224 jne L(mmu_map_error)
2225
2226
2227
2228 dputs "early term1"
2229 dputn %a2
2230 dputn %a3
2231 dputn %a1
2232 dputc '\n'
2233 movel %a2,%a0@
2234
2235 movel %a1,%a3
2236 lea %a2@(PTR_TABLE_SIZE*PAGE_TABLE_SIZE*PAGESIZE),%a2
2237 jra L(mmu_mapnext_030)
2238 1:
2239
2240
2241 movel %a3,%d0
2242 moveq #PTR_INDEX_SHIFT,%d1
2243 lsrl %d1,%d0
2244 andl #PTR_TABLE_SIZE-1,%d0
2245 mmu_get_ptr_table_entry %a0,%d0
2246
2247
2248
2249 tstl %a0@
2250 jne L(mmu_map_error)
2251
2252
2253
2254 dputs "early term2"
2255 dputn %a2
2256 dputn %a3
2257 dputc '\n'
2258 movel %a2,%a0@
2259
2260 addl #PAGE_TABLE_SIZE*PAGESIZE,%a2
2261 addl #PAGE_TABLE_SIZE*PAGESIZE,%a3
2262
2263 L(mmu_mapnext_030):
2264
2265
2266 lea %a3@(-1),%a0
2267 cmpl %a0,%a4
2268 jhi L(mmu_map_030)
2269 jra L(mmu_map_done)
2270
2271 L(mmu_map_error):
2272
2273 dputs "mmu_map error:"
2274 dputn %a2
2275 dputn %a3
2276 dputc '\n'
2277
2278 L(mmu_map_done):
2279
2280 func_return mmu_map
2281
2282
2283
2284
2285
2286
2287
2288
2289 func_start mmu_fixup_page_mmu_cache,%d0/%a0
2290
2291 dputs "mmu_fixup_page_mmu_cache"
2292 dputn ARG1
2293
2294
2295
2296 movel ARG1,%d0
2297 moveq #ROOT_INDEX_SHIFT,%d1
2298 lsrl %d1,%d0
2299 mmu_get_root_table_entry %d0
2300
2301
2302
2303 movel ARG1,%d0
2304 moveq #PTR_INDEX_SHIFT,%d1
2305 lsrl %d1,%d0
2306 andl #PTR_TABLE_SIZE-1,%d0
2307 mmu_get_ptr_table_entry %a0,%d0
2308
2309
2310
2311 movel ARG1,%d0
2312 moveq #PAGE_INDEX_SHIFT,%d1
2313 lsrl %d1,%d0
2314 andl #PAGE_TABLE_SIZE-1,%d0
2315 mmu_get_page_table_entry %a0,%d0
2316
2317 movel %a0@,%d0
2318 andil #_CACHEMASK040,%d0
2319 orl %pc@(m68k_pgtable_cachemode),%d0
2320 movel %d0,%a0@
2321
2322 dputc '\n'
2323
2324 func_return mmu_fixup_page_mmu_cache
2325
2326
2327
2328
2329
2330
2331
2332
2333 func_start mmu_temp_map,%d0/%d1/%a0/%a1
2334
2335 dputs "mmu_temp_map"
2336 dputn ARG1
2337 dputn ARG2
2338 dputc '\n'
2339
2340 lea %pc@(L(temp_mmap_mem)),%a1
2341
2342
2343
2344 movel ARG2,%d0
2345 moveq #ROOT_INDEX_SHIFT,%d1
2346 lsrl %d1,%d0
2347 mmu_get_root_table_entry %d0
2348
2349
2350
2351 movel %a0@,%d0
2352 cmpl %pc@(L(memory_start)),%d0
2353 jcc 1f
2354
2355
2356
2357 movel %a1@,%d0
2358 addl #PTR_TABLE_SIZE*4,%a1@
2359 orw #_PAGE_TABLE+_PAGE_ACCESSED,%d0
2360 movel %d0,%a0@
2361 dputs " (new)"
2362 1:
2363 dputn %d0
2364
2365
2366 andw #-ROOT_TABLE_SIZE,%d0
2367 movel %d0,%a0
2368
2369
2370
2371 movel ARG2,%d0
2372 moveq #PTR_INDEX_SHIFT,%d1
2373 lsrl %d1,%d0
2374 andl #PTR_TABLE_SIZE-1,%d0
2375 lea %a0@(%d0*4),%a0
2376 dputn %a0
2377
2378
2379
2380 movel %a0@,%d0
2381 jne 1f
2382
2383
2384
2385 movel %a1@,%d0
2386
2387
2388 addl #512,%a1@
2389 orw #_PAGE_TABLE+_PAGE_ACCESSED,%d0
2390 movel %d0,%a0@
2391 dputs " (new)"
2392 1:
2393 dputn %d0
2394
2395
2396 andw #-PTR_TABLE_SIZE,%d0
2397 movel %d0,%a0
2398
2399
2400
2401 movel ARG2,%d0
2402 moveq #PAGE_INDEX_SHIFT,%d1
2403 lsrl %d1,%d0
2404 andl #PAGE_TABLE_SIZE-1,%d0
2405 lea %a0@(%d0*4),%a0
2406 dputn %a0
2407
2408
2409
2410 movel ARG1,%d0
2411 andw #-PAGESIZE,%d0
2412 orw #_PAGE_PRESENT+_PAGE_ACCESSED+_PAGE_DIRTY,%d0
2413 movel %d0,%a0@
2414 dputn %d0
2415
2416 dputc '\n'
2417
2418 func_return mmu_temp_map
2419
2420 func_start mmu_engage,%d0-%d2/%a0-%a3
2421
2422 moveq #ROOT_TABLE_SIZE-1,%d0
2423
2424 lea %pc@(L(kernel_pgdir_ptr)),%a0
2425 movel %a0@,%a2
2426 movel %pc@(L(memory_start)),%a1
2427 movel %a1,%a0@
2428 movel %a2,%a0
2429 1:
2430 movel %a0@+,%a1@+
2431 dbra %d0,1b
2432
2433 lea %pc@(L(temp_mmap_mem)),%a0
2434 movel %a1,%a0@
2435
2436 movew #PAGESIZE-1,%d0
2437 1:
2438 clrl %a1@+
2439 dbra %d0,1b
2440
2441 lea %pc@(1b),%a0
2442 movel #1b,%a1
2443
2444 cmpl %a0,%a1
2445 jeq 1f
2446
2447 mmu_temp_map %a0,%a0
2448 mmu_temp_map %a0,%a1
2449
2450 addw #PAGESIZE,%a0
2451 addw #PAGESIZE,%a1
2452 mmu_temp_map %a0,%a0
2453 mmu_temp_map %a0,%a1
2454 1:
2455 movel %pc@(L(memory_start)),%a3
2456 movel %pc@(L(phys_kernel_start)),%d2
2457
2458 is_not_040_or_060(L(mmu_engage_030))
2459
2460 L(mmu_engage_040):
2461 .chip 68040
2462 nop
2463 cinva %bc
2464 nop
2465 pflusha
2466 nop
2467 movec %a3,%srp
2468 movel #TC_ENABLE+TC_PAGE4K,%d0
2469 movec %d0,%tc
2470 jmp 1f:l
2471 1: nop
2472 movec %a2,%srp
2473 nop
2474 cinva %bc
2475 nop
2476 pflusha
2477 .chip 68k
2478 jra L(mmu_engage_cleanup)
2479
2480 L(mmu_engage_030_temp):
2481 .space 12
2482 L(mmu_engage_030):
2483 .chip 68030
2484 lea %pc@(L(mmu_engage_030_temp)),%a0
2485 movel #0x80000002,%a0@
2486 movel %a3,%a0@(4)
2487 movel #0x0808,%d0
2488 movec %d0,%cacr
2489 pmove %a0@,%srp
2490 pflusha
2491
2492
2493
2494
2495 movel #0x82c07760,%a0@(8)
2496 pmove %a0@(8),%tc
2497 jmp 1f:l
2498 1: movel %a2,%a0@(4)
2499 movel #0x0808,%d0
2500 movec %d0,%cacr
2501 pmove %a0@,%srp
2502 pflusha
2503 .chip 68k
2504
2505 L(mmu_engage_cleanup):
2506 subl #PAGE_OFFSET,%d2
2507 subl %d2,%a2
2508 movel %a2,L(kernel_pgdir_ptr)
2509 subl %d2,%fp
2510 subl %d2,%sp
2511 subl %d2,ARG0
2512
2513 func_return mmu_engage
2514
2515 func_start mmu_get_root_table_entry,%d0/%a1
2516
2517 #if 0
2518 dputs "mmu_get_root_table_entry:"
2519 dputn ARG1
2520 dputs " ="
2521 #endif
2522
2523 movel %pc@(L(kernel_pgdir_ptr)),%a0
2524 tstl %a0
2525 jne 2f
2526
2527 dputs "\nmmu_init:"
2528
2529
2530
2531
2532
2533 get_bi_record BI_LAST
2534 addw #PAGESIZE-1,%a0
2535 movel %a0,%d0
2536 andw #-PAGESIZE,%d0
2537
2538 dputn %d0
2539
2540 lea %pc@(L(memory_start)),%a0
2541 movel %d0,%a0@
2542 lea %pc@(L(kernel_end)),%a0
2543 movel %d0,%a0@
2544
2545
2546
2547
2548
2549 lea %pc@(_stext),%a0
2550 lea %pc@(L(mmu_cached_pointer_tables)),%a1
2551 movel %a0,%a1@
2552 addl #ROOT_TABLE_SIZE*4,%a1@
2553
2554 lea %pc@(L(mmu_num_pointer_tables)),%a1
2555 addql #1,%a1@
2556
2557
2558
2559 movel %a0,%a1
2560 movew #PAGESIZE/4-1,%d0
2561 1:
2562 clrl %a1@+
2563 dbra %d0,1b
2564
2565 lea %pc@(L(kernel_pgdir_ptr)),%a1
2566 movel %a0,%a1@
2567
2568 dputn %a0
2569 dputc '\n'
2570 2:
2571 movel ARG1,%d0
2572 lea %a0@(%d0*4),%a0
2573
2574 #if 0
2575 dputn %a0
2576 dputc '\n'
2577 #endif
2578
2579 func_return mmu_get_root_table_entry
2580
2581
2582
2583 func_start mmu_get_ptr_table_entry,%d0/%a1
2584
2585 #if 0
2586 dputs "mmu_get_ptr_table_entry:"
2587 dputn ARG1
2588 dputn ARG2
2589 dputs " ="
2590 #endif
2591
2592 movel ARG1,%a0
2593 movel %a0@,%d0
2594 jne 2f
2595
2596
2597
2598 dputs "\nmmu_get_new_ptr_table:"
2599 lea %pc@(L(mmu_num_pointer_tables)),%a0
2600 movel %a0@,%d0
2601 addql #1,%a0@
2602
2603
2604
2605 lea %pc@(L(mmu_cached_pointer_tables)),%a1
2606 andw #7,%d0
2607 jne 1f
2608
2609
2610
2611 get_new_page
2612 movel %a0,%a1@
2613 1:
2614
2615
2616 movel %a1@,%d0
2617 addl #PTR_TABLE_SIZE*4,%a1@
2618
2619 dputn %d0
2620 dputc '\n'
2621
2622
2623
2624 movel ARG1,%a0
2625 orw #_PAGE_TABLE+_PAGE_ACCESSED,%d0
2626 movel %d0,%a0@
2627 2:
2628
2629
2630 andw #-PTR_TABLE_SIZE,%d0
2631 movel %d0,%a0
2632 movel ARG2,%d0
2633 lea %a0@(%d0*4),%a0
2634
2635 #if 0
2636 dputn %a0
2637 dputc '\n'
2638 #endif
2639
2640 func_return mmu_get_ptr_table_entry
2641
2642
2643 func_start mmu_get_page_table_entry,%d0/%a1
2644
2645 #if 0
2646 dputs "mmu_get_page_table_entry:"
2647 dputn ARG1
2648 dputn ARG2
2649 dputs " ="
2650 #endif
2651
2652 movel ARG1,%a0
2653 movel %a0@,%d0
2654 jne 2f
2655
2656
2657
2658
2659
2660 get_new_page
2661 addw #_PAGE_TABLE+_PAGE_ACCESSED,%a0
2662
2663
2664
2665 movel ARG1,%d0
2666 andw #-(PAGESIZE/PAGE_TABLE_SIZE),%d0
2667 movel %d0,%a1
2668
2669
2670
2671 moveq #PAGESIZE/PAGE_TABLE_SIZE/4-1,%d0
2672 1:
2673 movel %a0,%a1@+
2674 lea %a0@(PAGE_TABLE_SIZE*4),%a0
2675 dbra %d0,1b
2676
2677
2678
2679 movel ARG1,%a0
2680 movel %a0@,%d0
2681 2:
2682
2683
2684 andw #-PAGE_TABLE_SIZE,%d0
2685 movel %d0,%a0
2686 movel ARG2,%d0
2687 lea %a0@(%d0*4),%a0
2688
2689 #if 0
2690 dputn %a0
2691 dputc '\n'
2692 #endif
2693
2694 func_return mmu_get_page_table_entry
2695
2696
2697
2698
2699
2700
2701 func_start get_new_page,%d0/%a1
2702
2703 dputs "\nget_new_page:"
2704
2705
2706
2707 lea %pc@(L(memory_start)),%a0
2708 movel %a0@,%a1
2709 addl #PAGESIZE,%a0@
2710
2711
2712
2713 movel %a1,%a0
2714 movew #PAGESIZE/4-1,%d0
2715 1:
2716 clrl %a1@+
2717 dbra %d0,1b
2718
2719 dputn %a0
2720 dputc '\n'
2721
2722 func_return get_new_page
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732 #ifdef CONFIG_MAC
2733
2734 #define MAC_USE_SCC_A
2735 #define MAC_USE_SCC_B
2736
2737 #if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B)
2738
2739 L(scc_initable_mac):
2740 .byte 4,0x44
2741 .byte 3,0xc0
2742 .byte 5,0xe2
2743 .byte 10,0
2744 .byte 11,0x50
2745 .byte 12,1,13,0
2746 .byte 14,1
2747 .byte 3,0xc1
2748 .byte 5,0xea
2749 .byte -1
2750 .even
2751 #endif
2752 #endif
2753
2754 #ifdef CONFIG_ATARI
2755
2756
2757
2758 #define USE_MFP
2759
2760 #if defined(USE_SCC_A) || defined(USE_SCC_B)
2761
2762
2763 L(scc_initable_atari):
2764 .byte 4,0x44
2765 .byte 3,0xc0
2766 .byte 5,0xe2
2767 .byte 10,0
2768 .byte 11,0x50
2769 .byte 12,24,13,0
2770 .byte 14,2,14,3
2771 .byte 3,0xc1
2772 .byte 5,0xea
2773 .byte -1
2774 .even
2775 #endif
2776
2777 #ifdef USE_PRINTER
2778
2779 LPSG_SELECT = 0xff8800
2780 LPSG_READ = 0xff8800
2781 LPSG_WRITE = 0xff8802
2782 LPSG_IO_A = 14
2783 LPSG_IO_B = 15
2784 LPSG_CONTROL = 7
2785 LSTMFP_GPIP = 0xfffa01
2786 LSTMFP_DDR = 0xfffa05
2787 LSTMFP_IERB = 0xfffa09
2788
2789 #elif defined(USE_SCC_B)
2790
2791 LSCC_CTRL = 0xff8c85
2792 LSCC_DATA = 0xff8c87
2793
2794 #elif defined(USE_SCC_A)
2795
2796 LSCC_CTRL = 0xff8c81
2797 LSCC_DATA = 0xff8c83
2798
2799 #elif defined(USE_MFP)
2800
2801 LMFP_UCR = 0xfffa29
2802 LMFP_TDCDR = 0xfffa1d
2803 LMFP_TDDR = 0xfffa25
2804 LMFP_TSR = 0xfffa2d
2805 LMFP_UDR = 0xfffa2f
2806
2807 #endif
2808 #endif
2809
2810
2811
2812
2813
2814
2815
2816
2817 func_start serial_init,%d0/%d1/%a0/%a1
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833 #ifdef CONFIG_AMIGA
2834 #define SERIAL_DTR 7
2835 #define SERIAL_CNTRL CIABBASE+C_PRA
2836
2837 is_not_amiga(1f)
2838 lea %pc@(L(custom)),%a0
2839 movel #-ZTWOBASE,%a0@
2840 bclr #SERIAL_DTR,SERIAL_CNTRL-ZTWOBASE
2841 get_bi_record BI_AMIGA_SERPER
2842 movew %a0@,CUSTOMBASE+C_SERPER-ZTWOBASE
2843 | movew #61,CUSTOMBASE+C_SERPER-ZTWOBASE
2844 1:
2845 #endif
2846
2847 #ifdef CONFIG_ATARI
2848 is_not_atari(4f)
2849 movel %pc@(L(iobase)),%a1
2850 #if defined(USE_PRINTER)
2851 bclr #0,%a1@(LSTMFP_IERB)
2852 bclr #0,%a1@(LSTMFP_DDR)
2853 moveb #LPSG_CONTROL,%a1@(LPSG_SELECT)
2854 moveb #0xff,%a1@(LPSG_WRITE)
2855 moveb #LPSG_IO_B,%a1@(LPSG_SELECT)
2856 clrb %a1@(LPSG_WRITE)
2857 moveb #LPSG_IO_A,%a1@(LPSG_SELECT)
2858 moveb %a1@(LPSG_READ),%d0
2859 bset #5,%d0
2860 moveb %d0,%a1@(LPSG_WRITE)
2861 #elif defined(USE_SCC_A) || defined(USE_SCC_B)
2862 lea %a1@(LSCC_CTRL),%a0
2863
2864 moveb %a0@,%d0
2865
2866 moveb #9,%a0@
2867 moveb #0xc0,%a0@
2868
2869
2870 movel #32,%d0
2871 2:
2872 subq #1,%d0
2873 jne 2b
2874
2875 lea %pc@(L(scc_initable_atari)),%a1
2876 2: moveb %a1@+,%d0
2877 jmi 3f
2878 moveb %d0,%a0@
2879 moveb %a1@+,%a0@
2880 jra 2b
2881 3: clrb %a0@
2882 #elif defined(USE_MFP)
2883 bclr #1,%a1@(LMFP_TSR)
2884 moveb #0x88,%a1@(LMFP_UCR)
2885 andb #0x70,%a1@(LMFP_TDCDR)
2886 moveb #2,%a1@(LMFP_TDDR)
2887 orb #1,%a1@(LMFP_TDCDR)
2888 bset #1,%a1@(LMFP_TSR)
2889 #endif
2890 jra L(serial_init_done)
2891 4:
2892 #endif
2893
2894 #ifdef CONFIG_MAC
2895 is_not_mac(L(serial_init_not_mac))
2896 #if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B)
2897 #define mac_scc_cha_b_ctrl_offset 0x0
2898 #define mac_scc_cha_a_ctrl_offset 0x2
2899 #define mac_scc_cha_b_data_offset 0x4
2900 #define mac_scc_cha_a_data_offset 0x6
2901 movel %pc@(L(mac_sccbase)),%a0
2902
2903 moveb %a0@(mac_scc_cha_a_ctrl_offset),%d0
2904
2905 moveb #9,%a0@(mac_scc_cha_a_ctrl_offset)
2906 moveb #0xc0,%a0@(mac_scc_cha_a_ctrl_offset)
2907
2908
2909 movel #35,%d0
2910 5:
2911 subq #1,%d0
2912 jne 5b
2913 #endif
2914 #ifdef MAC_USE_SCC_A
2915
2916 lea %pc@(L(scc_initable_mac)),%a1
2917 5: moveb %a1@+,%d0
2918 jmi 6f
2919 moveb %d0,%a0@(mac_scc_cha_a_ctrl_offset)
2920 moveb %a1@+,%a0@(mac_scc_cha_a_ctrl_offset)
2921 jra 5b
2922 6:
2923 #endif
2924 #ifdef MAC_USE_SCC_B
2925
2926 lea %pc@(L(scc_initable_mac)),%a1
2927 7: moveb %a1@+,%d0
2928 jmi 8f
2929 moveb %d0,%a0@(mac_scc_cha_b_ctrl_offset)
2930 moveb %a1@+,%a0@(mac_scc_cha_b_ctrl_offset)
2931 jra 7b
2932 8:
2933 #endif
2934 jra L(serial_init_done)
2935 L(serial_init_not_mac):
2936 #endif
2937
2938 #ifdef CONFIG_Q40
2939 is_not_q40(2f)
2940
2941
2942 lea %pc@(q40_mem_cptr),%a1
2943 move.l #0xff020010,%a1@
2944 move.l #0xff020000,%a1
2945 cmp.b #'%',%a1@
2946 bne 2f
2947 addq.w #4,%a1
2948 cmp.b #'L',%a1@
2949 bne 2f
2950 addq.w #4,%a1
2951 cmp.b #'X',%a1@
2952 bne 2f
2953 addq.w #4,%a1
2954 cmp.b #'$',%a1@
2955 bne 2f
2956
2957 lea %pc@(L(q40_do_debug)),%a1
2958 tas %a1@
2959
2960 2:
2961 #endif
2962
2963 #ifdef CONFIG_MVME16x
2964 is_not_mvme16x(L(serial_init_not_mvme16x))
2965 moveb #0x10,M167_PCSCCMICR
2966 moveb #0x10,M167_PCSCCTICR
2967 moveb #0x10,M167_PCSCCRICR
2968 jra L(serial_init_done)
2969 L(serial_init_not_mvme16x):
2970 #endif
2971
2972 #ifdef CONFIG_APOLLO
2973
2974 #endif
2975
2976 #ifdef CONFIG_HP300
2977
2978 #endif
2979
2980 L(serial_init_done):
2981 func_return serial_init
2982
2983
2984
2985
2986 func_start serial_putc,%d0/%d1/%a0/%a1
2987
2988 movel ARG1,%d0
2989 cmpib #'\n',%d0
2990 jbne 1f
2991
2992
2993 serial_putc #'\r'
2994 1:
2995
2996 #ifdef CONFIG_AMIGA
2997 is_not_amiga(2f)
2998 andw #0x00ff,%d0
2999 oriw #0x0100,%d0
3000 movel %pc@(L(custom)),%a0
3001 movew %d0,%a0@(CUSTOMBASE+C_SERDAT)
3002 1: movew %a0@(CUSTOMBASE+C_SERDATR),%d0
3003 andw #0x2000,%d0
3004 jeq 1b
3005 jra L(serial_putc_done)
3006 2:
3007 #endif
3008
3009 #ifdef CONFIG_MAC
3010 is_not_mac(5f)
3011 #if defined(MAC_USE_SCC_A) || defined(MAC_USE_SCC_B)
3012 movel %pc@(L(mac_sccbase)),%a1
3013 #endif
3014 #ifdef MAC_USE_SCC_A
3015 3: btst #2,%a1@(mac_scc_cha_a_ctrl_offset)
3016 jeq 3b
3017 moveb %d0,%a1@(mac_scc_cha_a_data_offset)
3018 #endif
3019 #ifdef MAC_USE_SCC_B
3020 4: btst #2,%a1@(mac_scc_cha_b_ctrl_offset)
3021 jeq 4b
3022 moveb %d0,%a1@(mac_scc_cha_b_data_offset)
3023 #endif
3024 jra L(serial_putc_done)
3025 5:
3026 #endif
3027
3028 #ifdef CONFIG_ATARI
3029 is_not_atari(4f)
3030 movel %pc@(L(iobase)),%a1
3031 #if defined(USE_PRINTER)
3032 3: btst #0,%a1@(LSTMFP_GPIP)
3033 jne 3b
3034 moveb #LPSG_IO_B,%a1@(LPSG_SELECT)
3035 moveb %d0,%a1@(LPSG_WRITE)
3036 moveb #LPSG_IO_A,%a1@(LPSG_SELECT)
3037 moveb %a1@(LPSG_READ),%d0
3038 bclr #5,%d0
3039 moveb %d0,%a1@(LPSG_WRITE)
3040 nop
3041 nop
3042 bset #5,%d0
3043 moveb %d0,%a1@(LPSG_WRITE)
3044 #elif defined(USE_SCC_A) || defined(USE_SCC_B)
3045 3: btst #2,%a1@(LSCC_CTRL)
3046 jeq 3b
3047 moveb %d0,%a1@(LSCC_DATA)
3048 #elif defined(USE_MFP)
3049 3: btst #7,%a1@(LMFP_TSR)
3050 jeq 3b
3051 moveb %d0,%a1@(LMFP_UDR)
3052 #endif
3053 jra L(serial_putc_done)
3054 4:
3055 #endif
3056
3057 #ifdef CONFIG_MVME147
3058 is_not_mvme147(2f)
3059 1: btst #2,M147_SCC_CTRL_A
3060 jeq 1b
3061 moveb %d0,M147_SCC_DATA_A
3062 jbra L(serial_putc_done)
3063 2:
3064 #endif
3065
3066 #ifdef CONFIG_MVME16x
3067 is_not_mvme16x(2f)
3068
3069
3070
3071
3072
3073
3074
3075 moveml %d0-%d7/%a2-%a6,%sp@-
3076 movel vme_brdtype,%d1
3077 jeq 1f | No tag - use the Bug
3078 cmpi #VME_TYPE_MVME162,%d1
3079 jeq 6f
3080 cmpi #VME_TYPE_MVME172,%d1
3081 jne 5f
3082
3083 6: btst #2,M162_SCC_CTRL_A
3084 nop
3085 nop
3086 nop
3087 jeq 6b
3088 moveb #8,M162_SCC_CTRL_A
3089 nop
3090 nop
3091 nop
3092 moveb %d0,M162_SCC_CTRL_A
3093 jra 3f
3094 5:
3095
3096 moveb #0,M167_CYCAR
3097 moveb M167_CYIER,%d2
3098 moveb #0x02,M167_CYIER
3099 7:
3100 btst #5,M167_PCSCCTICR
3101 jeq 7b
3102 moveb M167_PCTPIACKR,%d1
3103 moveb M167_CYLICR,%d1
3104 jeq 8f
3105 moveb #0x08,M167_CYTEOIR
3106 jra 7b
3107 8:
3108 moveb %d0,M167_CYTDR
3109 moveb #0,M167_CYTEOIR
3110 moveb %d2,M167_CYIER
3111 jra 3f
3112 1:
3113 moveb %d0,%sp@-
3114 trap #15
3115 .word 0x0020
3116 3:
3117 moveml %sp@+,%d0-%d7/%a2-%a6
3118 jbra L(serial_putc_done)
3119 2:
3120 #endif
3121
3122 #ifdef CONFIG_BVME6000
3123 is_not_bvme6000(2f)
3124
3125
3126
3127 1: btst #2,BVME_SCC_CTRL_A
3128 jeq 1b
3129 moveb %d0,BVME_SCC_DATA_A
3130 jbra L(serial_putc_done)
3131 2:
3132 #endif
3133
3134 #ifdef CONFIG_SUN3X
3135 is_not_sun3x(2f)
3136 movel %d0,-(%sp)
3137 movel 0xFEFE0018,%a1
3138 jbsr (%a1)
3139 addq #4,%sp
3140 jbra L(serial_putc_done)
3141 2:
3142 #endif
3143
3144 #ifdef CONFIG_Q40
3145 is_not_q40(2f)
3146 tst.l %pc@(L(q40_do_debug))
3147 beq 2f
3148 lea %pc@(q40_mem_cptr),%a1
3149 move.l %a1@,%a0
3150 move.b %d0,%a0@
3151 addq.l #4,%a0
3152 move.l %a0,%a1@
3153 jbra L(serial_putc_done)
3154 2:
3155 #endif
3156
3157 #ifdef CONFIG_APOLLO
3158 is_not_apollo(2f)
3159 movl %pc@(L(iobase)),%a1
3160 moveb %d0,%a1@(LTHRB0)
3161 1: moveb %a1@(LSRB0),%d0
3162 andb #0x4,%d0
3163 beq 1b
3164 jbra L(serial_putc_done)
3165 2:
3166 #endif
3167
3168 #ifdef CONFIG_HP300
3169 is_not_hp300(3f)
3170 movl %pc@(L(iobase)),%a1
3171 addl %pc@(L(uartbase)),%a1
3172 movel %pc@(L(uart_scode)),%d1
3173 jmi 3f
3174 cmpi #256,%d1
3175 jeq 2f
3176 1: moveb %a1@(DCALSR),%d1
3177 andb #0x20,%d1
3178 beq 1b
3179 moveb %d0,%a1@(DCADATA)
3180 jbra L(serial_putc_done)
3181 2: moveb %a1@(APCILSR),%d1
3182 andb #0x20,%d1
3183 beq 2b
3184 moveb %d0,%a1@(APCIDATA)
3185 jbra L(serial_putc_done)
3186 3:
3187 #endif
3188
3189 L(serial_putc_done):
3190 func_return serial_putc
3191
3192
3193
3194
3195 func_start puts,%d0/%a0
3196
3197 movel ARG1,%a0
3198 jra 2f
3199 1:
3200 #ifdef CONSOLE_DEBUG
3201 console_putc %d0
3202 #endif
3203 #ifdef SERIAL_DEBUG
3204 serial_putc %d0
3205 #endif
3206 2: moveb %a0@+,%d0
3207 jne 1b
3208
3209 func_return puts
3210
3211
3212
3213
3214
3215 func_start putn,%d0-%d2
3216
3217 putc ' '
3218
3219 movel ARG1,%d0
3220 moveq #7,%d1
3221 1: roll #4,%d0
3222 move %d0,%d2
3223 andb #0x0f,%d2
3224 addb #'0',%d2
3225 cmpb #'9',%d2
3226 jls 2f
3227 addb #'A'-('9'+1),%d2
3228 2:
3229 #ifdef CONSOLE_DEBUG
3230 console_putc %d2
3231 #endif
3232 #ifdef SERIAL_DEBUG
3233 serial_putc %d2
3234 #endif
3235 dbra %d1,1b
3236
3237 func_return putn
3238
3239 #ifdef CONFIG_EARLY_PRINTK
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251 ENTRY(debug_cons_nputs)
3252 moveml %d0/%d1/%a0,%sp@-
3253 movew %sr,%sp@-
3254 ori #0x0700,%sr
3255 movel %sp@(18),%a0
3256 movel %sp@(22),%d1
3257 jra 2f
3258 1:
3259 #ifdef CONSOLE_DEBUG
3260 console_putc %d0
3261 #endif
3262 #ifdef SERIAL_DEBUG
3263 serial_putc %d0
3264 #endif
3265 subq #1,%d1
3266 2: jeq 3f
3267 moveb %a0@+,%d0
3268 jne 1b
3269 3:
3270 movew %sp@+,%sr
3271 moveml %sp@+,%d0/%d1/%a0
3272 rts
3273 #endif
3274
3275 #if defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
3276 func_start set_leds,%d0/%a0
3277 movel ARG1,%d0
3278 #ifdef CONFIG_HP300
3279 is_not_hp300(1f)
3280 movel %pc@(L(iobase)),%a0
3281 moveb %d0,%a0@(0x1ffff)
3282 jra 2f
3283 #endif
3284 1:
3285 #ifdef CONFIG_APOLLO
3286 movel %pc@(L(iobase)),%a0
3287 lsll #8,%d0
3288 eorw #0xff00,%d0
3289 moveb %d0,%a0@(LCPUCTRL)
3290 #endif
3291 2:
3292 func_return set_leds
3293 #endif
3294
3295 #ifdef CONSOLE_DEBUG
3296
3297
3298
3299
3300 #define Lconsole_struct_cur_column 0
3301 #define Lconsole_struct_cur_row 4
3302 #define Lconsole_struct_num_columns 8
3303 #define Lconsole_struct_num_rows 12
3304 #define Lconsole_struct_left_edge 16
3305
3306 func_start console_init,%a0-%a4/%d0-%d7
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321 lea %pc@(L(console_globals)),%a2
3322 movel %pc@(L(mac_videobase)),%a1
3323 movel %pc@(L(mac_rowbytes)),%d5
3324 movel %pc@(L(mac_dimensions)),%d3
3325 movel %d3,%d4
3326 swap %d4
3327 andl #0xffff,%d3
3328 andl #0xffff,%d4
3329
3330 movel %d5,%d6
3331 | subl #20,%d6
3332 mulul %d4,%d6
3333 divul #8,%d6
3334 moveq #-1,%d0
3335 subq #1,%d6
3336
3337 L(console_clear_loop):
3338 movel %d0,%a1@+
3339 movel %d0,%a1@+
3340 dbra %d6,L(console_clear_loop)
3341
3342
3343
3344 #if defined(FONT_8x8) && defined(CONFIG_FONT_8x8)
3345 lea %pc@(font_vga_8x8),%a0
3346 #elif defined(FONT_8x16) && defined(CONFIG_FONT_8x16)
3347 lea %pc@(font_vga_8x16),%a0
3348 #elif defined(FONT_6x11) && defined(CONFIG_FONT_6x11)
3349 lea %pc@(font_vga_6x11),%a0
3350 #elif defined(CONFIG_FONT_8x8)
3351 lea %pc@(font_vga_8x8),%a0
3352 #else
3353 lea 0,%a0
3354 #endif
3355
3356
3357
3358
3359
3360 lea %pc@(L(console_font)),%a1
3361 movel %a0,%a1@
3362 tstl %a0
3363 jeq 1f
3364 lea %pc@(L(console_font_data)),%a4
3365 movel %a0@(FONT_DESC_DATA),%d0
3366 subl #L(console_font),%a1
3367 addl %a1,%d0
3368 movel %d0,%a4@
3369
3370
3371
3372
3373
3374
3375
3376
3377 movel %d3,%d0
3378 divul %a0@(FONT_DESC_WIDTH),%d0
3379
3380 movel %d4,%d1
3381 divul %a0@(FONT_DESC_HEIGHT),%d1
3382
3383 movel %d0,%a2@(Lconsole_struct_num_columns)
3384 movel %d1,%a2@(Lconsole_struct_num_rows)
3385
3386
3387
3388
3389 clrl %a2@(Lconsole_struct_cur_column)
3390 clrl %a2@(Lconsole_struct_cur_row)
3391 clrl %a2@(Lconsole_struct_left_edge)
3392
3393
3394
3395
3396 1:
3397 func_return console_init
3398
3399 #ifdef CONFIG_LOGO
3400 func_start console_put_penguin,%a0-%a1/%d0-%d7
3401
3402
3403
3404
3405 lea %pc@(L(mac_dimensions)),%a0
3406 movel %a0@,%d0
3407 andil #0xffff,%d0
3408 subil #64,%d0
3409 clrl %d1
3410 movel #73,%d7
3411 lea %pc@(L(that_penguin)),%a1
3412 L(console_penguin_row):
3413 movel #31,%d6
3414 L(console_penguin_pixel_pair):
3415 moveb %a1@,%d2
3416 lsrb #4,%d2
3417 console_plot_pixel %d0,%d1,%d2
3418 addq #1,%d0
3419 moveb %a1@+,%d2
3420 console_plot_pixel %d0,%d1,%d2
3421 addq #1,%d0
3422 dbra %d6,L(console_penguin_pixel_pair)
3423
3424 subil #64,%d0
3425 addq #1,%d1
3426 dbra %d7,L(console_penguin_row)
3427
3428 func_return console_put_penguin
3429
3430
3431 L(that_penguin):
3432 #include "../mac/mac_penguin.S"
3433 #endif
3434
3435
3436
3437
3438
3439
3440
3441 func_start console_scroll,%a0-%a4/%d0-%d7
3442 lea %pc@(L(mac_videobase)),%a0
3443 movel %a0@,%a1
3444 movel %a1,%a2
3445 lea %pc@(L(mac_rowbytes)),%a0
3446 movel %a0@,%d5
3447 movel %pc@(L(console_font)),%a0
3448 tstl %a0
3449 jeq 1f
3450 mulul %a0@(FONT_DESC_HEIGHT),%d5
3451 addal %d5,%a2
3452
3453
3454
3455
3456 lea %pc@(L(mac_dimensions)),%a0
3457 movel %a0@,%d3
3458 movel %d3,%d4
3459 swap %d4
3460 andl #0xffff,%d3
3461 andl #0xffff,%d4
3462
3463
3464
3465
3466 lea %pc@(L(mac_rowbytes)),%a0
3467 movel %a0@,%d6
3468 movel %pc@(L(console_font)),%a0
3469 subl %a0@(FONT_DESC_HEIGHT),%d4
3470 mulul %d4,%d6
3471 divul #32,%d6
3472 subq #1,%d6
3473
3474 L(console_scroll_loop):
3475 movel %a2@+,%a1@+
3476 movel %a2@+,%a1@+
3477 movel %a2@+,%a1@+
3478 movel %a2@+,%a1@+
3479 movel %a2@+,%a1@+
3480 movel %a2@+,%a1@+
3481 movel %a2@+,%a1@+
3482 movel %a2@+,%a1@+
3483 dbra %d6,L(console_scroll_loop)
3484
3485 lea %pc@(L(mac_rowbytes)),%a0
3486 movel %a0@,%d6
3487 movel %pc@(L(console_font)),%a0
3488 mulul %a0@(FONT_DESC_HEIGHT),%d6
3489 divul #32,%d6
3490 subq #1,%d6
3491
3492 moveq #-1,%d0
3493 L(console_scroll_clear_loop):
3494 movel %d0,%a1@+
3495 movel %d0,%a1@+
3496 movel %d0,%a1@+
3497 movel %d0,%a1@+
3498 movel %d0,%a1@+
3499 movel %d0,%a1@+
3500 movel %d0,%a1@+
3501 movel %d0,%a1@+
3502 dbra %d6,L(console_scroll_clear_loop)
3503
3504 1:
3505 func_return console_scroll
3506
3507
3508 func_start console_putc,%a0/%a1/%d0-%d7
3509
3510 is_not_mac(L(console_exit))
3511 tstl %pc@(L(console_font))
3512 jeq L(console_exit)
3513
3514
3515
3516 movel ARG1,%d7
3517 cmpib #'\n',%d7
3518 jbne 1f
3519
3520
3521 console_putc #'\r'
3522 1:
3523 lea %pc@(L(console_globals)),%a0
3524
3525 cmpib #10,%d7
3526 jne L(console_not_lf)
3527 movel %a0@(Lconsole_struct_cur_row),%d0
3528 addil #1,%d0
3529 movel %d0,%a0@(Lconsole_struct_cur_row)
3530 movel %a0@(Lconsole_struct_num_rows),%d1
3531 cmpl %d1,%d0
3532 jcs 1f
3533 subil #1,%d0
3534 movel %d0,%a0@(Lconsole_struct_cur_row)
3535 console_scroll
3536 1:
3537 jra L(console_exit)
3538
3539 L(console_not_lf):
3540 cmpib #13,%d7
3541 jne L(console_not_cr)
3542 clrl %a0@(Lconsole_struct_cur_column)
3543 jra L(console_exit)
3544
3545 L(console_not_cr):
3546 cmpib #1,%d7
3547 jne L(console_not_home)
3548 clrl %a0@(Lconsole_struct_cur_row)
3549 clrl %a0@(Lconsole_struct_cur_column)
3550 jra L(console_exit)
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561 L(console_not_home):
3562 movel %a0@(Lconsole_struct_cur_column),%d0
3563 addql #1,%a0@(Lconsole_struct_cur_column)
3564 movel %a0@(Lconsole_struct_num_columns),%d1
3565 cmpl %d1,%d0
3566 jcs 1f
3567 console_putc #'\n'
3568 1:
3569 movel %a0@(Lconsole_struct_cur_row),%d1
3570
3571
3572
3573
3574
3575 movel %pc@(L(console_font)),%a0
3576 movel %pc@(L(console_font_data)),%a1
3577 andl #0x000000ff,%d7
3578
3579 mulul %a0@(FONT_DESC_HEIGHT),%d7
3580 addl %d7,%a1
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592 mulul %a0@(FONT_DESC_WIDTH),%d0
3593 mulul %a0@(FONT_DESC_HEIGHT),%d1
3594 movel %a0@(FONT_DESC_HEIGHT),%d7
3595 subq #1,%d7
3596 L(console_read_char_scanline):
3597 moveb %a1@+,%d3
3598
3599
3600 movel %a0@(FONT_DESC_WIDTH),%d6
3601 subql #1,%d6
3602
3603 L(console_do_font_scanline):
3604 lslb #1,%d3
3605 scsb %d2
3606 console_plot_pixel %d0,%d1,%d2
3607 addq #1,%d0
3608 dbra %d6,L(console_do_font_scanline)
3609
3610
3611 subl %a0@(FONT_DESC_WIDTH),%d0
3612 addq #1,%d1
3613 dbra %d7,L(console_read_char_scanline)
3614
3615 L(console_exit):
3616 func_return console_putc
3617
3618
3619
3620
3621
3622
3623
3624
3625 func_start console_plot_pixel,%a0-%a1/%d0-%d4
3626
3627 movel %pc@(L(mac_videobase)),%a1
3628 movel %pc@(L(mac_videodepth)),%d3
3629 movel ARG1,%d0
3630 movel ARG2,%d1
3631 mulul %pc@(L(mac_rowbytes)),%d1
3632 movel ARG3,%d2
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642 L(test_1bit):
3643 cmpb #1,%d3
3644 jbne L(test_2bit)
3645 movel %d0,%d4
3646 divul #8,%d0
3647 addal %d0,%a1
3648 addal %d1,%a1
3649 andb #7,%d4
3650 eorb #7,%d4
3651 andb #1,%d2
3652 jbne L(white_1)
3653 bsetb %d4,%a1@
3654 jbra L(console_plot_pixel_exit)
3655 L(white_1):
3656 bclrb %d4,%a1@
3657 jbra L(console_plot_pixel_exit)
3658
3659 L(test_2bit):
3660 cmpb #2,%d3
3661 jbne L(test_4bit)
3662 movel %d0,%d4
3663 divul #4,%d0
3664 addal %d0,%a1
3665 addal %d1,%a1
3666 andb #3,%d4
3667 eorb #3,%d4
3668 lsll #1,%d4
3669 andb #1,%d2
3670 jbne L(white_2)
3671 bsetb %d4,%a1@
3672 addq #1,%d4
3673 bsetb %d4,%a1@
3674 jbra L(console_plot_pixel_exit)
3675 L(white_2):
3676 bclrb %d4,%a1@
3677 addq #1,%d4
3678 bclrb %d4,%a1@
3679 jbra L(console_plot_pixel_exit)
3680
3681 L(test_4bit):
3682 cmpb #4,%d3
3683 jbne L(test_8bit)
3684 movel %d0,%d4
3685 divul #2,%d0
3686 addal %d0,%a1
3687 addal %d1,%a1
3688 andb #1,%d4
3689 eorb #1,%d4
3690 lsll #2,%d4
3691 andb #1,%d2
3692 jbne L(white_4)
3693 bsetb %d4,%a1@
3694 addq #1,%d4
3695 bsetb %d4,%a1@
3696 addq #1,%d4
3697 bsetb %d4,%a1@
3698 addq #1,%d4
3699 bsetb %d4,%a1@
3700 jbra L(console_plot_pixel_exit)
3701 L(white_4):
3702 bclrb %d4,%a1@
3703 addq #1,%d4
3704 bclrb %d4,%a1@
3705 addq #1,%d4
3706 bclrb %d4,%a1@
3707 addq #1,%d4
3708 bclrb %d4,%a1@
3709 jbra L(console_plot_pixel_exit)
3710
3711 L(test_8bit):
3712 cmpb #8,%d3
3713 jbne L(test_16bit)
3714 addal %d0,%a1
3715 addal %d1,%a1
3716 andb #1,%d2
3717 jbne L(white_8)
3718 moveb #0xff,%a1@
3719 jbra L(console_plot_pixel_exit)
3720 L(white_8):
3721 clrb %a1@
3722 jbra L(console_plot_pixel_exit)
3723
3724 L(test_16bit):
3725 cmpb #16,%d3
3726 jbne L(console_plot_pixel_exit)
3727 addal %d0,%a1
3728 addal %d0,%a1
3729 addal %d1,%a1
3730 andb #1,%d2
3731 jbne L(white_16)
3732 clrw %a1@
3733 jbra L(console_plot_pixel_exit)
3734 L(white_16):
3735 movew #0x0fff,%a1@
3736 jbra L(console_plot_pixel_exit)
3737
3738 L(console_plot_pixel_exit):
3739 func_return console_plot_pixel
3740 #endif
3741
3742
3743 __INITDATA
3744 .align 4
3745
3746 m68k_init_mapped_size:
3747 .long 0
3748
3749 #if defined(CONFIG_ATARI) || defined(CONFIG_AMIGA) || \
3750 defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
3751 L(custom):
3752 L(iobase):
3753 .long 0
3754 #endif
3755
3756 #ifdef CONSOLE_DEBUG
3757 L(console_globals):
3758 .long 0
3759 .long 0
3760 .long 0
3761 .long 0
3762 .long 0
3763 L(console_font):
3764 .long 0
3765 L(console_font_data):
3766 .long 0
3767 #endif
3768
3769 #if defined(MMU_PRINT)
3770 L(mmu_print_data):
3771 .long 0
3772 .long 0
3773 .long 0
3774 .long 0
3775 .long 0
3776 #endif
3777
3778 L(cputype):
3779 .long 0
3780 L(mmu_cached_pointer_tables):
3781 .long 0
3782 L(mmu_num_pointer_tables):
3783 .long 0
3784 L(phys_kernel_start):
3785 .long 0
3786 L(kernel_end):
3787 .long 0
3788 L(memory_start):
3789 .long 0
3790 L(kernel_pgdir_ptr):
3791 .long 0
3792 L(temp_mmap_mem):
3793 .long 0
3794
3795 #if defined (CONFIG_MVME147)
3796 M147_SCC_CTRL_A = 0xfffe3002
3797 M147_SCC_DATA_A = 0xfffe3003
3798 #endif
3799
3800 #if defined (CONFIG_MVME16x)
3801 M162_SCC_CTRL_A = 0xfff45005
3802 M167_CYCAR = 0xfff450ee
3803 M167_CYIER = 0xfff45011
3804 M167_CYLICR = 0xfff45026
3805 M167_CYTEOIR = 0xfff45085
3806 M167_CYTDR = 0xfff450f8
3807 M167_PCSCCMICR = 0xfff4201d
3808 M167_PCSCCTICR = 0xfff4201e
3809 M167_PCSCCRICR = 0xfff4201f
3810 M167_PCTPIACKR = 0xfff42025
3811 #endif
3812
3813 #if defined (CONFIG_BVME6000)
3814 BVME_SCC_CTRL_A = 0xffb0000b
3815 BVME_SCC_DATA_A = 0xffb0000f
3816 #endif
3817
3818 #if defined(CONFIG_MAC)
3819 L(mac_videobase):
3820 .long 0
3821 L(mac_videodepth):
3822 .long 0
3823 L(mac_dimensions):
3824 .long 0
3825 L(mac_rowbytes):
3826 .long 0
3827 L(mac_sccbase):
3828 .long 0
3829 #endif
3830
3831 #if defined (CONFIG_APOLLO)
3832 LSRB0 = 0x10412
3833 LTHRB0 = 0x10416
3834 LCPUCTRL = 0x10100
3835 #endif
3836
3837 #if defined(CONFIG_HP300)
3838 DCADATA = 0x11
3839 DCALSR = 0x1b
3840 APCIDATA = 0x00
3841 APCILSR = 0x14
3842 L(uartbase):
3843 .long 0
3844 L(uart_scode):
3845 .long -1
3846 #endif
3847
3848 __FINIT
3849 .data
3850 .align 4
3851
3852 availmem:
3853 .long 0
3854 m68k_pgtable_cachemode:
3855 .long 0
3856 m68k_supervisor_cachemode:
3857 .long 0
3858 #if defined(CONFIG_MVME16x)
3859 mvme_bdid:
3860 .long 0,0,0,0,0,0,0,0
3861 #endif
3862 #if defined(CONFIG_Q40)
3863 q40_mem_cptr:
3864 .long 0
3865 L(q40_do_debug):
3866 .long 0
3867 #endif