summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/dmv177/startup
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/powerpc/dmv177/startup')
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c18
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c138
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c226
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds198
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c56
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c83
6 files changed, 0 insertions, 719 deletions
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c b/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c
deleted file mode 100644
index 34b747089b..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-void bsp_cleanup( void )
-{
-#if 0
- asm volatile( "li 10,99" ); /* 0x63 */
- asm volatile( "sc" );
-#endif
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c b/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c
deleted file mode 100644
index 0a1ef09de1..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/* bspstart.c
- *
- * This set of routines starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before any of these are invoked.
- *
- * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
- * On-Line Applications Research Corporation (OAR).
- *
- * $Id$
- */
-
-#include <string.h>
-
-#include <bsp.h>
-#include <rtems/libio.h>
-#include <rtems/libcsupport.h>
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-
-extern rtems_configuration_table Configuration;
-rtems_configuration_table BSP_Configuration;
-rtems_cpu_table Cpu_table;
-uint32_t bsp_isr_level;
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, uint32_t, int );
-
-/*PAGE
- *
- * bsp_pretasking_hook
- *
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- */
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- uint32_t heap_start;
- uint32_t heap_size;
-
- heap_start = (uint32_t) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- heap_size = BSP_Configuration.work_space_start - (void *)&end;
- heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
-
- bsp_libc_init((void *) heap_start, heap_size, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-/* PAGE
- *
- * bsp_predriver_hook
- *
- * Initialization before drivers are setup.
- */
-
-void bsp_predriver_hook(void)
-{
- initialize_external_exception_vector();
-}
-
-/*PAGE
- *
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- unsigned char *work_space_start;
- unsigned int msr_value = 0x2030;
-
- /*
- * Set BSP to initial value. Note: This value is a guess
- * check how the real board comes up. This is critical to
- * getting the source to work with the debugger.
- */
-
- _CPU_MSR_SET( msr_value );
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- work_space_start =
- (unsigned char *)&RAM_END - BSP_Configuration.work_space_size;
-
- if ( work_space_start <= (unsigned char *)&end ) {
- DEBUG_puts( "bspstart: Not enough RAM!!!\n" );
- bsp_cleanup();
- }
-
- BSP_Configuration.work_space_start = work_space_start;
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.exceptions_in_RAM = TRUE;
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.predriver_hook = bsp_predriver_hook;
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- /* Cpu_table.clicks_per_usec = 66666667 / 4000000; */
- Cpu_table.clicks_per_usec = 66666667 / 4000000 / 2;
-
- Cpu_table.do_zero_of_workspace = TRUE;
- Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
-
- /*
- * Enable whatever caching is desired
- */
-
-#if ( DMV177_USE_INSTRUCTION_CACHE )
- rtems_cache_enable_instruction();
-#endif
-
-#if ( PPC_USE_DATA_CACHE )
- rtems_cache_enable_data();
-#endif
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c b/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c
deleted file mode 100644
index 82a2fdc001..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/* genpvec.c
- *
- * These routines handle the external exception. Multiple ISRs occur off
- * of this one interrupt. This method will allow multiple ISRs to be
- * called using the same IRQ index. However, removing the ISR routines is
- * presently not supported.
- *
- * The external exception vector numbers begin with DMV170_IRQ_FIRST.
- * DMV170_IRQ_FIRST is defined to be one greater than the last processor
- * interrupt.
- *
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <rtems/chain.h>
-#include <assert.h>
-
-#define NUM_LIRQ_HANDLERS 20
-#define NUM_LIRQ ( MAX_BOARD_IRQS - PPC_IRQ_LAST )
-
-/*
- * Structure to for one of possible multiple interrupt handlers for
- * a given interrupt.
- */
-typedef struct
-{
- Chain_Node Node;
- rtems_isr_entry handler; /* isr routine */
- rtems_vector_number vector; /* vector number */
-} EE_ISR_Type;
-
-/*
- * Note: The following will not work if we add a method to remove
- * handlers at a later time.
- */
-EE_ISR_Type ISR_Nodes [NUM_LIRQ_HANDLERS];
-uint16_t Nodes_Used;
-Chain_Control ISR_Array [NUM_LIRQ];
-
-/*PAGE
- *
- * external_exception_ISR
- *
- * This interrupt service routine is called for an External Exception.
- *
- * Input parameters:
- * vector - vector number representing the external exception vector.
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_isr external_exception_ISR (
- rtems_vector_number vector /* IN */
-)
-{
- uint16_t index;
- rtems_boolean is_active=FALSE;
- uint32_t scv64_status;
- Chain_Node *node;
- EE_ISR_Type *ee_isr;
-
- /*
- * Get all active interrupts.
- */
- scv64_status = SCV64_Get_Interrupt();
- scv64_status &= SCV64_Get_Interrupt_Enable();
-
- /*
- * Process any set interrupts.
- */
- for (index = 0; index <= 5; index++) {
- switch(index) {
- case 0:
- is_active = SCV64_Is_IRQ0( scv64_status );
- break;
- case 1:
- is_active = SCV64_Is_IRQ1( scv64_status );
- break;
- case 2:
- is_active = SCV64_Is_IRQ2( scv64_status );
- break;
- case 3:
- is_active = SCV64_Is_IRQ3( scv64_status );
- break;
- case 4:
- is_active = SCV64_Is_IRQ4( scv64_status );
- break;
- case 5:
- is_active = SCV64_Is_IRQ5( scv64_status );
- break;
- }
-
- if (is_active) {
- /*
- * Read vector.
- */
- node = ISR_Array[ index ].first;
- while ( !_Chain_Is_tail( &ISR_Array[ index ], node ) ) {
- ee_isr = (EE_ISR_Type *) node;
- (*ee_isr->handler)( ee_isr->vector );
- node = node->next;
- }
- }
- }
-}
-
-/*PAGE
- *
- * initialize_external_exception_vector
- *
- * This routine initializes the external exception vector
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void initialize_external_exception_vector ()
-{
- int i;
- rtems_isr_entry previous_isr;
- rtems_status_code status;
- extern void SCV64_Initialize( void );
-
- Nodes_Used = 0;
-
- /*
- * Initialize the SCV64 chip
- */
- SCV64_Initialize();
-
- for (i=0; i <NUM_LIRQ; i++)
- Chain_Initialize_empty( &ISR_Array[i] );
-
- /*
- * Install external_exception_ISR () as the handler for
- * the General Purpose Interrupt.
- */
-
- status = rtems_interrupt_catch( external_exception_ISR,
- PPC_IRQ_EXTERNAL , (rtems_isr_entry *) &previous_isr );
-
-}
-
-/*PAGE
- *
- * set_EE_vector
- *
- * This routine installs one of multiple ISRs for the general purpose
- * inerrupt.
- *
- * Input parameters:
- * handler - handler to call at exception
- * vector - vector number associated with this handler.
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-rtems_isr_entry set_EE_vector(
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector /* vector number */
-)
-{
- uint16_t vec_idx = vector - DMV170_IRQ_FIRST;
- uint32_t index;
-
- /*
- * Verify that all of the nodes have not been used.
- */
- assert (Nodes_Used < NUM_LIRQ_HANDLERS);
-
- /*
- * If we have already installed this handler for this vector, then
- * just reset it.
- */
-
- for ( index=0 ; index <= Nodes_Used ; index++ ) {
- if ( ISR_Nodes[index].vector == vector &&
- ISR_Nodes[index].handler == handler )
- return 0;
- }
-
- /*
- * Increment the number of nedes used and set the index for the node
- * array.
- */
-
- Nodes_Used++;
- index = Nodes_Used - 1;
-
- /*
- * Write the values of the handler and the vector to this node.
- */
- ISR_Nodes[index].handler = handler;
- ISR_Nodes[index].vector = vector;
-
- /*
- * Connect this node to the chain at the location of the
- * vector index.
- */
- Chain_Append( &ISR_Array[vec_idx], &ISR_Nodes[index].Node );
-
- /*
- * Enable the LIRQ interrupt.
- */
- SCV64_Generate_DUART_Interrupts();
-
- /*
- * No interrupt service routine was removed so return 0
- */
- return 0;
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds b/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds
deleted file mode 100644
index 3579e49f29..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds
+++ /dev/null
@@ -1,198 +0,0 @@
-OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
- "elf32-powerpc")
-OUTPUT_ARCH(powerpc)
-ENTRY(_start)
-
-/*
- * Number of Decrementer countdowns per millisecond
- *
- * Calculated by: (66.67 Mhz * 1000) / 4 cycles per click
- *
-
-PROVIDE(CPU_PPC_CLICKS_PER_MS = 16667);
-*/
-
-MEMORY
- {
- RAM : ORIGIN = 0x41000, LENGTH = 32M
- EPROM : ORIGIN = 0xFFF00000, LENGTH = 0x20000
- }
-
-SECTIONS
-{
- /* Read-only sections, merged into text segment: */
- /* . = 0x40000 + SIZEOF_HEADERS; */
- /* . = 0x1000000;*/
- . = 0x41000;
- .interp : { *(.interp) }
- .hash : { *(.hash) }
- .dynsym : { *(.dynsym) }
- .dynstr : { *(.dynstr) }
- .rela.text : { *(.rela.text) }
- .rela.data : { *(.rela.data) }
- .rela.rodata : { *(.rela.rodata) }
- .rela.got : { *(.rela.got) }
- .rela.got1 : { *(.rela.got1) }
- .rela.got2 : { *(.rela.got2) }
- .rela.ctors : { *(.rela.ctors) }
- .rela.dtors : { *(.rela.dtors) }
- .rela.init : { *(.rela.init) }
- .rela.fini : { *(.rela.fini) }
- .rela.bss : { *(.rela.bss) }
- .rela.plt : { *(.rela.plt) }
- .rela.sdata : { *(.rela.sdata2) }
- .rela.sbss : { *(.rela.sbss2) }
- .rela.sdata2 : { *(.rela.sdata2) }
- .rela.sbss2 : { *(.rela.sbss2) }
- .plt : { *(.plt) }
- .text :
- {
- *(.text)
- *(.gnu.linkonce.t.*)
- *(.descriptors)
-
- /*
- * Special FreeBSD sysctl sections.
- */
- . = ALIGN (16);
- __start_set_sysctl_set = .;
- *(set_sysctl_*);
- __stop_set_sysctl_set = ABSOLUTE(.);
- *(set_domain_*);
- *(set_pseudo_*);
-
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- } >RAM
- .init : { _init = .; *(.init) } >RAM
- .fini : { _fini = .; *(.fini) } >RAM
- .eh_frame : { *.(eh_frame) } >RAM
-
- .rodata : { *(.rodata*) *(.gnu.linkonce.r*) } >RAM
- .rodata1 : { *(.rodata1) } >RAM
- _etext = .;
- PROVIDE (etext = .);
- PROVIDE (__SDATA2_START__ = .);
- .sdata2 : { *(.sdata2) *(.gnu.linkonce.s2.*) } >RAM
- .sbss2 : { *(.sbss2) *(.gnu.linkonce.sb2.*) } >RAM
- PROVIDE (__SBSS2_END__ = .);
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. It would
- be more correct to do this:
- . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
- The current expression does not correctly handle the case of a
- text segment ending precisely at the end of a page; it causes the
- data segment to skip a page. The above expression does not have
- this problem, but it will currently (2/95) cause BFD to allocate
- a single segment, combining both text and data, for this case.
- This will prevent the text segment from being shared among
- multiple executions of the program; I think that is more
- important than losing a page of the virtual address space (note
- that no actual memory is lost; the page which is skipped can not
- be referenced). */
- . = ALIGN(8) + 0x40000;
- PROVIDE (sdata = .);
- .data :
- {
- *(.data)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- } >RAM
- PROVIDE (__EXCEPT_START__ = .);
- .gcc_except_table : { *(.gcc_except_table) } >RAM
- PROVIDE (__EXCEPT_END__ = .);
-
- .data1 : { *(.data1) } >RAM
- .got1 : { *(.got1) } >RAM
- .dynamic : { *(.dynamic) } >RAM
- /* Put .ctors and .dtors next to the .got2 section, so that the pointers
- get relocated with -mrelocatable. Also put in the .fixup pointers.
- The current compiler no longer needs this, but keep it around for 2.7.2 */
- PROVIDE (_GOT2_START_ = .);
- PROVIDE (__GOT2_START__ = .);
- .got2 : { *(.got2) } >RAM
- PROVIDE (_GOT2_END_ = .);
- PROVIDE (__GOT2_END__ = .);
-
- PROVIDE (__CTOR_LIST__ = .);
- .ctors : { *(.ctors) } >RAM
- PROVIDE (__CTOR_END__ = .);
-
- PROVIDE (__DTOR_LIST__ = .);
- .dtors : { *(.dtors) } >RAM
- PROVIDE (__DTOR_END__ = .);
-
- PROVIDE (_FIXUP_START_ = .);
- PROVIDE (__FIXUP_START__ = .);
- .fixup : { *(.fixup) } >RAM
- PROVIDE (_FIXUP_END_ = .);
- PROVIDE (__FIXUP_END__ = .);
-
- PROVIDE (_GOT2_END_ = .);
- PROVIDE (_GOT_START_ = .);
- s.got = .;
- .got : { *(.got) } >RAM
- .got.plt : { *(.got.plt) } >RAM
- PROVIDE (_GOT_END_ = .);
- PROVIDE (__GOT_END__ = .);
-
- /* We want the small data sections together, so single-instruction offsets
- can access them all, and initialized data all before uninitialized, so
- we can shorten the on-disk segment size. */
- PROVIDE (__SDATA_START__ = .);
- .sdata : { *(.sdata) *(.gnu.linkonce.s.*) } >RAM
- _edata = .;
- PROVIDE (edata = .);
-
- PROVIDE (RAM_END = 4M);
- .sbss :
- {
- PROVIDE (__sbss_start = .);
- *(.sbss)
- *(.scommon)
- PROVIDE (__sbss_end = .);
- } >RAM
- PROVIDE (__SBSS_END__ = .);
- .bss :
- {
- PROVIDE (__bss_start = .);
- *(.dynbss)
- *(.bss)
- *(COMMON)
- } >RAM
- . = ALIGN(8) + 0x8000;
- PROVIDE (__stack = .);
- _end = . ;
- PROVIDE (end = .);
-
- /* These are needed for ELF backends which have not yet been
- converted to the new style linker. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
- /* DWARF 1 */
- .debug 0 : { *(.debug) }
- .line 0 : { *(.line) }
- /* GNU DWARF 1 extensions */
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- /* DWARF 1.1 and DWARF 2 */
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- /* DWARF 2 */
- .debug_info 0 : { *(.debug_info) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line) }
- .debug_frame 0 : { *(.debug_frame) }
- .debug_str 0 : { *(.debug_str) }
- .debug_loc 0 : { *(.debug_loc) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- /* SGI/MIPS DWARF 2 extensions */
- .debug_weaknames 0 : { *(.debug_weaknames) }
- .debug_funcnames 0 : { *(.debug_funcnames) }
- .debug_typenames 0 : { *(.debug_typenames) }
- .debug_varnames 0 : { *(.debug_varnames) }
- /* These must appear regardless of . */
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c b/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c
deleted file mode 100644
index 614a9b8205..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* set_vector
- *
- * This routine installs an interrupt vector on the target Board/CPU.
- * This routine is allowed to be as board dependent as necessary.
- *
- * INPUT:
- * handler - interrupt handler entry point
- * vector - vector number
- * type - 0 indicates raw hardware connect
- * 1 indicates RTEMS interrupt connect
- *
- * RETURNS:
- * address of previous interrupt handler
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-
-/*PAGE
- *
- * set_vector
- *
- * This routine installs an interrupt handler for vector.
- */
-
-rtems_isr_entry set_vector( /* returns old vector */
- rtems_isr_entry handler, /* isr routine */
- rtems_vector_number vector, /* vector number */
- int type /* RTEMS or RAW intr */
-)
-{
- rtems_isr_entry previous_isr;
- rtems_status_code status;
-
- /*
- * vectors greater than PPC603e_IRQ_LAST are handled by the General purpose
- * interupt handler.
- */
- if ( vector > PPC_IRQ_LAST ) {
- set_EE_vector ( handler, vector );
- }
- else {
- status = rtems_interrupt_catch(
- handler, vector, (rtems_isr_entry *) &previous_isr );
- }
- return previous_isr;
-}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c b/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c
deleted file mode 100644
index 3643510aef..0000000000
--- a/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* vmeintr.c
- *
- * VMEbus support routines for the DMV170.
- *
- * COPYRIGHT (c) 1989-1997.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may in
- * the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <rtems/vmeintr.h>
-
-/* PAGE
- *
- * VME_interrupt_Disable
- *
- * This routine disables vme interupts
- *
- * Input parameters:
- * mask - interupt mask
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void VME_interrupt_Disable (
- VME_interrupt_Mask mask /* IN */
-)
-{
- volatile uint8_t *VME_interrupt_enable;
- uint8_t value;
-
-#if 0
- VME_interrupt_enable = ACC_VIE;
-#else
- VME_interrupt_enable = 0;
-#endif
- value = *VME_interrupt_enable;
-
- value &= ~mask; /* turn off interrupts for all levels in mask */
-
- *VME_interrupt_enable = value;
-}
-
-/* PAGE
- *
- * VME_interrupt_Enable
- *
- * This routine enables vme interupts
- *
- * Input parameters:
- * mask - interupt mask
- *
- * Output parameters: NONE
- *
- * Return values:
- */
-
-void VME_interrupt_Enable (
- VME_interrupt_Mask mask /* IN */
-)
-{
- volatile uint8_t *VME_interrupt_enable;
- uint8_t value;
-
-#if 0
- VME_interrupt_enable = ACC_VIE;
-#else
- VME_interrupt_enable = 0;
-#endif
- value = *VME_interrupt_enable;
-
- value |= mask; /* turn on interrupts for all levels in mask */
-
- *VME_interrupt_enable = value;
-}