summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/bfin
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-03-10 17:22:05 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-03-10 17:22:05 +0000
commit543f17b3915b3a9b0b5fab3f35c4544c430f82c5 (patch)
tree232873121bc00b3289b7047cd951caf8eb396ac6 /c/src/lib/libbsp/bfin
parent2010-03-10 Gedare Bloom <gedare@gwu.edu> (diff)
downloadrtems-543f17b3915b3a9b0b5fab3f35c4544c430f82c5.tar.bz2
2010-03-10 Marc Pignat <marc.pignat@hevs.ch>
PR 1488/bsps * start/start.S: Micromon on bf537 uses DMA for UART reception. This prevents the UART driver in RTEMS from working (and also causes received characters to be stored in a buffer that RTEMS doesn't know about, so it's potentially dangerous, but in practice the risk is small since an RTEMS app intended to be booted from Micromon would normally be configured to leave the RAM Micromon uses reserved). The attached patch corrects this by disabling all DMA channels at startup.
Diffstat (limited to 'c/src/lib/libbsp/bfin')
-rw-r--r--c/src/lib/libbsp/bfin/bf537Stamp/ChangeLog12
-rw-r--r--c/src/lib/libbsp/bfin/bf537Stamp/start/start.S18
2 files changed, 27 insertions, 3 deletions
diff --git a/c/src/lib/libbsp/bfin/bf537Stamp/ChangeLog b/c/src/lib/libbsp/bfin/bf537Stamp/ChangeLog
index cdaee5a098..7c31f0c8f6 100644
--- a/c/src/lib/libbsp/bfin/bf537Stamp/ChangeLog
+++ b/c/src/lib/libbsp/bfin/bf537Stamp/ChangeLog
@@ -1,3 +1,15 @@
+2010-03-10 Marc Pignat <marc.pignat@hevs.ch>
+
+ PR 1488/bsps
+ * start/start.S: Micromon on bf537 uses DMA for UART reception.
+ This prevents the UART driver in RTEMS from working (and also
+ causes received characters to be stored in a buffer that RTEMS
+ doesn't know about, so it's potentially dangerous, but in practice
+ the risk is small since an RTEMS app intended to be booted from
+ Micromon would normally be configured to leave the RAM Micromon
+ uses reserved). The attached patch corrects this by disabling
+ all DMA channels at startup.
+
2009-12-11 Ralf Corsépius <ralf.corsepius@rtems.org>
* console/console-io.c: Let bf537Stamp_BSP_poll_char return int.
diff --git a/c/src/lib/libbsp/bfin/bf537Stamp/start/start.S b/c/src/lib/libbsp/bfin/bf537Stamp/start/start.S
index 2a05e02f34..7ec133aa20 100644
--- a/c/src/lib/libbsp/bfin/bf537Stamp/start/start.S
+++ b/c/src/lib/libbsp/bfin/bf537Stamp/start/start.S
@@ -5,6 +5,7 @@
#include <libcpu/bf537.h>
#include <libcpu/sicRegs.h>
#include <libcpu/cecRegs.h>
+#include <libcpu/dmaRegs.h>
#include <libcpu/coreTimerRegs.h>
#ifndef LO
@@ -53,6 +54,17 @@ __start:
r0 = 0xffff (z);
[p0] = r0;
+ /* disable all dma channels */
+ p0.h = HI(DMA0_BASE_ADDRESS + DMA_CONFIG_OFFSET);
+ p0.l = LO(DMA0_BASE_ADDRESS + DMA_CONFIG_OFFSET);
+ p1 = DMA_PITCH;
+ p2 = DMA_CHANNELS;
+ r0 = ~DMA_CONFIG_DMAEN;
+ lsetup(loop1,loop2) lc0 = p2;
+loop1: r1 = w[p0];
+ r1 = r0 & r1;
+loop2: w[p0 ++ p1] = r1.l;
+
/* this is so we can stay in supervisor mode and still be able to
accept interrupts later. */
p0.h = start;
@@ -94,9 +106,9 @@ start:
r0 = 0;
/* Set _bss_start until _end to zero */
- lsetup(loop1,loop2) lc0 = p1;
-loop1: b[p0] = r0;
-loop2: p0 +=1;
+ lsetup(loop3,loop4) lc0 = p1;
+loop3: b[p0] = r0;
+loop4: p0 +=1;
l0 = 0;
l1 = 0;