- Timestamp:
- 03/11/97 15:42:59 (27 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- d0e126a6
- Parents:
- c43b34c
- Location:
- c/src/lib/libbsp/m68k
- Files:
-
- 7 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/m68k/efi332/README
rc43b34c r6335022e 13 13 "diy_efi" mailing list). Although efi332 was initially designed for 14 14 automotive research, it is a fairly generalized embedded controller 15 when used without the companion EFI board. It is patterned much after15 when used without the companion EFI I/O board. It is patterned much after 16 16 the the Motorola BCC but cost on the order of $250US. A 4x3 inch 17 (approx.) printed circuit board is available .For complete17 (approx.) printed circuit board is available (about $14US). For complete 18 18 information see 19 19 20 http://www.cim.swin.edu.au/wwwhome/aden/efi332/332_index.html 21 20 http://efi332.eng.ohio-state.edu 22 21 TODO: 23 22 ===== 24 - add separate interrupt stack (low priority). 25 23 - integrate the interrupt driven stdin/stdout into RTEMS to (a) reduce 24 the interrupt priority and (2) to prevent it from blocking. (high 25 priority) 26 26 - add a timer driver for the tmtest set. 27 28 - generate include/coverhd.c to preform the tmtest. 29 30 - the interrupt drive I/O should be integrated into the RTEMS. 31 32 - finish the ROM memory model. 33 27 - generate include/coverhd.c to perform the tmtest. 28 - add separate interrupt stack (low priority... may never happen :). 34 29 35 30 John S Gwynne … … 40 35 Telephone: (614) 292-7981 * Fax: (614) 292-7297 41 36 ------------------------------------------------------------------------------- 42 -
c/src/lib/libbsp/m68k/efi332/bsp_specs
rc43b34c r6335022e 5 5 startfile: replace 6 6 mrtems: 7 pg: start .o%s7 pg: start332.o%s 8 8 {!pg: 9 g: start .o%s9 g: start332.o%s 10 10 {!g: 11 p: start .o%s12 !p: start .o%s11 p: start332.o%s 12 !p: start332.o%s 13 13 }} 14 14 {!mrtems: -
c/src/lib/libbsp/m68k/efi332/console/console.c
rc43b34c r6335022e 37 37 static volatile char _debug_flag = 0; 38 38 39 #define SET_RTS(a) {*PORTF0 = (*PORTF0 & 0x4) | ( (a)? 0 : 0x4); }39 #define SET_RTS(a) {*PORTF0 = (*PORTF0 & ~0x4) | ( (a)? 0 : 0x4); } 40 40 #define GET_CTS (!(*PORTF0 & 0x2)) 41 41 … … 235 235 */ 236 236 237 void console_init() 238 { 239 *QSMCR = ( SAM(QSM_IARB,0,IARB) ); 240 *QILR = ( SAM(ISRL_QSPI,4,ILQSPI) | SAM(ISRL_SCI,0,ILSCI) ); 241 *QIVR = ( SAM(EFI_QIVR,0,INTV) ); 242 243 *SCCR0 = ( (int)( SYS_CLOCK/SCI_BAUD/32.0+0.5 ) & 0x1fff ); 244 *SCCR1 = ( RIE | TE | RE ); 245 246 set_vector(_catchSPURIOUSint, EFI_SPINT, 0); 247 set_vector(_catchSCIint, EFI_QIVR, 0); 248 set_vector(_catchCTSint, EFI_INT1, 0); 249 } 250 237 251 rtems_device_driver console_initialize( 238 252 rtems_device_major_number major, … … 242 256 { 243 257 rtems_status_code status; 244 245 *QSMCR = ( SAM(QSM_IARB,0,IARB) ); 246 *QILR = ( SAM(ISRL_QSPI,4,ILQSPI) | SAM(ISRL_SCI,0,ILSCI) ); 247 *QIVR = ( SAM(EFI_QIVR,0,INTV) ); 248 249 *SCCR0 = ( (int)( SYS_CLOCK/SCI_BAUD/32.0+0.5 ) & 0x1fff ); 250 *SCCR1 = ( RIE | TE | RE ); 251 252 set_vector(_catchSPURIOUSint, EFI_SPINT, 0); 253 set_vector(_catchSCIint, EFI_QIVR, 0); 254 set_vector(_catchCTSint, EFI_INT1, 0); 258 255 259 status = rtems_io_register_name( 256 260 "/dev/console", -
c/src/lib/libbsp/m68k/efi332/include/bsp.h
rc43b34c r6335022e 72 72 } 73 73 74 /* externals */ 75 76 extern char _endtext[]; 77 extern char _sdata[]; 78 extern char _edata[]; 79 extern char __bss_start[]; 80 extern char _end[]; 81 extern char _copy_data_from_rom[]; 82 extern char __end_of_ram[]; 83 84 /* constants */ 85 86 #define RAM_END ((int)__end_of_ram) 87 88 #ifdef __START_C__ 89 #define STACK_SIZE "#0x800" 90 #else 91 #define STACK_SIZE 0x800 92 #endif 93 74 94 /* macros */ 75 76 #define RAM_START 0x8000077 #define RAM_END 0xc000078 95 79 96 #define RAW_PUTS(str) \ -
c/src/lib/libbsp/m68k/efi332/include/efi332.h
rc43b34c r6335022e 37 37 #define EFI_Y 0x38 38 38 #define SYS_CLOCK (XTAL*4.0*(EFI_Y+1)*(1 << (2*EFI_W+EFI_X))) 39 #define SCI_BAUD 1 9200 /* RS232 Baud Rate */39 #define SCI_BAUD 115200 /* RS232 Baud Rate */ 40 40 41 41 42 42 /* macros/functions */ 43 #if 0 44 static void reboot(void) __attribute__ ((noreturn)); 45 __inline__ static void reboot() {asm("trap #15");} 46 #else 47 #define reboot() do {asm("trap #15");} while(0) 48 #endif 43 void reboot(void) __attribute__ ((noreturn)); 49 44 50 45 #endif /* _EFI332_H_ */ -
c/src/lib/libbsp/m68k/efi332/spurious/spinit.c
rc43b34c r6335022e 74 74 bsp_cleanup(); 75 75 76 /* BDM SIGEMT */ 77 asm(" .word 0x4afa"); 78 76 79 for(;;); 77 80 } -
c/src/lib/libbsp/m68k/efi332/startup/bspstart.c
rc43b34c r6335022e 50 50 void bsp_libc_init() 51 51 { 52 extern int end; 52 /* extern int end; */ 53 53 rtems_unsigned32 heap_start; 54 54 55 heap_start = (rtems_unsigned32) &end; 55 heap_start = (rtems_unsigned32) BSP_Configuration.work_space_start + 56 (rtems_unsigned32) BSP_Configuration.work_space_size; 56 57 if (heap_start & (CPU_ALIGNMENT-1)) 57 58 heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1); 58 59 59 RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0); 60 if (heap_start > RAM_END) { 61 /* rtems_fatal_error_occurred can not be used before initalization */ 62 RAW_PUTS("\n\rRTEMS: Out of memory.\n\r"); 63 RAW_PUTS("RTEMS: Check RAM_END and the size of the work space.\n\r"); 64 } 65 66 RTEMS_Malloc_Initialize((void *) heap_start, 67 (RAM_END - heap_start), 0); 60 68 61 69 /* … … 165 173 Cpu_table.interrupt_vector_table = vbr; 166 174 167 Cpu_table.interrupt_stack_size = 4096;175 Cpu_table.interrupt_stack_size = 0; 168 176 169 177 Cpu_table.extra_mpci_receive_server_stack = 0; … … 176 184 177 185 BSP_Configuration.work_space_start = (void *) 178 (RAM_END - BSP_Configuration.work_space_size); 179 180 if ((unsigned int)BSP_Configuration.work_space_start < 181 (unsigned int)((stack_start + stack_size) & 0xffffffc0) ) { 182 /* rtems_fatal_error_occurred can not be used before initalization */ 183 RAW_PUTS("\n\rRTEMS: Out of memory.\n\r"); 184 RAW_PUTS("RTEMS: Check RAM_END and the size of the work space.\n\r"); 185 goto exit; 186 } 186 (((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00); 187 187 188 188 /* … … 208 208 #endif 209 209 210 /* 211 * Tell libio how many fd's we want and allow it to tweak config 212 */ 213 214 rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); 215 210 216 rtems_initialize_executive( &BSP_Configuration, &Cpu_table ); 211 217 /* does not return */ … … 213 219 /* Clock_exit is done as an atexit() function */ 214 220 215 exit:216 221 /* configure peripherals for safe exit */ 217 222 bsp_cleanup(); -
c/src/lib/libbsp/m68k/efi332/startup/linkcmds
rc43b34c r6335022e 36 36 } 37 37 38 __end_of_ram = 0xc0000; 38 39 _copy_data_from_rom = 0; 39 40 -
c/src/lib/libbsp/m68k/efi68k/README
rc43b34c r6335022e 24 24 can be wire-wrapped in about four days. Cost is about $100US. 25 25 26 For more information, I can be contacted at the address below.27 28 29 26 TODO: 30 27 ===== 28 - add the "tm27 vector" ... can we use a trap instruction? 29 - generate include/coverhd.c to perform the tmtest. 30 - the interrupt drive I/O should be integrated into the RTEMS. 31 - finish the ROM memory model. 31 32 - add separate interrupt stack (low priority). 32 33 - add the "tm27 vector" ... can we use a trap instruction?34 35 - generate include/coverhd.c to preform the tmtest.36 37 - the interrupt drive I/O should be integrated into the RTEMS.38 39 - finish the ROM memory model.40 33 41 34 John S Gwynne -
c/src/lib/libbsp/m68k/efi68k/bsp_specs
rc43b34c r6335022e 5 5 startfile: replace 6 6 mrtems: 7 pg: start .o%s7 pg: start68k.o%s 8 8 {!pg: 9 g: start .o%s9 g: start68k.o%s 10 10 {!g: 11 p: start .o%s12 !p: start .o%s11 p: start68k.o%s 12 !p: start68k.o%s 13 13 }} 14 14 {!mrtems: -
c/src/lib/libbsp/m68k/efi68k/console/console.c
rc43b34c r6335022e 195 195 */ 196 196 197 rtems_device_driver console_initialize( 198 rtems_device_major_number major, 199 rtems_device_minor_number minor, 200 void *arg 201 ) 202 { 203 rtems_status_code status; 204 197 void console_init() 198 { 205 199 /* set clock divisor */ 206 200 *LCR = (char)(DLAB); … … 224 218 225 219 set_vector(_catchUARTint, UART_ISR_LEVEL+24, 0); 220 } 221 222 rtems_device_driver console_initialize( 223 rtems_device_major_number major, 224 rtems_device_minor_number minor, 225 void *arg 226 ) 227 { 228 rtems_status_code status; 226 229 227 230 status = rtems_io_register_name( -
c/src/lib/libbsp/m68k/efi68k/include/bsp.h
rc43b34c r6335022e 72 72 } 73 73 74 /* externals */ 75 76 extern char _endtext[]; 77 extern char _sdata[]; 78 extern char _edata[]; 79 extern char __bss_start[]; 80 extern char _end[]; 81 extern char _copy_data_from_rom[]; 82 extern char __end_of_ram[]; 83 84 /* constants */ 85 86 #define RAM_END ((int)__end_of_ram) 87 88 #ifdef __START_C__ 89 #define STACK_SIZE "#0x800" 90 #else 91 #define STACK_SIZE 0x800 92 #endif 93 74 94 /* macros */ 75 76 #define RAM_START 0x20000077 #define RAM_END 0x24000078 95 79 96 #define RAW_PUTS(str) \ -
c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c
rc43b34c r6335022e 21 21 */ 22 22 23 #include <stdlib.h>24 23 #include <bsp.h> 25 24 #include <rtems/libio.h> … … 47 46 rtems_unsigned32 Timer_interrupts; 48 47 49 /* extern void set_debug_traps(void); */ 50 /* extern void breakpoint(void); */ 48 extern void set_debug_traps(void); 49 extern void breakpoint(void); 51 50 52 51 /* Initialize whatever libc we are using … … 56 55 void bsp_libc_init() 57 56 { 58 extern int end; 57 /* extern int end; */ 59 58 rtems_unsigned32 heap_start; 60 59 61 heap_start = (rtems_unsigned32) &end; 60 heap_start = (rtems_unsigned32) BSP_Configuration.work_space_start + 61 (rtems_unsigned32) BSP_Configuration.work_space_size; 62 62 if (heap_start & (CPU_ALIGNMENT-1)) 63 63 heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1); 64 64 65 RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0); 65 if (heap_start > RAM_END) { 66 /* rtems_fatal_error_occurred can not be used before initalization */ 67 RAW_PUTS("\n\rRTEMS: Out of memory.\n\r"); 68 RAW_PUTS("RTEMS: Check RAM_END and the size of the work space.\n\r"); 69 } 70 71 RTEMS_Malloc_Initialize((void *) heap_start, 72 (RAM_END - heap_start), 0); 66 73 67 74 /* … … 81 88 else 82 89 libc_init(0); /* non-reentrant */ 83 84 90 } 85 91 … … 162 168 */ 163 169 164 Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */170 Cpu_table.pretasking_hook = bsp_pretasking_hook; 165 171 166 172 Cpu_table.predriver_hook = NULL; … … 175 181 Cpu_table.interrupt_vector_table = vbr; 176 182 177 Cpu_table.interrupt_stack_size = 4096;183 Cpu_table.interrupt_stack_size = 0; 178 184 179 185 Cpu_table.extra_mpci_receive_server_stack = 0; … … 186 192 187 193 BSP_Configuration.work_space_start = (void *) 188 (RAM_END - BSP_Configuration.work_space_size); 189 190 if ((unsigned int)BSP_Configuration.work_space_start < 191 (unsigned int)((stack_start + stack_size) & 0xffffffc0) ) { 192 /* rtems_fatal_error_occurred can not be used before initalization */ 193 RAW_PUTS("\n\rRTEMS: Out of memory.\n\r"); 194 RAW_PUTS("RTEMS: Check RAM_END and the size of the work space.\n\r"); 195 goto exit; 196 } 194 (((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00); 197 195 198 196 /* … … 218 216 #endif 219 217 218 /* 219 * Tell libio how many fd's we want and allow it to tweak config 220 */ 221 222 rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); 223 220 224 rtems_initialize_executive( &BSP_Configuration, &Cpu_table ); 221 225 /* does not return */ … … 223 227 /* Clock_exit is done as an atexit() function */ 224 228 225 exit: 229 /* exit: */ 226 230 /* configure peripherals for safe exit */ 227 231 bsp_cleanup(); -
c/src/lib/libbsp/m68k/efi68k/startup/linkcmds
rc43b34c r6335022e 44 44 45 45 _VBR = 0x200000; /* location of the VBR table (in RAM) */ 46 __end_of_ram = 0x240000; 46 47 _copy_data_from_rom = 0; 47 48
Note: See TracChangeset
for help on using the changeset viewer.