summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/calypso
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-02-23 01:31:03 +0100
committerHarald Welte <laforge@gnumonks.org>2010-02-23 01:44:37 +0100
commit3f3a84d5164927aaa430596da773fb96cf5ee890 (patch)
tree4493bfce75d2aa7219db9ec839bcf073fe9f82dd /src/target/firmware/calypso
parentc7224b79bd8631b16aea3825d11b6cd0624b8d17 (diff)
Calypso TPU: initialize TPU RAM to zero at tpu_init() time
Diffstat (limited to 'src/target/firmware/calypso')
-rw-r--r--src/target/firmware/calypso/tpu.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/target/firmware/calypso/tpu.c b/src/target/firmware/calypso/tpu.c
index 0df70a2c..37564f72 100644
--- a/src/target/firmware/calypso/tpu.c
+++ b/src/target/firmware/calypso/tpu.c
@@ -190,7 +190,7 @@ void tpu_rewind(void)
void tpu_enqueue(uint16_t instr)
{
- printd("tpu_enqueue(tpu_ptr=%p, instr=0x%04x\n", tpu_ptr, instr);
+ printd("tpu_enqueue(tpu_ptr=%p, instr=0x%04x)\n", tpu_ptr, instr);
*tpu_ptr++ = instr;
if (tpu_ptr > (uint16_t *) TPU_RAM_END)
puts("TPU enqueue beyond end of TPU memory\n");
@@ -198,9 +198,17 @@ void tpu_enqueue(uint16_t instr)
void tpu_init(void)
{
- /* Get TPU out of reset */
+ uint16_t *ptr;
+
+ /* Put TPU into Reset and enable clock */
tpu_reset(1);
tpu_clk_enable(1);
+
+ /* set all TPU RAM to zero */
+ for (ptr = (uint16_t *) BASE_ADDR_TPU_RAM; ptr < (uint16_t *) TPU_RAM_END; ptr++)
+ *ptr = 0x0000;
+
+ /* Get TPU out of reset */
tpu_reset(0);
/* Disable all interrupts */
writeb(0x7, TPU_REG(INT_CTRL));