summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/qemuppc
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-04-20 10:35:35 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-04-20 13:52:14 +0200
commit99648958668d3a33ee57974479b36201fe303f34 (patch)
tree6f27ea790e2823c6156e71219a4f54680263fac6 /c/src/lib/libbsp/powerpc/qemuppc
parentbsps: Move start files to bsps (diff)
downloadrtems-99648958668d3a33ee57974479b36201fe303f34.tar.bz2
bsps: Move startup files to bsps
Adjust build support files to new directory layout. This patch is a part of the BSP source reorganization. Update #3285.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/qemuppc')
-rw-r--r--c/src/lib/libbsp/powerpc/qemuppc/Makefile.am6
-rw-r--r--c/src/lib/libbsp/powerpc/qemuppc/startup/bsp_specs9
-rw-r--r--c/src/lib/libbsp/powerpc/qemuppc/startup/bspstart.c121
-rw-r--r--c/src/lib/libbsp/powerpc/qemuppc/startup/cmain.c55
-rw-r--r--c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds38
5 files changed, 3 insertions, 226 deletions
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am b/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am
index b918506e3b..d87eb49b56 100644
--- a/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am
@@ -3,7 +3,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/powerpc/qemuppc/start/bsp_specs
noinst_PROGRAMS =
@@ -26,8 +26,8 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspgetworkarea-defa
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/sbrk.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
-librtemsbsp_a_SOURCES += startup/cmain.c
-librtemsbsp_a_SOURCES += startup/bspstart.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/qemuppc/start/cmain.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/qemuppc/start/bspstart.c
# pclock
librtemsbsp_a_SOURCES +=../../../../../../bsps/powerpc/shared/clock/clock.c
# console
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/startup/bsp_specs b/c/src/lib/libbsp/powerpc/qemuppc/startup/bsp_specs
deleted file mode 100644
index 2625609327..0000000000
--- a/c/src/lib/libbsp/powerpc/qemuppc/startup/bsp_specs
+++ /dev/null
@@ -1,9 +0,0 @@
-%rename endfile old_endfile
-%rename startfile old_startfile
-
-*startfile:
-%{!qrtems: %(old_startfile)} \
-%{!nostdlib: %{qrtems: ecrti%O%s rtems_crti%O%s crtbegin.o%s}}
-
-*endfile:
-%{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s ecrtn.o%s}
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/startup/bspstart.c b/c/src/lib/libbsp/powerpc/qemuppc/startup/bspstart.c
deleted file mode 100644
index 94d7f4b84d..0000000000
--- a/c/src/lib/libbsp/powerpc/qemuppc/startup/bspstart.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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-2008.
- * 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 <string.h>
-#include <fcntl.h>
-
-#include <rtems/counter.h>
-
-#include <libcpu/bat.h>
-#include <libcpu/spr.h>
-#include <libcpu/powerpc-utility.h>
-
-#include <bsp.h>
-#include <bsp/irq.h>
-#include <bsp/vectors.h>
-#include <bsp/bootcard.h>
-#include <bsp/irq-generic.h>
-
-/*
- * CPU Bus Frequency
- */
-unsigned int BSP_bus_frequency;
-
-/* Configuration parameter for clock driver */
-uint32_t bsp_time_base_frequency;
-
-/* Legacy */
-uint32_t bsp_clicks_per_usec;
-
-/*
- * Memory on this board.
- */
-extern char RamSize[];
-extern char bsp_interrupt_stack_start[];
-extern char bsp_interrupt_stack_end[];
-uint32_t BSP_mem_size = (uint32_t)RamSize;
-
-/* Default decrementer exception handler */
-static int default_decrementer_exception_handler( BSP_Exception_frame *frame, unsigned number)
-{
- ppc_set_decrementer_register(UINT32_MAX);
-
- return 0;
-}
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-
-void bsp_start( void )
-{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
- uintptr_t intrStackStart;
- uintptr_t intrStackSize;
-
- /*
- * Note we can not get CPU identification dynamically, so
- * force current_ppc_cpu.
- */
- current_ppc_cpu = PPC_PSIM;
-
- /*
- * initialize the device driver parameters
- * assume we are running with 20MHz bus
- * this should speed up some tests :-)
- */
- BSP_bus_frequency = 20;
- bsp_time_base_frequency = 20000000;
- bsp_clicks_per_usec = BSP_bus_frequency;
- rtems_counter_initialize_converter(bsp_time_base_frequency);
-
- /*
- * Initialize the interrupt related settings.
- */
- intrStackStart = (uintptr_t) bsp_interrupt_stack_start;
- intrStackSize = (uintptr_t) bsp_interrupt_stack_end - intrStackStart;
-
- BSP_mem_size = (uint32_t )RamSize;
-
- /*
- * Initialize default raw exception handlers.
- */
- ppc_exc_initialize(intrStackStart, intrStackSize);
-
- /* Install default handler for the decrementer exception */
- sc = ppc_exc_set_handler( ASM_DEC_VECTOR, default_decrementer_exception_handler);
- if (sc != RTEMS_SUCCESSFUL) {
- rtems_panic("cannot install decrementer exception handler");
- }
-
- /* Initalize interrupt support */
- bsp_interrupt_initialize();
-
-#if 0
- /*
- * Setup BATs and enable MMU
- */
- /* Memory */
- setdbat(0, 0x0<<24, 0x0<<24, 2<<24, _PAGE_RW);
- setibat(0, 0x0<<24, 0x0<<24, 2<<24, 0);
- /* PCI */
- setdbat(1, 0x8<<24, 0x8<<24, 1<<24, IO_PAGE);
- setdbat(2, 0xc<<24, 0xc<<24, 1<<24, IO_PAGE);
-
- _write_MSR(_read_MSR() | MSR_DR | MSR_IR);
- __asm__ volatile("sync; isync");
-#endif
-}
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/startup/cmain.c b/c/src/lib/libbsp/powerpc/qemuppc/startup/cmain.c
deleted file mode 100644
index bf46d03177..0000000000
--- a/c/src/lib/libbsp/powerpc/qemuppc/startup/cmain.c
+++ /dev/null
@@ -1,55 +0,0 @@
-#include <bsp/bootcard.h>
-#include <bsp/linker-symbols.h>
-
-static void
-__outb(int port, unsigned char v)
-{
- *((volatile unsigned char *)(0x80000000 + port)) = v;
-}
-
-#if 0
-/* currently unused but keep just in case */
-
-static unsigned char
-__inb(int port)
-{
- return *((volatile unsigned char *)(0x80000000 + port));
-}
-#endif
-
-static void
-__memcpy (unsigned char *d, unsigned char *s, int len)
-{
- while (len--)
- *d++ = *s++;
-}
-
-static void
-__bzero (unsigned char *d, int len)
-{
- while (len--)
- *d++ = 0;
-}
-
-
-/*
- * Prototype this here because it is just the entry symbol and
- * not referenced from any compileable code.
- */
-void cmain (void);
-
-void cmain (void)
-{
- /*
- * init variable sections
- */
- __memcpy (bsp_section_data_begin, bsp_section_data_load_begin, (int)bsp_section_data_size);
- __bzero (bsp_section_bss_begin, (int)bsp_section_bss_size);
- __bzero (bsp_section_sbss_begin, (int)bsp_section_sbss_size);
- /* printk( "start of BSP\n"); */
- boot_card(0);
- /* printk( "end of BSP\n"); */
- __outb (0x92, 0x01);
- while (1)
- ;
-}
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds b/c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds
deleted file mode 100644
index 3169ad2741..0000000000
--- a/c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds
+++ /dev/null
@@ -1,38 +0,0 @@
-EXTERN(__vectors)
-
-MEMORY
- {
- EMPTY : ORIGIN = 0, LENGTH = 0
- RAM : ORIGIN = 0x2000, LENGTH = 4M - 0x2000
- ROM : ORIGIN = 0xFFC00000, LENGTH = 4M
- VECTORS : ORIGIN = 0xFFF00000, LENGTH = 0x20000
- RESET : ORIGIN = 0xFFFFFFFC, LENGTH = 0x4
- }
-
-REGION_ALIAS ("REGION_START", ROM);
-REGION_ALIAS ("REGION_FAST_TEXT", ROM);
-REGION_ALIAS ("REGION_FAST_TEXT_LOAD", ROM);
-REGION_ALIAS ("REGION_TEXT", ROM);
-REGION_ALIAS ("REGION_TEXT_LOAD", ROM);
-REGION_ALIAS ("REGION_RODATA", ROM);
-REGION_ALIAS ("REGION_RODATA_LOAD", ROM);
-REGION_ALIAS ("REGION_FAST_DATA", RAM);
-REGION_ALIAS ("REGION_FAST_DATA_LOAD", ROM);
-REGION_ALIAS ("REGION_DATA", RAM);
-REGION_ALIAS ("REGION_DATA_LOAD", ROM);
-REGION_ALIAS ("REGION_BSS", RAM);
-REGION_ALIAS ("REGION_RWEXTRA", RAM);
-REGION_ALIAS ("REGION_WORK", RAM);
-REGION_ALIAS ("REGION_STACK", RAM);
-REGION_ALIAS ("REGION_NOCACHE", EMPTY);
-REGION_ALIAS ("REGION_NOCACHE_LOAD", EMPTY);
-REGION_ALIAS ("REGION_NVRAM", EMPTY);
-
-SECTIONS {
- .reset :
- {
- KEEP(*(.reset))
- } >RESET
-}
-
-INCLUDE linkcmds.base