Lines Matching +full:no +full:- +full:pc +full:- +full:write

1 /* -*- mode: asm -*-
3 ** head.S -- This file contains the initial boot code for the
19 ** ++ Bjoern & Roman: ATARI-68040 support for the Medusa
22 ** Magnum- and FX-alternate ram
25 ** for linux-2.1.115
53 * 1) Remove register dependency through-out the file.
61 * write-ups on the structure of the file, and the features of the
65 * ------------------
74 * actual per-machine specific code very simple.
77 * (the same for all machines) and mapping machine-specific I/O
87 * others will plug-in support for specific machines.
92 * -------
106 * ------------------------
108 * -----------------------
110 * ------------------------
133 * ----------
145 * ---------
153 * ------------
156 * #ifdef / #endif clauses so it doesn't have to ship in known-good
167 * -------------------
173 * --------------
179 * -------------
193 * -------
240 * coded value. (But, you will notice the code is run-time
249 * USE_MFP: Use the ST-MFP port (Modem1) for serial debug.
260 #include <asm/bootinfo-amiga.h>
261 #include <asm/bootinfo-atari.h>
262 #include <asm/bootinfo-hp300.h>
263 #include <asm/bootinfo-mac.h>
264 #include <asm/bootinfo-q40.h>
265 #include <asm/bootinfo-virt.h>
266 #include <asm/bootinfo-vme.h>
270 #include <asm/asm-offsets.h>
322 TTR_RW = 0x0200 /* read/write mode */
323 TTR_RWM = 0x0100 /* read/write mask */
336 CC6_HALF_D = 0x08000000 /* half-cache mode for data cache (68060) */
342 CC6_HALF_I = 0x00002000 /* half-cache mode for instruction cache (68060) */
343 CC3_ALLOC_WRITE = 0x00002000 /* write allocate mode(68030) */
381 /* The __INITDATA stuff is a no-op when ftrace or kgdb are turned on */
388 * - func_start marks the beginning of the routine which setups the frame
391 * - func_return marks the end of the routine and simply calls the prepared
393 * - func_define generates another macro to automatically put arguments
410 linkw %a6,#-\stack
411 moveml \saveregs,%sp@-
412 .set stackstart,-\stack
431 move_stack "(\nr-1)",\arg2,\arg3,\arg4
432 movel \arg1,%sp@-
513 pea %pc@(.Lstr\@)
525 #define is_not_amiga(lab) cmpl &MACH_AMIGA,%pc@(m68k_machtype); jne lab
526 #define is_not_atari(lab) cmpl &MACH_ATARI,%pc@(m68k_machtype); jne lab
527 #define is_not_mac(lab) cmpl &MACH_MAC,%pc@(m68k_machtype); jne lab
528 #define is_not_mvme147(lab) cmpl &MACH_MVME147,%pc@(m68k_machtype); jne lab
529 #define is_not_mvme16x(lab) cmpl &MACH_MVME16x,%pc@(m68k_machtype); jne lab
530 #define is_not_bvme6000(lab) cmpl &MACH_BVME6000,%pc@(m68k_machtype); jne lab
531 #define is_mvme147(lab) cmpl &MACH_MVME147,%pc@(m68k_machtype); jeq lab
532 #define is_mvme16x(lab) cmpl &MACH_MVME16x,%pc@(m68k_machtype); jeq lab
533 #define is_bvme6000(lab) cmpl &MACH_BVME6000,%pc@(m68k_machtype); jeq lab
534 #define is_not_hp300(lab) cmpl &MACH_HP300,%pc@(m68k_machtype); jne lab
535 #define is_not_apollo(lab) cmpl &MACH_APOLLO,%pc@(m68k_machtype); jne lab
536 #define is_not_q40(lab) cmpl &MACH_Q40,%pc@(m68k_machtype); jne lab
537 #define is_not_sun3x(lab) cmpl &MACH_SUN3X,%pc@(m68k_machtype); jne lab
538 #define is_not_virt(lab) cmpl &MACH_VIRT,%pc@(m68k_machtype); jne lab
540 #define hasnt_leds(lab) cmpl &MACH_HP300,%pc@(m68k_machtype); \
542 cmpl &MACH_APOLLO,%pc@(m68k_machtype); \
546 #define is_040_or_060(lab) btst &CPUTYPE_0460,%pc@(L(cputype)+3); jne lab
547 #define is_not_040_or_060(lab) btst &CPUTYPE_0460,%pc@(L(cputype)+3); jeq lab
548 #define is_040(lab) btst &CPUTYPE_040,%pc@(L(cputype)+3); jne lab
549 #define is_060(lab) btst &CPUTYPE_060,%pc@(L(cputype)+3); jne lab
550 #define is_not_060(lab) btst &CPUTYPE_060,%pc@(L(cputype)+3); jeq lab
551 #define is_020(lab) btst &CPUTYPE_020,%pc@(L(cputype)+3); jne lab
552 #define is_not_020(lab) btst &CPUTYPE_020,%pc@(L(cputype)+3); jeq lab
554 /* On the HP300 we use the on-board LEDs for debug output before
556 _off_ - on the 340 bit 7 is towards the back panel of the machine. */
598 lea %pc@(_stext),%sp
604 lea %pc@(m68k_machtype),%a1
608 lea %pc@(m68k_fputype),%a1
612 lea %pc@(m68k_mmutype),%a1
616 lea %pc@(m68k_cputype),%a1
630 lea %pc@(L(mac_videobase)),%a1
634 lea %pc@(L(mac_videodepth)),%a1
638 lea %pc@(L(mac_dimensions)),%a1
642 lea %pc@(L(mac_rowbytes)),%a1
646 lea %pc@(L(mac_sccbase)),%a1
656 lea %pc@(L(virt_gf_tty_base)),%a1
667 movel %pc@(m68k_cputype),%d0
702 lea %pc@(L(cputype)),%a0
727 * d1 := cacheable write-through
728 * NOTE: The 68040 manual strongly recommends non-cached for MMU tables,
729 * but we have been using write-through since at least 2.0.29 so I
735 * problems, then supervisor memory accesses need to be write-through
751 lea %pc@(m68k_supervisor_cachemode),%a0
753 lea %pc@(m68k_pgtable_cachemode),%a0
771 same behaviour (0x0..0x7 are no ROM shadow). So we have to do
789 lea %pc@(atari_mch_type),%a0
793 * serial port. There are no I/O regs at 0x00ffxxxx at all. */
798 1: lea %pc@(L(iobase)),%a0
819 lea %pc@(vme_brdtype),%a0
834 movel %d2,%sp@-
836 .word 0x70 /* trap 0x70 - .BRD_ID */
839 lea %pc@(mvme_bdid),%a1
863 lea %pc@(L(uartbase)),%a0
869 lea %pc@(L(uart_scode)),%a0
898 dputn %pc@(L(cputype))
899 dputn %pc@(m68k_supervisor_cachemode)
900 dputn %pc@(m68k_pgtable_cachemode)
906 lea %pc@(L(phys_kernel_start)),%a0
907 lea %pc@(_stext),%a1
934 lea %pc@(m68k_init_mapped_size),%a0
936 mmu_map #PAGE_OFFSET,%pc@(L(phys_kernel_start)),%d1,\
937 %pc@(m68k_supervisor_cachemode)
988 0xffxxxxxx -> 0x00xxxxxx). For this, an additional pointer table is
989 needed. I/O ranges are marked non-cachable.
992 (i.e. 0xffxxxxxx -> 0xffxxxxxx), because some I/O registers are
999 /* I/O base addr for non-Medusa, non-Hades: 0x00000000 */
1001 movel %pc@(atari_mch_type),%d3
1011 /* Map everything non-cacheable, though not all parts really
1033 * add transparent mapping for 0xff00 0000 - 0xffff ffff
1034 * non-cached serialized etc..
1036 * 0xfe000000-0xfeffffff is for screen and ROM
1053 * by mapping 32MB (on 020/030) or 16 MB (on 040) from 0xf0xxxxxx -> 0x00xxxxxx).
1085 * so we can access on-board i/o areas.
1108 * PROM is 0xff800000->0xffbfffff and SRAM is
1109 * 0xffe00000->0xffe1ffff.
1127 * so we can access on-board i/o areas.
1183 * Mac Note: screen address of logical 0xF000.0000 -> <screen physical>
1188 andl %pc@(L(mac_videobase)),%d0
1208 * from 8k -> 4k pages as we go.
1220 andl #PTR_TABLE_SIZE-1, %d0
1226 andl #PAGE_TABLE_SIZE-1, %d0
1233 movel #((0x200000 >> 13)-1), %d1
1277 * tables should be non-cacheable on a '040 and write-through on a
1279 * experience, showed that write-through also works on a '040.
1296 movel %pc@(L(phys_kernel_start)),%d0
1298 lea %pc@(_stext),%a0
1302 movel %pc@(L(kernel_end)),%a0
1304 movel %pc@(L(memory_start)),%a1
1330 * the kernel of which there are two sub-possibilities:
1331 * A. The PC maps to the correct instruction (logical PC == physical
1333 * B. The PC does not map through and the processor will read some
1352 * you designed today, but I'm sure it wasn't good."). -- rst]
1357 * the physical location of the pc. And, create a transparent
1359 * is engaged, the PC can be moved up into the 0x8000.0000 range
1361 * the PC can jump to the correct logical location and it will be
1365 * is made in page 0 (an as of yet unused location -- except for the
1387 * After this point no new memory is allocated and
1415 movel %pc@(L(phys_kernel_start)),%d0
1533 * Returns: d0: size (-1 if not found)
1534 * a0: data pointer (end-of-records if not found)
1539 lea %pc@(_end),%a0
1550 3: moveq #-1,%d0
1563 * a hierarchical translation mechanism where the high-order
1599 * bits 31..26 - index into the Root Table
1600 * bits 25..18 - index into the Pointer Table
1601 * bits 17..12 - index into the Page Table
1602 * bits 11..0 - offset into a particular 4K page
1635 #define MMU_PRINT_INVALID -1
1641 func_start mmu_print,%a0-%a6/%d0-%d7
1643 movel %pc@(L(kernel_pgdir_ptr)),%a5
1644 lea %pc@(L(mmu_print_data)),%a0
1719 lea %pc@(kernel_pg_dir),%a5
1757 moveml %d0-%d1,%sp@-
1761 lea %pc@(mmu_040_print_flags),%a6
1763 moveml %sp@+,%d0-%d1
1784 jbeq 1f /* No, bail out */
1798 jbeq 1f /* No, bail out */
1823 putZc('w','c') /* write through or copy-back */
1828 putZc('s',' ') /* serialized non-cacheable, or non-cacheable */
1834 putZc('C','I') /* write through or copy-back */
1854 jbeq 1f /* no */
1871 jbeq 1f /* no */
1914 moveml %d0-%d1,%sp@-
1917 lea %pc@(mmu_030_print_flags),%a6
1919 moveml %sp@+,%d0-%d1
1923 moveml %a0/%d7,%sp@-
1925 lea %pc@(L(mmu_print_data)),%a0
1941 moveml %d0-%d7/%a0,%sp@-
1943 lea %pc@(L(mmu_print_data)),%a0
1953 puts "->"
1970 moveml %sp@+,%d0-%d7/%a0
2033 moveq #-1,%d0
2051 /* set 030 specific bits (read/write access for supervisor mode
2108 * routines in the case of a run-time error. For example,
2111 * NOTE-2
2116 func_start mmu_map,%d0-%d4/%a0-%a4
2128 andl #-(PAGESIZE*PAGE_TABLE_SIZE),%d0
2140 andl #-(PAGESIZE*PAGE_TABLE_SIZE),%d0
2185 andl #PTR_TABLE_SIZE-1,%d0
2193 andl #PAGE_TABLE_SIZE-1,%d0
2196 /* The page table entry must not no be busy
2210 lea %a3@(-1),%a0
2227 andl #(PTR_TABLE_SIZE*PAGE_TABLE_SIZE*PAGESIZE-1)&(-ROOT_TABLE_SIZE),%d0
2232 lea %a3@(PTR_TABLE_SIZE*PAGE_TABLE_SIZE*PAGESIZE-1),%a1
2238 /* The root table entry must not no be busy
2261 andl #PTR_TABLE_SIZE-1,%d0
2264 /* The pointer table entry must not no be busy
2283 lea %a3@(-1),%a0
2323 andl #PTR_TABLE_SIZE-1,%d0
2331 andl #PAGE_TABLE_SIZE-1,%d0
2336 orl %pc@(m68k_pgtable_cachemode),%d0
2357 lea %pc@(L(temp_mmap_mem)),%a1
2369 cmpl %pc@(L(memory_start)),%d0
2383 andw #-ROOT_TABLE_SIZE,%d0
2391 andl #PTR_TABLE_SIZE-1,%d0
2413 andw #-PTR_TABLE_SIZE,%d0
2421 andl #PAGE_TABLE_SIZE-1,%d0
2428 andw #-PAGESIZE,%d0
2437 func_start mmu_engage,%d0-%d2/%a0-%a3
2439 moveq #ROOT_TABLE_SIZE-1,%d0
2441 lea %pc@(L(kernel_pgdir_ptr)),%a0
2443 movel %pc@(L(memory_start)),%a1
2450 lea %pc@(L(temp_mmap_mem)),%a0
2453 movew #PAGESIZE-1,%d0
2458 lea %pc@(1b),%a0
2472 movel %pc@(L(memory_start)),%a3
2473 movel %pc@(L(phys_kernel_start)),%d2
2501 lea %pc@(L(mmu_engage_030_temp)),%a0
2540 movel %pc@(L(kernel_pgdir_ptr)),%a0
2551 addw #PAGESIZE-1,%a0
2553 andw #-PAGESIZE,%d0
2557 lea %pc@(L(memory_start)),%a0
2559 lea %pc@(L(kernel_end)),%a0
2566 lea %pc@(_stext),%a0
2567 lea %pc@(L(mmu_cached_pointer_tables)),%a1
2571 lea %pc@(L(mmu_num_pointer_tables)),%a1
2577 movew #PAGESIZE/4-1,%d0
2582 lea %pc@(L(kernel_pgdir_ptr)),%a1
2616 lea %pc@(L(mmu_num_pointer_tables)),%a0
2622 lea %pc@(L(mmu_cached_pointer_tables)),%a1
2647 andw #-PTR_TABLE_SIZE,%d0
2683 andw #-(PAGESIZE/PAGE_TABLE_SIZE),%d0
2688 moveq #PAGESIZE/PAGE_TABLE_SIZE/4-1,%d0
2701 andw #-PAGE_TABLE_SIZE,%d0
2724 lea %pc@(L(memory_start)),%a0
2731 movew #PAGESIZE/4-1,%d0
2757 .byte 4,0x44 /* x16, 1 stopbit, no parity */
2766 .byte -1
2781 .byte 4,0x44 /* x16, 1 stopbit, no parity */
2790 .byte -1
2855 lea %pc@(L(custom)),%a0
2856 movel #-ZTWOBASE,%a0@
2857 bclr #SERIAL_DTR,SERIAL_CNTRL-ZTWOBASE
2859 movew %a0@,CUSTOMBASE+C_SERPER-ZTWOBASE
2860 | movew #61,CUSTOMBASE+C_SERPER-ZTWOBASE
2866 movel %pc@(L(iobase)),%a1
2882 /* Reset SCC device: write register pointer then register value */
2892 lea %pc@(L(scc_initable_atari)),%a1
2918 movel %pc@(L(mac_sccbase)),%a0
2921 /* Reset SCC device: write register pointer then register value */
2933 lea %pc@(L(scc_initable_mac)),%a1
2943 lea %pc@(L(scc_initable_mac)),%a1
2958 - check for '%LX$' signature in SRAM */
2959 lea %pc@(q40_mem_cptr),%a1
2960 move.l #0xff020010,%a1@ /* must be inited - also used by debug=mem */
2974 lea %pc@(L(q40_do_debug)),%a1
3017 movel %pc@(L(custom)),%a0
3029 movel %pc@(L(mac_sccbase)),%a1
3047 movel %pc@(L(iobase)),%a1
3090 * the SRAM, which is non-standard.
3092 moveml %d0-%d7/%a2-%a6,%sp@-
3094 jeq 1f | No tag - use the Bug
3130 moveb %d0,%sp@-
3134 moveml %sp@+,%d0-%d7/%a2-%a6
3153 movel %d0,-(%sp)
3163 tst.l %pc@(L(q40_do_debug)) /* only debug if requested */
3165 lea %pc@(q40_mem_cptr),%a1
3176 movl %pc@(L(iobase)),%a1
3187 movl %pc@(L(iobase)),%a1
3188 addl %pc@(L(uartbase)),%a1
3189 movel %pc@(L(uart_scode)),%d1 /* Check the scode */
3240 func_start putn,%d0-%d2
3252 addb #'A'-('9'+1),%d2
3277 moveml %d0/%d1/%a0,%sp@-
3278 movew %sr,%sp@-
3305 movel %pc@(L(iobase)),%a0
3311 movel %pc@(L(iobase)),%a0
3331 func_start console_init,%a0-%a4/%d0-%d7
3346 lea %pc@(L(console_globals)),%a2
3347 movel %pc@(L(mac_videobase)),%a1
3348 movel %pc@(L(mac_rowbytes)),%d5
3349 movel %pc@(L(mac_dimensions)),%d3 /* -> low byte */
3351 swap %d4 /* -> high byte */
3359 moveq #-1,%d0 /* Mac_black */
3370 lea %pc@(font_vga_8x8),%a0
3372 lea %pc@(font_vga_8x16),%a0
3374 lea %pc@(font_vga_6x11),%a0
3376 lea %pc@(font_vga_8x8),%a0
3377 #else /* no compiled-in font */
3385 lea %pc@(L(console_font)),%a1
3389 lea %pc@(L(console_font_data)),%a4
3397 * Note - we can use either an
3425 func_start console_put_penguin,%a0-%a1/%d0-%d7
3430 lea %pc@(L(mac_dimensions)),%a0
3436 lea %pc@(L(that_penguin)),%a1
3466 func_start console_scroll,%a0-%a4/%d0-%d7
3467 lea %pc@(L(mac_videobase)),%a0
3470 lea %pc@(L(mac_rowbytes)),%a0
3472 movel %pc@(L(console_font)),%a0
3481 lea %pc@(L(mac_dimensions)),%a0
3491 lea %pc@(L(mac_rowbytes)),%a0
3493 movel %pc@(L(console_font)),%a0
3510 lea %pc@(L(mac_rowbytes)),%a0
3512 movel %pc@(L(console_font)),%a0
3517 moveq #-1,%d0
3533 func_start console_putc,%a0/%a1/%d0-%d7
3536 tstl %pc@(L(console_font))
3548 lea %pc@(L(console_globals)),%a0
3579 * rendered on the screen. Register usage is -
3600 movel %pc@(L(console_font)),%a0
3601 movel %pc@(L(console_font_data)),%a1 /* Load fbcon_font_desc.data into a1 */
3650 func_start console_plot_pixel,%a0-%a1/%d0-%d4
3652 movel %pc@(L(mac_videobase)),%a1
3653 movel %pc@(L(mac_videodepth)),%d3
3656 mulul %pc@(L(mac_rowbytes)),%d1
3675 eorb #7,%d4 /* reverse the x-coordinate w/ screen-bit # */
3692 eorb #3,%d4 /* reverse the x-coordinate w/ screen-bit # */
3870 .long -1