summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/shared/motorola
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-12-02 14:31:19 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-12-02 14:31:19 +0000
commitacc25eec35e186abc118b9ca4f097e22fc6b4846 (patch)
tree7fa75871c51372e70cbd9cb50b0a2fab55cfa750 /c/src/lib/libbsp/powerpc/shared/motorola
parentMerged of mcp750 and mvme2307 BSP by Eric Valette <valette@crf.canon.fr>. (diff)
downloadrtems-acc25eec35e186abc118b9ca4f097e22fc6b4846.tar.bz2
Merged of mcp750 and mvme2307 BSP by Eric Valette <valette@crf.canon.fr>.
As part of this effort, the mpc750 libcpu code is now shared with the ppc6xx.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/shared/motorola')
-rw-r--r--c/src/lib/libbsp/powerpc/shared/motorola/Makefile.in41
-rw-r--r--c/src/lib/libbsp/powerpc/shared/motorola/motorola.c120
-rw-r--r--c/src/lib/libbsp/powerpc/shared/motorola/motorola.h67
3 files changed, 228 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/motorola/Makefile.in b/c/src/lib/libbsp/powerpc/shared/motorola/Makefile.in
new file mode 100644
index 0000000000..7554571769
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/shared/motorola/Makefile.in
@@ -0,0 +1,41 @@
+#
+# $Id$
+#
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ../../..
+subdir = powerpc/shared/motorola
+
+RTEMS_ROOT = @RTEMS_ROOT@
+PROJECT_ROOT = @PROJECT_ROOT@
+
+VPATH = @srcdir@
+
+H_FILES = $(srcdir)/motorola.h
+
+SRCS = $(C_FILES) $(H_FILES)
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(RTEMS_ROOT)/make/leaf.cfg
+
+INSTALL_CHANGE = @INSTALL_CHANGE@
+mkinstalldirs = $(SHELL) $(top_srcdir)/@RTEMS_TOPdir@/mkinstalldirs
+
+INSTALLDIRS = $(PROJECT_INCLUDE)/bsp
+
+$(INSTALLDIRS):
+ @$(mkinstalldirs) $(INSTALLDIRS)
+
+preinstall:
+ @$(mkinstalldirs) $(PROJECT_INCLUDE)/bsp
+ @$(INSTALL_CHANGE) -m 644 $(H_FILES) $(PROJECT_INCLUDE)/bsp
+
+all: ${ARCH} $(SRCS) preinstall
+
+install: all
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
diff --git a/c/src/lib/libbsp/powerpc/shared/motorola/motorola.c b/c/src/lib/libbsp/powerpc/shared/motorola/motorola.c
new file mode 100644
index 0000000000..6b8d52eeb7
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/shared/motorola/motorola.c
@@ -0,0 +1,120 @@
+/* motorola.h
+ *
+ * This include file describe the data structure and the functions implemented
+ * by rtems to identify motorola boards.
+ *
+ * CopyRight (C) 1999 valette@crf.canon.fr
+ *
+ * The license and distribution terms for this file may be
+ * found in found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+
+#include <bsp/motorola.h>
+#include <libcpu/io.h>
+
+typedef struct {
+ /*
+ * 0x100 mask assumes for Raven and Hawk boards
+ * that the level/edge are set.
+ * 0x200 if this board has a Hawk chip.
+ */
+ int cpu_type;
+ int base_type;
+ const char *name;
+} mot_info_t;
+
+
+static const mot_info_t mot_boards[] = {
+ {0x300, 0x00, "MVME 2400"},
+ {0x010, 0x00, "Genesis"},
+ {0x020, 0x00, "Powerstack (Series E)"},
+ {0x040, 0x00, "Blackhawk (Powerstack)"},
+ {0x050, 0x00, "Omaha (PowerStack II Pro3000)"},
+ {0x060, 0x00, "Utah (Powerstack II Pro4000)"},
+ {0x0A0, 0x00, "Powerstack (Series EX)"},
+ {0x1E0, 0xE0, "Mesquite cPCI (MCP750)"},
+ {0x1E0, 0xE1, "Sitka cPCI (MCPN750)"},
+ {0x1E0, 0xE2, "Mesquite cPCI (MCP750) w/ HAC"},
+ {0x1E0, 0xF6, "MTX Plus"},
+ {0x1E0, 0xF7, "MTX wo/ Parallel Port"},
+ {0x1E0, 0xF8, "MTX w/ Parallel Port"},
+ {0x1E0, 0xF9, "MVME 2300"},
+ {0x1E0, 0xFA, "MVME 2300SC/2600"},
+ {0x1E0, 0xFB, "MVME 2600 with MVME712M"},
+ {0x1E0, 0xFC, "MVME 2600/2700 with MVME761"},
+ {0x1E0, 0xFD, "MVME 3600 with MVME712M"},
+ {0x1E0, 0xFE, "MVME 3600 with MVME761"},
+ {0x1E0, 0xFF, "MVME 1600-001 or 1600-011"},
+ {0x000, 0x00, ""}
+};
+
+prep_t currentPrepType;
+motorolaBoard currentBoard;
+prep_t checkPrepBoardType(RESIDUAL *res)
+{
+ prep_t PREP_type;
+ /* figure out what kind of prep workstation we are */
+ if ( res->ResidualLength != 0 ) {
+ if ( !strncmp(res->VitalProductData.PrintableModel,"IBM",3) )
+ PREP_type = PREP_IBM;
+ else if (!strncmp(res->VitalProductData.PrintableModel,
+ "Radstone",8)){
+ PREP_type = PREP_Radstone;
+ }
+ else
+ PREP_type = PREP_Motorola;
+ }
+ else /* assume motorola if no residual (netboot?) */ {
+ PREP_type = PREP_Motorola;
+ }
+ currentPrepType = PREP_type;
+ return PREP_type;
+}
+
+motorolaBoard getMotorolaBoard()
+{
+ unsigned char cpu_type;
+ unsigned char base_mod;
+ int entry;
+ int mot_entry = -1;
+
+ cpu_type = inb(MOTOROLA_CPUTYPE_REG) & 0xF0;
+ base_mod = inb(MOTOROLA_BASETYPE_REG);
+
+ for (entry = 0; mot_boards[entry].cpu_type != 0; entry++) {
+ if ((mot_boards[entry].cpu_type & 0xff) != cpu_type)
+ continue;
+
+ if (mot_boards[entry].base_type == 0) {
+ mot_entry = entry;
+ break;
+ }
+
+ if (mot_boards[entry].base_type != base_mod)
+ continue;
+ else{
+ mot_entry = entry;
+ break;
+ }
+ }
+ if (mot_entry == -1) {
+ printk("Unkwon motorola board Please update libbsp/powerpc/shared/motorola/motorola.c\n");
+ printk("cpu_type = %x\n", (unsigned) cpu_type);
+ printk("base_mod = %x\n", (unsigned) base_mod);
+ currentBoard = MOTOROLA_UNKNOWN;
+ return currentBoard;
+ }
+ currentBoard = (motorolaBoard) mot_entry;
+ return currentBoard;
+}
+
+const char* motorolaBoardToString(motorolaBoard board)
+{
+ if (board == MOTOROLA_UNKNOWN) return "Unknown motorola board";
+ return (mot_boards[board].name);
+}
+
diff --git a/c/src/lib/libbsp/powerpc/shared/motorola/motorola.h b/c/src/lib/libbsp/powerpc/shared/motorola/motorola.h
new file mode 100644
index 0000000000..585d1d62dc
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/shared/motorola/motorola.h
@@ -0,0 +1,67 @@
+/* motorola.h
+ *
+ * This include file describe the data structure and the functions implemented
+ * by rtems to identify motorola boards.
+ *
+ * CopyRight (C) 1999 valette@crf.canon.fr
+ *
+ * The license and distribution terms for this file may be
+ * found in found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#ifndef LIBBSP_POWERPC_SHARED_MOTOROLA_MOTOROLA_H
+#define LIBBSP_POWERPC_SHARED_MOTOROLA_MOTOROLA_H
+
+#include <bsp/residual.h>
+
+typedef enum {
+ PREP_IBM = 0,
+ PREP_Radstone = 1,
+ PREP_Motorola = 2
+}prep_t;
+
+typedef enum {
+ MVME_2400 = 0,
+ GENESIS = 1,
+ POWERSTACK_E = 2,
+ BLACKAWK = 3,
+ OMAHA = 4,
+ UTAH = 5,
+ POWERSTACK_EX = 6,
+ MESQUITE = 7,
+ SITKA = 8,
+ MESQUITE_W_HAC = 9,
+ MTX_PLUS = 10,
+ MTX_WO_PP = 11,
+ MTX_W_PP = 12,
+ MVME_2300 = 13,
+ MVME_2300SC_2600 = 14,
+ MVME_2600_W_MVME712M = 15,
+ MVME_2600_2700_W_MVME761 = 16,
+ MVME_3600_W_MVME712M = 17,
+ MVME_3600_W_MVME761 = 18,
+ MVME_1600 = 19,
+ MOTOROLA_UNKNOWN = 255
+} motorolaBoard;
+
+typedef enum {
+ HOST_BRIDGE_RAVEN = 0,
+ HOST_BRIDGE_HAWK = 1,
+ HOST_BRIDGE_UNKNOWN = 255
+}motorolaHostBridge;
+
+#define MOTOROLA_CPUTYPE_REG 0x800
+#define MOTOROLA_BASETYPE_REG 0x803
+
+extern prep_t checkPrepBoardType(RESIDUAL *res);
+extern prep_t currentPrepType;
+extern motorolaBoard getMotorolaBoard();
+extern motorolaBoard currentBoard;
+extern const char* motorolaBoardToString(motorolaBoard);
+
+
+#endif /* LIBBSP_POWERPC_SHARED_MOTOROLA_MOTOROLA_H */
+