Lines Matching +full:non +full:- +full:pc
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2 ** -*- mode: asm -*-
4 ** head.S -- This file contains the initial boot code for the
20 ** ++ Bjoern & Roman: ATARI-68040 support for the Medusa
23 ** Magnum- and FX-alternate ram
26 ** for linux-2.1.115
49 * 1) Remove register dependency through-out the file.
57 * write-ups on the structure of the file, and the features of the
61 * ------------------
70 * actual per-machine specific code very simple.
73 * (the same for all machines) and mapping machine-specific I/O
83 * others will plug-in support for specific machines.
88 * -------
102 * ------------------------
104 * -----------------------
106 * ------------------------
129 * ----------
141 * ---------
149 * ------------
152 * #ifdef / #endif clauses so it doesn't have to ship in known-good
163 * -------------------
169 * --------------
175 * -------------
189 * -------
236 * coded value. (But, you will notice the code is run-time
245 * USE_MFP: Use the ST-MFP port (Modem1) for serial debug.
256 #include <asm/bootinfo-amiga.h>
257 #include <asm/bootinfo-atari.h>
258 #include <asm/bootinfo-hp300.h>
259 #include <asm/bootinfo-mac.h>
260 #include <asm/bootinfo-q40.h>
261 #include <asm/bootinfo-virt.h>
262 #include <asm/bootinfo-vme.h>
266 #include <asm/asm-offsets.h>
332 CC6_HALF_D = 0x08000000 /* half-cache mode for data cache (68060) */
338 CC6_HALF_I = 0x00002000 /* half-cache mode for instruction cache (68060) */
377 /* The __INITDATA stuff is a no-op when ftrace or kgdb are turned on */
384 * - func_start marks the beginning of the routine which setups the frame
387 * - func_return marks the end of the routine and simply calls the prepared
389 * - func_define generates another macro to automatically put arguments
406 linkw %a6,#-\stack
407 moveml \saveregs,%sp@-
408 .set stackstart,-\stack
427 move_stack "(\nr-1)",\arg2,\arg3,\arg4
428 movel \arg1,%sp@-
509 pea %pc@(.Lstr\@)
521 #define is_not_amiga(lab) cmpl &MACH_AMIGA,%pc@(m68k_machtype); jne lab
522 #define is_not_atari(lab) cmpl &MACH_ATARI,%pc@(m68k_machtype); jne lab
523 #define is_not_mac(lab) cmpl &MACH_MAC,%pc@(m68k_machtype); jne lab
524 #define is_not_mvme147(lab) cmpl &MACH_MVME147,%pc@(m68k_machtype); jne lab
525 #define is_not_mvme16x(lab) cmpl &MACH_MVME16x,%pc@(m68k_machtype); jne lab
526 #define is_not_bvme6000(lab) cmpl &MACH_BVME6000,%pc@(m68k_machtype); jne lab
527 #define is_mvme147(lab) cmpl &MACH_MVME147,%pc@(m68k_machtype); jeq lab
528 #define is_mvme16x(lab) cmpl &MACH_MVME16x,%pc@(m68k_machtype); jeq lab
529 #define is_bvme6000(lab) cmpl &MACH_BVME6000,%pc@(m68k_machtype); jeq lab
530 #define is_not_hp300(lab) cmpl &MACH_HP300,%pc@(m68k_machtype); jne lab
531 #define is_not_apollo(lab) cmpl &MACH_APOLLO,%pc@(m68k_machtype); jne lab
532 #define is_not_q40(lab) cmpl &MACH_Q40,%pc@(m68k_machtype); jne lab
533 #define is_not_sun3x(lab) cmpl &MACH_SUN3X,%pc@(m68k_machtype); jne lab
534 #define is_not_virt(lab) cmpl &MACH_VIRT,%pc@(m68k_machtype); jne lab
536 #define hasnt_leds(lab) cmpl &MACH_HP300,%pc@(m68k_machtype); \
538 cmpl &MACH_APOLLO,%pc@(m68k_machtype); \
542 #define is_040_or_060(lab) btst &CPUTYPE_0460,%pc@(L(cputype)+3); jne lab
543 #define is_not_040_or_060(lab) btst &CPUTYPE_0460,%pc@(L(cputype)+3); jeq lab
544 #define is_040(lab) btst &CPUTYPE_040,%pc@(L(cputype)+3); jne lab
545 #define is_060(lab) btst &CPUTYPE_060,%pc@(L(cputype)+3); jne lab
546 #define is_not_060(lab) btst &CPUTYPE_060,%pc@(L(cputype)+3); jeq lab
547 #define is_020(lab) btst &CPUTYPE_020,%pc@(L(cputype)+3); jne lab
548 #define is_not_020(lab) btst &CPUTYPE_020,%pc@(L(cputype)+3); jeq lab
550 /* On the HP300 we use the on-board LEDs for debug output before
552 _off_ - on the 340 bit 7 is towards the back panel of the machine. */
594 lea %pc@(_stext),%sp
600 lea %pc@(m68k_machtype),%a1
604 lea %pc@(m68k_fputype),%a1
608 lea %pc@(m68k_mmutype),%a1
612 lea %pc@(m68k_cputype),%a1
626 lea %pc@(L(mac_videobase)),%a1
630 lea %pc@(L(mac_videodepth)),%a1
634 lea %pc@(L(mac_dimensions)),%a1
638 lea %pc@(L(mac_rowbytes)),%a1
642 lea %pc@(L(mac_sccbase)),%a1
652 lea %pc@(L(virt_gf_tty_base)),%a1
663 movel %pc@(m68k_cputype),%d0
698 lea %pc@(L(cputype)),%a0
723 * d1 := cacheable write-through
724 * NOTE: The 68040 manual strongly recommends non-cached for MMU tables,
725 * but we have been using write-through since at least 2.0.29 so I
731 * problems, then supervisor memory accesses need to be write-through
747 lea %pc@(m68k_supervisor_cachemode),%a0
749 lea %pc@(m68k_pgtable_cachemode),%a0
785 lea %pc@(atari_mch_type),%a0
794 1: lea %pc@(L(iobase)),%a0
815 lea %pc@(vme_brdtype),%a0
830 movel %d2,%sp@-
832 .word 0x70 /* trap 0x70 - .BRD_ID */
835 lea %pc@(mvme_bdid),%a1
859 lea %pc@(L(uartbase)),%a0
865 lea %pc@(L(uart_scode)),%a0
894 dputn %pc@(L(cputype))
895 dputn %pc@(m68k_supervisor_cachemode)
896 dputn %pc@(m68k_pgtable_cachemode)
902 lea %pc@(L(phys_kernel_start)),%a0
903 lea %pc@(_stext),%a1
930 lea %pc@(m68k_init_mapped_size),%a0
932 mmu_map #PAGE_OFFSET,%pc@(L(phys_kernel_start)),%d1,\
933 %pc@(m68k_supervisor_cachemode)
984 0xffxxxxxx -> 0x00xxxxxx). For this, an additional pointer table is
985 needed. I/O ranges are marked non-cachable.
988 (i.e. 0xffxxxxxx -> 0xffxxxxxx), because some I/O registers are
995 /* I/O base addr for non-Medusa, non-Hades: 0x00000000 */
997 movel %pc@(atari_mch_type),%d3
1007 /* Map everything non-cacheable, though not all parts really
1029 * add transparent mapping for 0xff00 0000 - 0xffff ffff
1030 * non-cached serialized etc..
1032 * 0xfe000000-0xfeffffff is for screen and ROM
1049 * by mapping 32MB (on 020/030) or 16 MB (on 040) from 0xf0xxxxxx -> 0x00xxxxxx).
1081 * so we can access on-board i/o areas.
1104 * PROM is 0xff800000->0xffbfffff and SRAM is
1105 * 0xffe00000->0xffe1ffff.
1123 * so we can access on-board i/o areas.
1179 * Mac Note: screen address of logical 0xF000.0000 -> <screen physical>
1184 andl %pc@(L(mac_videobase)),%d0
1204 * from 8k -> 4k pages as we go.
1216 andl #PTR_TABLE_SIZE-1, %d0
1222 andl #PAGE_TABLE_SIZE-1, %d0
1229 movel #((0x200000 >> 13)-1), %d1
1273 * tables should be non-cacheable on a '040 and write-through on a
1275 * experience, showed that write-through also works on a '040.
1292 movel %pc@(L(phys_kernel_start)),%d0
1294 lea %pc@(_stext),%a0
1298 movel %pc@(L(kernel_end)),%a0
1300 movel %pc@(L(memory_start)),%a1
1326 * the kernel of which there are two sub-possibilities:
1327 * A. The PC maps to the correct instruction (logical PC == physical
1329 * B. The PC does not map through and the processor will read some
1348 * you designed today, but I'm sure it wasn't good."). -- rst]
1353 * the physical location of the pc. And, create a transparent
1355 * is engaged, the PC can be moved up into the 0x8000.0000 range
1357 * the PC can jump to the correct logical location and it will be
1361 * is made in page 0 (an as of yet unused location -- except for the
1411 movel %pc@(L(phys_kernel_start)),%d0
1529 * Returns: d0: size (-1 if not found)
1530 * a0: data pointer (end-of-records if not found)
1535 lea %pc@(_end),%a0
1546 3: moveq #-1,%d0
1559 * a hierarchical translation mechanism where the high-order
1595 * bits 31..26 - index into the Root Table
1596 * bits 25..18 - index into the Pointer Table
1597 * bits 17..12 - index into the Page Table
1598 * bits 11..0 - offset into a particular 4K page
1631 #define MMU_PRINT_INVALID -1
1637 func_start mmu_print,%a0-%a6/%d0-%d7
1639 movel %pc@(L(kernel_pgdir_ptr)),%a5
1640 lea %pc@(L(mmu_print_data)),%a0
1715 lea %pc@(kernel_pg_dir),%a5
1753 moveml %d0-%d1,%sp@-
1757 lea %pc@(mmu_040_print_flags),%a6
1759 moveml %sp@+,%d0-%d1
1819 putZc('w','c') /* write through or copy-back */
1824 putZc('s',' ') /* serialized non-cacheable, or non-cacheable */
1830 putZc('C','I') /* write through or copy-back */
1910 moveml %d0-%d1,%sp@-
1913 lea %pc@(mmu_030_print_flags),%a6
1915 moveml %sp@+,%d0-%d1
1919 moveml %a0/%d7,%sp@-
1921 lea %pc@(L(mmu_print_data)),%a0
1937 moveml %d0-%d7/%a0,%sp@-
1939 lea %pc@(L(mmu_print_data)),%a0
1949 puts "->"
1966 moveml %sp@+,%d0-%d7/%a0
2029 moveq #-1,%d0
2104 * routines in the case of a run-time error. For example,
2107 * NOTE-2
2112 func_start mmu_map,%d0-%d4/%a0-%a4
2124 andl #-(PAGESIZE*PAGE_TABLE_SIZE),%d0
2136 andl #-(PAGESIZE*PAGE_TABLE_SIZE),%d0
2181 andl #PTR_TABLE_SIZE-1,%d0
2189 andl #PAGE_TABLE_SIZE-1,%d0
2206 lea %a3@(-1),%a0
2223 andl #(PTR_TABLE_SIZE*PAGE_TABLE_SIZE*PAGESIZE-1)&(-ROOT_TABLE_SIZE),%d0
2228 lea %a3@(PTR_TABLE_SIZE*PAGE_TABLE_SIZE*PAGESIZE-1),%a1
2257 andl #PTR_TABLE_SIZE-1,%d0
2279 lea %a3@(-1),%a0
2319 andl #PTR_TABLE_SIZE-1,%d0
2327 andl #PAGE_TABLE_SIZE-1,%d0
2332 orl %pc@(m68k_pgtable_cachemode),%d0
2353 lea %pc@(L(temp_mmap_mem)),%a1
2365 cmpl %pc@(L(memory_start)),%d0
2379 andw #-ROOT_TABLE_SIZE,%d0
2387 andl #PTR_TABLE_SIZE-1,%d0
2409 andw #-PTR_TABLE_SIZE,%d0
2417 andl #PAGE_TABLE_SIZE-1,%d0
2424 andw #-PAGESIZE,%d0
2433 func_start mmu_engage,%d0-%d2/%a0-%a3
2435 moveq #ROOT_TABLE_SIZE-1,%d0
2437 lea %pc@(L(kernel_pgdir_ptr)),%a0
2439 movel %pc@(L(memory_start)),%a1
2446 lea %pc@(L(temp_mmap_mem)),%a0
2449 movew #PAGESIZE-1,%d0
2454 lea %pc@(1b),%a0
2468 movel %pc@(L(memory_start)),%a3
2469 movel %pc@(L(phys_kernel_start)),%d2
2497 lea %pc@(L(mmu_engage_030_temp)),%a0
2536 movel %pc@(L(kernel_pgdir_ptr)),%a0
2547 addw #PAGESIZE-1,%a0
2549 andw #-PAGESIZE,%d0
2553 lea %pc@(L(memory_start)),%a0
2555 lea %pc@(L(kernel_end)),%a0
2562 lea %pc@(_stext),%a0
2563 lea %pc@(L(mmu_cached_pointer_tables)),%a1
2567 lea %pc@(L(mmu_num_pointer_tables)),%a1
2573 movew #PAGESIZE/4-1,%d0
2578 lea %pc@(L(kernel_pgdir_ptr)),%a1
2612 lea %pc@(L(mmu_num_pointer_tables)),%a0
2618 lea %pc@(L(mmu_cached_pointer_tables)),%a1
2643 andw #-PTR_TABLE_SIZE,%d0
2679 andw #-(PAGESIZE/PAGE_TABLE_SIZE),%d0
2684 moveq #PAGESIZE/PAGE_TABLE_SIZE/4-1,%d0
2697 andw #-PAGE_TABLE_SIZE,%d0
2720 lea %pc@(L(memory_start)),%a0
2727 movew #PAGESIZE/4-1,%d0
2762 .byte -1
2786 .byte -1
2851 lea %pc@(L(custom)),%a0
2852 movel #-ZTWOBASE,%a0@
2853 bclr #SERIAL_DTR,SERIAL_CNTRL-ZTWOBASE
2855 movew %a0@,CUSTOMBASE+C_SERPER-ZTWOBASE
2856 | movew #61,CUSTOMBASE+C_SERPER-ZTWOBASE
2862 movel %pc@(L(iobase)),%a1
2888 lea %pc@(L(scc_initable_atari)),%a1
2914 movel %pc@(L(mac_sccbase)),%a0
2929 lea %pc@(L(scc_initable_mac)),%a1
2939 lea %pc@(L(scc_initable_mac)),%a1
2954 - check for '%LX$' signature in SRAM */
2955 lea %pc@(q40_mem_cptr),%a1
2956 move.l #0xff020010,%a1@ /* must be inited - also used by debug=mem */
2970 lea %pc@(L(q40_do_debug)),%a1
3013 movel %pc@(L(custom)),%a0
3025 movel %pc@(L(mac_sccbase)),%a1
3043 movel %pc@(L(iobase)),%a1
3086 * the SRAM, which is non-standard.
3088 moveml %d0-%d7/%a2-%a6,%sp@-
3090 jeq 1f | No tag - use the Bug
3126 moveb %d0,%sp@-
3130 moveml %sp@+,%d0-%d7/%a2-%a6
3149 movel %d0,-(%sp)
3159 tst.l %pc@(L(q40_do_debug)) /* only debug if requested */
3161 lea %pc@(q40_mem_cptr),%a1
3172 movl %pc@(L(iobase)),%a1
3183 movl %pc@(L(iobase)),%a1
3184 addl %pc@(L(uartbase)),%a1
3185 movel %pc@(L(uart_scode)),%d1 /* Check the scode */
3236 func_start putn,%d0-%d2
3248 addb #'A'-('9'+1),%d2
3273 moveml %d0/%d1/%a0,%sp@-
3274 movew %sr,%sp@-
3301 movel %pc@(L(iobase)),%a0
3307 movel %pc@(L(iobase)),%a0
3327 func_start console_init,%a0-%a4/%d0-%d7
3342 lea %pc@(L(console_globals)),%a2
3343 movel %pc@(L(mac_videobase)),%a1
3344 movel %pc@(L(mac_rowbytes)),%d5
3345 movel %pc@(L(mac_dimensions)),%d3 /* -> low byte */
3347 swap %d4 /* -> high byte */
3355 moveq #-1,%d0 /* Mac_black */
3366 lea %pc@(font_vga_8x8),%a0
3368 lea %pc@(font_vga_8x16),%a0
3370 lea %pc@(font_vga_6x11),%a0
3372 lea %pc@(font_vga_8x8),%a0
3373 #else /* no compiled-in font */
3381 lea %pc@(L(console_font)),%a1
3385 lea %pc@(L(console_font_data)),%a4
3393 * Note - we can use either an
3421 func_start console_put_penguin,%a0-%a1/%d0-%d7
3426 lea %pc@(L(mac_dimensions)),%a0
3432 lea %pc@(L(that_penguin)),%a1
3462 func_start console_scroll,%a0-%a4/%d0-%d7
3463 lea %pc@(L(mac_videobase)),%a0
3466 lea %pc@(L(mac_rowbytes)),%a0
3468 movel %pc@(L(console_font)),%a0
3477 lea %pc@(L(mac_dimensions)),%a0
3487 lea %pc@(L(mac_rowbytes)),%a0
3489 movel %pc@(L(console_font)),%a0
3506 lea %pc@(L(mac_rowbytes)),%a0
3508 movel %pc@(L(console_font)),%a0
3513 moveq #-1,%d0
3529 func_start console_putc,%a0/%a1/%d0-%d7
3532 tstl %pc@(L(console_font))
3544 lea %pc@(L(console_globals)),%a0
3575 * rendered on the screen. Register usage is -
3596 movel %pc@(L(console_font)),%a0
3597 movel %pc@(L(console_font_data)),%a1 /* Load fbcon_font_desc.data into a1 */
3646 func_start console_plot_pixel,%a0-%a1/%d0-%d4
3648 movel %pc@(L(mac_videobase)),%a1
3649 movel %pc@(L(mac_videodepth)),%d3
3652 mulul %pc@(L(mac_rowbytes)),%d1
3671 eorb #7,%d4 /* reverse the x-coordinate w/ screen-bit # */
3688 eorb #3,%d4 /* reverse the x-coordinate w/ screen-bit # */
3866 .long -1