mine is nicer ;)

This commit is contained in:
Markus Fröschle
2012-10-14 21:12:03 +00:00
parent 838e960ee2
commit 5233d61cd7

View File

@@ -2,40 +2,52 @@
void startup(void) void startup(void)
{ {
__asm__ __volatile__ ("\n\t" asm volatile(
" .extern _initialize_hardware\n\t" " .extern _initialize_hardware\n\t"
"bra.s warmstart\n\t" " bra warmstart\n\t"
"jmp ___BOOT_FLASH + 8 | ist zugleich reset vector\n\t" " jmp ___BOOT_FLASH + 8" /* that's also our reset vector */
"| disable interrupts\n\t"
/* disable interrupts */
"warmstart:\n\t" "warmstart:\n\t"
"| disable interrupts\n\t"
" move.w #0x2700,sr\n\t" " move.w #0x2700,sr\n\t"
: : : "memory"); /* output */ :
/* input */ :
/* clobber */ : "d0");
/* Initialize MBAR */ /* Initialize MBAR */
__asm__ __volatile__ ("MOVE.L #__MBAR,D0\n\t" : : : "memory"); asm volatile(
__asm__ __volatile__ ("MOVEC D0,MBAR\n\t" : : : "memory"); " MOVE.L #__MBAR,D0\n\t"
__asm__ __volatile__ ("MOVE.L D0,_rt_mbar\n\t" : : : "memory"); " MOVEC D0,MBAR\n\t"
" MOVE.L D0,_rt_mbar\n\t"
/* output */ :
/* input */ :
/* clobber */ : "d0");
/* mmu off */ /* mmu off */
__asm__ __volatile__ ("move.l #__MMUBAR+1,d0\n\t" : : : "memory"); asm volatile(
__asm__ __volatile__ ("movec d0,MMUBAR" : : : "memory"); /* set mmubar */ " move.l #__MMUBAR+1,d0\n\t"
" movec d0,MMUBAR\n\t"
/* output */ :
/* input */ :
/* clobber */ : "d0");
MCF_MMU_MMUCR = 0L; /* MMU off */ MCF_MMU_MMUCR = 0L; /* MMU off */
__asm__ __volatile__ ( asm volatile(
"|/* Initialize RAMBARs: locate SRAM and validate it */\n\t" /* Initialize RAMBARs: locate SRAM and validate it */
" move.l #__RAMBAR0 + 0x7,d0\n\t | supervisor only" " move.l #__RAMBAR0 + 0x7,d0\n\t | supervisor only"
" movec d0,RAMBAR0\n\t" " movec d0,RAMBAR0\n\t"
" move.l #__RAMBAR1 + 0x1,d0\n\t""" " move.l #__RAMBAR1 + 0x1,d0\n\t"""
" movec d0,RAMBAR1\n\t" " movec d0,RAMBAR1\n\t"
"| STACKPOINTER AUF ENDE SRAM1\n\t" /* set stack pointer to end of SRAM1 */
" lea __SUP_SP,a7\n\t" " lea __SUP_SP,a7\n\t"
"| instruction cache on\n\t" /* instruction cache on */
" move.l #0x000C8100,d0\n\t" " move.l #0x000C8100,d0\n\t"
" movec d0,cacr\n\t" " movec d0,cacr\n\t"
" nop\n\t" " nop\n\t"
"| initialize any hardware specific issues\n\t" /* initialize any hardware specific issues */
" bra _initialize_hardware\n\t" " bra _initialize_hardware\n\t"
: : : "memory"); /* output */ :
/* input */ :
/* clobber */ : "d0");
} }