summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/helas403/dlentry
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-09-30 21:50:42 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-09-30 21:50:42 +0000
commitbe4284d0f20bccba0b27e915fd196c7ebac86297 (patch)
tree46597a2c2cb3d74b3292093e5c2de43d00fa43fd /c/src/lib/libbsp/powerpc/helas403/dlentry
parentCorrected TYPO error in the file. (diff)
downloadrtems-be4284d0f20bccba0b27e915fd196c7ebac86297.tar.bz2
BSP submitted by Thomas Doerfler <td@imd.m.isar.de>:
Finally I am through: I have found the last bugs that made RTEMS- 4.0-beta3 start on my ppc403 board from ROM. So now the '403 support is up to date again. Roughly I have added the following features: - support for the on-chip interrupt controller (in a separate module) - interrupt support for the console device - termios support for the console device ============================================== Since the BSP behaivour changed in some details (console no longer is polling, other memory layout etc) I have created a new BSP "helas403" rather than changing the "papyrus" BSP. The old "polled" console driver still sticks around in "console.c.polled" To get the BSP up and running, I had to create the new BSP files (derived from papyrus). Besides that, the following source areas have been changed: - c/src/lib/libcpu/powerpc/ppc403: changes to console driver, small changes to clock driver, new "ictrl" interrupt controller driver - c/src/exec/score/cpu/powerpc/ppc.h: some small changes (added ppc403 characteristics like a exception vector prefix register, some special register definitions). I am quite sure, they are compatible with the existing sources, although I did not check - c/src/exec/score/cpu/powerpc/cpu.c: There is one severe limitation in the exception entries: Due to the current code arrangement, the "branch absolute" to the ISR handler may only jump to the first 128MByte or the last 128MByte of the 4GByte address range. When the ppc403 is running out of ROM, the ROM functions are located in the last 128MByte (0xFFF00000 and up). These addresses were not handled correctly (sign reduced) in "install_raw_handler". The change I added should work on existing ppc BSPs aswell... - c/src/lib/libc/termios.c: During my tests, I added one change you sent me, so this patch will already be incorporated in the current source tree. There are some smaller changes, see the attached diff file. ========================================= Concerning the GNU toolchain: I tried several tool chains. Finally I almost succeeded with egcs-1.0.3a with patch egcs-1.0.3-rtems-diff-19980527 I had to add the following lines to the egcs files. Without them configure complaint that the cross compiler could not generate executable output. - additional lines needed in egcs distribution in file gcc/config/rs6000/rtems.h: +++ lines start #undef STARTFILE_DEFAULT_SPEC #define STARTFILE_DEFAULT_SPEC "ecrti.o%s" #undef ENDFILE_DEFAULT_SPEC #define ENDFILE_DEFAULT_SPEC "ecrtn.o%s" ++++ lines end As far as I have seen in the Changelog of egcs, you have recently sent two patches affecting the powerpc support, but they were added in the wrong order.... :-( egcs-19980628 with patch egcs-19980628-rtems-diff-19980707 does not work! I used binutils 2.9.1 with patch binutils-2.9.1-rtems-diff-19980515 (binutils 2.8.1 does not work, internal error in gas) and newlib-1.8.0 with patch newlib-1.8.0-rtems-diff-19980707 Finally I had to poke a line in the "bit" script, since, on my LINUX machine, the GNU make is only available as "make", not as "gmake"... For all the tools and newlib I selected configuration "powerpc- rtems". -------------------------------------------- IMD Ingenieurbuero fuer Microcomputertechnik Thomas Doerfler Herbststrasse 8 D-82178 Puchheim Germany email: td@imd.m.isar.de
Diffstat (limited to 'c/src/lib/libbsp/powerpc/helas403/dlentry')
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/dlentry/Makefile.in59
-rw-r--r--c/src/lib/libbsp/powerpc/helas403/dlentry/dlentry.s144
2 files changed, 203 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/helas403/dlentry/Makefile.in b/c/src/lib/libbsp/powerpc/helas403/dlentry/Makefile.in
new file mode 100644
index 0000000000..dc40c405f6
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/helas403/dlentry/Makefile.in
@@ -0,0 +1,59 @@
+#
+# $Id$
+#
+
+@SET_MAKE@
+srcdir = @srcdir@
+VPATH = @srcdir@
+RTEMS_ROOT = @top_srcdir@
+PROJECT_ROOT = @PROJECT_ROOT@
+
+PGM=${ARCH}/dlentry.rel
+
+# C source names, if any, go here -- minus the .c
+C_PIECES=
+C_FILES=$(C_PIECES:%=%.c)
+C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
+
+H_FILES=
+
+# Assembly source names, if any, go here -- minus the .s
+S_PIECES=dlentry
+S_FILES=$(S_PIECES:%=%.s)
+S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
+
+SRCS=$(C_FILES) $(H_FILES) $(S_FILES)
+OBJS=$(C_O_FILES) $(S_O_FILES)
+
+include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
+include $(RTEMS_ROOT)/make/leaf.cfg
+
+#
+# (OPTIONAL) Add local stuff here using +=
+#
+
+DEFINES +=
+CPPFLAGS +=
+CFLAGS +=
+
+LD_PATHS +=
+LD_LIBS +=
+LDFLAGS +=
+
+#
+# Add your list of files to delete here. The config files
+# already know how to delete some stuff, so you may want
+# to just run 'make clean' first to see what gets missed.
+# 'make clobber' already includes 'make clean'
+#
+
+CLEAN_ADDITIONS +=
+CLOBBER_ADDITIONS +=
+
+${PGM}: ${SRCS} ${OBJS}
+ $(make-rel)
+
+all: ${ARCH} $(SRCS) $(PGM)
+
+# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
+install: all
diff --git a/c/src/lib/libbsp/powerpc/helas403/dlentry/dlentry.s b/c/src/lib/libbsp/powerpc/helas403/dlentry/dlentry.s
new file mode 100644
index 0000000000..3944d2bc47
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/helas403/dlentry/dlentry.s
@@ -0,0 +1,144 @@
+/* dlentry.s
+ *
+ * This file contains the entry code for RTEMS programs starting
+ * after download to RAM
+ *
+ * Author: Thomas Doerfler <td@imd.m.isar.de>
+ * IMD Ingenieurbuero fuer Microcomputertechnik
+ *
+ * COPYRIGHT (c) 1998 by IMD
+ *
+ * Changes from IMD are covered by the original distributions terms.
+ * This file has been derived from the papyrus BSP:
+ *
+ * This file contains the entry veneer for RTEMS programs
+ * downloaded to Papyrus.
+ *
+ * Author: Andrew Bray <andy@i-cubed.co.uk>
+ *
+ * COPYRIGHT (c) 1995 by i-cubed ltd.
+ *
+ * To anyone who acknowledges that this file is provided "AS IS"
+ * without any express or implied warranty:
+ * permission to use, copy, modify, and distribute this file
+ * for any purpose is hereby granted without fee, provided that
+ * the above copyright notice and this notice appears in all
+ * copies, and that the name of i-cubed limited not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * i-cubed limited makes no representations about the suitability
+ * of this software for any purpose.
+ *
+ * $Id$
+ */
+
+#include "asm.h"
+
+/*
+ * The helas403 ELF link scripts support three special sections:
+ * .entry The actual entry point
+ * .vectors The section containing the interrupt entry veneers.
+ */
+
+/*
+ * Downloaded code loads the vectors separately to 0x00000100,
+ * so .entry can be over 256 bytes.
+ *
+ * The other sections are linked in the following order:
+ * .entry
+ * .text
+ * .data
+ * .bss
+ * see linker command file for section placement
+ *
+ * The initial stack is set to stack.end
+ *
+ * All the entry veneer has to do is to clear the BSS.
+ */
+
+/*
+ * GDB likes to have debugging information for the entry veneer.
+ * Here was some DWARF information. IMD removed it, because we
+ * could not check, whether it was still correct. Sorry.
+
+ */
+
+#if PPC_ASM == PPC_ASM_ELF
+ .section .entry
+#else
+ .csect .text[PR]
+#endif
+
+ PUBLIC_VAR (download_entry)
+SYM(download_entry):
+ bl .startup
+base_addr:
+
+/*---------------------------------------------------------------------------
+ * Parameters from linker
+ *--------------------------------------------------------------------------*/
+toc_pointer:
+#if PPC_ASM == PPC_ASM_ELF
+ .long s.got
+#else
+ .long TOC[tc0]
+#endif
+bss_length:
+ .long bss.size
+bss_addr:
+ .long bss.start
+stack_top:
+ .long stack.end
+/*---------------------------------------------------------------------------
+ * Reset_entry.
+ *--------------------------------------------------------------------------*/
+.startup:
+ /* Get start address, stack grows down from here... */
+ mflr r1
+
+ /* Assume Bank regs set up..., cache etc. */
+ bl bssclr
+
+ .extern SYM(__vectors)
+
+ lis r2,__vectors@h /* set EVPR exc. vector prefix */
+ mtspr evpr,r2
+
+ /*-------------------------------------------------------------------
+ * C_setup.
+ *------------------------------------------------------------------*/
+ lwz r2,toc_pointer-base_addr(r1) /* set r2 to toc */
+ lwz r1,stack_top-base_addr(r1) /* set r1 to stack_top */
+
+ addi r1,r1,-56-4 /* start stack at text_addr - 56 */
+ addi r3,r0,0x0 /* clear r3 */
+ stw r3, 0(r1) /* Clear stack chain */
+ stw r3, 4(r1)
+ stw r3, 8(r1)
+ stw r3, 12(r1)
+ .extern SYM (boot_card)
+ b SYM (boot_card) /* call the first C routine */
+
+/*---------------------------------------------------------------------------
+ * bssclr.
+ *--------------------------------------------------------------------------*/
+bssclr:
+ /*-------------------------------------------------------------------
+ * Data move finished, zero out bss.
+ *------------------------------------------------------------------*/
+ lwz r2,bss_addr-base_addr(r1) /* start of bss set by loader */
+ lwz r3,bss_length-base_addr(r1) /* bss length */
+ rlwinm. r3,r3,30,0x3FFFFFFF /* form length/4 */
+ beqlr /* no bss */
+ mtctr r3 /* set ctr reg */
+ xor r6,r6,r6 /* r6 = 0 */
+clear_bss:
+ stswi r6,r2,0x4 /* store r6 */
+ addi r2,r2,0x4 /* update r2 */
+ bdnz clear_bss /* decrement counter and loop */
+ blr /* return */
+.L_text_e:
+
+#if PPC_ABI == PPC_ABI_POWEROPEN
+ DESCRIPTOR (startup)
+#endif