Changeset 6335022e in rtems


Ignore:
Timestamp:
03/11/97 15:42:59 (27 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
d0e126a6
Parents:
c43b34c
Message:

updates from John Gwynne

Location:
c/src/lib/libbsp/m68k
Files:
7 added
14 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/efi332/README

    rc43b34c r6335022e  
    1313"diy_efi" mailing list). Although efi332 was initially designed for
    1414automotive research, it is a fairly generalized embedded controller
    15 when used without the companion EFI board. It is patterned much after
     15when used without the companion EFI I/O board. It is patterned much after
    1616the the Motorola BCC but cost on the order of $250US. A 4x3 inch
    17 (approx.) printed circuit board is available. For complete
     17(approx.) printed circuit board is available (about $14US). For complete
    1818information see
    1919
    20         http://www.cim.swin.edu.au/wwwhome/aden/efi332/332_index.html
    21 
     20        http://efi332.eng.ohio-state.edu
    2221TODO:
    2322=====
    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)
    2626- 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 :).
    3429
    3530                                       John S Gwynne
     
    4035                Telephone: (614) 292-7981 * Fax: (614) 292-7297
    4136-------------------------------------------------------------------------------
    42 
  • c/src/lib/libbsp/m68k/efi332/bsp_specs

    rc43b34c r6335022e  
    55startfile: replace
    66mrtems:
    7 pg: start.o%s
     7pg: start332.o%s
    88{!pg:
    9 g: start.o%s
     9g: start332.o%s
    1010{!g:
    11 p: start.o%s
    12 !p: start.o%s
     11p: start332.o%s
     12!p: start332.o%s
    1313}}
    1414{!mrtems:
  • c/src/lib/libbsp/m68k/efi332/console/console.c

    rc43b34c r6335022e  
    3737static volatile char _debug_flag = 0;
    3838
    39 #define SET_RTS(a) {*PORTF0 = (*PORTF0 & 0x4) | ( (a)? 0 : 0x4); }
     39#define SET_RTS(a) {*PORTF0 = (*PORTF0 & ~0x4) | ( (a)? 0 : 0x4); }
    4040#define GET_CTS (!(*PORTF0 & 0x2))
    4141
     
    235235 */
    236236 
     237void 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
    237251rtems_device_driver console_initialize(
    238252  rtems_device_major_number  major,
     
    242256{
    243257  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
    255259  status = rtems_io_register_name(
    256260    "/dev/console",
  • c/src/lib/libbsp/m68k/efi332/include/bsp.h

    rc43b34c r6335022e  
    7272  }
    7373
     74/* externals */
     75
     76extern char _endtext[];
     77extern char _sdata[];
     78extern char _edata[];
     79extern char __bss_start[];
     80extern char _end[];
     81extern char _copy_data_from_rom[];
     82extern 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
    7494/* macros */
    75 
    76 #define RAM_START 0x80000
    77 #define RAM_END   0xc0000
    7895
    7996#define RAW_PUTS(str) \
  • c/src/lib/libbsp/m68k/efi332/include/efi332.h

    rc43b34c r6335022e  
    3737#define EFI_Y 0x38
    3838#define SYS_CLOCK (XTAL*4.0*(EFI_Y+1)*(1 << (2*EFI_W+EFI_X)))
    39 #define SCI_BAUD 19200          /* RS232 Baud Rate */
     39#define SCI_BAUD 115200         /* RS232 Baud Rate */
    4040
    4141
    4242/* 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
     43void reboot(void) __attribute__ ((noreturn));
    4944
    5045#endif /* _EFI332_H_ */
  • c/src/lib/libbsp/m68k/efi332/spurious/spinit.c

    rc43b34c r6335022e  
    7474  bsp_cleanup();
    7575
     76  /* BDM SIGEMT */
     77  asm("  .word  0x4afa");
     78
    7679  for(;;);
    7780}
  • c/src/lib/libbsp/m68k/efi332/startup/bspstart.c

    rc43b34c r6335022e  
    5050void bsp_libc_init()
    5151{
    52   extern int end;
     52/*   extern int end; */
    5353  rtems_unsigned32        heap_start;
    5454 
    55   heap_start = (rtems_unsigned32) &end;
     55  heap_start = (rtems_unsigned32) BSP_Configuration.work_space_start +
     56               (rtems_unsigned32) BSP_Configuration.work_space_size;
    5657  if (heap_start & (CPU_ALIGNMENT-1))
    5758    heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    5859 
    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);
    6068   
    6169  /*
     
    165173  Cpu_table.interrupt_vector_table = vbr;
    166174
    167   Cpu_table.interrupt_stack_size = 4096;
     175  Cpu_table.interrupt_stack_size = 0;
    168176
    169177  Cpu_table.extra_mpci_receive_server_stack = 0;
     
    176184
    177185  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);
    187187
    188188  /*
     
    208208#endif
    209209
     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
    210216  rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
    211217  /* does not return */
     
    213219  /* Clock_exit is done as an atexit() function */
    214220
    215 exit:
    216221  /* configure peripherals for safe exit */
    217222  bsp_cleanup();
  • c/src/lib/libbsp/m68k/efi332/startup/linkcmds

    rc43b34c r6335022e  
    3636}
    3737
     38__end_of_ram = 0xc0000;
    3839_copy_data_from_rom = 0;
    3940
  • c/src/lib/libbsp/m68k/efi68k/README

    rc43b34c r6335022e  
    2424can be wire-wrapped in about four days. Cost is about $100US.
    2525
    26 For more information, I can be contacted at the address below.
    27 
    28 
    2926TODO:
    3027=====
     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.
    3132- 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.
    4033
    4134                                       John S Gwynne
  • c/src/lib/libbsp/m68k/efi68k/bsp_specs

    rc43b34c r6335022e  
    55startfile: replace
    66mrtems:
    7 pg: start.o%s
     7pg: start68k.o%s
    88{!pg:
    9 g: start.o%s
     9g: start68k.o%s
    1010{!g:
    11 p: start.o%s
    12 !p: start.o%s
     11p: start68k.o%s
     12!p: start68k.o%s
    1313}}
    1414{!mrtems:
  • c/src/lib/libbsp/m68k/efi68k/console/console.c

    rc43b34c r6335022e  
    195195 */
    196196 
    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 
     197void console_init()
     198{
    205199  /* set clock divisor */
    206200  *LCR = (char)(DLAB);
     
    224218
    225219  set_vector(_catchUARTint, UART_ISR_LEVEL+24, 0);
     220}
     221
     222rtems_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;
    226229
    227230  status = rtems_io_register_name(
  • c/src/lib/libbsp/m68k/efi68k/include/bsp.h

    rc43b34c r6335022e  
    7272  }
    7373
     74/* externals */
     75
     76extern char _endtext[];
     77extern char _sdata[];
     78extern char _edata[];
     79extern char __bss_start[];
     80extern char _end[];
     81extern char _copy_data_from_rom[];
     82extern 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
    7494/* macros */
    75 
    76 #define RAM_START 0x200000
    77 #define RAM_END   0x240000
    7895
    7996#define RAW_PUTS(str) \
  • c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c

    rc43b34c r6335022e  
    2121 */
    2222
    23 #include <stdlib.h>
    2423#include <bsp.h>
    2524#include <rtems/libio.h>
     
    4746rtems_unsigned32 Timer_interrupts;
    4847
    49 /* extern void set_debug_traps(void); */
    50 /* extern void breakpoint(void); */
     48extern void set_debug_traps(void);
     49extern void breakpoint(void);
    5150
    5251/*      Initialize whatever libc we are using
     
    5655void bsp_libc_init()
    5756{
    58   extern int end;
     57/*   extern int end; */
    5958  rtems_unsigned32        heap_start;
    6059 
    61   heap_start = (rtems_unsigned32) &end;
     60  heap_start = (rtems_unsigned32) BSP_Configuration.work_space_start +
     61               (rtems_unsigned32) BSP_Configuration.work_space_size;
    6262  if (heap_start & (CPU_ALIGNMENT-1))
    6363    heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    6464 
    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);
    6673   
    6774  /*
     
    8188  else
    8289    libc_init(0);                /* non-reentrant */
    83  
    8490}
    8591 
     
    162168   */
    163169
    164   Cpu_table.pretasking_hook = bsp_pretasking_hook;  /* init libc, etc. */
     170  Cpu_table.pretasking_hook = bsp_pretasking_hook;
    165171 
    166172  Cpu_table.predriver_hook = NULL;
     
    175181  Cpu_table.interrupt_vector_table = vbr;
    176182
    177   Cpu_table.interrupt_stack_size = 4096;
     183  Cpu_table.interrupt_stack_size = 0;
    178184
    179185  Cpu_table.extra_mpci_receive_server_stack = 0;
     
    186192
    187193  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);
    197195
    198196  /*
     
    218216#endif
    219217
     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
    220224  rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
    221225  /* does not return */
     
    223227  /* Clock_exit is done as an atexit() function */
    224228
    225 exit:
     229/* exit: */
    226230  /* configure peripherals for safe exit */
    227231  bsp_cleanup();
  • c/src/lib/libbsp/m68k/efi68k/startup/linkcmds

    rc43b34c r6335022e  
    4444
    4545_VBR = 0x200000;                /* location of the VBR table (in RAM) */
     46__end_of_ram = 0x240000;
    4647_copy_data_from_rom = 0;
    4748
Note: See TracChangeset for help on using the changeset viewer.