summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2014-08-08 09:59:36 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2014-08-08 09:59:36 +0200
commit65e92f4d281d40218ff7051b7e3084dcee8ae80d (patch)
treedcf03ce28c92a4e81d8574b1782cc70fb7f6c01d
parent24707a0967ffcee4a3a4bc223265cf61821d93c3 (diff)
B1553BRM: change the init of the RT legalization registers
-rw-r--r--c/src/lib/libbsp/sparc/shared/1553/b1553brm.c23
-rw-r--r--c/src/lib/libbsp/sparc/shared/include/b1553brm.h8
2 files changed, 29 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/1553/b1553brm.c b/c/src/lib/libbsp/sparc/shared/1553/b1553brm.c
index 65af6bfd49..63774d0ade 100644
--- a/c/src/lib/libbsp/sparc/shared/1553/b1553brm.c
+++ b/c/src/lib/libbsp/sparc/shared/1553/b1553brm.c
@@ -598,6 +598,25 @@ static void clr_int_logs(struct irq_log_list *logs){
}
}
+unsigned short b1553brm_rt_cmd_legalize[16] = {
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0xffff,
+ 0xffff,
+ 0xffff,
+ 0xfffd,
+ 0xfe01,
+ 0xfff2,
+ 0xffff,
+ 0xfffd,
+ 0xfe05,
+ 0xffff,
+};
+
static rtems_device_driver rt_init(brm_priv *brm) {
unsigned int i;
@@ -635,9 +654,9 @@ static rtems_device_driver rt_init(brm_priv *brm) {
clr_int_logs(brm->irq_log);
- /* Legalize all commands */
+ /* Initialize the Legalize register with standard values */
for (i = 0; i < 16; i++) {
- brm->regs->rt_cmd_leg[i] = 0;
+ brm->regs->rt_cmd_leg[i] = b1553brm_rt_cmd_legalize[i];
}
/* Init descriptor table
diff --git a/c/src/lib/libbsp/sparc/shared/include/b1553brm.h b/c/src/lib/libbsp/sparc/shared/include/b1553brm.h
index c1ceb1578b..d6142b00de 100644
--- a/c/src/lib/libbsp/sparc/shared/include/b1553brm.h
+++ b/c/src/lib/libbsp/sparc/shared/include/b1553brm.h
@@ -149,6 +149,14 @@ struct bc_msg {
void b1553brm_register_drv(void);
+/* Default initialization of the RT legalization registers. The values in this
+ * array are written to the registers on boot driver initialization and when
+ * the user set the mode to RT-mode by calling ioctl(BRM_SET_MODE). Thus,
+ * update the array first then call ioctl(BRM_SET_MODE) for the changes to have
+ * an affect. Note that this affects all B1553BRM RTs in the system.
+ */
+extern unsigned short b1553brm_rt_cmd_legalize[16];
+
#ifdef __cplusplus
}
#endif