summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/mips/malta
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/mips/malta')
-rw-r--r--c/src/lib/libbsp/mips/malta/Makefile.am12
-rw-r--r--c/src/lib/libbsp/mips/malta/startup/bsp_specs9
-rw-r--r--c/src/lib/libbsp/mips/malta/startup/bspreset.c34
-rw-r--r--c/src/lib/libbsp/mips/malta/startup/bspstart.c113
-rw-r--r--c/src/lib/libbsp/mips/malta/startup/inittlb.c27
-rw-r--r--c/src/lib/libbsp/mips/malta/startup/linkcmds213
-rw-r--r--c/src/lib/libbsp/mips/malta/startup/simple_access.c133
7 files changed, 6 insertions, 535 deletions
diff --git a/c/src/lib/libbsp/mips/malta/Makefile.am b/c/src/lib/libbsp/mips/malta/Makefile.am
index b7bea74064..ce78801123 100644
--- a/c/src/lib/libbsp/mips/malta/Makefile.am
+++ b/c/src/lib/libbsp/mips/malta/Makefile.am
@@ -6,7 +6,7 @@ ACLOCAL_AMFLAGS = -I ../../../../aclocal
include $(top_srcdir)/../../../../automake/compile.am
include $(top_srcdir)/../../bsp.am
-dist_project_lib_DATA = startup/bsp_specs
+dist_project_lib_DATA = ../../../../../../bsps/mips/malta/start/bsp_specs
#isr
#pci
@@ -23,15 +23,15 @@ project_lib_LIBRARIES = librtemsbsp.a
librtemsbsp_a_SOURCES =
# startup
-librtemsbsp_a_SOURCES += startup/simple_access.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/mips/malta/start/simple_access.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-default.c
-librtemsbsp_a_SOURCES += startup/bspstart.c
-librtemsbsp_a_SOURCES += startup/bspreset.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/mips/malta/start/bspstart.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/mips/malta/start/bspreset.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c
-librtemsbsp_a_SOURCES += startup/inittlb.c
-librtemsbsp_a_SOURCES += ../shared/startup/idttlb.S
+librtemsbsp_a_SOURCES += ../../../../../../bsps/mips/malta/start/inittlb.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/mips/shared/start/idttlb.S
# clock
librtemsbsp_a_SOURCES +=../../../../../../bsps/mips/shared/clock/clockdrv.c
diff --git a/c/src/lib/libbsp/mips/malta/startup/bsp_specs b/c/src/lib/libbsp/mips/malta/startup/bsp_specs
deleted file mode 100644
index 87638cc027..0000000000
--- a/c/src/lib/libbsp/mips/malta/startup/bsp_specs
+++ /dev/null
@@ -1,9 +0,0 @@
-%rename endfile old_endfile
-%rename startfile old_startfile
-
-*startfile:
-%{!qrtems: %(old_startfile)} \
-%{!nostdlib: %{qrtems: crti.o%s crtbegin.o%s}}
-
-*endfile:
-%{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s crtn.o%s}
diff --git a/c/src/lib/libbsp/mips/malta/startup/bspreset.c b/c/src/lib/libbsp/mips/malta/startup/bspreset.c
deleted file mode 100644
index 6d406ea943..0000000000
--- a/c/src/lib/libbsp/mips/malta/startup/bspreset.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * @file
- *
- * This file contains the code necessary to reset the Malta board.
- */
-
-/*
- * COPYRIGHT (c) 1989-2012.
- * 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.org/license/LICENSE.
- */
-
-#include <rtems.h>
-#include <bsp/bootcard.h>
-
-void bsp_reset(void)
-{
- uint32_t *reset;
-
- reset= (uint32_t *)0x9F000500;
- /*
- * Qemu understands 0x42 to reset simulated machine.
- * We added code to recognize 0xFF to exit simulator.
- *
- * TBD: Qemu PC simulation has option to exit on reset.
- * find processing of that command line option and
- * use it to change behaviour of 0x42.
- */
- // *reset = 0x42;
- *reset = 0xFF;
-}
diff --git a/c/src/lib/libbsp/mips/malta/startup/bspstart.c b/c/src/lib/libbsp/mips/malta/startup/bspstart.c
deleted file mode 100644
index 58eee11027..0000000000
--- a/c/src/lib/libbsp/mips/malta/startup/bspstart.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * @file
- *
- * This file contains the bsp_start() method and support.
- */
-
-/*
- * COPYRIGHT (c) 1989-2012.
- * 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.org/license/LICENSE.
- */
-
-#include <bsp.h>
-#include <libcpu/isr_entries.h>
-#include <bsp/bootcard.h>
-#include <rtems/pci.h>
-#include <bsp/irq-generic.h>
-#include <bsp/i8259.h>
-
-/*
- * STRUCTURES
- */
-
-/* Structure filled in by get_mem_info. Only the size field is
- * actually used (to clear bss), so the others aren't even filled in.
- */
-struct s_mem
-{
- unsigned int size;
- unsigned int icsize;
- unsigned int dcsize;
-};
-
-
-/*
- * GLOBALS
- */
-uint32_t bsp_clicks_per_microsecond;
-
-
-/*
- * PROTOTYPES
- */
-void clear_cache( void *address, size_t n );
-void get_mem_info( struct s_mem *mem );
-
-/*
- * EXTERNs
- */
-extern int RamSize;
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-void bsp_start( void )
-{
- /* uint32_t board_ID = 0x420; */
- static int j = 1;
- int pci_init_retval;
-
- /*
- * Note: This is the value that works for qemu, and it was
- * unable to be validated on the actual hardware.
- */
- mips_set_sr( 0x04100000 );
-
- bsp_interrupt_initialize();
-
- /*
- * XXX need to figure out a real value. :)
- * This works for the qemu simulation, but timeing may
- * be off for the actual hardware.
- */
- bsp_clicks_per_microsecond = 100;
-
- #if 1
- while ( j != 1 ) {
- int i;
- printk (".");
- for (i=0; i<1000; i++);
- }
- #endif
-
- /*
- * init PCI Bios interface...
- */
- pci_init_retval = pci_initialize();
- if (pci_init_retval != PCIB_ERR_SUCCESS) {
- printk("PCI bus: could not initialize PCI BIOS interface\n");
- }
-
- BSP_i8259s_init();
-
-}
-
-/*
- * Required routine by some gcc run-times.
- */
-void clear_cache( void *address, size_t n )
-{
-}
-
-void get_mem_info(
- struct s_mem *mem
-)
-{
- mem->size = (int) (&RamSize); /* Normally 128 or 256 MB */
-}
diff --git a/c/src/lib/libbsp/mips/malta/startup/inittlb.c b/c/src/lib/libbsp/mips/malta/startup/inittlb.c
deleted file mode 100644
index 0088b98483..0000000000
--- a/c/src/lib/libbsp/mips/malta/startup/inittlb.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * @file
- */
-
-/*
- * COPYRIGHT (c) 1989-2012.
- * 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.org/license/LICENSE.
- */
-
-#include <bsp.h>
-#include <rtems/mips/idtcpu.h>
-
-extern void resettlb( int i );
-
-void init_tlb(void);
-
-void init_tlb(void)
-{
- int i;
-
- for (i = 0; i < N_TLB_ENTRIES; i++ )
- resettlb(i);
-}
diff --git a/c/src/lib/libbsp/mips/malta/startup/linkcmds b/c/src/lib/libbsp/mips/malta/startup/linkcmds
deleted file mode 100644
index 3a71c5af8b..0000000000
--- a/c/src/lib/libbsp/mips/malta/startup/linkcmds
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * MIPS Malta Linker Script
- */
-
-/*
- * Declare some sizes.
- */
-RamBase = DEFINED(RamBase) ? RamBase : 0x80000000;
-RamSize = DEFINED(RamSize) ? RamSize : 128M;
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
-_StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000;
-
-ENTRY(_start)
-STARTUP(start.o)
-
-SECTIONS
-{
- . = 0x80010000;
- .text :
- {
- _ftext = . ;
- eprol = .;
- *(.text*)
- *(.gnu.linkonce.t*)
- *(.mips16.fn.*)
- *(.mips16.call.*)
- PROVIDE (__runtime_reloc_start = .);
- *(.rel.sdata)
- PROVIDE (__runtime_reloc_stop = .);
-
- *(.gcc_except_table*)
- *(.eh_frame_hdr)
- *(.eh_frame)
- }
-
- .init :
- {
- KEEP(*(.init))
- }
-
- .fini :
- {
- KEEP(*(.fini))
- }
-
- .ctors :
- {
- /* gcc uses crtbegin.o to find the start of
- the constructors, so we make sure it is
- first. Because this is a wildcard, it
- doesn't matter if the user does not
- actually link against crtbegin.o; the
- linker won't look for a file to match a
- wildcard. The wildcard also means that it
- doesn't matter which directory crtbegin.o
- is in. */
-
- KEEP (*crtbegin.o(.ctors))
-
- /* We don't want to include the .ctor section from
- from the crtend.o file until after the sorted ctors.
- The .ctor section from the crtend file contains the
- end of ctors marker and it must be last */
-
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*(.ctors))
- }
-
- .dtors :
- {
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*(.dtors))
-
- etext = .;
- _etext = .;
- }
-
- .rtemsroset : {
- /* for pre rtems-libbsd FreeBSD code */
- __start_set_sysctl_set = .;
- *(set_sysctl_*);
- __stop_set_sysctl_set = .;
- *(set_domain_*);
- *(set_pseudo_*);
-
- KEEP (*(SORT(.rtemsroset.*)))
-
- . = ALIGN (16);
- _endtext = .;
- }
-
- .rdata : {
- *(.rdata)
- *(.rodata)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- }
-
- .tdata : {
- _TLS_Data_begin = .;
- *(.tdata .tdata.* .gnu.linkonce.td.*)
- _TLS_Data_end = .;
- }
-
- .tbss : {
- _TLS_BSS_begin = .;
- *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
- _TLS_BSS_end = .;
- }
-
- _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
- _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
- _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
- _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
- _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
- _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
-
- _fdata = ALIGN(16);
-
- .data : {
- *(.data)
- *(.data.*)
- *(.gnu.linkonce.d*)
- SORT(CONSTRUCTORS)
- }
-
- .rtemsrwset : {
- KEEP (*(SORT(.rtemsrwset.*)))
- }
-
- . = ALIGN(8);
-
- .jcr : {
- KEEP (*(.jcr))
- }
-
- _gp = ALIGN(16) + 0x7440;
- __global = _gp;
-
- .sdata : {
- *(.sdata)
- *(.sdata.*)
- *(.gnu.linkonce.s*)
- }
- .lit8 : {
- *(.lit8)
- }
- .lit4 : {
- *(.lit4)
- }
-
- edata = .;
- _edata = .;
- _fbss = .;
-
- .sbss : {
- *(.sbss*)
- *(.scommon)
- }
- .bss : {
- _bss_start = . ;
- *(.bss*)
- *(COMMON)
- . = ALIGN (64);
- _stack_limit = .;
- . += _StackSize;
- __stack = .;
- _stack_init = .;
- WorkAreaBase = .;
- _clear_end = .;
- }
- . = 0x88400000; /* reserve some memory for Work Area */
- end = .;
- _end = .;
-
-
-/* Put starting stack in SRAM (8 Kb); this size is the same as the stack from
- the original script (when everything was in SRAM). */
- /* __stack = 0x8000A000; */
- /* 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) }
-}
diff --git a/c/src/lib/libbsp/mips/malta/startup/simple_access.c b/c/src/lib/libbsp/mips/malta/startup/simple_access.c
deleted file mode 100644
index cd15484b1c..0000000000
--- a/c/src/lib/libbsp/mips/malta/startup/simple_access.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/**
- * @file
- *
- * This file contains the code to do simple memory and io accesses.
- */
-
-/*
- * COPYRIGHT (c) 1989-2012.
- * 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.org/license/LICENSE.
- */
-
-#include <rtems.h>
-#include <bsp.h>
-
-#include <bsp/pci.h>
-#include <bsp/irq.h>
-#include <rtems/bspIo.h>
-#include <rtems/endian.h>
-// #define DEBUG_ACCESSES 1
-
-#ifdef DEBUG_ACCESSES
- #define JPRINTK(fmt, ...) printk("%s: " fmt, __FUNCTION__, ##__VA_ARGS__)
-#else
- #define JPRINTK(fmt, ...)
-#endif
-
-/*
- * * Simple accesses
- * */
-void simple_out_32(uint32_t base, uint32_t addr, uint32_t val)
-{
- volatile uint32_t *ptr;
-
- ptr = (volatile uint32_t *) (base + addr);
- *ptr = val;
-
- JPRINTK( "%p data: 0x%x\n", ptr, val);
-}
-
-void simple_out_le32(uint32_t base, uint32_t addr, uint32_t val)
-{
- volatile uint32_t *ptr;
- uint32_t data = 0;
-
- ptr = (volatile uint32_t *) (base + addr);
- rtems_uint32_to_little_endian( val, (uint8_t *) &data);
- *ptr = data;
-
- JPRINTK( "%p data: 0x%x\n", ptr, data);
-}
-
-uint8_t simple_in_8( uint32_t base, uint32_t addr ) {
- volatile uint8_t *ptr;
- uint8_t val;
-
- ptr = (volatile uint8_t *) (base + addr);
- val = *ptr;
- JPRINTK( "0x%x data: 0x%x\n", ptr, val);
-
- return val;
-}
-
-int16_t simple_in_le16( uint32_t base, uint32_t addr ) {
- volatile uint16_t *ptr;
- uint16_t val;
- uint16_t rval;
-
- ptr = (volatile uint16_t *) (base + addr);
- val = *ptr;
- rval = rtems_uint16_from_little_endian( (uint8_t *) &val);
- JPRINTK( "0x%x data: 0x%x raw: 0x%x\n", ptr, rval, val);
- return rval;
-}
-
-int16_t simple_in_16( uint32_t base, uint32_t addr ) {
- volatile uint16_t *ptr;
- uint16_t val;
-
- ptr = (volatile uint16_t *) (base + addr);
- val = *ptr;
- JPRINTK( "0x%x data: 0x%x raw: 0x%x\n", ptr, val, val);
- return val;
-}
-
-uint32_t simple_in_le32( uint32_t base, uint32_t addr ) {
- volatile uint32_t *ptr;
- uint32_t val;
- uint32_t rval;
-
- ptr = (volatile uint32_t *) (base + addr);
- val = *ptr;
- rval = rtems_uint32_from_little_endian( (uint8_t *) &val);
- JPRINTK( "0x%x data: 0x%x raw: 0x%x\n", ptr, rval, val);
- return rval;
-}
-
-uint32_t simple_in_32( uint32_t base, uint32_t addr ) {
- volatile uint32_t *ptr;
- uint32_t val;
-
- ptr = (volatile uint32_t *) (base + addr);
- val = *ptr;
- JPRINTK( "0x%x data: 0x%x raw: 0x%x\n", ptr, val, val);
- return val;
-}
-
-void simple_out_8( uint32_t base, uint32_t addr, uint8_t val ) {
- volatile uint8_t *ptr;
-
- ptr = (volatile uint8_t *) (base | addr);
- JPRINTK( "0x%x data: 0x%x\n", ptr, val);
- *ptr = val;
-}
-
-void simple_out_le16( uint32_t base, uint32_t addr, uint16_t val ) {
- volatile uint16_t *ptr;
- uint16_t data;
- ptr = (volatile uint16_t *) (base + addr);
- rtems_uint16_to_little_endian( val, (uint8_t *) &data);
- *ptr = data;
- JPRINTK( "0x%x data: 0x%x\n", ptr, data);
-}
-
-void simple_out_16( uint32_t base, uint32_t addr, uint16_t val ) {
- volatile uint16_t *ptr;
- ptr = (volatile uint16_t *) (base + addr);
- *ptr = val;
- JPRINTK( "0x%x data: 0x%x\n", ptr, val);
-}