From d1c9dc074b9b11096088d9f10f524a7004df74b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Tue, 16 Oct 2012 15:54:58 +0000 Subject: [PATCH] startup file in assembler language --- sources/startcf.S | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 sources/startcf.S diff --git a/sources/startcf.S b/sources/startcf.S new file mode 100644 index 0000000..4904a57 --- /dev/null +++ b/sources/startcf.S @@ -0,0 +1,42 @@ +#include + +_startup: + .extern _initialize_hardware + .extern _rt_mbar + + bra.s warmstart + jmp ___BOOT_FLASH + 8 /* that's also our reset vector */ + + /* disable interrupts */ +warmstart: + move.w #0x2700,sr + + /* Initialize MBAR */ + + move.l #__MBAR,d0 + movec d0,MBAR + move.l d0,_rt_mbar + + /* mmu off */ + move.l #__MMUBAR+1,d0 + movec d0,MMUBAR + + clr.l d0 + move.l d0,MCF_MMU_MMUCR + + /* Initialize RAMBARs: locate SRAM and validate it */ + move.l #__RAMBAR0 + 0x7,d0 /* supervisor only */ + movec d0,RAMBAR0 + move.l #__RAMBAR1 + 0x1,d0 + movec d0,RAMBAR1 + + /* set stack pointer to end of SRAM1 */ + lea __SUP_SP,a7 + + /* instruction cache on */ + move.l #0x000C8100,d0 + movec d0,cacr + nop + + /* initialize any hardware specific issues */ + bra _initialize_hardware