summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/m68k/efi332/start332/start332.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/m68k/efi332/start332/start332.c')
-rw-r--r--c/src/lib/libbsp/m68k/efi332/start332/start332.c83
1 files changed, 59 insertions, 24 deletions
diff --git a/c/src/lib/libbsp/m68k/efi332/start332/start332.c b/c/src/lib/libbsp/m68k/efi332/start332/start332.c
index 05f8d75ce9..1029e66b2e 100644
--- a/c/src/lib/libbsp/m68k/efi332/start332/start332.c
+++ b/c/src/lib/libbsp/m68k/efi332/start332/start332.c
@@ -10,19 +10,17 @@
m68k_isr_entry M68Kvec[256];
m68k_isr_entry vectors[256];
char * const __argv[]= {"main", ""};
-char * const __env[]= {""};
+
+void boot_card(int argc, char * const argv[]);
/*
* This prototype really should have the noreturn attribute but
- * that causes a warning since it appears that the routine does
- * return.
- *
- * void dumby_start () __attribute__ ((noreturn));
+ * that causes a warning. Not sure how to fix that.
*/
-
+/* void dumby_start () __attribute__ ((noreturn)); */
void dumby_start ();
+
void dumby_start() {
-void boot_card();
/* We need to by-pass the link instruction since the RAM chip-
select pins are not yet configured. */
@@ -36,7 +34,7 @@ void boot_card();
movel #_end, %d0;
addl " STACK_SIZE ",%d0;
movel %d0,%sp;
- link %a6, #0"
+ movel %d0,%a6"
);
/* include in ram_init.S */
@@ -91,16 +89,34 @@ void boot_card();
*CSBAR1 = (unsigned short int)
(((0x080000 >> 8)&0xfff8) | BS_256K ); /* 256k bytes located at 0x80000 */
*CSBAR2 = (unsigned short int)
- (((0x080000 >> 8)&0xfff8) | BS_256K ); /* 256 bytes located at 0x80000 */
+ (((0x080000 >> 8)&0xfff8) | BS_256K ); /* 256k bytes located at 0x80000 */
*CSBAR3 = (unsigned short int)
+ (((0x0C0000 >> 8)&0xfff8) | BS_256K ); /* 256k bytes located at 0xC0000 */
+ *CSBAR4 = (unsigned short int)
+ (((0x0C0000 >> 8)&0xfff8) | BS_256K ); /* 256 bytes located at 0xC0000 */
+ *CSBAR5 = (unsigned short int)
(0xfff8 | BS_64K); /* AVEC interrupts */
+#ifdef EFI332_v040b
+ *CSBAR6 = (unsigned short int)
+ (((0x000000 >> 8)&0xfff8) | BS_512K ); /* 512k bytes located at 0x0000 */
+ *CSBAR8 = (unsigned short int) /* PCMCIA IOCS */
+ (((0x0c0000 >> 8)&0xfff8) | BS_64K ); /* 64k bytes located at 0xc0000 */
+ *CSBAR9 = (unsigned short int) /* PCMCIA MEMCS */
+ (((0x0D0000 >> 8)&0xfff8) | BS_64K ); /* 64k bytes located at 0xd0000 */
+#else /* EFI332_v040b */
*CSBAR10 = (unsigned short int)
(((0x000000 >> 8)&0xfff8) | BS_512K ); /* 512k bytes located at 0x0000 */
+#endif /* EFI332_v040b */
/* Chip-Select Options Registers */
/* see section 7 of the SIM Reference Manual */
+#ifdef FLASHWRITE
+ *CSORBT = (unsigned short int)
+ ( BothBytes | ReadWrite | SyncAS | WaitStates_2 | UserSupSpace );
+#else /* FLASHWRITE */
*CSORBT = (unsigned short int)
- ( BothBytes | ReadWrite | SyncAS | WaitStates_13 | UserSupSpace );
+ ( BothBytes | ReadOnly | SyncAS | WaitStates_2 | UserSupSpace );
+#endif /* FLASHWRITE */
*CSOR0 = (unsigned short int)
( BothBytes | ReadOnly | SyncAS | External | UserSupSpace );
*CSOR1 = (unsigned short int)
@@ -108,31 +124,54 @@ void boot_card();
*CSOR2 = (unsigned short int)
( UpperByte | ReadWrite | SyncAS | FastTerm | UserSupSpace );
*CSOR3 = (unsigned short int)
+ ( LowerByte | ReadWrite | SyncAS | FastTerm | UserSupSpace );
+ *CSOR4 = (unsigned short int)
+ ( UpperByte | ReadWrite | SyncAS | FastTerm | UserSupSpace );
+ *CSOR5 = (unsigned short int)
( BothBytes | ReadWrite | SyncAS | CPUSpace | IPLevel_any | AVEC );
+#ifdef EFI332_v040b
+ *CSOR6 = (unsigned short int)
+ ( BothBytes | ReadOnly | SyncAS | External | UserSupSpace );
+ *CSOR8 = (unsigned short int)
+ ( BothBytes | ReadWrite | SyncAS | External | UserSupSpace );
+ *CSOR9 = (unsigned short int)
+ ( BothBytes | ReadWrite | SyncAS | External | UserSupSpace );
+#else /* EFI332_v040b */
*CSOR10 = (unsigned short int)
( BothBytes | ReadOnly | SyncAS | External | UserSupSpace );
+#endif /* EFI332_v040b */
/* Chip Select Pin Assignment Register 0 */
/* see section 7 of the SIM Reference Manual */
*CSPAR0 = (unsigned short int)(
- SAM(DisOut,CS_5,0x3000) | /* PC2 */
- SAM(DisOut,CS_4,0x0c00) | /* PC1 */
- SAM(DisOut,CS_3,0x0300) | /* AVEC (internally) */
- SAM(CS16bit,CS_2,0x00c0)| /* RAM UDS */
- SAM(CS16bit,CS_1,0x0030)| /* RAM LDS */
+ SAM(DisOut,CS_5,0x3000) | /* AVEC (internally) */
+ SAM(CS16bit,CS_4,0x0c00) | /* RAM UDS, bank2 */
+ SAM(CS16bit,CS_3,0x0300) | /* RAM LDS, bank2 */
+ SAM(CS16bit,CS_2,0x00c0)| /* RAM UDS, bank1 */
+ SAM(CS16bit,CS_1,0x0030)| /* RAM LDS, bank1 */
SAM(CS16bit,CS_0,0x000c)| /* W/!R */
- SAM(CS16bit,CSBOOT,0x0003) /* ROM DS */
+ SAM(CS16bit,CSBOOT,0x0003) /* ROM CS */
);
/* Chip Select Pin Assignment Register 1 */
/* see section 7 of the SIM Reference Manual */
+#ifdef EFI332_v040b
+ *CSPAR1 = (unsigned short int)(
+ SAM(DisOut,CS_10,0x300)| /* ECLK */
+ SAM(CS16bit,CS_9,0x0c0) | /* PCMCIA MEMCS */
+ SAM(CS16bit,CS_8,0x030) | /* PCMCIA IOCS */
+ SAM(DisOut,CS_7,0x00c) | /* PC4 */
+ SAM(CS16bit,CS_6,0x003) /* ROM !OE */
+ );
+#else /* EFI332_v040b */
*CSPAR1 = (unsigned short int)(
- SAM(CS16bit,CS_10,0x300)| /* ECLK */
+ SAM(CS16bit,CS_10,0x300)| /* ROM !OE */
SAM(DisOut,CS_9,0x0c0) | /* PC6 */
SAM(DisOut,CS_8,0x030) | /* PC5 */
SAM(DisOut,CS_7,0x00c) | /* PC4 */
SAM(DisOut,CS_6,0x003) /* PC3 */
);
+#endif /* EFI332_v040b */
/* Port E and F Data Register */
/* see section 9 of the SIM Reference Manual */
@@ -179,14 +218,10 @@ void boot_card();
console_init();
/*
- * Execute main with arguments argv and environment env
+ * Execute main with arguments argc and agrv.
*/
- /* main(1, __argv, __env); */
-
- boot_card();
-
+ boot_card(1,__argv);
reboot();
-}
-void reboot() {asm("trap #15");}
+}