summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2004-11-10 23:51:57 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2004-11-10 23:51:57 +0000
commita84392db857e3a7514d46930e61007306cfaf3b2 (patch)
tree2b58e262607beb68dbb0faca396ed3a7005d5f29 /c
parent2004-11-10 Richard Campbell <richard.campbell@oarcorp.com> (diff)
downloadrtems-a84392db857e3a7514d46930e61007306cfaf3b2.tar.bz2
2004-11-10 Richard Campbell <richard.campbell@oarcorp.com>
* configure.ac, mpc6xx/exceptions/raw_exception.c, mpc6xx/exceptions/raw_exception.h, mpc6xx/mmu/bat.c, mpc6xx/mmu/bat.h, mpc6xx/mmu/mmuAsm.S, shared/include/cpuIdent.c, shared/include/cpuIdent.h: Add MPC8240 and MPC8245 support. There was also a significant amount of spelling and whitespace cleanup.
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libcpu/powerpc/ChangeLog8
-rw-r--r--c/src/lib/libcpu/powerpc/configure.ac6
-rw-r--r--c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c33
-rw-r--r--c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h8
-rw-r--r--c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c4
-rw-r--r--c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.h4
-rw-r--r--c/src/lib/libcpu/powerpc/mpc6xx/mmu/mmuAsm.S3
-rw-r--r--c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c8
-rw-r--r--c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h4
9 files changed, 56 insertions, 22 deletions
diff --git a/c/src/lib/libcpu/powerpc/ChangeLog b/c/src/lib/libcpu/powerpc/ChangeLog
index 6d6436195d..84836264f9 100644
--- a/c/src/lib/libcpu/powerpc/ChangeLog
+++ b/c/src/lib/libcpu/powerpc/ChangeLog
@@ -1,3 +1,11 @@
+2004-11-10 Richard Campbell <richard.campbell@oarcorp.com>
+
+ * configure.ac, mpc6xx/exceptions/raw_exception.c,
+ mpc6xx/exceptions/raw_exception.h, mpc6xx/mmu/bat.c,
+ mpc6xx/mmu/bat.h, mpc6xx/mmu/mmuAsm.S, shared/include/cpuIdent.c,
+ shared/include/cpuIdent.h: Add MPC8240 and MPC8245 support. There was
+ also a significant amount of spelling and whitespace cleanup.
+
2004-10-21 Ralf Corsepius <ralf_corsepius@rtems.org>
* mpc5xx/clock/clock.c, mpc5xx/include/mpc5xx.h
diff --git a/c/src/lib/libcpu/powerpc/configure.ac b/c/src/lib/libcpu/powerpc/configure.ac
index b7b6f479e4..05fe819190 100644
--- a/c/src/lib/libcpu/powerpc/configure.ac
+++ b/c/src/lib/libcpu/powerpc/configure.ac
@@ -31,6 +31,8 @@ AM_CONDITIONAL(shared, \
|| test "$RTEMS_CPU_MODEL" = "mpc6xx" \
|| test "$RTEMS_CPU_MODEL" = "mpc821" \
|| test "$RTEMS_CPU_MODEL" = "mpc860" \
+|| test "$RTEMS_CPU_MODEL" = "mpc8240" \
+|| test "$RTEMS_CPU_MODEL" = "mpc8245" \
|| test "$RTEMS_CPU_MODEL" = "mpc8260" \
|| test "$RTEMS_CPU_MODEL" = "mpc8xx" )
@@ -42,7 +44,9 @@ AM_CONDITIONAL(mpc6xx, test "$RTEMS_CPU_MODEL" = "mpc6xx" \
|| test "$RTEMS_CPU_MODEL" = "mpc604" \
|| test "$RTEMS_CPU_MODEL" = "mpc7400" \
|| test "$RTEMS_CPU_MODEL" = "mpc7455" \
-|| test "$RTEMS_CPU_MODEL" = "mpc750" )
+|| test "$RTEMS_CPU_MODEL" = "mpc750" \
+|| test "$RTEMS_CPU_MODEL" = "mpc8240" \
+|| test "$RTEMS_CPU_MODEL" = "mpc8245" )
AM_CONDITIONAL(mpc8xx, test "$RTEMS_CPU_MODEL" = "mpc8xx" \
|| test "$RTEMS_CPU_MODEL" = "mpc821" \
|| test "$RTEMS_CPU_MODEL" = "mpc860" )
diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c b/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c
index 1989a9bfb0..911031de44 100644
--- a/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c
+++ b/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c
@@ -1,7 +1,7 @@
/*
* raw_exception.c - This file contains implementation of C function to
- * Instanciate 60x ppc primary exception entries.
- * More detailled information can be found on motorola
+ * Instantiate 60x ppc primary exception entries.
+ * More detailed information can be found on motorola
* site and more precisely in the following book :
*
* MPC750
@@ -33,6 +33,17 @@ static rtems_raw_except_connect_data default_raw_except_entry;
static rtems_raw_except_global_settings* local_settings;
void * codemove(void *, const void *, unsigned int, unsigned long);
+
+void* mpc60x_get_vector_addr(rtems_vector vector)
+{
+ extern rtems_cpu_table Cpu_table;
+
+ if ( Cpu_table.exceptions_in_RAM )
+ return ((void*) (((unsigned) vector) << 8));
+
+ return ((void*) (((unsigned) vector) << 8) + 0xfff00000);
+}
+
int mpc750_vector_is_valid(rtems_vector vector)
{
@@ -134,13 +145,17 @@ int mpc60x_vector_is_valid(rtems_vector vector)
case PPC_603:
case PPC_603e:
case PPC_603ev:
+ case PPC_8260:
+ /* case PPC_8240: -- same value as 8260 */
+ case PPC_8245:
if (!mpc603_vector_is_valid(vector)) {
return 0;
}
break;
- default:
- printk("Please complete libcpu/powerpc/mpc6xx/exceptions/raw_exception.c\n");
- printk("current_ppc_cpu = %x\n", current_ppc_cpu);
+ default:
+ printk("Please complete "
+ "libcpu/powerpc/mpc6xx/exceptions/raw_exception.c\n"
+ "current_ppc_cpu = %x\n", current_ppc_cpu);
return 0;
}
return 1;
@@ -151,6 +166,8 @@ int mpc60x_set_exception (const rtems_raw_except_connect_data* except)
unsigned int level;
if (!mpc60x_vector_is_valid(except->exceptIndex)) {
+ printk("mpc60x_set_exception: vector %d is not valid\n",
+ except->exceptIndex);
return 0;
}
/*
@@ -160,7 +177,11 @@ int mpc60x_set_exception (const rtems_raw_except_connect_data* except)
* RATIONALE : to always have the same transition by forcing the user
* to get the previous handler before accepting to disconnect.
*/
- if (memcmp(mpc60x_get_vector_addr(except->exceptIndex), (void*)default_raw_except_entry.hdl.raw_hdl,default_raw_except_entry.hdl.raw_hdl_size)) {
+
+ if (memcmp(mpc60x_get_vector_addr(except->exceptIndex),
+ (void*)default_raw_except_entry.hdl.raw_hdl,
+ default_raw_except_entry.hdl.raw_hdl_size)) {
+ printk("mpc60x_set_exception: raw vector not installed\n");
return 0;
}
diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h b/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h
index 0d1ff7e8a4..7a28820cb1 100644
--- a/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h
+++ b/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h
@@ -2,8 +2,8 @@
* raw_execption.h
*
* This file contains implementation of C function to
- * Instanciate 60x ppc primary exception entries.
- * More detailled information can be found on motorola
+ * Instantiate 60x ppc primary exception entries.
+ * More detailed information can be found on motorola
* site and more precisely in the following book :
*
* MPC750
@@ -159,10 +159,6 @@ extern int mpc60x_delete_exception (const rtems_raw_except_connect_data*);
*/
extern int mpc750_vector_is_valid(rtems_vector vector);
-inline static void* mpc60x_get_vector_addr(rtems_vector vector)
-{
- return ((void*) (((unsigned) vector) << 8));
-}
/*
* Exception global init.
*/
diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c
index 0058b90970..e706256535 100644
--- a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c
+++ b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c
@@ -2,8 +2,8 @@
* bat.c
*
* This file contains the implementation of C function to
- * Instanciate 60x/7xx ppc Block Address Translation (BAT) registers.
- * More detailled information can be found on motorola
+ * Instantiate 60x/7xx ppc Block Address Translation (BAT) registers.
+ * More detailed information can be found on motorola
* site and more precisely in the following book :
*
* MPC750
diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.h b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.h
index 99d18e56c1..0ea9fc234e 100644
--- a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.h
+++ b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.h
@@ -2,8 +2,8 @@
* bat.h
*
* This file contains declaration of C function to
- * Instanciate 60x/7xx ppc Block Address Translation (BAT) registers.
- * More detailled information can be found on motorola
+ * Instantiate 60x/7xx ppc Block Address Translation (BAT) registers.
+ * More detailed information can be found on motorola
* site and more precisely in the following book :
*
* MPC750
diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/mmuAsm.S b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/mmuAsm.S
index e97ac653fb..55ebcc8b1e 100644
--- a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/mmuAsm.S
+++ b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/mmuAsm.S
@@ -38,6 +38,7 @@
#define PPC_860 0x50
#define PPC_821 PPC_860
#define PPC_8260 0x81
+#define PPC_8240 PPC_8260
/* ALTIVEC instructions (not recognized by off-the shelf gcc yet) */
#define DSSALL .long 0x7e00066c /* DSSALL altivec instruction opcode */
@@ -47,8 +48,6 @@
#ifndef MSSCR0
#define MSSCR0 1014
-#else
-#warning MSSCR0 seems to be known, update __FILE__
#endif
#define DL1HWF (1<<(31-8))
diff --git a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c
index 74e18078cf..bfe5600328 100644
--- a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c
+++ b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c
@@ -42,8 +42,10 @@ char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu)
case PPC_620: return "MPC620";
case PPC_860: return "MPC860";
case PPC_8260: return "MPC8260";
+ case PPC_8245: return "MPC8245";
default:
- printk("Unknown CPU value of 0x%x. Please add it to <libcpu/powerpc/shared/include/cpuIdent.c>\n", cpu );
+ printk("Unknown CPU value of 0x%x. Please add it to "
+ "<libcpu/powerpc/shared/include/cpuIdent.c>\n", cpu );
}
return "UNKNOWN";
}
@@ -66,9 +68,11 @@ ppc_cpu_id_t get_ppc_cpu_type()
case PPC_620:
case PPC_860:
case PPC_8260:
+ case PPC_8245:
return current_ppc_cpu;
default:
- printk("Unknown PVR value of 0x%x. Please add it to <libcpu/powerpc/shared/include/cpuIdent.c>\n", pvr );
+ printk("Unknown PVR value of 0x%x. Please add it to "
+ "<libcpu/powerpc/shared/include/cpuIdent.c>\n", pvr );
return PPC_UNKNOWN;
}
}
diff --git a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h
index 03205c772f..88d1138651 100644
--- a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h
+++ b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h
@@ -35,7 +35,9 @@ typedef enum
PPC_821 = PPC_860,
PPC_823 = PPC_860,
PPC_8260 = 0x81,
- PPC_UNKNOWN = 0xff
+ PPC_8240 = PPC_8260,
+ PPC_8245 = 0x8081,
+ PPC_UNKNOWN = 0xffff
} ppc_cpu_id_t;
typedef unsigned short ppc_cpu_revision_t;