summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2014-01-23 09:41:25 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2014-03-07 12:23:21 +0100
commitd4a919c3a795db922dc30dd7f49772d15b87e15c (patch)
tree3474db36543eb551f120e3e07b4cda1a5cd0dfc6
parent3919da57616fa64df4ea9c51f3bcde1a6b1f8bfe (diff)
SPWTDP: updated driver against updated HW spec
-rw-r--r--c/src/lib/libbsp/sparc/shared/include/spwtdp.h32
-rw-r--r--c/src/lib/libbsp/sparc/shared/time/spwtdp.c28
2 files changed, 30 insertions, 30 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/include/spwtdp.h b/c/src/lib/libbsp/sparc/shared/include/spwtdp.h
index 31ef0cbf12..63f24f8ded 100644
--- a/c/src/lib/libbsp/sparc/shared/include/spwtdp.h
+++ b/c/src/lib/libbsp/sparc/shared/include/spwtdp.h
@@ -13,13 +13,12 @@
#ifndef __SPWTDP_H__
#define __SPWTDP_H__
-#define SPWTDP_IRQ_SYNC 0x01
-#define SPWTDP_IRQ_TICKRX_ERR 0x02
-#define SPWTDP_IRQ_TICKRX 0x04
-#define SPWTDP_IRQ_TIME_MSG_TX 0x08
-#define SPWTDP_IRQ_TICKTX 0x10
-#define SPWTDP_IRQ_RX 0x20
-#define SPWTDP_IRQ_TX 0x40
+#define SPWTDP_IRQ_S 0x01
+#define SPWTDP_IRQ_TR 0x02
+#define SPWTDP_IRQ_TM 0x04
+#define SPWTDP_IRQ_TT 0x08
+#define SPWTDP_IRQ_DIR 0x10
+#define SPWTDP_IRQ_DIT 0x20
/* SPWTDP Register layout */
struct spwtdp_regs {
@@ -31,11 +30,11 @@ struct spwtdp_regs {
volatile unsigned int dat_ctrl; /* 40 */
volatile unsigned int dat_et[5]; /* 44 */
volatile unsigned int resv2[2]; /* 58 */
- volatile unsigned int ts_tx_ctrl; /* 60 */
- volatile unsigned int ts_tx_et[5]; /* 64 */
+ volatile unsigned int ts_rx_ctrl; /* 60 */
+ volatile unsigned int ts_rx_et[5]; /* 64 */
volatile unsigned int resv3[2]; /* 78 */
- volatile unsigned int ts_rx_ctrl; /* 80 */
- volatile unsigned int ts_rx_et[5]; /* 84 */
+ volatile unsigned int ts_tx_ctrl; /* 80 */
+ volatile unsigned int ts_tx_et[5]; /* 84 */
volatile unsigned int resv4[2]; /* 98 */
volatile unsigned int lat_ctrl; /* A0 */
volatile unsigned int lat_et[5]; /* A4 */
@@ -49,12 +48,11 @@ struct spwtdp_stats {
/* IRQ Stats */
unsigned int nirqs;
- unsigned int tx;
- unsigned int rx;
- unsigned int tick_tx;
- unsigned int time_msg_tx;
- unsigned int tick_rx;
- unsigned int tick_rx_err;
+ unsigned int irq_tx;
+ unsigned int irq_rx;
+ unsigned int time_ccsds_tx;
+ unsigned int tc_tx;
+ unsigned int tc_rx;
unsigned int sync;
};
diff --git a/c/src/lib/libbsp/sparc/shared/time/spwtdp.c b/c/src/lib/libbsp/sparc/shared/time/spwtdp.c
index 4b22346ab0..99baaea132 100644
--- a/c/src/lib/libbsp/sparc/shared/time/spwtdp.c
+++ b/c/src/lib/libbsp/sparc/shared/time/spwtdp.c
@@ -163,21 +163,23 @@ void spwtdp_isr(void *data)
struct spwtdp_stats *stats = &priv->stats;
unsigned int ists = priv->regs->ists;
+ /* Return if the SPWTDP didn't generate the IRQ */
+ if (ists == 0)
+ return;
+
stats->nirqs++;
- if (ists & SPWTDP_IRQ_TX)
- stats->tx++;
- if (ists & SPWTDP_IRQ_RX)
- stats->rx++;
- if (ists & SPWTDP_IRQ_TICKTX)
- stats->tick_tx++;
- if (ists & SPWTDP_IRQ_TIME_MSG_TX)
- stats->time_msg_tx++;
- if (ists & SPWTDP_IRQ_TICKRX)
- stats->tick_rx++;
- if (ists & SPWTDP_IRQ_TICKRX_ERR)
- stats->tick_rx_err++;
- if (ists & SPWTDP_IRQ_SYNC)
+ if (ists & SPWTDP_IRQ_DIT)
+ stats->irq_tx++;
+ if (ists & SPWTDP_IRQ_DIR)
+ stats->irq_rx++;
+ if (ists & SPWTDP_IRQ_TT)
+ stats->tc_tx++;
+ if (ists & SPWTDP_IRQ_TM)
+ stats->time_ccsds_tx++;
+ if (ists & SPWTDP_IRQ_TR)
+ stats->tc_rx++;
+ if (ists & SPWTDP_IRQ_S)
stats->sync++;
/* Let user Handle Interrupt */