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-vme.h>
269 #include <asm/asm-offsets.h>
321 TTR_RW = 0x0200 /* read/write mode */
322 TTR_RWM = 0x0100 /* read/write mask */
335 CC6_HALF_D = 0x08000000 /* half-cache mode for data cache (68060) */
341 CC6_HALF_I = 0x00002000 /* half-cache mode for instruction cache (68060) */
342 CC3_ALLOC_WRITE = 0x00002000 /* write allocate mode(68030) */
380 /* The __INITDATA stuff is a no-op when ftrace or kgdb are turned on */
387 * - func_start marks the beginning of the routine which setups the frame
390 * - func_return marks the end of the routine and simply calls the prepared
392 * - func_define generates another macro to automatically put arguments
409 linkw %a6,#-\stack
410 moveml \saveregs,%sp@-
411 .set stackstart,-\stack
430 move_stack "(\nr-1)",\arg2,\arg3,\arg4
431 movel \arg1,%sp@-
512 pea %pc@(.Lstr\@)
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
538 #define hasnt_leds(lab) cmpl &MACH_HP300,%pc@(m68k_machtype); \
540 cmpl &MACH_APOLLO,%pc@(m68k_machtype); \
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
552 /* On the HP300 we use the on-board LEDs for debug output before
554 _off_ - on the 340 bit 7 is towards the back panel of the machine. */
596 lea %pc@(_stext),%sp
602 lea %pc@(m68k_machtype),%a1
606 lea %pc@(m68k_fputype),%a1
610 lea %pc@(m68k_mmutype),%a1
614 lea %pc@(m68k_cputype),%a1
628 lea %pc@(L(mac_videobase)),%a1
632 lea %pc@(L(mac_videodepth)),%a1
636 lea %pc@(L(mac_dimensions)),%a1
640 lea %pc@(L(mac_rowbytes)),%a1
644 lea %pc@(L(mac_sccbase)),%a1
657 movel %pc@(m68k_cputype),%d0
692 lea %pc@(L(cputype)),%a0
717 * d1 := cacheable write-through
718 * NOTE: The 68040 manual strongly recommends non-cached for MMU tables,
719 * but we have been using write-through since at least 2.0.29 so I
725 * problems, then supervisor memory accesses need to be write-through
741 lea %pc@(m68k_supervisor_cachemode),%a0
743 lea %pc@(m68k_pgtable_cachemode),%a0
761 same behaviour (0x0..0x7 are no ROM shadow). So we have to do
779 lea %pc@(atari_mch_type),%a0
783 * serial port. There are no I/O regs at 0x00ffxxxx at all. */
788 1: lea %pc@(L(iobase)),%a0
809 lea %pc@(vme_brdtype),%a0
824 movel %d2,%sp@-
826 .word 0x70 /* trap 0x70 - .BRD_ID */
829 lea %pc@(mvme_bdid),%a1
853 lea %pc@(L(uartbase)),%a0
859 lea %pc@(L(uart_scode)),%a0
888 dputn %pc@(L(cputype))
889 dputn %pc@(m68k_supervisor_cachemode)
890 dputn %pc@(m68k_pgtable_cachemode)
896 lea %pc@(L(phys_kernel_start)),%a0
897 lea %pc@(_stext),%a1
924 lea %pc@(m68k_init_mapped_size),%a0
926 mmu_map #PAGE_OFFSET,%pc@(L(phys_kernel_start)),%d1,\
927 %pc@(m68k_supervisor_cachemode)
978 0xffxxxxxx -> 0x00xxxxxx). For this, an additional pointer table is
979 needed. I/O ranges are marked non-cachable.
982 (i.e. 0xffxxxxxx -> 0xffxxxxxx), because some I/O registers are
989 /* I/O base addr for non-Medusa, non-Hades: 0x00000000 */
991 movel %pc@(atari_mch_type),%d3
1001 /* Map everything non-cacheable, though not all parts really
1023 * add transparent mapping for 0xff00 0000 - 0xffff ffff
1024 * non-cached serialized etc..
1026 * 0xfe000000-0xfeffffff is for screen and ROM
1043 * by mapping 32MB (on 020/030) or 16 MB (on 040) from 0xf0xxxxxx -> 0x00xxxxxx).
1075 * so we can access on-board i/o areas.
1098 * PROM is 0xff800000->0xffbfffff and SRAM is
1099 * 0xffe00000->0xffe1ffff.
1117 * so we can access on-board i/o areas.
1173 * Mac Note: screen address of logical 0xF000.0000 -> <screen physical>
1178 andl %pc@(L(mac_videobase)),%d0
1198 * from 8k -> 4k pages as we go.
1210 andl #PTR_TABLE_SIZE-1, %d0
1216 andl #PAGE_TABLE_SIZE-1, %d0
1223 movel #((0x200000 >> 13)-1), %d1
1260 * tables should be non-cacheable on a '040 and write-through on a
1262 * experience, showed that write-through also works on a '040.
1279 movel %pc@(L(phys_kernel_start)),%d0
1281 lea %pc@(_stext),%a0
1285 movel %pc@(L(kernel_end)),%a0
1287 movel %pc@(L(memory_start)),%a1
1313 * the kernel of which there are two sub-possibilities:
1314 * A. The PC maps to the correct instruction (logical PC == physical
1316 * B. The PC does not map through and the processor will read some
1335 * you designed today, but I'm sure it wasn't good."). -- rst]
1340 * the physical location of the pc. And, create a transparent
1342 * is engaged, the PC can be moved up into the 0x8000.0000 range
1344 * the PC can jump to the correct logical location and it will be
1348 * is made in page 0 (an as of yet unused location -- except for the
1370 * After this point no new memory is allocated and
1398 movel %pc@(L(phys_kernel_start)),%d0
1516 * Returns: d0: size (-1 if not found)
1517 * a0: data pointer (end-of-records if not found)
1522 lea %pc@(_end),%a0
1533 3: moveq #-1,%d0
1546 * a hierarchical translation mechanism where the high-order
1582 * bits 31..26 - index into the Root Table
1583 * bits 25..18 - index into the Pointer Table
1584 * bits 17..12 - index into the Page Table
1585 * bits 11..0 - offset into a particular 4K page
1618 #define MMU_PRINT_INVALID -1
1624 func_start mmu_print,%a0-%a6/%d0-%d7
1626 movel %pc@(L(kernel_pgdir_ptr)),%a5
1627 lea %pc@(L(mmu_print_data)),%a0
1702 lea %pc@(kernel_pg_dir),%a5
1740 moveml %d0-%d1,%sp@-
1744 lea %pc@(mmu_040_print_flags),%a6
1746 moveml %sp@+,%d0-%d1
1767 jbeq 1f /* No, bail out */
1781 jbeq 1f /* No, bail out */
1806 putZc('w','c') /* write through or copy-back */
1811 putZc('s',' ') /* serialized non-cacheable, or non-cacheable */
1817 putZc('C','I') /* write through or copy-back */
1837 jbeq 1f /* no */
1854 jbeq 1f /* no */
1897 moveml %d0-%d1,%sp@-
1900 lea %pc@(mmu_030_print_flags),%a6
1902 moveml %sp@+,%d0-%d1
1906 moveml %a0/%d7,%sp@-
1908 lea %pc@(L(mmu_print_data)),%a0
1924 moveml %d0-%d7/%a0,%sp@-
1926 lea %pc@(L(mmu_print_data)),%a0
1936 puts "->"
1953 moveml %sp@+,%d0-%d7/%a0
2016 moveq #-1,%d0
2034 /* set 030 specific bits (read/write access for supervisor mode
2091 * routines in the case of a run-time error. For example,
2094 * NOTE-2
2099 func_start mmu_map,%d0-%d4/%a0-%a4
2111 andl #-(PAGESIZE*PAGE_TABLE_SIZE),%d0
2123 andl #-(PAGESIZE*PAGE_TABLE_SIZE),%d0
2168 andl #PTR_TABLE_SIZE-1,%d0
2176 andl #PAGE_TABLE_SIZE-1,%d0
2179 /* The page table entry must not no be busy
2193 lea %a3@(-1),%a0
2210 andl #(PTR_TABLE_SIZE*PAGE_TABLE_SIZE*PAGESIZE-1)&(-ROOT_TABLE_SIZE),%d0
2215 lea %a3@(PTR_TABLE_SIZE*PAGE_TABLE_SIZE*PAGESIZE-1),%a1
2221 /* The root table entry must not no be busy
2244 andl #PTR_TABLE_SIZE-1,%d0
2247 /* The pointer table entry must not no be busy
2266 lea %a3@(-1),%a0
2306 andl #PTR_TABLE_SIZE-1,%d0
2314 andl #PAGE_TABLE_SIZE-1,%d0
2319 orl %pc@(m68k_pgtable_cachemode),%d0
2340 lea %pc@(L(temp_mmap_mem)),%a1
2352 cmpl %pc@(L(memory_start)),%d0
2366 andw #-ROOT_TABLE_SIZE,%d0
2374 andl #PTR_TABLE_SIZE-1,%d0
2396 andw #-PTR_TABLE_SIZE,%d0
2404 andl #PAGE_TABLE_SIZE-1,%d0
2411 andw #-PAGESIZE,%d0
2420 func_start mmu_engage,%d0-%d2/%a0-%a3
2422 moveq #ROOT_TABLE_SIZE-1,%d0
2424 lea %pc@(L(kernel_pgdir_ptr)),%a0
2426 movel %pc@(L(memory_start)),%a1
2433 lea %pc@(L(temp_mmap_mem)),%a0
2436 movew #PAGESIZE-1,%d0
2441 lea %pc@(1b),%a0
2455 movel %pc@(L(memory_start)),%a3
2456 movel %pc@(L(phys_kernel_start)),%d2
2484 lea %pc@(L(mmu_engage_030_temp)),%a0
2523 movel %pc@(L(kernel_pgdir_ptr)),%a0
2534 addw #PAGESIZE-1,%a0
2536 andw #-PAGESIZE,%d0
2540 lea %pc@(L(memory_start)),%a0
2542 lea %pc@(L(kernel_end)),%a0
2549 lea %pc@(_stext),%a0
2550 lea %pc@(L(mmu_cached_pointer_tables)),%a1
2554 lea %pc@(L(mmu_num_pointer_tables)),%a1
2560 movew #PAGESIZE/4-1,%d0
2565 lea %pc@(L(kernel_pgdir_ptr)),%a1
2599 lea %pc@(L(mmu_num_pointer_tables)),%a0
2605 lea %pc@(L(mmu_cached_pointer_tables)),%a1
2630 andw #-PTR_TABLE_SIZE,%d0
2666 andw #-(PAGESIZE/PAGE_TABLE_SIZE),%d0
2671 moveq #PAGESIZE/PAGE_TABLE_SIZE/4-1,%d0
2684 andw #-PAGE_TABLE_SIZE,%d0
2707 lea %pc@(L(memory_start)),%a0
2714 movew #PAGESIZE/4-1,%d0
2740 .byte 4,0x44 /* x16, 1 stopbit, no parity */
2749 .byte -1
2764 .byte 4,0x44 /* x16, 1 stopbit, no parity */
2773 .byte -1
2838 lea %pc@(L(custom)),%a0
2839 movel #-ZTWOBASE,%a0@
2840 bclr #SERIAL_DTR,SERIAL_CNTRL-ZTWOBASE
2842 movew %a0@,CUSTOMBASE+C_SERPER-ZTWOBASE
2843 | movew #61,CUSTOMBASE+C_SERPER-ZTWOBASE
2849 movel %pc@(L(iobase)),%a1
2865 /* Reset SCC device: write register pointer then register value */
2875 lea %pc@(L(scc_initable_atari)),%a1
2901 movel %pc@(L(mac_sccbase)),%a0
2904 /* Reset SCC device: write register pointer then register value */
2916 lea %pc@(L(scc_initable_mac)),%a1
2926 lea %pc@(L(scc_initable_mac)),%a1
2941 - check for '%LX$' signature in SRAM */
2942 lea %pc@(q40_mem_cptr),%a1
2943 move.l #0xff020010,%a1@ /* must be inited - also used by debug=mem */
2957 lea %pc@(L(q40_do_debug)),%a1
3000 movel %pc@(L(custom)),%a0
3012 movel %pc@(L(mac_sccbase)),%a1
3030 movel %pc@(L(iobase)),%a1
3073 * the SRAM, which is non-standard.
3075 moveml %d0-%d7/%a2-%a6,%sp@-
3077 jeq 1f | No tag - use the Bug
3113 moveb %d0,%sp@-
3117 moveml %sp@+,%d0-%d7/%a2-%a6
3136 movel %d0,-(%sp)
3146 tst.l %pc@(L(q40_do_debug)) /* only debug if requested */
3148 lea %pc@(q40_mem_cptr),%a1
3159 movl %pc@(L(iobase)),%a1
3170 movl %pc@(L(iobase)),%a1
3171 addl %pc@(L(uartbase)),%a1
3172 movel %pc@(L(uart_scode)),%d1 /* Check the scode */
3215 func_start putn,%d0-%d2
3227 addb #'A'-('9'+1),%d2
3252 moveml %d0/%d1/%a0,%sp@-
3253 movew %sr,%sp@-
3280 movel %pc@(L(iobase)),%a0
3286 movel %pc@(L(iobase)),%a0
3306 func_start console_init,%a0-%a4/%d0-%d7
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 /* -> low byte */
3326 swap %d4 /* -> high byte */
3334 moveq #-1,%d0 /* Mac_black */
3345 lea %pc@(font_vga_8x8),%a0
3347 lea %pc@(font_vga_8x16),%a0
3349 lea %pc@(font_vga_6x11),%a0
3351 lea %pc@(font_vga_8x8),%a0
3352 #else /* no compiled-in font */
3360 lea %pc@(L(console_font)),%a1
3364 lea %pc@(L(console_font_data)),%a4
3372 * Note - we can use either an
3400 func_start console_put_penguin,%a0-%a1/%d0-%d7
3405 lea %pc@(L(mac_dimensions)),%a0
3411 lea %pc@(L(that_penguin)),%a1
3441 func_start console_scroll,%a0-%a4/%d0-%d7
3442 lea %pc@(L(mac_videobase)),%a0
3445 lea %pc@(L(mac_rowbytes)),%a0
3447 movel %pc@(L(console_font)),%a0
3456 lea %pc@(L(mac_dimensions)),%a0
3466 lea %pc@(L(mac_rowbytes)),%a0
3468 movel %pc@(L(console_font)),%a0
3485 lea %pc@(L(mac_rowbytes)),%a0
3487 movel %pc@(L(console_font)),%a0
3492 moveq #-1,%d0
3508 func_start console_putc,%a0/%a1/%d0-%d7
3511 tstl %pc@(L(console_font))
3523 lea %pc@(L(console_globals)),%a0
3554 * rendered on the screen. Register usage is -
3575 movel %pc@(L(console_font)),%a0
3576 movel %pc@(L(console_font_data)),%a1 /* Load fbcon_font_desc.data into a1 */
3625 func_start console_plot_pixel,%a0-%a1/%d0-%d4
3627 movel %pc@(L(mac_videobase)),%a1
3628 movel %pc@(L(mac_videodepth)),%d3
3631 mulul %pc@(L(mac_rowbytes)),%d1
3650 eorb #7,%d4 /* reverse the x-coordinate w/ screen-bit # */
3667 eorb #3,%d4 /* reverse the x-coordinate w/ screen-bit # */
3845 .long -1