summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-10-13 16:54:12 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-10-16 08:58:47 -0500
commitaf03345cac27849b4a9ea5faf787577c154c19bb (patch)
treee82239058ef8789720f6ce15f37a2fef6a3365ab
parent9488c9d1f5e518fdccbc89b09364297fd8f4d7c2 (diff)
downloadrtems-af03345cac27849b4a9ea5faf787577c154c19bb.tar.bz2
Move CPU cache support from mcf5225x BSP to libcpu
-rw-r--r--c/src/lib/libbsp/m68k/mcf5225x/Makefile.am1
-rw-r--r--c/src/lib/libbsp/m68k/mcf5225x/startup/bspstart.c24
-rw-r--r--c/src/lib/libcpu/m68k/Makefile.am20
-rw-r--r--c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c32
4 files changed, 47 insertions, 30 deletions
diff --git a/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am b/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am
index 1758c1a3f6..0c2fd554f8 100644
--- a/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am
@@ -42,6 +42,7 @@ libbsp_a_SOURCES += timer/timer.c
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
+ ../../../libcpu/@RTEMS_CPU@/mcf5225x/cachepd.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel
include $(srcdir)/preinstall.am
diff --git a/c/src/lib/libbsp/m68k/mcf5225x/startup/bspstart.c b/c/src/lib/libbsp/m68k/mcf5225x/startup/bspstart.c
index af472029db..d5e0f37dc8 100644
--- a/c/src/lib/libbsp/m68k/mcf5225x/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/mcf5225x/startup/bspstart.c
@@ -18,30 +18,6 @@
#include <bsp.h>
#include <bsp/bootcard.h>
-/*
- * Cannot be frozen
- */
-void _CPU_cache_freeze_data(void) {}
-void _CPU_cache_unfreeze_data(void) {}
-void _CPU_cache_freeze_instruction(void) {}
-void _CPU_cache_unfreeze_instruction(void) {}
-
-/*
- * Write-through data cache -- flushes are unnecessary
- */
-void _CPU_cache_flush_1_data_line(const void *d_addr) {}
-void _CPU_cache_flush_entire_data(void) {}
-
-void _CPU_cache_enable_instruction(void) {}
-void _CPU_cache_disable_instruction(void) {}
-void _CPU_cache_invalidate_entire_instruction(void) {}
-void _CPU_cache_invalidate_1_instruction_line(const void *addr) {}
-
-void _CPU_cache_enable_data(void) {}
-void _CPU_cache_disable_data(void) {}
-void _CPU_cache_invalidate_entire_data(void) {}
-void _CPU_cache_invalidate_1_data_line(const void *addr) {}
-
void __attribute__((weak)) bsp_start(void)
{
}
diff --git a/c/src/lib/libcpu/m68k/Makefile.am b/c/src/lib/libcpu/m68k/Makefile.am
index c61fa49c86..2c46834347 100644
--- a/c/src/lib/libcpu/m68k/Makefile.am
+++ b/c/src/lib/libcpu/m68k/Makefile.am
@@ -11,9 +11,10 @@ include_libcpudir = $(includedir)/libcpu
include_libcpu_HEADERS = ../shared/include/cache.h
noinst_PROGRAMS += shared/cache.rel
-shared_cache_rel_SOURCES = shared/cache/cache.c shared/cache/cache_.h \
- ../shared/src/cache_aligned_malloc.c \
- ../shared/src/cache_manager.c
+shared_cache_rel_SOURCES = shared/cache/cache.c
+shared_cache_rel_SOURCES += shared/cache/cache_.h
+shared_cache_rel_SOURCES += ../shared/src/cache_aligned_malloc.c
+shared_cache_rel_SOURCES += ../shared/src/cache_manager.c
shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
shared_cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
@@ -108,7 +109,7 @@ include_mcf5223x_HEADERS = mcf5223x/include/mcf5223x.h
## mcf5223x/cache
noinst_PROGRAMS += mcf5223x/cachepd.rel
mcf5223x_cachepd_rel_SOURCES = mcf5223x/cache/cachepd.c
-mcf5223x_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS)
+mcf5223x_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
mcf5223x_cachepd_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
@@ -116,6 +117,13 @@ if mcf5225x
## mcf5225x/include
include_mcf5225xdir = $(includedir)/mcf5225x
include_mcf5225x_HEADERS = mcf5225x/include/mcf5225x.h
+
+# mcf5225x/cache
+noinst_PROGRAMS += mcf5225x/cachepd.rel
+mcf5225x_cachepd_rel_SOURCES = mcf5225x/cache/cachepd.c
+mcf5225x_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
+mcf5225x_cachepd_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+
# Network
if HAS_NETWORKING
include_mcf5225x_HEADERS += mcf5225x/include/fec.h
@@ -130,7 +138,7 @@ include_mcf5235_HEADERS = mcf5235/include/mcf5235.h
## mcf5235/cache
noinst_PROGRAMS += mcf5235/cachepd.rel
mcf5235_cachepd_rel_SOURCES = mcf5235/cache/cachepd.c
-mcf5235_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS)
+mcf5235_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
mcf5235_cachepd_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
@@ -142,7 +150,7 @@ include_mcf532x_HEADERS = mcf532x/include/mcf532x.h
## mcf532x/cache
noinst_PROGRAMS += mcf532x/cachepd.rel
mcf532x_cachepd_rel_SOURCES = mcf532x/cache/cachepd.c
-mcf532x_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS)
+mcf532x_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
mcf532x_cachepd_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
diff --git a/c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c b/c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c
new file mode 100644
index 0000000000..031f02b601
--- /dev/null
+++ b/c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c
@@ -0,0 +1,32 @@
+/**
+ * @file
+ *
+ * Cache Management Support Routines for the MCF5225x
+ */
+
+#include <rtems.h>
+#include "cache_.h"
+
+/*
+ * Cannot be frozen
+ */
+void _CPU_cache_freeze_data(void) {}
+void _CPU_cache_unfreeze_data(void) {}
+void _CPU_cache_freeze_instruction(void) {}
+void _CPU_cache_unfreeze_instruction(void) {}
+
+/*
+ * Write-through data cache -- flushes are unnecessary
+ */
+void _CPU_cache_flush_1_data_line(const void *d_addr) {}
+void _CPU_cache_flush_entire_data(void) {}
+
+void _CPU_cache_enable_instruction(void) {}
+void _CPU_cache_disable_instruction(void) {}
+void _CPU_cache_invalidate_entire_instruction(void) {}
+void _CPU_cache_invalidate_1_instruction_line(const void *addr) {}
+
+void _CPU_cache_enable_data(void) {}
+void _CPU_cache_disable_data(void) {}
+void _CPU_cache_invalidate_entire_data(void) {}
+void _CPU_cache_invalidate_1_data_line(const void *addr) {}