forked from Imagelibrary/rtems
leon, grspw_router: Clear only error bits defined by clear mask
This commit is contained in:
committed by
Daniel Hellstrom
parent
56cf340f10
commit
2727bc7f80
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user