From 2727bc7f80c6ebe5af7bd5711cf1f80ef18911fc Mon Sep 17 00:00:00 2001 From: Javier Jalle Date: Tue, 20 Jun 2017 17:39:21 +0200 Subject: leon, grspw_router: Clear only error bits defined by clear mask --- c/src/lib/libbsp/sparc/shared/include/grspw_router.h | 2 +- c/src/lib/libbsp/sparc/shared/spw/grspw_router.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'c/src/lib/libbsp/sparc/shared') diff --git a/c/src/lib/libbsp/sparc/shared/include/grspw_router.h b/c/src/lib/libbsp/sparc/shared/include/grspw_router.h index 94e13b1feb..2fab8d5f6c 100644 --- a/c/src/lib/libbsp/sparc/shared/include/grspw_router.h +++ b/c/src/lib/libbsp/sparc/shared/include/grspw_router.h @@ -328,7 +328,7 @@ extern int router_port_maxplen_set(void *d, int port, uint32_t length); #define PSTS_PE_BIT 0 /* Check Port Status register and clear errors if there are */ -extern int router_port_status(void *d, int port, uint32_t *sts); +extern int router_port_status(void *d, int port, uint32_t *sts, uint32_t clrmsk); #define ROUTER_LINK_STATUS_ERROR_RESET 0 #define ROUTER_LINK_STATUS_ERROR_WAIT 1 diff --git a/c/src/lib/libbsp/sparc/shared/spw/grspw_router.c b/c/src/lib/libbsp/sparc/shared/spw/grspw_router.c index c65a2fb2e1..d95c351443 100644 --- a/c/src/lib/libbsp/sparc/shared/spw/grspw_router.c +++ b/c/src/lib/libbsp/sparc/shared/spw/grspw_router.c @@ -1331,7 +1331,7 @@ int router_port_ctrl_get(void *d, int port, uint32_t *ctrl) } /* Read Port Status register and clear errors if there are */ -int router_port_status(void *d, int port, uint32_t *sts, uint32_t clrmsk) /* review clrmsks */ +int router_port_status(void *d, int port, uint32_t *sts, uint32_t clrmsk) { struct router_priv *priv = d; int error = router_check_port(d, port); @@ -1350,7 +1350,7 @@ int router_port_status(void *d, int port, uint32_t *sts, uint32_t clrmsk) /* rev if (port == 0) { REG_WRITE(&priv->regs->psts[port], ((*sts) & (PSTSCFG_WCLEAR & clrmsk)) | (PSTSCFG_WCLEAR2 & clrmsk)); }else{ - REG_WRITE(&priv->regs->psts[port], (*sts) & PSTS_WCLEAR); + REG_WRITE(&priv->regs->psts[port], (*sts) & (PSTS_WCLEAR & clrmsk)); } SPIN_UNLOCK_IRQ(&priv->plock[port], irqflags); return ROUTER_ERR_OK; -- cgit v1.2.3