summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/mpc8260ads/start
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-10-22 14:46:02 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-10-22 14:46:02 +0000
commit5edbffe3f64131c582839e0bbd389fda5eeb407c (patch)
tree81ab7ce00a76f8f8cae955ef5fac8fb4cd9cc7f1 /c/src/lib/libbsp/powerpc/mpc8260ads/start
parent2001-10-22 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-5edbffe3f64131c582839e0bbd389fda5eeb407c.tar.bz2
01-10-22 Andy Dachs <a.dachs@sstl.co.uk>
* mpc8260ads added as new BSP. tm27 reported not to run at this time. * ChangeLog, Makefile.am, README, aclocal.m4, bsp_specs, clock/.cvsignore, clock/Makefile.am, clock/p_clock.c, configure.in, console/Makefile.am, console/console.c, include/Makefile.am, include/bsp.h, include/coverhd.h, irq/.cvsignore, irq/Makefile.am, irq/irq.c, irq/irq.h, irq/irq_asm.S, irq/irq_init.c, network/Makefile.am, network/README, network/if_hdlcsubr.c, network/if_hdlcsubr.h, network/network.c, start/Makefile.am, start/start.S, startup/Makefile.am, startup/bspstart.c, startup/cpuinit.c, startup/linkcmds, startup/setvec.c, times, vectors/.cvsignore, vectors/Makefile.am, vectors/vectors.S, vectors/vectors.h, vectors/vectors_init.c, wrapup/Makefile.am: New files.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/mpc8260ads/start')
-rw-r--r--c/src/lib/libbsp/powerpc/mpc8260ads/start/Makefile.am33
-rw-r--r--c/src/lib/libbsp/powerpc/mpc8260ads/start/start.S191
2 files changed, 224 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/start/Makefile.am b/c/src/lib/libbsp/powerpc/mpc8260ads/start/Makefile.am
new file mode 100644
index 0000000000..86053b9e99
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/start/Makefile.am
@@ -0,0 +1,33 @@
+##
+## $Id$
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+
+PGM = $(ARCH)/start.o
+
+S_FILES = start.S
+S_O_FILES = $(S_FILES:%.S=$(ARCH)/%.o)
+
+OBJS = $(S_O_FILES)
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../../../../../../automake/compile.am
+include $(top_srcdir)/../../../../../../automake/lib.am
+
+#
+# (OPTIONAL) Add local stuff here using +=
+#
+
+$(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o: $(PGM)
+ $(INSTALL_DATA) $< $@
+
+TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
+
+all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES)
+
+.PRECIOUS: $(PGM)
+
+EXTRA_DIST = start.S
+
+include $(top_srcdir)/../../../../../../automake/local.am
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/start/start.S b/c/src/lib/libbsp/powerpc/mpc8260ads/start/start.S
new file mode 100644
index 0000000000..b517c175c9
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/start/start.S
@@ -0,0 +1,191 @@
+/* start.S
+ *
+ * $Id$
+ *
+ * Modified for the Motorola PQII ADS board by
+ * Andy Dachs <a.dachs@sstl.co.uk> 23-11-00.
+ * Surrey Satellite Technology Limited
+ *
+ * I have a proprietary bootloader programmed into the flash
+ * on the board which initialises the SDRAM prior to calling
+ * this function.
+ *
+ * This file is based on the one by Jay Monkman (jmonkman@fracsa.com)
+ * which in turn was based on the dlentry.s file for the Papyrus BSP,
+ * written by:
+ *
+ * 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.
+ *
+ */
+
+#include "asm.h"
+
+/*
+ * The initial stack is set to run BELOW the code base address.
+ * (between the vectors and text sections)
+ *
+ * The entry veneer has to clear the BSS and copy the read only
+ * version of the data segment to the correct location.
+ */
+
+
+ .section ".entry" /* This might have to be the first thing in the
+ * text section. At one time, it had to be
+ * first, but I don't believe it is true
+ * any more. */
+ PUBLIC_VAR (start)
+SYM(start):
+ bl .startup
+base_addr:
+
+/*
+ * Parameters from linker
+ */
+toc_pointer:
+ .long s.got
+bss_length:
+ .long bss.size
+bss_addr:
+ .long bss.start
+
+PUBLIC_VAR (data_length )
+data_length:
+ .long data.size
+PUBLIC_VAR (data_addr )
+data_addr:
+ .long data.start
+
+
+
+PUBLIC_VAR (text_addr)
+text_addr:
+ .long text.start
+
+PUBLIC_VAR (text_length)
+text_length:
+ .long text.size
+
+
+/*
+ * Initialization code
+ */
+.startup:
+ /* Get start address */
+ mflr r1
+
+
+ /* --------------------------------------------------
+ * Clear MSR[EE] to disable interrupts
+ * Clear MSR[IP] bit to put vectors at 0x00000000
+ * Set MSR[FP] to enable FPU - not on my eval board!
+ * -------------------------------------------------- */
+ mfmsr r5
+ lis r13, 0xFFFF
+ ori r13, r13, 0x7FBF
+ and r5, r5, r13 /* Clear EE and IP */
+#if 1
+ ori r5, r5, 0x2000 /* Enable FPU */
+#endif
+ mtmsr r5
+
+
+
+
+#ifdef ENABLE_CACHE
+ /* Enable caches */
+ mfspr r5, 1008
+ ori r5, r5, 0x8000
+ isync
+ mtspr 1008, r5
+
+/* Leave D-cache disabled for now */
+#if 0
+ ori r5, r5, 0x4000
+ sync
+ mtspr 1008, r5
+#endif
+#endif
+
+
+ /*--------------------------------------------------
+ * Set up the power management modes
+ * The 8260 has a dynamic power management mode that
+ * is automatically invoked if the unit is idle.
+ * We invoke the NAP mode in the RTEMS idle task.
+ *-------------------------------------------------- */
+
+ lis r13, 0x0050 /* set nap mode and DPM */
+ or r5, r5, r13
+ mtspr 1008, r5
+
+ /*--------------------------------------------------
+ *
+ *-------------------------------------------------- */
+
+
+
+ /* clear the bss section */
+ bl bssclr
+
+
+/*
+ * C_setup.
+ */
+
+ /* set toc */
+ lwz r2, toc_pointer-base_addr(r1)
+
+ /* Set up stack pointer = beginning of text section - 56 */
+ addi r1, r1, -56-4
+
+
+ /* clear argc and argv */
+ xor r3, r3, r3
+ xor r4, r4, r4
+
+ .extern SYM (boot_card)
+ bl SYM (boot_card) /* call the first C routine */
+
+
+
+ /* we don't expect to return from boot_card but if we do */
+ /* wait here for watchdog to kick us into hard reset */
+
+
+twiddle:
+ b twiddle
+
+
+/*
+ * bssclr - zero out bss
+ */
+bssclr:
+ lwz r4, bss_addr-base_addr(r1) /* Start of bss */
+ lwz r5, bss_length-base_addr(r1) /* Length of bss */
+
+ rlwinm. r5,r5,30,0x3FFFFFFF /* form length/4 */
+ beqlr /* no bss */
+ mtctr r5 /* set ctr reg */
+ xor r6,r6,r6 /* r6 = 0 */
+clear_bss:
+ stswi r6,r4,0x4 /* store r6 */
+ addi r4,r4,0x4 /* update r2 */
+
+ bdnz clear_bss /* dec counter and loop */
+ blr /* return */
+
+
+