2 * Copyright (C) 2013, The AROS Development Team
4 * Author: Jason S. McMullan <jason.mcmullan@gmail.com>
6 * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1
11 #include <aros/m68k/asm.h>
12 #include <aros/config.h>
22 bra.w arosbootstrap_init
26 /* Wait a bit for reset to finish.
27 * Simulate ROM checksum check.
38 /* Check for cartridge ROM */
40 move.w %a0@(0),%d0 /* Get the ROM ID (0x1111) */
42 bne.s 0f /* Must be 0x1111 */
47 beq.s 0f /* skip if we booted at 0xF00000 */
48 lea 0x40000,%sp /* Safe stack at Chip Mem 128K */
53 /* Disable the overlay, power led off. */
61 /* Initial Custom chipset setup. Does same writes as AOS.
62 * It is possible some bus snooping hardware assumes this.
66 move.w %d0,0x9a(%a0) /* Interrupt disable */
67 move.w %d0,0x9c(%a0) /* Clear interrupts */
68 move.w %d0,0x96(%a0) /* Stop DMA */
69 move.w #0x0174,0x032(%a0) /* SERPER */
70 move.w #0x0200,0x100(%a0) /* BPLCON0 */
71 move.w #0x0000,0x110(%a0) /* BPL1DAT */
72 move.w #0x0111,0x180(%a0) /* COLOR00 */
74 /* temp system stack */
75 lea.l _ss_end,%sp /* System stack */
76 /* Put the memory bank array at the bottom of the stack, reserve space for extra memory bank */
79 /* Do we have a Gayle? */
81 jsr AROS_SLIB_ENTRY(ReadGayle,Exec,136)
86 /* Disable PCMCIA slot */
91 move.l %a5,%a4 /* Space for CPU/FPU data array */
92 lea 16(%a5),%a5 /* Space also reserved for extra membank */
95 /* High word = gayle flag, low word = AttnFlags */
98 btst #2,%d6 /* AttnFlags AFB_68030? */
100 btst #1,%d6 /* AttnFlags AFB_68020? */
102 /* 32-bit CPU check only, no memory tested */
103 move.l #0x08000000,%a0
104 move.l #0x08000000,%a1
105 move.l #0x00100000,%d0
109 /* set AttnFlags AFB_ADDR32 */
113 /* Memory region array is put into the
114 * system stack from the bottom up, so
115 * we check the non-autoconfig memory areas
116 * in order of fastest to slowest, going
117 * up the system stack in A5.
121 move.l #0x00c00000,%a0
122 move.l #0x00d80000,%a1
123 /* Limit max size if Gayle */
126 move.l #0x00dc0000,%a1
127 0: move.l #0x00040000,%d0
132 move.l #0x00200000,%a1
133 move.l #0x00040000,%d0
137 /* end of memory region list */
142 move.l %a5,%sp@- /* CPU/FPU data array */
144 move.l %a5,%sp@- /* memory bank array */
148 move.w #0x0f0,0xdff180
153 #define STACK_OFFSET (6*4)
154 .globl Early_Exception
157 #if AROS_SERIAL_DEBUG
158 movem.l %d0-%d2/%a0-%a2,-(%sp)
162 move.l STACK_OFFSET+2(%sp),-(%sp)
168 move.w STACK_OFFSET+6(%sp),%d0
174 move.l STACK_OFFSET+8(%sp),-(%sp)
179 movem.l (%sp)+,%d0-%d2/%a0-%a2
181 jmp Early_TrapHandler
185 .string "Early Exception!\nPC"