[PATCH 034/111] GRSPW: fixed SET_RMAPEN and SET_RMAPBUFDIS

Daniel Hellstrom daniel at gaisler.com
Thu Feb 26 16:38:36 UTC 2015


Both ioctl commands destroyed the control register by writing the
content of the status register into it.
---
 c/src/lib/libbsp/sparc/shared/spw/grspw.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/shared/spw/grspw.c b/c/src/lib/libbsp/sparc/shared/spw/grspw.c
index b6ee255..5cedcb9 100644
--- a/c/src/lib/libbsp/sparc/shared/spw/grspw.c
+++ b/c/src/lib/libbsp/sparc/shared/spw/grspw.c
@@ -1138,7 +1138,7 @@ static rtems_device_driver grspw_control(
 			if ((unsigned int)ioarg->buffer > 1) {
 				return RTEMS_INVALID_NAME;
 			}
-			SPW_CTRL_WRITE(pDev, (SPW_STATUS_READ(pDev) & 0xFFFEFFFF) | ((unsigned int)ioarg->buffer << 16));
+			SPW_CTRL_WRITE(pDev, (SPW_CTRL_READ(pDev) & 0xFFFEFFFF) | ((unsigned int)ioarg->buffer << 16));
 			if (((SPW_CTRL_READ(pDev) >> 16) & 1) != (unsigned int)ioarg->buffer) {
 				return RTEMS_IO_ERROR;
 			}
@@ -1149,7 +1149,7 @@ static rtems_device_driver grspw_control(
 			if ((unsigned int)ioarg->buffer > 1) {
 				return RTEMS_INVALID_NAME;
 			}
-			SPW_CTRL_WRITE(pDev, (SPW_STATUS_READ(pDev) & 0xFFFDFFFF) | ((unsigned int)ioarg->buffer << 17));
+			SPW_CTRL_WRITE(pDev, (SPW_CTRL_READ(pDev) & 0xFFFDFFFF) | ((unsigned int)ioarg->buffer << 17));
 			if (((SPW_CTRL_READ(pDev) >> 17) & 1) != (unsigned int)ioarg->buffer) {
 				return RTEMS_IO_ERROR;
 			}
-- 
1.7.0.4




More information about the devel mailing list